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 do a tuple contain ?
| def load_data():
f = gzip.open('../data/mnist.pkl.gz', 'rb')
(training_data, validation_data, test_data) = cPickle.load(f)
f.close()
return (training_data, validation_data, test_data)
| null | null | null | the training data
| codeqa | def load data f gzip open ' /data/mnist pkl gz' 'rb' training data validation data test data c Pickle load f f close return training data validation data test data
| null | null | null | null | Question:
What do a tuple contain ?
Code:
def load_data():
f = gzip.open('../data/mnist.pkl.gz', 'rb')
(training_data, validation_data, test_data) = cPickle.load(f)
f.close()
return (training_data, validation_data, test_data)
|
null | null | null | What is containing the training data ?
| def load_data():
f = gzip.open('../data/mnist.pkl.gz', 'rb')
(training_data, validation_data, test_data) = cPickle.load(f)
f.close()
return (training_data, validation_data, test_data)
| null | null | null | a tuple
| codeqa | def load data f gzip open ' /data/mnist pkl gz' 'rb' training data validation data test data c Pickle load f f close return training data validation data test data
| null | null | null | null | Question:
What is containing the training data ?
Code:
def load_data():
f = gzip.open('../data/mnist.pkl.gz', 'rb')
(training_data, validation_data, test_data) = cPickle.load(f)
f.close()
return (training_data, validation_data, test_data)
|
null | null | null | Do a tuple contain the training data ?
| def load_data():
f = gzip.open('../data/mnist.pkl.gz', 'rb')
(training_data, validation_data, test_data) = cPickle.load(f)
f.close()
return (training_data, validation_data, test_data)
| null | null | null | Yes
| codeqa | def load data f gzip open ' /data/mnist pkl gz' 'rb' training data validation data test data c Pickle load f f close return training data validation data test data
| null | null | null | null | Question:
Do a tuple contain the training data ?
Code:
def load_data():
f = gzip.open('../data/mnist.pkl.gz', 'rb')
(training_data, validation_data, test_data) = cPickle.load(f)
f.close()
return (training_data, validation_data, test_data)
|
null | null | null | Does the code convert a sequence to a bytes type ?
| def to_bytes(seq):
if isinstance(seq, bytes):
return seq
elif isinstance(seq, bytearray):
return bytes(seq)
elif isinstance(seq, memoryview):
return seq.tobytes()
elif isinstance(seq, unicode):
raise TypeError('unicode strings are not supported, please encode to bytes: {!r}'.format(seq))
else:
r... | null | null | null | Yes
| codeqa | def to bytes seq if isinstance seq bytes return seqelif isinstance seq bytearray return bytes seq elif isinstance seq memoryview return seq tobytes elif isinstance seq unicode raise Type Error 'unicodestringsarenotsupported pleaseencodetobytes { r}' format seq else return bytes bytearray seq
| null | null | null | null | Question:
Does the code convert a sequence to a bytes type ?
Code:
def to_bytes(seq):
if isinstance(seq, bytes):
return seq
elif isinstance(seq, bytearray):
return bytes(seq)
elif isinstance(seq, memoryview):
return seq.tobytes()
elif isinstance(seq, unicode):
raise TypeError('unicode strings are not... |
null | null | null | What does the code convert to a bytes type ?
| def to_bytes(seq):
if isinstance(seq, bytes):
return seq
elif isinstance(seq, bytearray):
return bytes(seq)
elif isinstance(seq, memoryview):
return seq.tobytes()
elif isinstance(seq, unicode):
raise TypeError('unicode strings are not supported, please encode to bytes: {!r}'.format(seq))
else:
r... | null | null | null | a sequence
| codeqa | def to bytes seq if isinstance seq bytes return seqelif isinstance seq bytearray return bytes seq elif isinstance seq memoryview return seq tobytes elif isinstance seq unicode raise Type Error 'unicodestringsarenotsupported pleaseencodetobytes { r}' format seq else return bytes bytearray seq
| null | null | null | null | Question:
What does the code convert to a bytes type ?
Code:
def to_bytes(seq):
if isinstance(seq, bytes):
return seq
elif isinstance(seq, bytearray):
return bytes(seq)
elif isinstance(seq, memoryview):
return seq.tobytes()
elif isinstance(seq, unicode):
raise TypeError('unicode strings are not supp... |
null | null | null | What does the code create using a configuration dictionary ?
| def engine_from_config(configuration, prefix='sqlalchemy.', **kwargs):
options = dict(((key[len(prefix):], configuration[key]) for key in configuration if key.startswith(prefix)))
options['_coerce_config'] = True
options.update(kwargs)
url = options.pop('url')
return create_engine(url, **options)
| null | null | null | a new engine instance
| codeqa | def engine from config configuration prefix 'sqlalchemy ' **kwargs options dict key[len prefix ] configuration[key] for key in configuration if key startswith prefix options[' coerce config'] Trueoptions update kwargs url options pop 'url' return create engine url **options
| null | null | null | null | Question:
What does the code create using a configuration dictionary ?
Code:
def engine_from_config(configuration, prefix='sqlalchemy.', **kwargs):
options = dict(((key[len(prefix):], configuration[key]) for key in configuration if key.startswith(prefix)))
options['_coerce_config'] = True
options.update(kwargs)
... |
null | null | null | How does the code create a new engine instance ?
| def engine_from_config(configuration, prefix='sqlalchemy.', **kwargs):
options = dict(((key[len(prefix):], configuration[key]) for key in configuration if key.startswith(prefix)))
options['_coerce_config'] = True
options.update(kwargs)
url = options.pop('url')
return create_engine(url, **options)
| null | null | null | using a configuration dictionary
| codeqa | def engine from config configuration prefix 'sqlalchemy ' **kwargs options dict key[len prefix ] configuration[key] for key in configuration if key startswith prefix options[' coerce config'] Trueoptions update kwargs url options pop 'url' return create engine url **options
| null | null | null | null | Question:
How does the code create a new engine instance ?
Code:
def engine_from_config(configuration, prefix='sqlalchemy.', **kwargs):
options = dict(((key[len(prefix):], configuration[key]) for key in configuration if key.startswith(prefix)))
options['_coerce_config'] = True
options.update(kwargs)
url = optio... |
null | null | null | Does the code create a new engine instance using a configuration dictionary ?
| def engine_from_config(configuration, prefix='sqlalchemy.', **kwargs):
options = dict(((key[len(prefix):], configuration[key]) for key in configuration if key.startswith(prefix)))
options['_coerce_config'] = True
options.update(kwargs)
url = options.pop('url')
return create_engine(url, **options)
| null | null | null | Yes
| codeqa | def engine from config configuration prefix 'sqlalchemy ' **kwargs options dict key[len prefix ] configuration[key] for key in configuration if key startswith prefix options[' coerce config'] Trueoptions update kwargs url options pop 'url' return create engine url **options
| null | null | null | null | Question:
Does the code create a new engine instance using a configuration dictionary ?
Code:
def engine_from_config(configuration, prefix='sqlalchemy.', **kwargs):
options = dict(((key[len(prefix):], configuration[key]) for key in configuration if key.startswith(prefix)))
options['_coerce_config'] = True
option... |
null | null | null | What does the code show ?
| def askUser(text, parent=None, help='', defaultno=False, msgfunc=None, title='Anki'):
if (not parent):
parent = aqt.mw.app.activeWindow()
if (not msgfunc):
msgfunc = QMessageBox.question
sb = (QMessageBox.Yes | QMessageBox.No)
if help:
sb |= QMessageBox.Help
while 1:
if defaultno:
default = QMessageBox.... | null | null | null | a yes / no question
| codeqa | def ask User text parent None help '' defaultno False msgfunc None title ' Anki' if not parent parent aqt mw app active Window if not msgfunc msgfunc Q Message Box questionsb Q Message Box Yes Q Message Box No if help sb Q Message Box Helpwhile 1 if defaultno default Q Message Box Noelse default Q Message Box Yesr msgf... | null | null | null | null | Question:
What does the code show ?
Code:
def askUser(text, parent=None, help='', defaultno=False, msgfunc=None, title='Anki'):
if (not parent):
parent = aqt.mw.app.activeWindow()
if (not msgfunc):
msgfunc = QMessageBox.question
sb = (QMessageBox.Yes | QMessageBox.No)
if help:
sb |= QMessageBox.Help
whil... |
null | null | null | Does the code show a yes / no question ?
| def askUser(text, parent=None, help='', defaultno=False, msgfunc=None, title='Anki'):
if (not parent):
parent = aqt.mw.app.activeWindow()
if (not msgfunc):
msgfunc = QMessageBox.question
sb = (QMessageBox.Yes | QMessageBox.No)
if help:
sb |= QMessageBox.Help
while 1:
if defaultno:
default = QMessageBox.... | null | null | null | Yes
| codeqa | def ask User text parent None help '' defaultno False msgfunc None title ' Anki' if not parent parent aqt mw app active Window if not msgfunc msgfunc Q Message Box questionsb Q Message Box Yes Q Message Box No if help sb Q Message Box Helpwhile 1 if defaultno default Q Message Box Noelse default Q Message Box Yesr msgf... | null | null | null | null | Question:
Does the code show a yes / no question ?
Code:
def askUser(text, parent=None, help='', defaultno=False, msgfunc=None, title='Anki'):
if (not parent):
parent = aqt.mw.app.activeWindow()
if (not msgfunc):
msgfunc = QMessageBox.question
sb = (QMessageBox.Yes | QMessageBox.No)
if help:
sb |= QMessag... |
null | null | null | Can string be coerced to int ?
| def int_coercable(string):
try:
int(string)
return True
except ValueError:
return False
| null | null | null | Yes
| codeqa | def int coercable string try int string return Trueexcept Value Error return False
| null | null | null | null | Question:
Can string be coerced to int ?
Code:
def int_coercable(string):
try:
int(string)
return True
except ValueError:
return False
|
null | null | null | What can string be coerced ?
| def int_coercable(string):
try:
int(string)
return True
except ValueError:
return False
| null | null | null | to int
| codeqa | def int coercable string try int string return Trueexcept Value Error return False
| null | null | null | null | Question:
What can string be coerced ?
Code:
def int_coercable(string):
try:
int(string)
return True
except ValueError:
return False
|
null | null | null | What can be coerced to int ?
| def int_coercable(string):
try:
int(string)
return True
except ValueError:
return False
| null | null | null | string
| codeqa | def int coercable string try int string return Trueexcept Value Error return False
| null | null | null | null | Question:
What can be coerced to int ?
Code:
def int_coercable(string):
try:
int(string)
return True
except ValueError:
return False
|
null | null | null | Does this method return the output ?
| def run_cli(module, cli):
cliswitch = module.params['pn_cliswitch']
command = module.params['pn_command']
cmd = shlex.split(cli)
(result, out, err) = module.run_command(cmd)
print_cli = cli.split(cliswitch)[1]
if (result != 0):
module.exit_json(command=print_cli, msg=('%s: ' % command), stderr=err.strip(), cha... | null | null | null | Yes
| codeqa | def run cli module cli cliswitch module params['pn cliswitch']command module params['pn command']cmd shlex split cli result out err module run command cmd print cli cli split cliswitch [1 ]if result 0 module exit json command print cli msg '%s ' % command stderr err strip changed False if out module exit json command p... | null | null | null | null | Question:
Does this method return the output ?
Code:
def run_cli(module, cli):
cliswitch = module.params['pn_cliswitch']
command = module.params['pn_command']
cmd = shlex.split(cli)
(result, out, err) = module.run_command(cmd)
print_cli = cli.split(cliswitch)[1]
if (result != 0):
module.exit_json(command=pr... |
null | null | null | What does this method return ?
| def run_cli(module, cli):
cliswitch = module.params['pn_cliswitch']
command = module.params['pn_command']
cmd = shlex.split(cli)
(result, out, err) = module.run_command(cmd)
print_cli = cli.split(cliswitch)[1]
if (result != 0):
module.exit_json(command=print_cli, msg=('%s: ' % command), stderr=err.strip(), cha... | null | null | null | the output
| codeqa | def run cli module cli cliswitch module params['pn cliswitch']command module params['pn command']cmd shlex split cli result out err module run command cmd print cli cli split cliswitch [1 ]if result 0 module exit json command print cli msg '%s ' % command stderr err strip changed False if out module exit json command p... | null | null | null | null | Question:
What does this method return ?
Code:
def run_cli(module, cli):
cliswitch = module.params['pn_cliswitch']
command = module.params['pn_command']
cmd = shlex.split(cli)
(result, out, err) = module.run_command(cmd)
print_cli = cli.split(cliswitch)[1]
if (result != 0):
module.exit_json(command=print_cl... |
null | null | null | Does the code add the directory to the system path in the index location returns ?
| def add(path, index=0):
currIndex = (-1)
sysPath = get_path()
path = _normalize_dir(path)
index = int(index)
if (index < 0):
index = ((len(sysPath) + index) + 1)
if (index > len(sysPath)):
index = len(sysPath)
localPath = os.environ['PATH'].split(os.pathsep)
if (path not in localPath):
localPath.append(pa... | null | null | null | Yes
| codeqa | def add path index 0 curr Index -1 sys Path get path path normalize dir path index int index if index < 0 index len sys Path + index + 1 if index > len sys Path index len sys Path local Path os environ['PATH'] split os pathsep if path not in local Path local Path append path os environ['PATH'] os pathsep join local Pat... | null | null | null | null | Question:
Does the code add the directory to the system path in the index location returns ?
Code:
def add(path, index=0):
currIndex = (-1)
sysPath = get_path()
path = _normalize_dir(path)
index = int(index)
if (index < 0):
index = ((len(sysPath) + index) + 1)
if (index > len(sysPath)):
index = len(sysPat... |
null | null | null | What does the code add to the system path in the index location returns ?
| def add(path, index=0):
currIndex = (-1)
sysPath = get_path()
path = _normalize_dir(path)
index = int(index)
if (index < 0):
index = ((len(sysPath) + index) + 1)
if (index > len(sysPath)):
index = len(sysPath)
localPath = os.environ['PATH'].split(os.pathsep)
if (path not in localPath):
localPath.append(pa... | null | null | null | the directory
| codeqa | def add path index 0 curr Index -1 sys Path get path path normalize dir path index int index if index < 0 index len sys Path + index + 1 if index > len sys Path index len sys Path local Path os environ['PATH'] split os pathsep if path not in local Path local Path append path os environ['PATH'] os pathsep join local Pat... | null | null | null | null | Question:
What does the code add to the system path in the index location returns ?
Code:
def add(path, index=0):
currIndex = (-1)
sysPath = get_path()
path = _normalize_dir(path)
index = int(index)
if (index < 0):
index = ((len(sysPath) + index) + 1)
if (index > len(sysPath)):
index = len(sysPath)
local... |
null | null | null | Where do tabs replace the code ?
| def fix_indentation(text):
return text.replace(' DCTB ', (' ' * 4))
| null | null | null | by spaces
| codeqa | def fix indentation text return text replace ' DCTB ' '' * 4
| null | null | null | null | Question:
Where do tabs replace the code ?
Code:
def fix_indentation(text):
return text.replace(' DCTB ', (' ' * 4))
|
null | null | null | What replaces the code by spaces ?
| def fix_indentation(text):
return text.replace(' DCTB ', (' ' * 4))
| null | null | null | tabs
| codeqa | def fix indentation text return text replace ' DCTB ' '' * 4
| null | null | null | null | Question:
What replaces the code by spaces ?
Code:
def fix_indentation(text):
return text.replace(' DCTB ', (' ' * 4))
|
null | null | null | Do tabs replace the code by spaces ?
| def fix_indentation(text):
return text.replace(' DCTB ', (' ' * 4))
| null | null | null | Yes
| codeqa | def fix indentation text return text replace ' DCTB ' '' * 4
| null | null | null | null | Question:
Do tabs replace the code by spaces ?
Code:
def fix_indentation(text):
return text.replace(' DCTB ', (' ' * 4))
|
null | null | null | Does the code add bottom loop to loops ?
| def addBottomLoop(deltaZ, loops):
bottomLoop = loops[0]
bottomAddition = []
bottomZ = (euclidean.getBottomPath(bottomLoop) + deltaZ)
for point in bottomLoop:
bottomAddition.append(Vector3Index(len(bottomAddition), point.x, point.y, bottomZ))
loops.insert(0, bottomAddition)
numberOfVertexes = 0
for loop in loop... | null | null | null | Yes
| codeqa | def add Bottom Loop delta Z loops bottom Loop loops[ 0 ]bottom Addition []bottom Z euclidean get Bottom Path bottom Loop + delta Z for point in bottom Loop bottom Addition append Vector 3 Index len bottom Addition point x point y bottom Z loops insert 0 bottom Addition number Of Vertexes 0for loop in loops for point in... | null | null | null | null | Question:
Does the code add bottom loop to loops ?
Code:
def addBottomLoop(deltaZ, loops):
bottomLoop = loops[0]
bottomAddition = []
bottomZ = (euclidean.getBottomPath(bottomLoop) + deltaZ)
for point in bottomLoop:
bottomAddition.append(Vector3Index(len(bottomAddition), point.x, point.y, bottomZ))
loops.inse... |
null | null | null | What does the code add to loops ?
| def addBottomLoop(deltaZ, loops):
bottomLoop = loops[0]
bottomAddition = []
bottomZ = (euclidean.getBottomPath(bottomLoop) + deltaZ)
for point in bottomLoop:
bottomAddition.append(Vector3Index(len(bottomAddition), point.x, point.y, bottomZ))
loops.insert(0, bottomAddition)
numberOfVertexes = 0
for loop in loop... | null | null | null | bottom loop
| codeqa | def add Bottom Loop delta Z loops bottom Loop loops[ 0 ]bottom Addition []bottom Z euclidean get Bottom Path bottom Loop + delta Z for point in bottom Loop bottom Addition append Vector 3 Index len bottom Addition point x point y bottom Z loops insert 0 bottom Addition number Of Vertexes 0for loop in loops for point in... | null | null | null | null | Question:
What does the code add to loops ?
Code:
def addBottomLoop(deltaZ, loops):
bottomLoop = loops[0]
bottomAddition = []
bottomZ = (euclidean.getBottomPath(bottomLoop) + deltaZ)
for point in bottomLoop:
bottomAddition.append(Vector3Index(len(bottomAddition), point.x, point.y, bottomZ))
loops.insert(0, b... |
null | null | null | How do caching its return value handle ?
| def request_cached(f):
def wrapper(*args, **kwargs):
'\n Wrapper function to decorate with.\n '
converted_args = map(str, args)
converted_kwargs = map(str, reduce(list.__add__, map(list, sorted(kwargs.iteritems())), []))
cache_keys = (([f.__module__, f.func_name] + converted_args) + convert... | null | null | null | automatically
| codeqa | def request cached f def wrapper *args **kwargs '\n Wrapperfunctiontodecoratewith \n'converted args map str args converted kwargs map str reduce list add map list sorted kwargs iteritems [] cache keys [f module f func name] + converted args + converted kwargs cache key ' ' join cache keys rcache Request Cache get reque... | null | null | null | null | Question:
How do caching its return value handle ?
Code:
def request_cached(f):
def wrapper(*args, **kwargs):
'\n Wrapper function to decorate with.\n '
converted_args = map(str, args)
converted_kwargs = map(str, reduce(list.__add__, map(list, sorted(kwargs.iteritems())), []))
cache_key... |
null | null | null | What does the code get ?
| def libvlc_media_player_get_media(p_mi):
f = (_Cfunctions.get('libvlc_media_player_get_media', None) or _Cfunction('libvlc_media_player_get_media', ((1,),), class_result(Media), ctypes.c_void_p, MediaPlayer))
return f(p_mi)
| null | null | null | the media used by the media_player
| codeqa | def libvlc media player get media p mi f Cfunctions get 'libvlc media player get media' None or Cfunction 'libvlc media player get media' 1 class result Media ctypes c void p Media Player return f p mi
| null | null | null | null | Question:
What does the code get ?
Code:
def libvlc_media_player_get_media(p_mi):
f = (_Cfunctions.get('libvlc_media_player_get_media', None) or _Cfunction('libvlc_media_player_get_media', ((1,),), class_result(Media), ctypes.c_void_p, MediaPlayer))
return f(p_mi)
|
null | null | null | Does the code get the media used by the media_player ?
| def libvlc_media_player_get_media(p_mi):
f = (_Cfunctions.get('libvlc_media_player_get_media', None) or _Cfunction('libvlc_media_player_get_media', ((1,),), class_result(Media), ctypes.c_void_p, MediaPlayer))
return f(p_mi)
| null | null | null | Yes
| codeqa | def libvlc media player get media p mi f Cfunctions get 'libvlc media player get media' None or Cfunction 'libvlc media player get media' 1 class result Media ctypes c void p Media Player return f p mi
| null | null | null | null | Question:
Does the code get the media used by the media_player ?
Code:
def libvlc_media_player_get_media(p_mi):
f = (_Cfunctions.get('libvlc_media_player_get_media', None) or _Cfunction('libvlc_media_player_get_media', ((1,),), class_result(Media), ctypes.c_void_p, MediaPlayer))
return f(p_mi)
|
null | null | null | How is a related field defined when ?
| def add_lazy_relation(cls, field, relation, operation):
if (relation == RECURSIVE_RELATIONSHIP_CONSTANT):
app_label = cls._meta.app_label
model_name = cls.__name__
elif isinstance(relation, six.string_types):
try:
(app_label, model_name) = relation.split('.')
except ValueError:
app_label = cls._meta.app... | null | null | null | using a string
| codeqa | def add lazy relation cls field relation operation if relation RECURSIVE RELATIONSHIP CONSTANT app label cls meta app labelmodel name cls name elif isinstance relation six string types try app label model name relation split ' ' except Value Error app label cls meta app labelmodel name relationelse app label relation m... | null | null | null | null | Question:
How is a related field defined when ?
Code:
def add_lazy_relation(cls, field, relation, operation):
if (relation == RECURSIVE_RELATIONSHIP_CONSTANT):
app_label = cls._meta.app_label
model_name = cls.__name__
elif isinstance(relation, six.string_types):
try:
(app_label, model_name) = relation.sp... |
null | null | null | Does the code use a device by device number ?
| def _get_device(devnum=0):
if (not _custack):
_custack.push(get_gpu(devnum))
return _custack.top
| null | null | null | Yes
| codeqa | def get device devnum 0 if not custack custack push get gpu devnum return custack top
| null | null | null | null | Question:
Does the code use a device by device number ?
Code:
def _get_device(devnum=0):
if (not _custack):
_custack.push(get_gpu(devnum))
return _custack.top
|
null | null | null | What does the code use by device number ?
| def _get_device(devnum=0):
if (not _custack):
_custack.push(get_gpu(devnum))
return _custack.top
| null | null | null | a device
| codeqa | def get device devnum 0 if not custack custack push get gpu devnum return custack top
| null | null | null | null | Question:
What does the code use by device number ?
Code:
def _get_device(devnum=0):
if (not _custack):
_custack.push(get_gpu(devnum))
return _custack.top
|
null | null | null | How does the code use a device ?
| def _get_device(devnum=0):
if (not _custack):
_custack.push(get_gpu(devnum))
return _custack.top
| null | null | null | by device number
| codeqa | def get device devnum 0 if not custack custack push get gpu devnum return custack top
| null | null | null | null | Question:
How does the code use a device ?
Code:
def _get_device(devnum=0):
if (not _custack):
_custack.push(get_gpu(devnum))
return _custack.top
|
null | null | null | What does the code get ?
| def _get_device(devnum=0):
if (not _custack):
_custack.push(get_gpu(devnum))
return _custack.top
| null | null | null | the current device
| codeqa | def get device devnum 0 if not custack custack push get gpu devnum return custack top
| null | null | null | null | Question:
What does the code get ?
Code:
def _get_device(devnum=0):
if (not _custack):
_custack.push(get_gpu(devnum))
return _custack.top
|
null | null | null | Does the code get the current device ?
| def _get_device(devnum=0):
if (not _custack):
_custack.push(get_gpu(devnum))
return _custack.top
| null | null | null | Yes
| codeqa | def get device devnum 0 if not custack custack push get gpu devnum return custack top
| null | null | null | null | Question:
Does the code get the current device ?
Code:
def _get_device(devnum=0):
if (not _custack):
_custack.push(get_gpu(devnum))
return _custack.top
|
null | null | null | What does the code update ?
| def task_status_update(context, data_dict):
model = context['model']
session = model.meta.create_local_session()
context['session'] = session
user = context['user']
id = data_dict.get('id')
schema = (context.get('schema') or schema_.default_task_status_schema())
if id:
task_status = model.TaskStatus.get(id)
... | null | null | null | a task status
| codeqa | def task status update context data dict model context['model']session model meta create local session context['session'] sessionuser context['user']id data dict get 'id' schema context get 'schema' or schema default task status schema if id task status model Task Status get id context['task status'] task statusif task... | null | null | null | null | Question:
What does the code update ?
Code:
def task_status_update(context, data_dict):
model = context['model']
session = model.meta.create_local_session()
context['session'] = session
user = context['user']
id = data_dict.get('id')
schema = (context.get('schema') or schema_.default_task_status_schema())
if... |
null | null | null | Does the code update a task status ?
| def task_status_update(context, data_dict):
model = context['model']
session = model.meta.create_local_session()
context['session'] = session
user = context['user']
id = data_dict.get('id')
schema = (context.get('schema') or schema_.default_task_status_schema())
if id:
task_status = model.TaskStatus.get(id)
... | null | null | null | Yes
| codeqa | def task status update context data dict model context['model']session model meta create local session context['session'] sessionuser context['user']id data dict get 'id' schema context get 'schema' or schema default task status schema if id task status model Task Status get id context['task status'] task statusif task... | null | null | null | null | Question:
Does the code update a task status ?
Code:
def task_status_update(context, data_dict):
model = context['model']
session = model.meta.create_local_session()
context['session'] = session
user = context['user']
id = data_dict.get('id')
schema = (context.get('schema') or schema_.default_task_status_sche... |
null | null | null | Does the code capitalize the first character of the value ?
| @register.filter(is_safe=True)
@stringfilter
def capfirst(value):
return (value and (value[0].upper() + value[1:]))
| null | null | null | Yes
| codeqa | @register filter is safe True @stringfilterdef capfirst value return value and value[ 0 ] upper + value[ 1 ]
| null | null | null | null | Question:
Does the code capitalize the first character of the value ?
Code:
@register.filter(is_safe=True)
@stringfilter
def capfirst(value):
return (value and (value[0].upper() + value[1:]))
|
null | null | null | What does the code capitalize ?
| @register.filter(is_safe=True)
@stringfilter
def capfirst(value):
return (value and (value[0].upper() + value[1:]))
| null | null | null | the first character of the value
| codeqa | @register filter is safe True @stringfilterdef capfirst value return value and value[ 0 ] upper + value[ 1 ]
| null | null | null | null | Question:
What does the code capitalize ?
Code:
@register.filter(is_safe=True)
@stringfilter
def capfirst(value):
return (value and (value[0].upper() + value[1:]))
|
null | null | null | What do context manager set temporarily ?
| @contextlib.contextmanager
def _setenv(key, value):
old_value = os.environ.get(key, None)
if (value is None):
os.environ.pop(key, None)
else:
os.environ[key] = value
(yield)
if (old_value is None):
os.environ.pop(key, None)
else:
os.environ[key] = value
| null | null | null | an environment variable
| codeqa | @contextlib contextmanagerdef setenv key value old value os environ get key None if value is None os environ pop key None else os environ[key] value yield if old value is None os environ pop key None else os environ[key] value
| null | null | null | null | Question:
What do context manager set temporarily ?
Code:
@contextlib.contextmanager
def _setenv(key, value):
old_value = os.environ.get(key, None)
if (value is None):
os.environ.pop(key, None)
else:
os.environ[key] = value
(yield)
if (old_value is None):
os.environ.pop(key, None)
else:
os.environ[key... |
null | null | null | What sets an environment variable temporarily ?
| @contextlib.contextmanager
def _setenv(key, value):
old_value = os.environ.get(key, None)
if (value is None):
os.environ.pop(key, None)
else:
os.environ[key] = value
(yield)
if (old_value is None):
os.environ.pop(key, None)
else:
os.environ[key] = value
| null | null | null | context manager
| codeqa | @contextlib contextmanagerdef setenv key value old value os environ get key None if value is None os environ pop key None else os environ[key] value yield if old value is None os environ pop key None else os environ[key] value
| null | null | null | null | Question:
What sets an environment variable temporarily ?
Code:
@contextlib.contextmanager
def _setenv(key, value):
old_value = os.environ.get(key, None)
if (value is None):
os.environ.pop(key, None)
else:
os.environ[key] = value
(yield)
if (old_value is None):
os.environ.pop(key, None)
else:
os.envir... |
null | null | null | When do context manager set an environment variable ?
| @contextlib.contextmanager
def _setenv(key, value):
old_value = os.environ.get(key, None)
if (value is None):
os.environ.pop(key, None)
else:
os.environ[key] = value
(yield)
if (old_value is None):
os.environ.pop(key, None)
else:
os.environ[key] = value
| null | null | null | temporarily
| codeqa | @contextlib contextmanagerdef setenv key value old value os environ get key None if value is None os environ pop key None else os environ[key] value yield if old value is None os environ pop key None else os environ[key] value
| null | null | null | null | Question:
When do context manager set an environment variable ?
Code:
@contextlib.contextmanager
def _setenv(key, value):
old_value = os.environ.get(key, None)
if (value is None):
os.environ.pop(key, None)
else:
os.environ[key] = value
(yield)
if (old_value is None):
os.environ.pop(key, None)
else:
os... |
null | null | null | Do context manager set an environment variable temporarily ?
| @contextlib.contextmanager
def _setenv(key, value):
old_value = os.environ.get(key, None)
if (value is None):
os.environ.pop(key, None)
else:
os.environ[key] = value
(yield)
if (old_value is None):
os.environ.pop(key, None)
else:
os.environ[key] = value
| null | null | null | Yes
| codeqa | @contextlib contextmanagerdef setenv key value old value os environ get key None if value is None os environ pop key None else os environ[key] value yield if old value is None os environ pop key None else os environ[key] value
| null | null | null | null | Question:
Do context manager set an environment variable temporarily ?
Code:
@contextlib.contextmanager
def _setenv(key, value):
old_value = os.environ.get(key, None)
if (value is None):
os.environ.pop(key, None)
else:
os.environ[key] = value
(yield)
if (old_value is None):
os.environ.pop(key, None)
els... |
null | null | null | Did the code expect inclusion_explicit_no_context_from_template _ _ doc _ _ ?
| @register.inclusion_tag(get_template('inclusion.html'), takes_context=False)
def inclusion_explicit_no_context_from_template(arg):
return {'result': ('inclusion_explicit_no_context_from_template - Expected result: %s' % arg)}
| null | null | null | Yes
| codeqa | @register inclusion tag get template 'inclusion html' takes context False def inclusion explicit no context from template arg return {'result' 'inclusion explicit no context from template- Expectedresult %s' % arg }
| null | null | null | null | Question:
Did the code expect inclusion_explicit_no_context_from_template _ _ doc _ _ ?
Code:
@register.inclusion_tag(get_template('inclusion.html'), takes_context=False)
def inclusion_explicit_no_context_from_template(arg):
return {'result': ('inclusion_explicit_no_context_from_template - Expected result: %s'... |
null | null | null | What did the code expect ?
| @register.inclusion_tag(get_template('inclusion.html'), takes_context=False)
def inclusion_explicit_no_context_from_template(arg):
return {'result': ('inclusion_explicit_no_context_from_template - Expected result: %s' % arg)}
| null | null | null | inclusion_explicit_no_context_from_template _ _ doc _ _
| codeqa | @register inclusion tag get template 'inclusion html' takes context False def inclusion explicit no context from template arg return {'result' 'inclusion explicit no context from template- Expectedresult %s' % arg }
| null | null | null | null | Question:
What did the code expect ?
Code:
@register.inclusion_tag(get_template('inclusion.html'), takes_context=False)
def inclusion_explicit_no_context_from_template(arg):
return {'result': ('inclusion_explicit_no_context_from_template - Expected result: %s' % arg)}
|
null | null | null | How do dictionary of predecessors return ?
| def dfs_predecessors(G, source=None):
return dict(((t, s) for (s, t) in dfs_edges(G, source=source)))
| null | null | null | in depth - first - search from source
| codeqa | def dfs predecessors G source None return dict t s for s t in dfs edges G source source
| null | null | null | null | Question:
How do dictionary of predecessors return ?
Code:
def dfs_predecessors(G, source=None):
return dict(((t, s) for (s, t) in dfs_edges(G, source=source)))
|
null | null | null | What does the code return ?
| def status(job_label, runas=None):
service = _service_by_name(job_label)
lookup_name = (service['plist']['Label'] if service else job_label)
launchctl_data = _get_launchctl_data(lookup_name, runas=runas)
if launchctl_data:
if BEFORE_YOSEMITE:
if six.PY3:
return ('PID' in plistlib.loads(launchctl_data))
... | null | null | null | the status for a service
| codeqa | def status job label runas None service service by name job label lookup name service['plist'][' Label'] if service else job label launchctl data get launchctl data lookup name runas runas if launchctl data if BEFORE YOSEMITE if six PY 3 return 'PID' in plistlib loads launchctl data else return 'PID' in dict plistlib r... | null | null | null | null | Question:
What does the code return ?
Code:
def status(job_label, runas=None):
service = _service_by_name(job_label)
lookup_name = (service['plist']['Label'] if service else job_label)
launchctl_data = _get_launchctl_data(lookup_name, runas=runas)
if launchctl_data:
if BEFORE_YOSEMITE:
if six.PY3:
retu... |
null | null | null | Does the code return the status for a service ?
| def status(job_label, runas=None):
service = _service_by_name(job_label)
lookup_name = (service['plist']['Label'] if service else job_label)
launchctl_data = _get_launchctl_data(lookup_name, runas=runas)
if launchctl_data:
if BEFORE_YOSEMITE:
if six.PY3:
return ('PID' in plistlib.loads(launchctl_data))
... | null | null | null | Yes
| codeqa | def status job label runas None service service by name job label lookup name service['plist'][' Label'] if service else job label launchctl data get launchctl data lookup name runas runas if launchctl data if BEFORE YOSEMITE if six PY 3 return 'PID' in plistlib loads launchctl data else return 'PID' in dict plistlib r... | null | null | null | null | Question:
Does the code return the status for a service ?
Code:
def status(job_label, runas=None):
service = _service_by_name(job_label)
lookup_name = (service['plist']['Label'] if service else job_label)
launchctl_data = _get_launchctl_data(lookup_name, runas=runas)
if launchctl_data:
if BEFORE_YOSEMITE:
... |
null | null | null | In which direction does a sequence pad ?
| def padTo(n, seq, default=None):
if (len(seq) > n):
raise ValueError(('%d elements is more than %d.' % (len(seq), n)))
blank = ([default] * n)
blank[:len(seq)] = list(seq)
return blank
| null | null | null | out
| codeqa | def pad To n seq default None if len seq > n raise Value Error '%delementsismorethan%d ' % len seq n blank [default] * n blank[ len seq ] list seq return blank
| null | null | null | null | Question:
In which direction does a sequence pad ?
Code:
def padTo(n, seq, default=None):
if (len(seq) > n):
raise ValueError(('%d elements is more than %d.' % (len(seq), n)))
blank = ([default] * n)
blank[:len(seq)] = list(seq)
return blank
|
null | null | null | What is using to combine them from right to left ?
| def foldr(fn, elems, initializer=None, name=None):
if (initializer is None):
initializer = elems[(-1)]
elems = elems[:(-1)]
fn2 = (lambda x, acc: fn(acc, x))
return theano.foldr(fn2, elems, initializer, name=name)[0]
| null | null | null | fn
| codeqa | def foldr fn elems initializer None name None if initializer is None initializer elems[ -1 ]elems elems[ -1 ]fn 2 lambda x acc fn acc x return theano foldr fn 2 elems initializer name name [0 ]
| null | null | null | null | Question:
What is using to combine them from right to left ?
Code:
def foldr(fn, elems, initializer=None, name=None):
if (initializer is None):
initializer = elems[(-1)]
elems = elems[:(-1)]
fn2 = (lambda x, acc: fn(acc, x))
return theano.foldr(fn2, elems, initializer, name=name)[0]
|
null | null | null | What does the code invert ?
| def invert(image):
lut = []
for i in range(256):
lut.append((255 - i))
return _lut(image, lut)
| null | null | null | the image
| codeqa | def invert image lut []for i in range 256 lut append 255 - i return lut image lut
| null | null | null | null | Question:
What does the code invert ?
Code:
def invert(image):
lut = []
for i in range(256):
lut.append((255 - i))
return _lut(image, lut)
|
null | null | null | Does the code invert the image ?
| def invert(image):
lut = []
for i in range(256):
lut.append((255 - i))
return _lut(image, lut)
| null | null | null | Yes
| codeqa | def invert image lut []for i in range 256 lut append 255 - i return lut image lut
| null | null | null | null | Question:
Does the code invert the image ?
Code:
def invert(image):
lut = []
for i in range(256):
lut.append((255 - i))
return _lut(image, lut)
|
null | null | null | How does metadata of the decorated function replicate ?
| def make_decorator(func):
def decorate(newfunc):
if hasattr(func, 'compat_func_name'):
name = func.compat_func_name
else:
name = func.__name__
newfunc.__dict__ = func.__dict__
newfunc.__doc__ = func.__doc__
newfunc.__module__ = func.__module__
if (not hasattr(newfunc, 'compat_co_firstlineno')):
ne... | null | null | null | properly
| codeqa | def make decorator func def decorate newfunc if hasattr func 'compat func name' name func compat func nameelse name func name newfunc dict func dict newfunc doc func doc newfunc module func module if not hasattr newfunc 'compat co firstlineno' newfunc compat co firstlineno func func code co firstlinenotry newfunc name ... | null | null | null | null | Question:
How does metadata of the decorated function replicate ?
Code:
def make_decorator(func):
def decorate(newfunc):
if hasattr(func, 'compat_func_name'):
name = func.compat_func_name
else:
name = func.__name__
newfunc.__dict__ = func.__dict__
newfunc.__doc__ = func.__doc__
newfunc.__module__ =... |
null | null | null | For what purpose does a test decorator wrap ?
| def make_decorator(func):
def decorate(newfunc):
if hasattr(func, 'compat_func_name'):
name = func.compat_func_name
else:
name = func.__name__
newfunc.__dict__ = func.__dict__
newfunc.__doc__ = func.__doc__
newfunc.__module__ = func.__module__
if (not hasattr(newfunc, 'compat_co_firstlineno')):
ne... | null | null | null | so as to properly replicate metadata of the decorated function
| codeqa | def make decorator func def decorate newfunc if hasattr func 'compat func name' name func compat func nameelse name func name newfunc dict func dict newfunc doc func doc newfunc module func module if not hasattr newfunc 'compat co firstlineno' newfunc compat co firstlineno func func code co firstlinenotry newfunc name ... | null | null | null | null | Question:
For what purpose does a test decorator wrap ?
Code:
def make_decorator(func):
def decorate(newfunc):
if hasattr(func, 'compat_func_name'):
name = func.compat_func_name
else:
name = func.__name__
newfunc.__dict__ = func.__dict__
newfunc.__doc__ = func.__doc__
newfunc.__module__ = func.__mo... |
null | null | null | What does the code add to the group type access list ?
| @require_admin_context
def group_type_access_add(context, type_id, project_id):
group_type_id = _group_type_get_id_from_group_type(context, type_id)
access_ref = models.GroupTypeProjects()
access_ref.update({'group_type_id': group_type_id, 'project_id': project_id})
session = get_session()
with session.begin():
... | null | null | null | given tenant
| codeqa | @require admin contextdef group type access add context type id project id group type id group type get id from group type context type id access ref models Group Type Projects access ref update {'group type id' group type id 'project id' project id} session get session with session begin try access ref save session se... | null | null | null | null | Question:
What does the code add to the group type access list ?
Code:
@require_admin_context
def group_type_access_add(context, type_id, project_id):
group_type_id = _group_type_get_id_from_group_type(context, type_id)
access_ref = models.GroupTypeProjects()
access_ref.update({'group_type_id': group_type_id, 'p... |
null | null | null | What does the code create ?
| def make_image_dict(image):
def _fetch_attrs(d, attrs):
return dict([(a, d[a]) for a in attrs if (a in d.keys())])
properties = dict(((p['name'], p['value']) for p in image['properties'] if (not p['deleted'])))
image_dict = _fetch_attrs(image, glance.db.IMAGE_ATTRS)
image_dict['properties'] = properties
_limit_l... | null | null | null | a dict representation of an image which we can use to serialize the image
| codeqa | def make image dict image def fetch attrs d attrs return dict [ a d[a] for a in attrs if a in d keys ] properties dict p['name'] p['value'] for p in image['properties'] if not p['deleted'] image dict fetch attrs image glance db IMAGE ATTRS image dict['properties'] properties limit locations image dict return image dict... | null | null | null | null | Question:
What does the code create ?
Code:
def make_image_dict(image):
def _fetch_attrs(d, attrs):
return dict([(a, d[a]) for a in attrs if (a in d.keys())])
properties = dict(((p['name'], p['value']) for p in image['properties'] if (not p['deleted'])))
image_dict = _fetch_attrs(image, glance.db.IMAGE_ATTRS)
... |
null | null | null | Can we use to serialize the image an image ?
| def make_image_dict(image):
def _fetch_attrs(d, attrs):
return dict([(a, d[a]) for a in attrs if (a in d.keys())])
properties = dict(((p['name'], p['value']) for p in image['properties'] if (not p['deleted'])))
image_dict = _fetch_attrs(image, glance.db.IMAGE_ATTRS)
image_dict['properties'] = properties
_limit_l... | null | null | null | Yes
| codeqa | def make image dict image def fetch attrs d attrs return dict [ a d[a] for a in attrs if a in d keys ] properties dict p['name'] p['value'] for p in image['properties'] if not p['deleted'] image dict fetch attrs image glance db IMAGE ATTRS image dict['properties'] properties limit locations image dict return image dict... | null | null | null | null | Question:
Can we use to serialize the image an image ?
Code:
def make_image_dict(image):
def _fetch_attrs(d, attrs):
return dict([(a, d[a]) for a in attrs if (a in d.keys())])
properties = dict(((p['name'], p['value']) for p in image['properties'] if (not p['deleted'])))
image_dict = _fetch_attrs(image, glance... |
null | null | null | Does the code create a dict representation of an image which we can use to serialize the image ?
| def make_image_dict(image):
def _fetch_attrs(d, attrs):
return dict([(a, d[a]) for a in attrs if (a in d.keys())])
properties = dict(((p['name'], p['value']) for p in image['properties'] if (not p['deleted'])))
image_dict = _fetch_attrs(image, glance.db.IMAGE_ATTRS)
image_dict['properties'] = properties
_limit_l... | null | null | null | Yes
| codeqa | def make image dict image def fetch attrs d attrs return dict [ a d[a] for a in attrs if a in d keys ] properties dict p['name'] p['value'] for p in image['properties'] if not p['deleted'] image dict fetch attrs image glance db IMAGE ATTRS image dict['properties'] properties limit locations image dict return image dict... | null | null | null | null | Question:
Does the code create a dict representation of an image which we can use to serialize the image ?
Code:
def make_image_dict(image):
def _fetch_attrs(d, attrs):
return dict([(a, d[a]) for a in attrs if (a in d.keys())])
properties = dict(((p['name'], p['value']) for p in image['properties'] if (not p['d... |
null | null | null | What can we use an image ?
| def make_image_dict(image):
def _fetch_attrs(d, attrs):
return dict([(a, d[a]) for a in attrs if (a in d.keys())])
properties = dict(((p['name'], p['value']) for p in image['properties'] if (not p['deleted'])))
image_dict = _fetch_attrs(image, glance.db.IMAGE_ATTRS)
image_dict['properties'] = properties
_limit_l... | null | null | null | to serialize the image
| codeqa | def make image dict image def fetch attrs d attrs return dict [ a d[a] for a in attrs if a in d keys ] properties dict p['name'] p['value'] for p in image['properties'] if not p['deleted'] image dict fetch attrs image glance db IMAGE ATTRS image dict['properties'] properties limit locations image dict return image dict... | null | null | null | null | Question:
What can we use an image ?
Code:
def make_image_dict(image):
def _fetch_attrs(d, attrs):
return dict([(a, d[a]) for a in attrs if (a in d.keys())])
properties = dict(((p['name'], p['value']) for p in image['properties'] if (not p['deleted'])))
image_dict = _fetch_attrs(image, glance.db.IMAGE_ATTRS)
... |
null | null | null | What does the code get ?
| def getNewRepository():
return AlterationRepository()
| null | null | null | new repository
| codeqa | def get New Repository return Alteration Repository
| null | null | null | null | Question:
What does the code get ?
Code:
def getNewRepository():
return AlterationRepository()
|
null | null | null | Is this function called where ?
| def nextLine():
caller = currentframe(1)
return (getsourcefile(sys.modules[caller.f_globals['__name__']]), (caller.f_lineno + 1))
| null | null | null | Yes
| codeqa | def next Line caller currentframe 1 return getsourcefile sys modules[caller f globals[' name ']] caller f lineno + 1
| null | null | null | null | Question:
Is this function called where ?
Code:
def nextLine():
caller = currentframe(1)
return (getsourcefile(sys.modules[caller.f_globals['__name__']]), (caller.f_lineno + 1))
|
null | null | null | Where is this function called ?
| def nextLine():
caller = currentframe(1)
return (getsourcefile(sys.modules[caller.f_globals['__name__']]), (caller.f_lineno + 1))
| null | null | null | where
| codeqa | def next Line caller currentframe 1 return getsourcefile sys modules[caller f globals[' name ']] caller f lineno + 1
| null | null | null | null | Question:
Where is this function called ?
Code:
def nextLine():
caller = currentframe(1)
return (getsourcefile(sys.modules[caller.f_globals['__name__']]), (caller.f_lineno + 1))
|
null | null | null | How do a static address delete ?
| def delete_address(kwargs=None, call=None):
if (call != 'function'):
raise SaltCloudSystemExit('The delete_address function must be called with -f or --function.')
if ((not kwargs) or ('name' not in kwargs)):
log.error('A name must be specified when deleting an address.')
return False
if ((not... | null | null | null | permanently
| codeqa | def delete address kwargs None call None if call 'function' raise Salt Cloud System Exit ' Thedelete addressfunctionmustbecalledwith-for--function ' if not kwargs or 'name' not in kwargs log error ' Anamemustbespecifiedwhendeletinganaddress ' return Falseif not kwargs or 'region' not in kwargs log error ' Aregionmustbe... | null | null | null | null | Question:
How do a static address delete ?
Code:
def delete_address(kwargs=None, call=None):
if (call != 'function'):
raise SaltCloudSystemExit('The delete_address function must be called with -f or --function.')
if ((not kwargs) or ('name' not in kwargs)):
log.error('A name must be specified wh... |
null | null | null | What do apps use ?
| def auth(request):
if hasattr(request, 'user'):
user = request.user
else:
from django.contrib.auth.models import AnonymousUser
user = AnonymousUser()
return {'user': user, 'perms': PermWrapper(user)}
| null | null | null | djangos authentication system
| codeqa | def auth request if hasattr request 'user' user request userelse from django contrib auth models import Anonymous Useruser Anonymous User return {'user' user 'perms' Perm Wrapper user }
| null | null | null | null | Question:
What do apps use ?
Code:
def auth(request):
if hasattr(request, 'user'):
user = request.user
else:
from django.contrib.auth.models import AnonymousUser
user = AnonymousUser()
return {'user': user, 'perms': PermWrapper(user)}
|
null | null | null | How do the legend based on series labels fill ?
| def AutoLegend(chart):
chart._show_legend = False
labels = []
for series in chart.data:
if (series.label is None):
labels.append('')
else:
labels.append(series.label)
chart._show_legend = True
if chart._show_legend:
chart._legend_labels = labels
| null | null | null | automatically
| codeqa | def Auto Legend chart chart show legend Falselabels []for series in chart data if series label is None labels append '' else labels append series label chart show legend Trueif chart show legend chart legend labels labels
| null | null | null | null | Question:
How do the legend based on series labels fill ?
Code:
def AutoLegend(chart):
chart._show_legend = False
labels = []
for series in chart.data:
if (series.label is None):
labels.append('')
else:
labels.append(series.label)
chart._show_legend = True
if chart._show_legend:
chart._legend_lab... |
null | null | null | Does the code add a user in the group ?
| def adduser(group, name):
cmd = 'dscl . -merge /Groups/{0} GroupMembership {1}'.format(group, name)
return (__salt__['cmd.retcode'](cmd) == 0)
| null | null | null | Yes
| codeqa | def adduser group name cmd 'dscl -merge/ Groups/{ 0 } Group Membership{ 1 }' format group name return salt ['cmd retcode'] cmd 0
| null | null | null | null | Question:
Does the code add a user in the group ?
Code:
def adduser(group, name):
cmd = 'dscl . -merge /Groups/{0} GroupMembership {1}'.format(group, name)
return (__salt__['cmd.retcode'](cmd) == 0)
|
null | null | null | What does the code add ?
| def adduser(group, name):
cmd = 'dscl . -merge /Groups/{0} GroupMembership {1}'.format(group, name)
return (__salt__['cmd.retcode'](cmd) == 0)
| null | null | null | a user in the group
| codeqa | def adduser group name cmd 'dscl -merge/ Groups/{ 0 } Group Membership{ 1 }' format group name return salt ['cmd retcode'] cmd 0
| null | null | null | null | Question:
What does the code add ?
Code:
def adduser(group, name):
cmd = 'dscl . -merge /Groups/{0} GroupMembership {1}'.format(group, name)
return (__salt__['cmd.retcode'](cmd) == 0)
|
null | null | null | When is an error raised ?
| def test_nm1_sample_wt_fit():
ratio = 'auto'
nm1 = NearMiss(ratio=ratio, random_state=RND_SEED, version=VERSION_NEARMISS)
assert_raises(RuntimeError, nm1.sample, X, Y)
| null | null | null | when sample is called before fitting
| codeqa | def test nm 1 sample wt fit ratio 'auto'nm 1 Near Miss ratio ratio random state RND SEED version VERSION NEARMISS assert raises Runtime Error nm 1 sample X Y
| null | null | null | null | Question:
When is an error raised ?
Code:
def test_nm1_sample_wt_fit():
ratio = 'auto'
nm1 = NearMiss(ratio=ratio, random_state=RND_SEED, version=VERSION_NEARMISS)
assert_raises(RuntimeError, nm1.sample, X, Y)
|
null | null | null | What does the code monitor ?
| def monitorTest(N=3, seconds=3):
topo = SingleSwitchTopo(N)
net = Mininet(topo)
net.start()
hosts = net.hosts
info('Starting test...\n')
server = hosts[0]
(outfiles, errfiles) = ({}, {})
for h in hosts:
outfiles[h] = ('/tmp/%s.out' % h.name)
errfiles[h] = ('/tmp/%s.err' % h.name)
h.cmd('echo >', outfile... | null | null | null | multiple hosts
| codeqa | def monitor Test N 3 seconds 3 topo Single Switch Topo N net Mininet topo net start hosts net hostsinfo ' Startingtest \n' server hosts[ 0 ] outfiles errfiles {} {} for h in hosts outfiles[h] '/tmp/%s out' % h name errfiles[h] '/tmp/%s err' % h name h cmd 'echo>' outfiles[h] h cmd 'echo>' errfiles[h] h cmd Print 'ping'... | null | null | null | null | Question:
What does the code monitor ?
Code:
def monitorTest(N=3, seconds=3):
topo = SingleSwitchTopo(N)
net = Mininet(topo)
net.start()
hosts = net.hosts
info('Starting test...\n')
server = hosts[0]
(outfiles, errfiles) = ({}, {})
for h in hosts:
outfiles[h] = ('/tmp/%s.out' % h.name)
errfiles[h] = ('... |
null | null | null | Does the code monitor multiple hosts ?
| def monitorTest(N=3, seconds=3):
topo = SingleSwitchTopo(N)
net = Mininet(topo)
net.start()
hosts = net.hosts
info('Starting test...\n')
server = hosts[0]
(outfiles, errfiles) = ({}, {})
for h in hosts:
outfiles[h] = ('/tmp/%s.out' % h.name)
errfiles[h] = ('/tmp/%s.err' % h.name)
h.cmd('echo >', outfile... | null | null | null | Yes
| codeqa | def monitor Test N 3 seconds 3 topo Single Switch Topo N net Mininet topo net start hosts net hostsinfo ' Startingtest \n' server hosts[ 0 ] outfiles errfiles {} {} for h in hosts outfiles[h] '/tmp/%s out' % h name errfiles[h] '/tmp/%s err' % h name h cmd 'echo>' outfiles[h] h cmd 'echo>' errfiles[h] h cmd Print 'ping'... | null | null | null | null | Question:
Does the code monitor multiple hosts ?
Code:
def monitorTest(N=3, seconds=3):
topo = SingleSwitchTopo(N)
net = Mininet(topo)
net.start()
hosts = net.hosts
info('Starting test...\n')
server = hosts[0]
(outfiles, errfiles) = ({}, {})
for h in hosts:
outfiles[h] = ('/tmp/%s.out' % h.name)
errfil... |
null | null | null | How do completion for -- in command get ?
| def test_completion_option_for_command(script):
(res, env) = setup_completion(script, 'pip search --', '2')
assert ('--help' in res.stdout), 'autocomplete function could not complete ``--``'
| null | null | null | test
| codeqa | def test completion option for command script res env setup completion script 'pipsearch--' '2 ' assert '--help' in res stdout 'autocompletefunctioncouldnotcomplete``--``'
| null | null | null | null | Question:
How do completion for -- in command get ?
Code:
def test_completion_option_for_command(script):
(res, env) = setup_completion(script, 'pip search --', '2')
assert ('--help' in res.stdout), 'autocomplete function could not complete ``--``'
|
null | null | null | How do a string split ?
| def safe_shlex_split(text_or_binary):
return shlex.split(ensure_binary(text_or_binary))
| null | null | null | using shell - like syntax
| codeqa | def safe shlex split text or binary return shlex split ensure binary text or binary
| null | null | null | null | Question:
How do a string split ?
Code:
def safe_shlex_split(text_or_binary):
return shlex.split(ensure_binary(text_or_binary))
|
null | null | null | For what purpose does this function truncate digests that are longer than a given elliptic curve keys length ?
| def _truncate_digest_for_ecdsa(ec_key_cdata, digest, backend):
_lib = backend._lib
_ffi = backend._ffi
group = _lib.EC_KEY_get0_group(ec_key_cdata)
with backend._tmp_bn_ctx() as bn_ctx:
order = _lib.BN_CTX_get(bn_ctx)
assert (order != _ffi.NULL)
res = _lib.EC_GROUP_get_order(group, order, bn_ctx)
assert (re... | null | null | null | so they can be signed
| codeqa | def truncate digest for ecdsa ec key cdata digest backend lib backend lib ffi backend ffigroup lib EC KEY get 0 group ec key cdata with backend tmp bn ctx as bn ctx order lib BN CTX get bn ctx assert order ffi NULL res lib EC GROUP get order group order bn ctx assert res 1 order bits lib BN num bits order return trunca... | null | null | null | null | Question:
For what purpose does this function truncate digests that are longer than a given elliptic curve keys length ?
Code:
def _truncate_digest_for_ecdsa(ec_key_cdata, digest, backend):
_lib = backend._lib
_ffi = backend._ffi
group = _lib.EC_KEY_get0_group(ec_key_cdata)
with backend._tmp_bn_ctx() as bn_ctx:... |
null | null | null | What does the code get ?
| def libvlc_video_get_aspect_ratio(p_mi):
f = (_Cfunctions.get('libvlc_video_get_aspect_ratio', None) or _Cfunction('libvlc_video_get_aspect_ratio', ((1,),), string_result, ctypes.c_void_p, MediaPlayer))
return f(p_mi)
| null | null | null | current video aspect ratio
| codeqa | def libvlc video get aspect ratio p mi f Cfunctions get 'libvlc video get aspect ratio' None or Cfunction 'libvlc video get aspect ratio' 1 string result ctypes c void p Media Player return f p mi
| null | null | null | null | Question:
What does the code get ?
Code:
def libvlc_video_get_aspect_ratio(p_mi):
f = (_Cfunctions.get('libvlc_video_get_aspect_ratio', None) or _Cfunction('libvlc_video_get_aspect_ratio', ((1,),), string_result, ctypes.c_void_p, MediaPlayer))
return f(p_mi)
|
null | null | null | Does the code get current video aspect ratio ?
| def libvlc_video_get_aspect_ratio(p_mi):
f = (_Cfunctions.get('libvlc_video_get_aspect_ratio', None) or _Cfunction('libvlc_video_get_aspect_ratio', ((1,),), string_result, ctypes.c_void_p, MediaPlayer))
return f(p_mi)
| null | null | null | Yes
| codeqa | def libvlc video get aspect ratio p mi f Cfunctions get 'libvlc video get aspect ratio' None or Cfunction 'libvlc video get aspect ratio' 1 string result ctypes c void p Media Player return f p mi
| null | null | null | null | Question:
Does the code get current video aspect ratio ?
Code:
def libvlc_video_get_aspect_ratio(p_mi):
f = (_Cfunctions.get('libvlc_video_get_aspect_ratio', None) or _Cfunction('libvlc_video_get_aspect_ratio', ((1,),), string_result, ctypes.c_void_p, MediaPlayer))
return f(p_mi)
|
null | null | null | Does the code accumulate all attributes of a given name in a class hierarchy into a single dictionary ?
| def accumulateClassDict(classObj, attr, adict, baseClass=None):
for base in classObj.__bases__:
accumulateClassDict(base, attr, adict)
if ((baseClass is None) or (baseClass in classObj.__bases__)):
adict.update(classObj.__dict__.get(attr, {}))
| null | null | null | Yes
| codeqa | def accumulate Class Dict class Obj attr adict base Class None for base in class Obj bases accumulate Class Dict base attr adict if base Class is None or base Class in class Obj bases adict update class Obj dict get attr {}
| null | null | null | null | Question:
Does the code accumulate all attributes of a given name in a class hierarchy into a single dictionary ?
Code:
def accumulateClassDict(classObj, attr, adict, baseClass=None):
for base in classObj.__bases__:
accumulateClassDict(base, attr, adict)
if ((baseClass is None) or (baseClass in classObj.__bases... |
null | null | null | What does the code accumulate into a single dictionary ?
| def accumulateClassDict(classObj, attr, adict, baseClass=None):
for base in classObj.__bases__:
accumulateClassDict(base, attr, adict)
if ((baseClass is None) or (baseClass in classObj.__bases__)):
adict.update(classObj.__dict__.get(attr, {}))
| null | null | null | all attributes of a given name in a class hierarchy
| codeqa | def accumulate Class Dict class Obj attr adict base Class None for base in class Obj bases accumulate Class Dict base attr adict if base Class is None or base Class in class Obj bases adict update class Obj dict get attr {}
| null | null | null | null | Question:
What does the code accumulate into a single dictionary ?
Code:
def accumulateClassDict(classObj, attr, adict, baseClass=None):
for base in classObj.__bases__:
accumulateClassDict(base, attr, adict)
if ((baseClass is None) or (baseClass in classObj.__bases__)):
adict.update(classObj.__dict__.get(attr... |
null | null | null | How do a path package ?
| def pkgPath(root, path, rpath='/'):
global data_files
if (not os.path.exists(path)):
return
files = []
for spath in os.listdir(path):
if (spath == 'test'):
continue
subpath = os.path.join(path, spath)
spath = os.path.join(rpath, spath)
if os.path.isfile(subpath):
files.append(subpath)
if os.path.i... | null | null | null | recursively
| codeqa | def pkg Path root path rpath '/' global data filesif not os path exists path returnfiles []for spath in os listdir path if spath 'test' continuesubpath os path join path spath spath os path join rpath spath if os path isfile subpath files append subpath if os path isdir subpath pkg Path root subpath spath data files ap... | null | null | null | null | Question:
How do a path package ?
Code:
def pkgPath(root, path, rpath='/'):
global data_files
if (not os.path.exists(path)):
return
files = []
for spath in os.listdir(path):
if (spath == 'test'):
continue
subpath = os.path.join(path, spath)
spath = os.path.join(rpath, spath)
if os.path.isfile(subpa... |
null | null | null | Does the code join a path ?
| def save_join(*args):
return fs_encode(join(*[(x if (type(x) == unicode) else decode(x)) for x in args]))
| null | null | null | Yes
| codeqa | def save join *args return fs encode join *[ x if type x unicode else decode x for x in args]
| null | null | null | null | Question:
Does the code join a path ?
Code:
def save_join(*args):
return fs_encode(join(*[(x if (type(x) == unicode) else decode(x)) for x in args]))
|
null | null | null | What does the code join ?
| def save_join(*args):
return fs_encode(join(*[(x if (type(x) == unicode) else decode(x)) for x in args]))
| null | null | null | a path
| codeqa | def save join *args return fs encode join *[ x if type x unicode else decode x for x in args]
| null | null | null | null | Question:
What does the code join ?
Code:
def save_join(*args):
return fs_encode(join(*[(x if (type(x) == unicode) else decode(x)) for x in args]))
|
null | null | null | What does the code add to the search index ?
| def index_collections_given_ids(collection_ids):
collection_list = get_multiple_collections_by_id(collection_ids, strict=False).values()
search_services.add_documents_to_index([_collection_to_search_dict(collection) for collection in collection_list if _should_index(collection)], SEARCH_INDEX_COLLECTIONS)
| null | null | null | the given collections
| codeqa | def index collections given ids collection ids collection list get multiple collections by id collection ids strict False values search services add documents to index [ collection to search dict collection for collection in collection list if should index collection ] SEARCH INDEX COLLECTIONS
| null | null | null | null | Question:
What does the code add to the search index ?
Code:
def index_collections_given_ids(collection_ids):
collection_list = get_multiple_collections_by_id(collection_ids, strict=False).values()
search_services.add_documents_to_index([_collection_to_search_dict(collection) for collection in collection_list if ... |
null | null | null | Does the code add the given collections to the search index ?
| def index_collections_given_ids(collection_ids):
collection_list = get_multiple_collections_by_id(collection_ids, strict=False).values()
search_services.add_documents_to_index([_collection_to_search_dict(collection) for collection in collection_list if _should_index(collection)], SEARCH_INDEX_COLLECTIONS)
| null | null | null | Yes
| codeqa | def index collections given ids collection ids collection list get multiple collections by id collection ids strict False values search services add documents to index [ collection to search dict collection for collection in collection list if should index collection ] SEARCH INDEX COLLECTIONS
| null | null | null | null | Question:
Does the code add the given collections to the search index ?
Code:
def index_collections_given_ids(collection_ids):
collection_list = get_multiple_collections_by_id(collection_ids, strict=False).values()
search_services.add_documents_to_index([_collection_to_search_dict(collection) for collection in co... |
null | null | null | In which direction did any non - string objects pass to strings ?
| def html_escape(s):
if (s is None):
return ''
__html__ = getattr(s, '__html__', None)
if ((__html__ is not None) and callable(__html__)):
return s.__html__()
if (not isinstance(s, string_types)):
__unicode__ = getattr(s, '__unicode__', None)
if ((__unicode__ is not None) and callable(__unicode__)):
s = s... | null | null | null | into it
| codeqa | def html escape s if s is None return '' html getattr s ' html ' None if html is not None and callable html return s html if not isinstance s string types unicode getattr s ' unicode ' None if unicode is not None and callable unicode s s unicode else s str s s escape s True if isinstance s text type s s encode 'ascii' ... | null | null | null | null | Question:
In which direction did any non - string objects pass to strings ?
Code:
def html_escape(s):
if (s is None):
return ''
__html__ = getattr(s, '__html__', None)
if ((__html__ is not None) and callable(__html__)):
return s.__html__()
if (not isinstance(s, string_types)):
__unicode__ = getattr(s, '__... |
null | null | null | Do this convert any non - string objects passed into it to strings actually ?
| def html_escape(s):
if (s is None):
return ''
__html__ = getattr(s, '__html__', None)
if ((__html__ is not None) and callable(__html__)):
return s.__html__()
if (not isinstance(s, string_types)):
__unicode__ = getattr(s, '__unicode__', None)
if ((__unicode__ is not None) and callable(__unicode__)):
s = s... | null | null | null | Yes
| codeqa | def html escape s if s is None return '' html getattr s ' html ' None if html is not None and callable html return s html if not isinstance s string types unicode getattr s ' unicode ' None if unicode is not None and callable unicode s s unicode else s str s s escape s True if isinstance s text type s s encode 'ascii' ... | null | null | null | null | Question:
Do this convert any non - string objects passed into it to strings actually ?
Code:
def html_escape(s):
if (s is None):
return ''
__html__ = getattr(s, '__html__', None)
if ((__html__ is not None) and callable(__html__)):
return s.__html__()
if (not isinstance(s, string_types)):
__unicode__ = ge... |
null | null | null | Does the code get the value as a complex ?
| def getComplexDefaultByDictionary(defaultComplex, dictionary, key):
if (key in dictionary):
return complex(dictionary[key].strip().replace('(', '').replace(')', ''))
return defaultComplex
| null | null | null | Yes
| codeqa | def get Complex Default By Dictionary default Complex dictionary key if key in dictionary return complex dictionary[key] strip replace ' ' '' replace ' ' '' return default Complex
| null | null | null | null | Question:
Does the code get the value as a complex ?
Code:
def getComplexDefaultByDictionary(defaultComplex, dictionary, key):
if (key in dictionary):
return complex(dictionary[key].strip().replace('(', '').replace(')', ''))
return defaultComplex
|
null | null | null | What does the code get ?
| def getComplexDefaultByDictionary(defaultComplex, dictionary, key):
if (key in dictionary):
return complex(dictionary[key].strip().replace('(', '').replace(')', ''))
return defaultComplex
| null | null | null | the value as a complex
| codeqa | def get Complex Default By Dictionary default Complex dictionary key if key in dictionary return complex dictionary[key] strip replace ' ' '' replace ' ' '' return default Complex
| null | null | null | null | Question:
What does the code get ?
Code:
def getComplexDefaultByDictionary(defaultComplex, dictionary, key):
if (key in dictionary):
return complex(dictionary[key].strip().replace('(', '').replace(')', ''))
return defaultComplex
|
null | null | null | What does the code create ?
| def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0, dry_run=0, owner=None, group=None):
save_cwd = os.getcwd()
if (root_dir is not None):
log.debug("changing into '%s'", root_dir)
base_name = os.path.abspath(base_name)
if (not dry_run):
os.chdir(root_dir)
if (base_dir is None):
... | null | null | null | an archive file
| codeqa | def make archive base name format root dir None base dir None verbose 0 dry run 0 owner None group None save cwd os getcwd if root dir is not None log debug "changinginto'%s'" root dir base name os path abspath base name if not dry run os chdir root dir if base dir is None base dir os curdirkwargs {'dry run' dry run}tr... | null | null | null | null | Question:
What does the code create ?
Code:
def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0, dry_run=0, owner=None, group=None):
save_cwd = os.getcwd()
if (root_dir is not None):
log.debug("changing into '%s'", root_dir)
base_name = os.path.abspath(base_name)
if (not dry_run):
... |
null | null | null | Does the code create an archive file ?
| def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0, dry_run=0, owner=None, group=None):
save_cwd = os.getcwd()
if (root_dir is not None):
log.debug("changing into '%s'", root_dir)
base_name = os.path.abspath(base_name)
if (not dry_run):
os.chdir(root_dir)
if (base_dir is None):
... | null | null | null | Yes
| codeqa | def make archive base name format root dir None base dir None verbose 0 dry run 0 owner None group None save cwd os getcwd if root dir is not None log debug "changinginto'%s'" root dir base name os path abspath base name if not dry run os chdir root dir if base dir is None base dir os curdirkwargs {'dry run' dry run}tr... | null | null | null | null | Question:
Does the code create an archive file ?
Code:
def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0, dry_run=0, owner=None, group=None):
save_cwd = os.getcwd()
if (root_dir is not None):
log.debug("changing into '%s'", root_dir)
base_name = os.path.abspath(base_name)
if (not... |
null | null | null | Does the code stop a machine by name ?
| def stop(name, call=None):
node = get_node(name)
ret = take_action(name=name, call=call, method='POST', command='/my/machines/{0}'.format(node['id']), location=node['location'], data={'action': 'stop'})
return (ret[0] in VALID_RESPONSE_CODES)
| null | null | null | Yes
| codeqa | def stop name call None node get node name ret take action name name call call method 'POST' command '/my/machines/{ 0 }' format node['id'] location node['location'] data {'action' 'stop'} return ret[ 0 ] in VALID RESPONSE CODES
| null | null | null | null | Question:
Does the code stop a machine by name ?
Code:
def stop(name, call=None):
node = get_node(name)
ret = take_action(name=name, call=call, method='POST', command='/my/machines/{0}'.format(node['id']), location=node['location'], data={'action': 'stop'})
return (ret[0] in VALID_RESPONSE_CODES)
|
null | null | null | What does the code stop by name ?
| def stop(name, call=None):
node = get_node(name)
ret = take_action(name=name, call=call, method='POST', command='/my/machines/{0}'.format(node['id']), location=node['location'], data={'action': 'stop'})
return (ret[0] in VALID_RESPONSE_CODES)
| null | null | null | a machine
| codeqa | def stop name call None node get node name ret take action name name call call method 'POST' command '/my/machines/{ 0 }' format node['id'] location node['location'] data {'action' 'stop'} return ret[ 0 ] in VALID RESPONSE CODES
| null | null | null | null | Question:
What does the code stop by name ?
Code:
def stop(name, call=None):
node = get_node(name)
ret = take_action(name=name, call=call, method='POST', command='/my/machines/{0}'.format(node['id']), location=node['location'], data={'action': 'stop'})
return (ret[0] in VALID_RESPONSE_CODES)
|
null | null | null | How does the code stop a machine ?
| def stop(name, call=None):
node = get_node(name)
ret = take_action(name=name, call=call, method='POST', command='/my/machines/{0}'.format(node['id']), location=node['location'], data={'action': 'stop'})
return (ret[0] in VALID_RESPONSE_CODES)
| null | null | null | by name
| codeqa | def stop name call None node get node name ret take action name name call call method 'POST' command '/my/machines/{ 0 }' format node['id'] location node['location'] data {'action' 'stop'} return ret[ 0 ] in VALID RESPONSE CODES
| null | null | null | null | Question:
How does the code stop a machine ?
Code:
def stop(name, call=None):
node = get_node(name)
ret = take_action(name=name, call=call, method='POST', command='/my/machines/{0}'.format(node['id']), location=node['location'], data={'action': 'stop'})
return (ret[0] in VALID_RESPONSE_CODES)
|
null | null | null | When did data sources configure ?
| @manager.command()
@click.option('--org', 'organization', default=None, help='The organization the user belongs to (leave blank for all organizations).')
def list(organization=None):
if organization:
org = models.Organization.get_by_slug(organization)
data_sources = models.DataSource.query.filter((models... | null | null | null | currently
| codeqa | @manager command @click option '--org' 'organization' default None help ' Theorganizationtheuserbelongsto leaveblankforallorganizations ' def list organization None if organization org models Organization get by slug organization data sources models Data Source query filter models Data Source org org else data sources ... | null | null | null | null | Question:
When did data sources configure ?
Code:
@manager.command()
@click.option('--org', 'organization', default=None, help='The organization the user belongs to (leave blank for all organizations).')
def list(organization=None):
if organization:
org = models.Organization.get_by_slug(organization)
... |
null | null | null | What does a traditional - style method take ?
| def cr_uid_records_context(method):
method._api = 'cr_uid_records_context'
return method
| null | null | null | cr
| codeqa | def cr uid records context method method api 'cr uid records context'return method
| null | null | null | null | Question:
What does a traditional - style method take ?
Code:
def cr_uid_records_context(method):
method._api = 'cr_uid_records_context'
return method
|
null | null | null | How did it display ?
| def colorize(s, color, bold=False):
shell_colors = {'gray': '30', 'red': '31', 'green': '32', 'yellow': '33', 'blue': '34', 'magenta': '35', 'cyan': '36', 'white': '37', 'crimson': '38', 'highlighted_red': '41', 'highlighted_green': '42', 'highlighted_brown': '43', 'highlighted_blue': '44', 'highlighted_magenta': '45'... | null | null | null | with the given color
| codeqa | def colorize s color bold False shell colors {'gray' '30 ' 'red' '31 ' 'green' '32 ' 'yellow' '33 ' 'blue' '34 ' 'magenta' '35 ' 'cyan' '36 ' 'white' '37 ' 'crimson' '38 ' 'highlighted red' '41 ' 'highlighted green' '42 ' 'highlighted brown' '43 ' 'highlighted blue' '44 ' 'highlighted magenta' '45 ' 'highlighted cyan' ... | null | null | null | null | Question:
How did it display ?
Code:
def colorize(s, color, bold=False):
shell_colors = {'gray': '30', 'red': '31', 'green': '32', 'yellow': '33', 'blue': '34', 'magenta': '35', 'cyan': '36', 'white': '37', 'crimson': '38', 'highlighted_red': '41', 'highlighted_green': '42', 'highlighted_brown': '43', 'highlighted... |
null | null | null | Does the code find a static file with the given path using all enabled finders ?
| def find(path, all=False):
searched_locations[:] = []
matches = []
for finder in get_finders():
result = finder.find(path, all=all)
if ((not all) and result):
return result
if (not isinstance(result, (list, tuple))):
result = [result]
matches.extend(result)
if matches:
return matches
return ([] if ... | null | null | null | Yes
| codeqa | def find path all False searched locations[ ] []matches []for finder in get finders result finder find path all all if not all and result return resultif not isinstance result list tuple result [result]matches extend result if matches return matchesreturn [] if all else None
| null | null | null | null | Question:
Does the code find a static file with the given path using all enabled finders ?
Code:
def find(path, all=False):
searched_locations[:] = []
matches = []
for finder in get_finders():
result = finder.find(path, all=all)
if ((not all) and result):
return result
if (not isinstance(result, (list, ... |
null | null | null | How does the code find a static file with the given path ?
| def find(path, all=False):
searched_locations[:] = []
matches = []
for finder in get_finders():
result = finder.find(path, all=all)
if ((not all) and result):
return result
if (not isinstance(result, (list, tuple))):
result = [result]
matches.extend(result)
if matches:
return matches
return ([] if ... | null | null | null | using all enabled finders
| codeqa | def find path all False searched locations[ ] []matches []for finder in get finders result finder find path all all if not all and result return resultif not isinstance result list tuple result [result]matches extend result if matches return matchesreturn [] if all else None
| null | null | null | null | Question:
How does the code find a static file with the given path ?
Code:
def find(path, all=False):
searched_locations[:] = []
matches = []
for finder in get_finders():
result = finder.find(path, all=all)
if ((not all) and result):
return result
if (not isinstance(result, (list, tuple))):
result = ... |
null | null | null | What does the code find using all enabled finders ?
| def find(path, all=False):
searched_locations[:] = []
matches = []
for finder in get_finders():
result = finder.find(path, all=all)
if ((not all) and result):
return result
if (not isinstance(result, (list, tuple))):
result = [result]
matches.extend(result)
if matches:
return matches
return ([] if ... | null | null | null | a static file with the given path
| codeqa | def find path all False searched locations[ ] []matches []for finder in get finders result finder find path all all if not all and result return resultif not isinstance result list tuple result [result]matches extend result if matches return matchesreturn [] if all else None
| null | null | null | null | Question:
What does the code find using all enabled finders ?
Code:
def find(path, all=False):
searched_locations[:] = []
matches = []
for finder in get_finders():
result = finder.find(path, all=all)
if ((not all) and result):
return result
if (not isinstance(result, (list, tuple))):
result = [result... |
null | null | null | How can by a following node be modified a file ?
| def copy_files(in_files, out_files):
import shutil
import sys
if (len(in_files) != len(out_files)):
print ('ERROR: Length of input files must be identical to the length of ' + 'outrput files to be copied')
sys.exit((-1))
for (i, in_file) in enumerate(in_files):
out_file = out_files[i]
print ... | null | null | null | without changing the original file
| codeqa | def copy files in files out files import shutilimport sysif len in files len out files print 'ERROR Lengthofinputfilesmustbeidenticaltothelengthof' + 'outrputfilestobecopied' sys exit -1 for i in file in enumerate in files out file out files[i]print 'copying{ 0 }to{ 1 }' format in file out file shutil copy in file out ... | null | null | null | null | Question:
How can by a following node be modified a file ?
Code:
def copy_files(in_files, out_files):
import shutil
import sys
if (len(in_files) != len(out_files)):
print ('ERROR: Length of input files must be identical to the length of ' + 'outrput files to be copied')
sys.exit((-1))
for (i... |
null | null | null | What does the code create ?
| def copy_files(in_files, out_files):
import shutil
import sys
if (len(in_files) != len(out_files)):
print ('ERROR: Length of input files must be identical to the length of ' + 'outrput files to be copied')
sys.exit((-1))
for (i, in_file) in enumerate(in_files):
out_file = out_files[i]
print ... | null | null | null | a function to copy a file that can be modified by a following node without changing the original file
| codeqa | def copy files in files out files import shutilimport sysif len in files len out files print 'ERROR Lengthofinputfilesmustbeidenticaltothelengthof' + 'outrputfilestobecopied' sys exit -1 for i in file in enumerate in files out file out files[i]print 'copying{ 0 }to{ 1 }' format in file out file shutil copy in file out ... | null | null | null | null | Question:
What does the code create ?
Code:
def copy_files(in_files, out_files):
import shutil
import sys
if (len(in_files) != len(out_files)):
print ('ERROR: Length of input files must be identical to the length of ' + 'outrput files to be copied')
sys.exit((-1))
for (i, in_file) in enumera... |
null | null | null | Does the code create a function to copy a file that can be modified by a following node without changing the original file ?
| def copy_files(in_files, out_files):
import shutil
import sys
if (len(in_files) != len(out_files)):
print ('ERROR: Length of input files must be identical to the length of ' + 'outrput files to be copied')
sys.exit((-1))
for (i, in_file) in enumerate(in_files):
out_file = out_files[i]
print ... | null | null | null | Yes
| codeqa | def copy files in files out files import shutilimport sysif len in files len out files print 'ERROR Lengthofinputfilesmustbeidenticaltothelengthof' + 'outrputfilestobecopied' sys exit -1 for i in file in enumerate in files out file out files[i]print 'copying{ 0 }to{ 1 }' format in file out file shutil copy in file out ... | null | null | null | null | Question:
Does the code create a function to copy a file that can be modified by a following node without changing the original file ?
Code:
def copy_files(in_files, out_files):
import shutil
import sys
if (len(in_files) != len(out_files)):
print ('ERROR: Length of input files must be identical to the... |
null | null | null | How do a file that can be modified by a following node copy ?
| def copy_files(in_files, out_files):
import shutil
import sys
if (len(in_files) != len(out_files)):
print ('ERROR: Length of input files must be identical to the length of ' + 'outrput files to be copied')
sys.exit((-1))
for (i, in_file) in enumerate(in_files):
out_file = out_files[i]
print ... | null | null | null | without changing the original file
| codeqa | def copy files in files out files import shutilimport sysif len in files len out files print 'ERROR Lengthofinputfilesmustbeidenticaltothelengthof' + 'outrputfilestobecopied' sys exit -1 for i in file in enumerate in files out file out files[i]print 'copying{ 0 }to{ 1 }' format in file out file shutil copy in file out ... | null | null | null | null | Question:
How do a file that can be modified by a following node copy ?
Code:
def copy_files(in_files, out_files):
import shutil
import sys
if (len(in_files) != len(out_files)):
print ('ERROR: Length of input files must be identical to the length of ' + 'outrput files to be copied')
sys.exit(... |
null | null | null | How did relay fingerprint format ?
| def is_valid_fingerprint(entry, check_prefix=False):
try:
if check_prefix:
if ((not entry) or (entry[0] != '$')):
return False
entry = entry[1:]
return is_hex_digits(entry, 40)
except TypeError:
return False
| null | null | null | properly
| codeqa | def is valid fingerprint entry check prefix False try if check prefix if not entry or entry[ 0 ] '$' return Falseentry entry[ 1 ]return is hex digits entry 40 except Type Error return False
| null | null | null | null | Question:
How did relay fingerprint format ?
Code:
def is_valid_fingerprint(entry, check_prefix=False):
try:
if check_prefix:
if ((not entry) or (entry[0] != '$')):
return False
entry = entry[1:]
return is_hex_digits(entry, 40)
except TypeError:
return False
|
null | null | null | What does a string convert if it is not already one ?
| def to_binary_string(text):
raise Exception('Should be overriden')
| null | null | null | to a binary string
| codeqa | def to binary string text raise Exception ' Shouldbeoverriden'
| null | null | null | null | Question:
What does a string convert if it is not already one ?
Code:
def to_binary_string(text):
raise Exception('Should be overriden')
|
null | null | null | What converts to a binary string if it is not already one ?
| def to_binary_string(text):
raise Exception('Should be overriden')
| null | null | null | a string
| codeqa | def to binary string text raise Exception ' Shouldbeoverriden'
| null | null | null | null | Question:
What converts to a binary string if it is not already one ?
Code:
def to_binary_string(text):
raise Exception('Should be overriden')
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.