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 is containing a python expression ?
| def literal_eval(node_or_string):
_safe_names = {'None': None, 'True': True, 'False': False}
if isinstance(node_or_string, basestring):
node_or_string = parse(node_or_string, mode='eval')
if isinstance(node_or_string, Expression):
node_or_string = node_or_string.body
def _convert(node):
if isinstance(node, St... | null | null | null | a string
| codeqa | def literal eval node or string safe names {' None' None ' True' True ' False' False}if isinstance node or string basestring node or string parse node or string mode 'eval' if isinstance node or string Expression node or string node or string bodydef convert node if isinstance node Str return node selif isinstance node... | null | null | null | null | Question:
What is containing a python expression ?
Code:
def literal_eval(node_or_string):
_safe_names = {'None': None, 'True': True, 'False': False}
if isinstance(node_or_string, basestring):
node_or_string = parse(node_or_string, mode='eval')
if isinstance(node_or_string, Expression):
node_or_string = node... |
null | null | null | What did we introspect ?
| def can_introspect(field):
if (hasattr(field, '_south_introspects') and field._south_introspects):
return True
full_name = ('%s.%s' % (field.__class__.__module__, field.__class__.__name__))
for regex in allowed_fields:
if re.match(regex, full_name):
return True
return False
| null | null | null | this field
| codeqa | def can introspect field if hasattr field ' south introspects' and field south introspects return Truefull name '%s %s' % field class module field class name for regex in allowed fields if re match regex full name return Truereturn False
| null | null | null | null | Question:
What did we introspect ?
Code:
def can_introspect(field):
if (hasattr(field, '_south_introspects') and field._south_introspects):
return True
full_name = ('%s.%s' % (field.__class__.__module__, field.__class__.__name__))
for regex in allowed_fields:
if re.match(regex, full_name):
return True
re... |
null | null | null | What does the code get ?
| def getFileTextInFileDirectory(fileInDirectory, fileName, readMode='r'):
absoluteFilePathInFileDirectory = os.path.join(os.path.dirname(fileInDirectory), fileName)
return getFileText(absoluteFilePathInFileDirectory, readMode)
| null | null | null | the entire text of a file in the directory of the file in directory
| codeqa | def get File Text In File Directory file In Directory file Name read Mode 'r' absolute File Path In File Directory os path join os path dirname file In Directory file Name return get File Text absolute File Path In File Directory read Mode
| null | null | null | null | Question:
What does the code get ?
Code:
def getFileTextInFileDirectory(fileInDirectory, fileName, readMode='r'):
absoluteFilePathInFileDirectory = os.path.join(os.path.dirname(fileInDirectory), fileName)
return getFileText(absoluteFilePathInFileDirectory, readMode)
|
null | null | null | What does the code show ?
| @register.inclusion_tag('addons/impala/contribution.html')
@jinja2.contextfunction
def impala_contribution(context, addon, text=None, src='', show_install=False, show_help=True, large=False, contribution_src=None):
if (not contribution_src):
contribution_src = src
has_suggested = bool(addon.suggested_amount)
comme... | null | null | null | a contribution box
| codeqa | @register inclusion tag 'addons/impala/contribution html' @jinja 2 contextfunctiondef impala contribution context addon text None src '' show install False show help True large False contribution src None if not contribution src contribution src srchas suggested bool addon suggested amount comment limit PAYPAL MAX COMM... | null | null | null | null | Question:
What does the code show ?
Code:
@register.inclusion_tag('addons/impala/contribution.html')
@jinja2.contextfunction
def impala_contribution(context, addon, text=None, src='', show_install=False, show_help=True, large=False, contribution_src=None):
if (not contribution_src):
contribution_src = src
has_s... |
null | null | null | What does wrapper function initialize ?
| def wrapper(func, *args, **kwds):
try:
stdscr = initscr()
noecho()
cbreak()
stdscr.keypad(1)
try:
start_color()
except:
pass
return func(stdscr, *args, **kwds)
finally:
if ('stdscr' in locals()):
stdscr.keypad(0)
echo()
nocbreak()
endwin()
| null | null | null | curses
| codeqa | def wrapper func *args **kwds try stdscr initscr noecho cbreak stdscr keypad 1 try start color except passreturn func stdscr *args **kwds finally if 'stdscr' in locals stdscr keypad 0 echo nocbreak endwin
| null | null | null | null | Question:
What does wrapper function initialize ?
Code:
def wrapper(func, *args, **kwds):
try:
stdscr = initscr()
noecho()
cbreak()
stdscr.keypad(1)
try:
start_color()
except:
pass
return func(stdscr, *args, **kwds)
finally:
if ('stdscr' in locals()):
stdscr.keypad(0)
echo()
nocbrea... |
null | null | null | What calls another function ?
| def wrapper(func, *args, **kwds):
try:
stdscr = initscr()
noecho()
cbreak()
stdscr.keypad(1)
try:
start_color()
except:
pass
return func(stdscr, *args, **kwds)
finally:
if ('stdscr' in locals()):
stdscr.keypad(0)
echo()
nocbreak()
endwin()
| null | null | null | wrapper function
| codeqa | def wrapper func *args **kwds try stdscr initscr noecho cbreak stdscr keypad 1 try start color except passreturn func stdscr *args **kwds finally if 'stdscr' in locals stdscr keypad 0 echo nocbreak endwin
| null | null | null | null | Question:
What calls another function ?
Code:
def wrapper(func, *args, **kwds):
try:
stdscr = initscr()
noecho()
cbreak()
stdscr.keypad(1)
try:
start_color()
except:
pass
return func(stdscr, *args, **kwds)
finally:
if ('stdscr' in locals()):
stdscr.keypad(0)
echo()
nocbreak()
end... |
null | null | null | What does wrapper function call ?
| def wrapper(func, *args, **kwds):
try:
stdscr = initscr()
noecho()
cbreak()
stdscr.keypad(1)
try:
start_color()
except:
pass
return func(stdscr, *args, **kwds)
finally:
if ('stdscr' in locals()):
stdscr.keypad(0)
echo()
nocbreak()
endwin()
| null | null | null | another function
| codeqa | def wrapper func *args **kwds try stdscr initscr noecho cbreak stdscr keypad 1 try start color except passreturn func stdscr *args **kwds finally if 'stdscr' in locals stdscr keypad 0 echo nocbreak endwin
| null | null | null | null | Question:
What does wrapper function call ?
Code:
def wrapper(func, *args, **kwds):
try:
stdscr = initscr()
noecho()
cbreak()
stdscr.keypad(1)
try:
start_color()
except:
pass
return func(stdscr, *args, **kwds)
finally:
if ('stdscr' in locals()):
stdscr.keypad(0)
echo()
nocbreak()
... |
null | null | null | What initializes curses ?
| def wrapper(func, *args, **kwds):
try:
stdscr = initscr()
noecho()
cbreak()
stdscr.keypad(1)
try:
start_color()
except:
pass
return func(stdscr, *args, **kwds)
finally:
if ('stdscr' in locals()):
stdscr.keypad(0)
echo()
nocbreak()
endwin()
| null | null | null | wrapper function
| codeqa | def wrapper func *args **kwds try stdscr initscr noecho cbreak stdscr keypad 1 try start color except passreturn func stdscr *args **kwds finally if 'stdscr' in locals stdscr keypad 0 echo nocbreak endwin
| null | null | null | null | Question:
What initializes curses ?
Code:
def wrapper(func, *args, **kwds):
try:
stdscr = initscr()
noecho()
cbreak()
stdscr.keypad(1)
try:
start_color()
except:
pass
return func(stdscr, *args, **kwds)
finally:
if ('stdscr' in locals()):
stdscr.keypad(0)
echo()
nocbreak()
endwin(... |
null | null | null | What does the code add to the lists ?
| def addListsToRepositoryByFunction(fileNameHelp, getProfileDirectory, repository):
repository.displayEntities = []
repository.executeTitle = None
repository.fileNameHelp = fileNameHelp
repository.fileNameInput = None
repository.lowerName = fileNameHelp.split('.')[(-2)]
repository.baseName = (repository.lowerName ... | null | null | null | the value
| codeqa | def add Lists To Repository By Function file Name Help get Profile Directory repository repository display Entities []repository execute Title Nonerepository file Name Help file Name Helprepository file Name Input Nonerepository lower Name file Name Help split ' ' [ -2 ]repository base Name repository lower Name + ' cs... | null | null | null | null | Question:
What does the code add to the lists ?
Code:
def addListsToRepositoryByFunction(fileNameHelp, getProfileDirectory, repository):
repository.displayEntities = []
repository.executeTitle = None
repository.fileNameHelp = fileNameHelp
repository.fileNameInput = None
repository.lowerName = fileNameHelp.spli... |
null | null | null | What does the code delete safely ?
| def safe_delete(filename):
try:
os.unlink(filename)
except OSError as e:
if (e.errno != errno.ENOENT):
raise
| null | null | null | a file
| codeqa | def safe delete filename try os unlink filename except OS Error as e if e errno errno ENOENT raise
| null | null | null | null | Question:
What does the code delete safely ?
Code:
def safe_delete(filename):
try:
os.unlink(filename)
except OSError as e:
if (e.errno != errno.ENOENT):
raise
|
null | null | null | How does the code delete a file ?
| def safe_delete(filename):
try:
os.unlink(filename)
except OSError as e:
if (e.errno != errno.ENOENT):
raise
| null | null | null | safely
| codeqa | def safe delete filename try os unlink filename except OS Error as e if e errno errno ENOENT raise
| null | null | null | null | Question:
How does the code delete a file ?
Code:
def safe_delete(filename):
try:
os.unlink(filename)
except OSError as e:
if (e.errno != errno.ENOENT):
raise
|
null | null | null | In which direction does a user log ?
| def login_user(user, remember=False, force=False, fresh=True):
if ((not force) and (not user.is_active)):
return False
user_id = getattr(user, current_app.login_manager.id_attribute)()
session['user_id'] = user_id
session['_fresh'] = fresh
session['_id'] = _create_identifier()
if remember:
session['remember']... | null | null | null | in
| codeqa | def login user user remember False force False fresh True if not force and not user is active return Falseuser id getattr user current app login manager id attribute session['user id'] user idsession[' fresh'] freshsession[' id'] create identifier if remember session['remember'] 'set' request ctx stack top user useruse... | null | null | null | null | Question:
In which direction does a user log ?
Code:
def login_user(user, remember=False, force=False, fresh=True):
if ((not force) and (not user.is_active)):
return False
user_id = getattr(user, current_app.login_manager.id_attribute)()
session['user_id'] = user_id
session['_fresh'] = fresh
session['_id'] =... |
null | null | null | How is a value tagged ?
| def _fix_tagging(value, params):
if (u'tag_type' in params):
required_tag_type = params[u'tag_type']
retag = False
if (required_tag_type != value.tag_type):
retag = True
elif ((required_tag_type == u'explicit') and (value.explicit_tag != params[u'tag'])):
retag = True
elif ((required_tag_type == u'impl... | null | null | null | properly
| codeqa | def fix tagging value params if u'tag type' in params required tag type params[u'tag type']retag Falseif required tag type value tag type retag Trueelif required tag type u'explicit' and value explicit tag params[u'tag'] retag Trueelif required tag type u'implicit' and value tag params[u'tag'] retag Trueif retag return... | null | null | null | null | Question:
How is a value tagged ?
Code:
def _fix_tagging(value, params):
if (u'tag_type' in params):
required_tag_type = params[u'tag_type']
retag = False
if (required_tag_type != value.tag_type):
retag = True
elif ((required_tag_type == u'explicit') and (value.explicit_tag != params[u'tag'])):
retag... |
null | null | null | What does the code do ?
| def iter_format_modules(lang, format_module_path=None):
if (not check_for_language(lang)):
return
if (format_module_path is None):
format_module_path = settings.FORMAT_MODULE_PATH
format_locations = []
if format_module_path:
if isinstance(format_module_path, str):
format_module_path = [format_module_path]
... | null | null | null | the heavy lifting of finding format modules
| codeqa | def iter format modules lang format module path None if not check for language lang returnif format module path is None format module path settings FORMAT MODULE PAT Hformat locations []if format module path if isinstance format module path str format module path [format module path]for path in format module path forma... | null | null | null | null | Question:
What does the code do ?
Code:
def iter_format_modules(lang, format_module_path=None):
if (not check_for_language(lang)):
return
if (format_module_path is None):
format_module_path = settings.FORMAT_MODULE_PATH
format_locations = []
if format_module_path:
if isinstance(format_module_path, str):
... |
null | null | null | How does a cow image create ?
| def create_cow_image(backing_file, path, size=None):
base_cmd = ['qemu-img', 'create', '-f', 'qcow2']
cow_opts = []
if backing_file:
cow_opts += [('backing_file=%s' % backing_file)]
base_details = images.qemu_img_info(backing_file)
else:
base_details = None
if (base_details and (base_details.cluster_size is ... | null | null | null | with the given backing file
| codeqa | def create cow image backing file path size None base cmd ['qemu-img' 'create' '-f' 'qcow 2 ']cow opts []if backing file cow opts + [ 'backing file %s' % backing file ]base details images qemu img info backing file else base details Noneif base details and base details cluster size is not None cow opts + [ 'cluster siz... | null | null | null | null | Question:
How does a cow image create ?
Code:
def create_cow_image(backing_file, path, size=None):
base_cmd = ['qemu-img', 'create', '-f', 'qcow2']
cow_opts = []
if backing_file:
cow_opts += [('backing_file=%s' % backing_file)]
base_details = images.qemu_img_info(backing_file)
else:
base_details = None
i... |
null | null | null | What does the code return ?
| def query(conn, sql, *args):
cur = conn.cursor()
ret = []
try:
if DEBUG:
print >>sys.stderr, 'QUERY: ', sql, args
cur.execute(sql, args)
for row in cur:
dic = {}
for (i, value) in enumerate(row):
field = cur.description[i][0]
dic[field] = value
if DEBUG:
print >>sys.stderr, 'RET: ', d... | null | null | null | rows
| codeqa | def query conn sql *args cur conn cursor ret []try if DEBUG print >>sys stderr 'QUERY ' sql argscur execute sql args for row in cur dic {}for i value in enumerate row field cur description[i][ 0 ]dic[field] valueif DEBUG print >>sys stderr 'RET ' dicret append dic return retexcept cx Oracle Database Error as exc error ... | null | null | null | null | Question:
What does the code return ?
Code:
def query(conn, sql, *args):
cur = conn.cursor()
ret = []
try:
if DEBUG:
print >>sys.stderr, 'QUERY: ', sql, args
cur.execute(sql, args)
for row in cur:
dic = {}
for (i, value) in enumerate(row):
field = cur.description[i][0]
dic[field] = value
... |
null | null | null | What do home new home directory modify ?
| def chhome(name, home, persist=False):
pre_info = info(name)
if (not pre_info):
raise CommandExecutionError("User '{0}' does not exist".format(name))
if (home == pre_info['home']):
return True
cmd = ['usermod', '-d', home]
if persist:
cmd.append('-m')
cmd.append(name)
__salt__['cmd.run'](cmd, python_sh... | null | null | null | to set persist
| codeqa | def chhome name home persist False pre info info name if not pre info raise Command Execution Error " User'{ 0 }'doesnotexist" format name if home pre info['home'] return Truecmd ['usermod' '-d' home]if persist cmd append '-m' cmd append name salt ['cmd run'] cmd python shell False return info name get 'home' home
| null | null | null | null | Question:
What do home new home directory modify ?
Code:
def chhome(name, home, persist=False):
pre_info = info(name)
if (not pre_info):
raise CommandExecutionError("User '{0}' does not exist".format(name))
if (home == pre_info['home']):
return True
cmd = ['usermod', '-d', home]
if persist:
cmd.appen... |
null | null | null | What prevents from being overwritten by the files from the skeleton directory ?
| def chhome(name, home, persist=False):
pre_info = info(name)
if (not pre_info):
raise CommandExecutionError("User '{0}' does not exist".format(name))
if (home == pre_info['home']):
return True
cmd = ['usermod', '-d', home]
if persist:
cmd.append('-m')
cmd.append(name)
__salt__['cmd.run'](cmd, python_sh... | null | null | null | configuration files in the new home directory
| codeqa | def chhome name home persist False pre info info name if not pre info raise Command Execution Error " User'{ 0 }'doesnotexist" format name if home pre info['home'] return Truecmd ['usermod' '-d' home]if persist cmd append '-m' cmd append name salt ['cmd run'] cmd python shell False return info name get 'home' home
| null | null | null | null | Question:
What prevents from being overwritten by the files from the skeleton directory ?
Code:
def chhome(name, home, persist=False):
pre_info = info(name)
if (not pre_info):
raise CommandExecutionError("User '{0}' does not exist".format(name))
if (home == pre_info['home']):
return True
cmd = ['usermod... |
null | null | null | What does the code get ?
| def get_matching_docs(dirname, suffix, exclude_docs=(), exclude_dirs=(), exclude_trees=(), exclude_dirnames=()):
pattern = ('*' + suffix)
dirname = path.normpath(path.abspath(dirname))
dirlen = (len(dirname) + 1)
for (root, dirs, files) in walk(dirname, followlinks=True):
if (root[dirlen:] in exclude_dirs):
co... | null | null | null | all file names matching a suffix in a directory
| codeqa | def get matching docs dirname suffix exclude docs exclude dirs exclude trees exclude dirnames pattern '*' + suffix dirname path normpath path abspath dirname dirlen len dirname + 1 for root dirs files in walk dirname followlinks True if root[dirlen ] in exclude dirs continueif root[dirlen ] in exclude trees del dirs[ ]... | null | null | null | null | Question:
What does the code get ?
Code:
def get_matching_docs(dirname, suffix, exclude_docs=(), exclude_dirs=(), exclude_trees=(), exclude_dirnames=()):
pattern = ('*' + suffix)
dirname = path.normpath(path.abspath(dirname))
dirlen = (len(dirname) + 1)
for (root, dirs, files) in walk(dirname, followlinks=True)... |
null | null | null | What do all file names match in a directory ?
| def get_matching_docs(dirname, suffix, exclude_docs=(), exclude_dirs=(), exclude_trees=(), exclude_dirnames=()):
pattern = ('*' + suffix)
dirname = path.normpath(path.abspath(dirname))
dirlen = (len(dirname) + 1)
for (root, dirs, files) in walk(dirname, followlinks=True):
if (root[dirlen:] in exclude_dirs):
co... | null | null | null | a suffix
| codeqa | def get matching docs dirname suffix exclude docs exclude dirs exclude trees exclude dirnames pattern '*' + suffix dirname path normpath path abspath dirname dirlen len dirname + 1 for root dirs files in walk dirname followlinks True if root[dirlen ] in exclude dirs continueif root[dirlen ] in exclude trees del dirs[ ]... | null | null | null | null | Question:
What do all file names match in a directory ?
Code:
def get_matching_docs(dirname, suffix, exclude_docs=(), exclude_dirs=(), exclude_trees=(), exclude_dirnames=()):
pattern = ('*' + suffix)
dirname = path.normpath(path.abspath(dirname))
dirlen = (len(dirname) + 1)
for (root, dirs, files) in walk(dirna... |
null | null | null | What is matching a suffix in a directory ?
| def get_matching_docs(dirname, suffix, exclude_docs=(), exclude_dirs=(), exclude_trees=(), exclude_dirnames=()):
pattern = ('*' + suffix)
dirname = path.normpath(path.abspath(dirname))
dirlen = (len(dirname) + 1)
for (root, dirs, files) in walk(dirname, followlinks=True):
if (root[dirlen:] in exclude_dirs):
co... | null | null | null | all file names
| codeqa | def get matching docs dirname suffix exclude docs exclude dirs exclude trees exclude dirnames pattern '*' + suffix dirname path normpath path abspath dirname dirlen len dirname + 1 for root dirs files in walk dirname followlinks True if root[dirlen ] in exclude dirs continueif root[dirlen ] in exclude trees del dirs[ ]... | null | null | null | null | Question:
What is matching a suffix in a directory ?
Code:
def get_matching_docs(dirname, suffix, exclude_docs=(), exclude_dirs=(), exclude_trees=(), exclude_dirnames=()):
pattern = ('*' + suffix)
dirname = path.normpath(path.abspath(dirname))
dirlen = (len(dirname) + 1)
for (root, dirs, files) in walk(dirname,... |
null | null | null | Where do all file names match a suffix ?
| def get_matching_docs(dirname, suffix, exclude_docs=(), exclude_dirs=(), exclude_trees=(), exclude_dirnames=()):
pattern = ('*' + suffix)
dirname = path.normpath(path.abspath(dirname))
dirlen = (len(dirname) + 1)
for (root, dirs, files) in walk(dirname, followlinks=True):
if (root[dirlen:] in exclude_dirs):
co... | null | null | null | in a directory
| codeqa | def get matching docs dirname suffix exclude docs exclude dirs exclude trees exclude dirnames pattern '*' + suffix dirname path normpath path abspath dirname dirlen len dirname + 1 for root dirs files in walk dirname followlinks True if root[dirlen ] in exclude dirs continueif root[dirlen ] in exclude trees del dirs[ ]... | null | null | null | null | Question:
Where do all file names match a suffix ?
Code:
def get_matching_docs(dirname, suffix, exclude_docs=(), exclude_dirs=(), exclude_trees=(), exclude_dirnames=()):
pattern = ('*' + suffix)
dirname = path.normpath(path.abspath(dirname))
dirlen = (len(dirname) + 1)
for (root, dirs, files) in walk(dirname, f... |
null | null | null | Where are characters represented via escape sequences converted to those escape sequences ?
| def _quoteAndEscape(string):
assert (type(string) in types.StringTypes)
return pprint.pformat(string)
| null | null | null | in python
| codeqa | def quote And Escape string assert type string in types String Types return pprint pformat string
| null | null | null | null | Question:
Where are characters represented via escape sequences converted to those escape sequences ?
Code:
def _quoteAndEscape(string):
assert (type(string) in types.StringTypes)
return pprint.pformat(string)
|
null | null | null | What are represented in python ?
| def _quoteAndEscape(string):
assert (type(string) in types.StringTypes)
return pprint.pformat(string)
| null | null | null | characters
| codeqa | def quote And Escape string assert type string in types String Types return pprint pformat string
| null | null | null | null | Question:
What are represented in python ?
Code:
def _quoteAndEscape(string):
assert (type(string) in types.StringTypes)
return pprint.pformat(string)
|
null | null | null | How are characters represented in python ?
| def _quoteAndEscape(string):
assert (type(string) in types.StringTypes)
return pprint.pformat(string)
| null | null | null | via escape sequences converted to those escape sequences
| codeqa | def quote And Escape string assert type string in types String Types return pprint pformat string
| null | null | null | null | Question:
How are characters represented in python ?
Code:
def _quoteAndEscape(string):
assert (type(string) in types.StringTypes)
return pprint.pformat(string)
|
null | null | null | What does the code get ?
| def cluster_get(context, id=None, is_up=None, get_services=False, services_summary=False, read_deleted='no', name_match_level=None, **filters):
return IMPL.cluster_get(context, id, is_up, get_services, services_summary, read_deleted, name_match_level, **filters)
| null | null | null | a cluster that matches the criteria
| codeqa | def cluster get context id None is up None get services False services summary False read deleted 'no' name match level None **filters return IMPL cluster get context id is up get services services summary read deleted name match level **filters
| null | null | null | null | Question:
What does the code get ?
Code:
def cluster_get(context, id=None, is_up=None, get_services=False, services_summary=False, read_deleted='no', name_match_level=None, **filters):
return IMPL.cluster_get(context, id, is_up, get_services, services_summary, read_deleted, name_match_level, **filters)
|
null | null | null | For what purpose did factory function provide ?
| def SQLiteFileLock(*args, **kwds):
from . import sqlitelockfile
return _fl_helper(sqlitelockfile.SQLiteLockFile, 'lockfile.sqlitelockfile', *args, **kwds)
| null | null | null | for backwards compatibility
| codeqa | def SQ Lite File Lock *args **kwds from import sqlitelockfilereturn fl helper sqlitelockfile SQ Lite Lock File 'lockfile sqlitelockfile' *args **kwds
| null | null | null | null | Question:
For what purpose did factory function provide ?
Code:
def SQLiteFileLock(*args, **kwds):
from . import sqlitelockfile
return _fl_helper(sqlitelockfile.SQLiteLockFile, 'lockfile.sqlitelockfile', *args, **kwds)
|
null | null | null | How do two l{tensortype}s stack ?
| @constructor
def horizontal_stack(*args):
assert (len(args) >= 2)
for arg in args:
assert (arg.type.ndim == 2)
return concatenate(args, axis=1)
| null | null | null | horizontally
| codeqa | @constructordef horizontal stack *args assert len args > 2 for arg in args assert arg type ndim 2 return concatenate args axis 1
| null | null | null | null | Question:
How do two l{tensortype}s stack ?
Code:
@constructor
def horizontal_stack(*args):
assert (len(args) >= 2)
for arg in args:
assert (arg.type.ndim == 2)
return concatenate(args, axis=1)
|
null | null | null | What does the code get ?
| def get_member_refids(group, exclude=None):
members = get_members(group)
if (len(members) == 0):
return []
if (exclude is None):
exclude = []
return [r.FnGetRefId() for r in members if (r.FnGetRefId() not in exclude)]
| null | null | null | a list of member resources managed by the specified group
| codeqa | def get member refids group exclude None members get members group if len members 0 return []if exclude is None exclude []return [r Fn Get Ref Id for r in members if r Fn Get Ref Id not in exclude ]
| null | null | null | null | Question:
What does the code get ?
Code:
def get_member_refids(group, exclude=None):
members = get_members(group)
if (len(members) == 0):
return []
if (exclude is None):
exclude = []
return [r.FnGetRefId() for r in members if (r.FnGetRefId() not in exclude)]
|
null | null | null | How does the percentage of positive cases classify as positive ?
| def recall(classify=(lambda document: False), documents=[], average=None):
return test(classify, documents, average)[2]
| null | null | null | correctly
| codeqa | def recall classify lambda document False documents [] average None return test classify documents average [2 ]
| null | null | null | null | Question:
How does the percentage of positive cases classify as positive ?
Code:
def recall(classify=(lambda document: False), documents=[], average=None):
return test(classify, documents, average)[2]
|
null | null | null | What does the code return ?
| def recall(classify=(lambda document: False), documents=[], average=None):
return test(classify, documents, average)[2]
| null | null | null | the percentage of positive cases correctly classified as positive
| codeqa | def recall classify lambda document False documents [] average None return test classify documents average [2 ]
| null | null | null | null | Question:
What does the code return ?
Code:
def recall(classify=(lambda document: False), documents=[], average=None):
return test(classify, documents, average)[2]
|
null | null | null | What does the code apply ?
| def temporaryApplyOverrides(repository):
global globalTemporaryOverrides
if (repository.baseName in globalTemporaryOverrides):
settingTable = {}
for setting in repository.preferences:
settingTable[setting.name] = setting
for (name, value) in overrides[repository.baseName].items():
if (name in settingTable... | null | null | null | any overrides that have been set at the command line
| codeqa | def temporary Apply Overrides repository global global Temporary Overridesif repository base Name in global Temporary Overrides setting Table {}for setting in repository preferences setting Table[setting name] settingfor name value in overrides[repository base Name] items if name in setting Table setting Table[name] se... | null | null | null | null | Question:
What does the code apply ?
Code:
def temporaryApplyOverrides(repository):
global globalTemporaryOverrides
if (repository.baseName in globalTemporaryOverrides):
settingTable = {}
for setting in repository.preferences:
settingTable[setting.name] = setting
for (name, value) in overrides[repository... |
null | null | null | What does the code create ?
| def link(src, dst):
if (os.name == u'nt'):
if (ctypes.windll.kernel32.CreateHardLinkW(dst, src, 0) == 0):
raise ctypes.WinError()
else:
os.link(src, dst)
| null | null | null | a file link from source to destination
| codeqa | def link src dst if os name u'nt' if ctypes windll kernel 32 Create Hard Link W dst src 0 0 raise ctypes Win Error else os link src dst
| null | null | null | null | Question:
What does the code create ?
Code:
def link(src, dst):
if (os.name == u'nt'):
if (ctypes.windll.kernel32.CreateHardLinkW(dst, src, 0) == 0):
raise ctypes.WinError()
else:
os.link(src, dst)
|
null | null | null | What is joining the accepted matches input ?
| def plot_matches(im1, im2, locs1, locs2, matchscores, show_below=True):
im3 = appendimages(im1, im2)
if show_below:
im3 = vstack((im3, im3))
imshow(im3)
cols1 = im1.shape[1]
for (i, m) in enumerate(matchscores):
if (m > 0):
plot([locs1[i][1], (locs2[m][1] + cols1)], [locs1[i][0], locs2[m][0]], 'c')
axis('o... | null | null | null | lines
| codeqa | def plot matches im 1 im 2 locs 1 locs 2 matchscores show below True im 3 appendimages im 1 im 2 if show below im 3 vstack im 3 im 3 imshow im 3 cols 1 im 1 shape[ 1 ]for i m in enumerate matchscores if m > 0 plot [locs 1 [i][ 1 ] locs 2 [m][ 1 ] + cols 1 ] [locs 1 [i][ 0 ] locs 2 [m][ 0 ]] 'c' axis 'off'
| null | null | null | null | Question:
What is joining the accepted matches input ?
Code:
def plot_matches(im1, im2, locs1, locs2, matchscores, show_below=True):
im3 = appendimages(im1, im2)
if show_below:
im3 = vstack((im3, im3))
imshow(im3)
cols1 = im1.shape[1]
for (i, m) in enumerate(matchscores):
if (m > 0):
plot([locs1[i][1], ... |
null | null | null | What does the code show ?
| def plot_matches(im1, im2, locs1, locs2, matchscores, show_below=True):
im3 = appendimages(im1, im2)
if show_below:
im3 = vstack((im3, im3))
imshow(im3)
cols1 = im1.shape[1]
for (i, m) in enumerate(matchscores):
if (m > 0):
plot([locs1[i][1], (locs2[m][1] + cols1)], [locs1[i][0], locs2[m][0]], 'c')
axis('o... | null | null | null | a figure with lines joining the accepted matches input
| codeqa | def plot matches im 1 im 2 locs 1 locs 2 matchscores show below True im 3 appendimages im 1 im 2 if show below im 3 vstack im 3 im 3 imshow im 3 cols 1 im 1 shape[ 1 ]for i m in enumerate matchscores if m > 0 plot [locs 1 [i][ 1 ] locs 2 [m][ 1 ] + cols 1 ] [locs 1 [i][ 0 ] locs 2 [m][ 0 ]] 'c' axis 'off'
| null | null | null | null | Question:
What does the code show ?
Code:
def plot_matches(im1, im2, locs1, locs2, matchscores, show_below=True):
im3 = appendimages(im1, im2)
if show_below:
im3 = vstack((im3, im3))
imshow(im3)
cols1 = im1.shape[1]
for (i, m) in enumerate(matchscores):
if (m > 0):
plot([locs1[i][1], (locs2[m][1] + cols... |
null | null | null | What do lines join ?
| def plot_matches(im1, im2, locs1, locs2, matchscores, show_below=True):
im3 = appendimages(im1, im2)
if show_below:
im3 = vstack((im3, im3))
imshow(im3)
cols1 = im1.shape[1]
for (i, m) in enumerate(matchscores):
if (m > 0):
plot([locs1[i][1], (locs2[m][1] + cols1)], [locs1[i][0], locs2[m][0]], 'c')
axis('o... | null | null | null | the accepted matches input
| codeqa | def plot matches im 1 im 2 locs 1 locs 2 matchscores show below True im 3 appendimages im 1 im 2 if show below im 3 vstack im 3 im 3 imshow im 3 cols 1 im 1 shape[ 1 ]for i m in enumerate matchscores if m > 0 plot [locs 1 [i][ 1 ] locs 2 [m][ 1 ] + cols 1 ] [locs 1 [i][ 0 ] locs 2 [m][ 0 ]] 'c' axis 'off'
| null | null | null | null | Question:
What do lines join ?
Code:
def plot_matches(im1, im2, locs1, locs2, matchscores, show_below=True):
im3 = appendimages(im1, im2)
if show_below:
im3 = vstack((im3, im3))
imshow(im3)
cols1 = im1.shape[1]
for (i, m) in enumerate(matchscores):
if (m > 0):
plot([locs1[i][1], (locs2[m][1] + cols1)], ... |
null | null | null | How do a sequence of text strings sort ?
| def natsort(seq, case_sensitive=True):
if case_sensitive:
natsort_key = _natsort_key
else:
natsort_key = _natsort_key_case_insensitive
alist = list(seq)
alist.sort(key=natsort_key)
return alist
| null | null | null | in a reasonable order
| codeqa | def natsort seq case sensitive True if case sensitive natsort key natsort keyelse natsort key natsort key case insensitivealist list seq alist sort key natsort key return alist
| null | null | null | null | Question:
How do a sequence of text strings sort ?
Code:
def natsort(seq, case_sensitive=True):
if case_sensitive:
natsort_key = _natsort_key
else:
natsort_key = _natsort_key_case_insensitive
alist = list(seq)
alist.sort(key=natsort_key)
return alist
|
null | null | null | By how much did characters encode ?
| def tamper(payload, **kwargs):
retVal = payload
if payload:
retVal = ''
i = 0
while (i < len(payload)):
if ((payload[i] == '%') and (i < (len(payload) - 2)) and (payload[(i + 1):(i + 2)] in string.hexdigits) and (payload[(i + 2):(i + 3)] in string.hexdigits)):
retVal += ('%%u00%s' % payload[(i + 1):(i + ... | null | null | null | non
| codeqa | def tamper payload **kwargs ret Val payloadif payload ret Val ''i 0while i < len payload if payload[i] '%' and i < len payload - 2 and payload[ i + 1 i + 2 ] in string hexdigits and payload[ i + 2 i + 3 ] in string hexdigits ret Val + '%%u 00 %s' % payload[ i + 1 i + 3 ] i + 3else ret Val + '%%u% 4X' % ord payload[i] i... | null | null | null | null | Question:
By how much did characters encode ?
Code:
def tamper(payload, **kwargs):
retVal = payload
if payload:
retVal = ''
i = 0
while (i < len(payload)):
if ((payload[i] == '%') and (i < (len(payload) - 2)) and (payload[(i + 1):(i + 2)] in string.hexdigits) and (payload[(i + 2):(i + 3)] in string.hexdi... |
null | null | null | What does the code obtain ?
| def get_lineno(node):
lineno = None
while ((lineno is None) and node):
node = node.parent
lineno = node.line
return lineno
| null | null | null | line number information for a node
| codeqa | def get lineno node lineno Nonewhile lineno is None and node node node parentlineno node linereturn lineno
| null | null | null | null | Question:
What does the code obtain ?
Code:
def get_lineno(node):
lineno = None
while ((lineno is None) and node):
node = node.parent
lineno = node.line
return lineno
|
null | null | null | For what purpose is the module name checked ?
| def _hadoop_cmd(module, command, *args):
out = None
if (module and command):
if (module in __authorized_modules__):
cmd = 'hadoop {0} -{1} {2}'.format(module, command, ' '.join(args))
out = __salt__['cmd.run'](cmd, python_shell=False)
else:
return 'Error: Unknown module'
else:
return 'Error: Mo... | null | null | null | in order to prevent random execution
| codeqa | def hadoop cmd module command *args out Noneif module and command if module in authorized modules cmd 'hadoop{ 0 }-{ 1 }{ 2 }' format module command '' join args out salt ['cmd run'] cmd python shell False else return ' Error Unknownmodule'else return ' Error Moduleandcommandnotdefined'return out
| null | null | null | null | Question:
For what purpose is the module name checked ?
Code:
def _hadoop_cmd(module, command, *args):
out = None
if (module and command):
if (module in __authorized_modules__):
cmd = 'hadoop {0} -{1} {2}'.format(module, command, ' '.join(args))
out = __salt__['cmd.run'](cmd, python_shell=False)
els... |
null | null | null | What does the code create on a specified network ?
| def network_create(request, **kwargs):
LOG.debug(('network_create(): kwargs = %s' % kwargs))
body = {'network': kwargs}
network = quantumclient(request).create_network(body=body).get('network')
return Network(network)
| null | null | null | a subnet
| codeqa | def network create request **kwargs LOG debug 'network create kwargs %s' % kwargs body {'network' kwargs}network quantumclient request create network body body get 'network' return Network network
| null | null | null | null | Question:
What does the code create on a specified network ?
Code:
def network_create(request, **kwargs):
LOG.debug(('network_create(): kwargs = %s' % kwargs))
body = {'network': kwargs}
network = quantumclient(request).create_network(body=body).get('network')
return Network(network)
|
null | null | null | Where does the code create a subnet ?
| def network_create(request, **kwargs):
LOG.debug(('network_create(): kwargs = %s' % kwargs))
body = {'network': kwargs}
network = quantumclient(request).create_network(body=body).get('network')
return Network(network)
| null | null | null | on a specified network
| codeqa | def network create request **kwargs LOG debug 'network create kwargs %s' % kwargs body {'network' kwargs}network quantumclient request create network body body get 'network' return Network network
| null | null | null | null | Question:
Where does the code create a subnet ?
Code:
def network_create(request, **kwargs):
LOG.debug(('network_create(): kwargs = %s' % kwargs))
body = {'network': kwargs}
network = quantumclient(request).create_network(body=body).get('network')
return Network(network)
|
null | null | null | What does the code get from its name ?
| def get_projection_class(projection=None):
if (projection is None):
projection = 'rectilinear'
try:
return projection_registry.get_projection_class(projection)
except KeyError:
raise ValueError(("Unknown projection '%s'" % projection))
| null | null | null | a projection class
| codeqa | def get projection class projection None if projection is None projection 'rectilinear'try return projection registry get projection class projection except Key Error raise Value Error " Unknownprojection'%s'" % projection
| null | null | null | null | Question:
What does the code get from its name ?
Code:
def get_projection_class(projection=None):
if (projection is None):
projection = 'rectilinear'
try:
return projection_registry.get_projection_class(projection)
except KeyError:
raise ValueError(("Unknown projection '%s'" % projection))
|
null | null | null | What does the code generate using the hash value of the title and link ?
| def new_entry_id(entry, cache={}):
s = (entry['link'] + entry['title']).encode('ascii', 'ignore')
return hashlib.md5(s).hexdigest()
| null | null | null | an entry i d
| codeqa | def new entry id entry cache {} s entry['link'] + entry['title'] encode 'ascii' 'ignore' return hashlib md 5 s hexdigest
| null | null | null | null | Question:
What does the code generate using the hash value of the title and link ?
Code:
def new_entry_id(entry, cache={}):
s = (entry['link'] + entry['title']).encode('ascii', 'ignore')
return hashlib.md5(s).hexdigest()
|
null | null | null | How does the code generate an entry i d ?
| def new_entry_id(entry, cache={}):
s = (entry['link'] + entry['title']).encode('ascii', 'ignore')
return hashlib.md5(s).hexdigest()
| null | null | null | using the hash value of the title and link
| codeqa | def new entry id entry cache {} s entry['link'] + entry['title'] encode 'ascii' 'ignore' return hashlib md 5 s hexdigest
| null | null | null | null | Question:
How does the code generate an entry i d ?
Code:
def new_entry_id(entry, cache={}):
s = (entry['link'] + entry['title']).encode('ascii', 'ignore')
return hashlib.md5(s).hexdigest()
|
null | null | null | What logs on the root logger ?
| def exception(msg, *args, **kwargs):
kwargs['exc_info'] = 1
error(msg, *args, **kwargs)
| null | null | null | a message with severity error
| codeqa | def exception msg *args **kwargs kwargs['exc info'] 1error msg *args **kwargs
| null | null | null | null | Question:
What logs on the root logger ?
Code:
def exception(msg, *args, **kwargs):
kwargs['exc_info'] = 1
error(msg, *args, **kwargs)
|
null | null | null | Where do a message with severity error log ?
| def exception(msg, *args, **kwargs):
kwargs['exc_info'] = 1
error(msg, *args, **kwargs)
| null | null | null | on the root logger
| codeqa | def exception msg *args **kwargs kwargs['exc info'] 1error msg *args **kwargs
| null | null | null | null | Question:
Where do a message with severity error log ?
Code:
def exception(msg, *args, **kwargs):
kwargs['exc_info'] = 1
error(msg, *args, **kwargs)
|
null | null | null | What does the code send ?
| def send_message(sender, password, recipient, use_tls, message):
import sleekxmpp
class SendNotificationBot(sleekxmpp.ClientXMPP, ):
'Service for sending Jabber (XMPP) messages.'
def __init__(self):
'Initialize the Jabber Bot.'
super(SendNotificationBot, self).__init__(sender, password)
logging.b... | null | null | null | a message
| codeqa | def send message sender password recipient use tls message import sleekxmppclass Send Notification Bot sleekxmpp Client XMPP ' Serviceforsending Jabber XMPP messages 'def init self ' Initializethe Jabber Bot 'super Send Notification Bot self init sender password logging basic Config level logging ERROR self use tls use... | null | null | null | null | Question:
What does the code send ?
Code:
def send_message(sender, password, recipient, use_tls, message):
import sleekxmpp
class SendNotificationBot(sleekxmpp.ClientXMPP, ):
'Service for sending Jabber (XMPP) messages.'
def __init__(self):
'Initialize the Jabber Bot.'
super(SendNotificationBot,... |
null | null | null | What does the code execute ?
| def parallel(iterable, count, callable, *args, **named):
coop = task.Cooperator()
work = (callable(elem, *args, **named) for elem in iterable)
return defer.DeferredList([coop.coiterate(work) for i in xrange(count)])
| null | null | null | a callable over the objects in the given iterable
| codeqa | def parallel iterable count callable *args **named coop task Cooperator work callable elem *args **named for elem in iterable return defer Deferred List [coop coiterate work for i in xrange count ]
| null | null | null | null | Question:
What does the code execute ?
Code:
def parallel(iterable, count, callable, *args, **named):
coop = task.Cooperator()
work = (callable(elem, *args, **named) for elem in iterable)
return defer.DeferredList([coop.coiterate(work) for i in xrange(count)])
|
null | null | null | Where does text detect ?
| def detect_text_cloud_storage(uri):
vision_client = vision.Client()
image = vision_client.image(source_uri=uri)
texts = image.detect_text()
print 'Texts:'
for text in texts:
print text.description
| null | null | null | in the file located in google cloud storage
| codeqa | def detect text cloud storage uri vision client vision Client image vision client image source uri uri texts image detect text print ' Texts 'for text in texts print text description
| null | null | null | null | Question:
Where does text detect ?
Code:
def detect_text_cloud_storage(uri):
vision_client = vision.Client()
image = vision_client.image(source_uri=uri)
texts = image.detect_text()
print 'Texts:'
for text in texts:
print text.description
|
null | null | null | What detects in the file located in google cloud storage ?
| def detect_text_cloud_storage(uri):
vision_client = vision.Client()
image = vision_client.image(source_uri=uri)
texts = image.detect_text()
print 'Texts:'
for text in texts:
print text.description
| null | null | null | text
| codeqa | def detect text cloud storage uri vision client vision Client image vision client image source uri uri texts image detect text print ' Texts 'for text in texts print text description
| null | null | null | null | Question:
What detects in the file located in google cloud storage ?
Code:
def detect_text_cloud_storage(uri):
vision_client = vision.Client()
image = vision_client.image(source_uri=uri)
texts = image.detect_text()
print 'Texts:'
for text in texts:
print text.description
|
null | null | null | What yields a secret model defined at runtime ?
| @contextmanager
def secret_model():
try:
attrs = {'name': EncryptedCharField('Name', max_length=Secret._meta.get_field('name').max_length), 'text': EncryptedTextField('Text'), '__module__': 'tests.testapp.models', 'Meta': type('Meta', (object,), {'managed': False, 'db_table': Secret._meta.db_table})}
(yield type('... | null | null | null | a context manager
| codeqa | @contextmanagerdef secret model try attrs {'name' Encrypted Char Field ' Name' max length Secret meta get field 'name' max length 'text' Encrypted Text Field ' Text' ' module ' 'tests testapp models' ' Meta' type ' Meta' object {'managed' False 'db table' Secret meta db table} } yield type ' Secret' models Model attrs ... | null | null | null | null | Question:
What yields a secret model defined at runtime ?
Code:
@contextmanager
def secret_model():
try:
attrs = {'name': EncryptedCharField('Name', max_length=Secret._meta.get_field('name').max_length), 'text': EncryptedTextField('Text'), '__module__': 'tests.testapp.models', 'Meta': type('Meta', (object,), {'m... |
null | null | null | What does a context manager yield ?
| @contextmanager
def secret_model():
try:
attrs = {'name': EncryptedCharField('Name', max_length=Secret._meta.get_field('name').max_length), 'text': EncryptedTextField('Text'), '__module__': 'tests.testapp.models', 'Meta': type('Meta', (object,), {'managed': False, 'db_table': Secret._meta.db_table})}
(yield type('... | null | null | null | a secret model defined at runtime
| codeqa | @contextmanagerdef secret model try attrs {'name' Encrypted Char Field ' Name' max length Secret meta get field 'name' max length 'text' Encrypted Text Field ' Text' ' module ' 'tests testapp models' ' Meta' type ' Meta' object {'managed' False 'db table' Secret meta db table} } yield type ' Secret' models Model attrs ... | null | null | null | null | Question:
What does a context manager yield ?
Code:
@contextmanager
def secret_model():
try:
attrs = {'name': EncryptedCharField('Name', max_length=Secret._meta.get_field('name').max_length), 'text': EncryptedTextField('Text'), '__module__': 'tests.testapp.models', 'Meta': type('Meta', (object,), {'managed': Fal... |
null | null | null | When did a secret model define ?
| @contextmanager
def secret_model():
try:
attrs = {'name': EncryptedCharField('Name', max_length=Secret._meta.get_field('name').max_length), 'text': EncryptedTextField('Text'), '__module__': 'tests.testapp.models', 'Meta': type('Meta', (object,), {'managed': False, 'db_table': Secret._meta.db_table})}
(yield type('... | null | null | null | at runtime
| codeqa | @contextmanagerdef secret model try attrs {'name' Encrypted Char Field ' Name' max length Secret meta get field 'name' max length 'text' Encrypted Text Field ' Text' ' module ' 'tests testapp models' ' Meta' type ' Meta' object {'managed' False 'db table' Secret meta db table} } yield type ' Secret' models Model attrs ... | null | null | null | null | Question:
When did a secret model define ?
Code:
@contextmanager
def secret_model():
try:
attrs = {'name': EncryptedCharField('Name', max_length=Secret._meta.get_field('name').max_length), 'text': EncryptedTextField('Text'), '__module__': 'tests.testapp.models', 'Meta': type('Meta', (object,), {'managed': False,... |
null | null | null | What does the code compute in x and y ?
| def paired_manhattan_distances(X, Y):
(X, Y) = check_paired_arrays(X, Y)
diff = (X - Y)
if issparse(diff):
diff.data = np.abs(diff.data)
return np.squeeze(np.array(diff.sum(axis=1)))
else:
return np.abs(diff).sum(axis=(-1))
| null | null | null | the l1 distances between the vectors
| codeqa | def paired manhattan distances X Y X Y check paired arrays X Y diff X - Y if issparse diff diff data np abs diff data return np squeeze np array diff sum axis 1 else return np abs diff sum axis -1
| null | null | null | null | Question:
What does the code compute in x and y ?
Code:
def paired_manhattan_distances(X, Y):
(X, Y) = check_paired_arrays(X, Y)
diff = (X - Y)
if issparse(diff):
diff.data = np.abs(diff.data)
return np.squeeze(np.array(diff.sum(axis=1)))
else:
return np.abs(diff).sum(axis=(-1))
|
null | null | null | Where does the code compute the l1 distances between the vectors ?
| def paired_manhattan_distances(X, Y):
(X, Y) = check_paired_arrays(X, Y)
diff = (X - Y)
if issparse(diff):
diff.data = np.abs(diff.data)
return np.squeeze(np.array(diff.sum(axis=1)))
else:
return np.abs(diff).sum(axis=(-1))
| null | null | null | in x and y
| codeqa | def paired manhattan distances X Y X Y check paired arrays X Y diff X - Y if issparse diff diff data np abs diff data return np squeeze np array diff sum axis 1 else return np abs diff sum axis -1
| null | null | null | null | Question:
Where does the code compute the l1 distances between the vectors ?
Code:
def paired_manhattan_distances(X, Y):
(X, Y) = check_paired_arrays(X, Y)
diff = (X - Y)
if issparse(diff):
diff.data = np.abs(diff.data)
return np.squeeze(np.array(diff.sum(axis=1)))
else:
return np.abs(diff).sum(axis=(-1))... |
null | null | null | What does the code subscribe to a feedback thread ?
| def subscribe_to_thread(user_id, feedback_thread_id):
subscriptions_model = user_models.UserSubscriptionsModel.get(user_id, strict=False)
if (not subscriptions_model):
subscriptions_model = user_models.UserSubscriptionsModel(id=user_id)
if (feedback_thread_id not in subscriptions_model.feedback_thread_ids):
subs... | null | null | null | a user
| codeqa | def subscribe to thread user id feedback thread id subscriptions model user models User Subscriptions Model get user id strict False if not subscriptions model subscriptions model user models User Subscriptions Model id user id if feedback thread id not in subscriptions model feedback thread ids subscriptions model fee... | null | null | null | null | Question:
What does the code subscribe to a feedback thread ?
Code:
def subscribe_to_thread(user_id, feedback_thread_id):
subscriptions_model = user_models.UserSubscriptionsModel.get(user_id, strict=False)
if (not subscriptions_model):
subscriptions_model = user_models.UserSubscriptionsModel(id=user_id)
if (fe... |
null | null | null | What does the code stop ?
| def stop(name, quiet=False, path=None):
data = _do_names(name, 'stop', path=path)
if (data and (not quiet)):
__jid_event__.fire_event({'data': data, 'outputter': 'lxc_force_off'}, 'progress')
return data
| null | null | null | the named container
| codeqa | def stop name quiet False path None data do names name 'stop' path path if data and not quiet jid event fire event {'data' data 'outputter' 'lxc force off'} 'progress' return data
| null | null | null | null | Question:
What does the code stop ?
Code:
def stop(name, quiet=False, path=None):
data = _do_names(name, 'stop', path=path)
if (data and (not quiet)):
__jid_event__.fire_event({'data': data, 'outputter': 'lxc_force_off'}, 'progress')
return data
|
null | null | null | What does the code update if it does not exist or not visible ?
| @utils.no_4byte_params
def metadef_object_update(context, namespace_name, object_id, object_dict, session=None):
session = (session or get_session())
return metadef_object_api.update(context, namespace_name, object_id, object_dict, session)
| null | null | null | an object
| codeqa | @utils no 4byte paramsdef metadef object update context namespace name object id object dict session None session session or get session return metadef object api update context namespace name object id object dict session
| null | null | null | null | Question:
What does the code update if it does not exist or not visible ?
Code:
@utils.no_4byte_params
def metadef_object_update(context, namespace_name, object_id, object_dict, session=None):
session = (session or get_session())
return metadef_object_api.update(context, namespace_name, object_id, object_dict, se... |
null | null | null | What uses to disable test on specified backend ?
| def no_backend(test_func, backend):
if (settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].rsplit('.')[(-1)] == backend):
return pass_test
else:
return test_func
| null | null | null | this decorator
| codeqa | def no backend test func backend if settings DATABASES[DEFAULT DB ALIAS]['ENGINE'] rsplit ' ' [ -1 ] backend return pass testelse return test func
| null | null | null | null | Question:
What uses to disable test on specified backend ?
Code:
def no_backend(test_func, backend):
if (settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].rsplit('.')[(-1)] == backend):
return pass_test
else:
return test_func
|
null | null | null | What does the code get from attribute dictionary ?
| def getGeometryOutput(derivation, xmlElement):
if (derivation == None):
derivation = SVGDerivation()
derivation.setToXMLElement(xmlElement)
return getGeometryOutputBySVGReader(derivation.svgReader, xmlElement)
| null | null | null | vector3 vertexes
| codeqa | def get Geometry Output derivation xml Element if derivation None derivation SVG Derivation derivation set To XML Element xml Element return get Geometry Output By SVG Reader derivation svg Reader xml Element
| null | null | null | null | Question:
What does the code get from attribute dictionary ?
Code:
def getGeometryOutput(derivation, xmlElement):
if (derivation == None):
derivation = SVGDerivation()
derivation.setToXMLElement(xmlElement)
return getGeometryOutputBySVGReader(derivation.svgReader, xmlElement)
|
null | null | null | In which direction will their quota revert to default ?
| @utils.arg('--tenant', metavar='<tenant-id>', required=True, help=_('ID of tenant to delete quota for.'))
@utils.arg('--user', metavar='<user-id>', help=_('ID of user to delete quota for.'))
def do_quota_delete(cs, args):
cs.quotas.delete(args.tenant, user_id=args.user)
| null | null | null | back
| codeqa | @utils arg '--tenant' metavar '<tenant-id>' required True help 'I Doftenanttodeletequotafor ' @utils arg '--user' metavar '<user-id>' help 'I Dofusertodeletequotafor ' def do quota delete cs args cs quotas delete args tenant user id args user
| null | null | null | null | Question:
In which direction will their quota revert to default ?
Code:
@utils.arg('--tenant', metavar='<tenant-id>', required=True, help=_('ID of tenant to delete quota for.'))
@utils.arg('--user', metavar='<user-id>', help=_('ID of user to delete quota for.'))
def do_quota_delete(cs, args):
cs.quotas... |
null | null | null | When do style settings use ?
| @contextlib.contextmanager
def context(style, after_reset=False):
initial_settings = mpl.rcParams.copy()
if after_reset:
mpl.rcdefaults()
try:
use(style)
except:
mpl.rcParams.update(initial_settings)
raise
else:
(yield)
finally:
mpl.rcParams.update(initial_settings)
| null | null | null | temporarily
| codeqa | @contextlib contextmanagerdef context style after reset False initial settings mpl rc Params copy if after reset mpl rcdefaults try use style except mpl rc Params update initial settings raiseelse yield finally mpl rc Params update initial settings
| null | null | null | null | Question:
When do style settings use ?
Code:
@contextlib.contextmanager
def context(style, after_reset=False):
initial_settings = mpl.rcParams.copy()
if after_reset:
mpl.rcdefaults()
try:
use(style)
except:
mpl.rcParams.update(initial_settings)
raise
else:
(yield)
finally:
mpl.rcParams.update(init... |
null | null | null | What does the code serialize ?
| def _nested_output(obj):
from salt.output import nested
nested.__opts__ = {}
ret = nested.output(obj).rstrip()
return ret
| null | null | null | obj and format
| codeqa | def nested output obj from salt output import nestednested opts {}ret nested output obj rstrip return ret
| null | null | null | null | Question:
What does the code serialize ?
Code:
def _nested_output(obj):
from salt.output import nested
nested.__opts__ = {}
ret = nested.output(obj).rstrip()
return ret
|
null | null | null | When do email send ?
| def send_email_after_account_create(form):
send_email(to=form['email'], action=USER_REGISTER, subject=MAILS[USER_REGISTER]['subject'].format(app_name=get_settings()['app_name']), html=MAILS[USER_REGISTER]['message'].format(email=form['email']))
| null | null | null | after account
| codeqa | def send email after account create form send email to form['email'] action USER REGISTER subject MAILS[USER REGISTER]['subject'] format app name get settings ['app name'] html MAILS[USER REGISTER]['message'] format email form['email']
| null | null | null | null | Question:
When do email send ?
Code:
def send_email_after_account_create(form):
send_email(to=form['email'], action=USER_REGISTER, subject=MAILS[USER_REGISTER]['subject'].format(app_name=get_settings()['app_name']), html=MAILS[USER_REGISTER]['message'].format(email=form['email']))
|
null | null | null | When does test method run in the following order ?
| def setup(templates, *args, **kwargs):
test_once = kwargs.get('test_once', False)
for arg in args:
templates.update(arg)
templates['inclusion.html'] = '{{ result }}'
loaders = [('django.template.loaders.cached.Loader', [('django.template.loaders.locmem.Loader', templates)])]
def decorator(func):
@override_se... | null | null | null | multiple times
| codeqa | def setup templates *args **kwargs test once kwargs get 'test once' False for arg in args templates update arg templates['inclusion html'] '{{result}}'loaders [ 'django template loaders cached Loader' [ 'django template loaders locmem Loader' templates ] ]def decorator func @override settings TEMPLATES None @functools ... | null | null | null | null | Question:
When does test method run in the following order ?
Code:
def setup(templates, *args, **kwargs):
test_once = kwargs.get('test_once', False)
for arg in args:
templates.update(arg)
templates['inclusion.html'] = '{{ result }}'
loaders = [('django.template.loaders.cached.Loader', [('django.template.loa... |
null | null | null | How does test method run multiple times ?
| def setup(templates, *args, **kwargs):
test_once = kwargs.get('test_once', False)
for arg in args:
templates.update(arg)
templates['inclusion.html'] = '{{ result }}'
loaders = [('django.template.loaders.cached.Loader', [('django.template.loaders.locmem.Loader', templates)])]
def decorator(func):
@override_se... | null | null | null | in the following order
| codeqa | def setup templates *args **kwargs test once kwargs get 'test once' False for arg in args templates update arg templates['inclusion html'] '{{result}}'loaders [ 'django template loaders cached Loader' [ 'django template loaders locmem Loader' templates ] ]def decorator func @override settings TEMPLATES None @functools ... | null | null | null | null | Question:
How does test method run multiple times ?
Code:
def setup(templates, *args, **kwargs):
test_once = kwargs.get('test_once', False)
for arg in args:
templates.update(arg)
templates['inclusion.html'] = '{{ result }}'
loaders = [('django.template.loaders.cached.Loader', [('django.template.loaders.locm... |
null | null | null | What does the user have ?
| def action_allowed_user(user, app, action):
if (not user.is_authenticated()):
return False
return any((match_rules(group.rules, app, action) for group in user.groups_list))
| null | null | null | permission to do a certain action
| codeqa | def action allowed user user app action if not user is authenticated return Falsereturn any match rules group rules app action for group in user groups list
| null | null | null | null | Question:
What does the user have ?
Code:
def action_allowed_user(user, app, action):
if (not user.is_authenticated()):
return False
return any((match_rules(group.rules, app, action) for group in user.groups_list))
|
null | null | null | What has permission to do a certain action ?
| def action_allowed_user(user, app, action):
if (not user.is_authenticated()):
return False
return any((match_rules(group.rules, app, action) for group in user.groups_list))
| null | null | null | the user
| codeqa | def action allowed user user app action if not user is authenticated return Falsereturn any match rules group rules app action for group in user groups list
| null | null | null | null | Question:
What has permission to do a certain action ?
Code:
def action_allowed_user(user, app, action):
if (not user.is_authenticated()):
return False
return any((match_rules(group.rules, app, action) for group in user.groups_list))
|
null | null | null | What dos a certain action ?
| def action_allowed_user(user, app, action):
if (not user.is_authenticated()):
return False
return any((match_rules(group.rules, app, action) for group in user.groups_list))
| null | null | null | the user
| codeqa | def action allowed user user app action if not user is authenticated return Falsereturn any match rules group rules app action for group in user groups list
| null | null | null | null | Question:
What dos a certain action ?
Code:
def action_allowed_user(user, app, action):
if (not user.is_authenticated()):
return False
return any((match_rules(group.rules, app, action) for group in user.groups_list))
|
null | null | null | What shared code ?
| def _write_instance_repr(out, visited, name, pyop_attrdict, address):
out.write('<')
out.write(name)
if isinstance(pyop_attrdict, PyDictObjectPtr):
out.write('(')
first = True
for (pyop_arg, pyop_val) in pyop_attrdict.iteritems():
if (not first):
out.write(', ')
first = False
out.write(pyop_arg.p... | null | null | null | code
| codeqa | def write instance repr out visited name pyop attrdict address out write '<' out write name if isinstance pyop attrdict Py Dict Object Ptr out write ' ' first Truefor pyop arg pyop val in pyop attrdict iteritems if not first out write ' ' first Falseout write pyop arg proxyval visited out write ' ' pyop val write repr ... | null | null | null | null | Question:
What shared code ?
Code:
def _write_instance_repr(out, visited, name, pyop_attrdict, address):
out.write('<')
out.write(name)
if isinstance(pyop_attrdict, PyDictObjectPtr):
out.write('(')
first = True
for (pyop_arg, pyop_val) in pyop_attrdict.iteritems():
if (not first):
out.write(', ')
... |
null | null | null | What did code share ?
| def _write_instance_repr(out, visited, name, pyop_attrdict, address):
out.write('<')
out.write(name)
if isinstance(pyop_attrdict, PyDictObjectPtr):
out.write('(')
first = True
for (pyop_arg, pyop_val) in pyop_attrdict.iteritems():
if (not first):
out.write(', ')
first = False
out.write(pyop_arg.p... | null | null | null | code
| codeqa | def write instance repr out visited name pyop attrdict address out write '<' out write name if isinstance pyop attrdict Py Dict Object Ptr out write ' ' first Truefor pyop arg pyop val in pyop attrdict iteritems if not first out write ' ' first Falseout write pyop arg proxyval visited out write ' ' pyop val write repr ... | null | null | null | null | Question:
What did code share ?
Code:
def _write_instance_repr(out, visited, name, pyop_attrdict, address):
out.write('<')
out.write(name)
if isinstance(pyop_attrdict, PyDictObjectPtr):
out.write('(')
first = True
for (pyop_arg, pyop_val) in pyop_attrdict.iteritems():
if (not first):
out.write(', '... |
null | null | null | What does the code show ?
| @blueprint.route('/large_graph', methods=['GET'])
def large_graph():
job = job_from_request()
return flask.render_template('models/images/classification/large_graph.html', job=job)
| null | null | null | the loss / accuracy graph
| codeqa | @blueprint route '/large graph' methods ['GET'] def large graph job job from request return flask render template 'models/images/classification/large graph html' job job
| null | null | null | null | Question:
What does the code show ?
Code:
@blueprint.route('/large_graph', methods=['GET'])
def large_graph():
job = job_from_request()
return flask.render_template('models/images/classification/large_graph.html', job=job)
|
null | null | null | What is describing specific flavor_id ?
| @require_context
def instance_type_get_by_flavor_id(context, flavor_id, session=None):
result = _instance_type_get_query(context, session=session).filter_by(flavorid=flavor_id).first()
if (not result):
raise exception.FlavorNotFound(flavor_id=flavor_id)
return _dict_with_extra_specs(result)
| null | null | null | a dict
| codeqa | @require contextdef instance type get by flavor id context flavor id session None result instance type get query context session session filter by flavorid flavor id first if not result raise exception Flavor Not Found flavor id flavor id return dict with extra specs result
| null | null | null | null | Question:
What is describing specific flavor_id ?
Code:
@require_context
def instance_type_get_by_flavor_id(context, flavor_id, session=None):
result = _instance_type_get_query(context, session=session).filter_by(flavorid=flavor_id).first()
if (not result):
raise exception.FlavorNotFound(flavor_id=flavor_id)
r... |
null | null | null | What does the code create ?
| def create_tables(model):
from django.core.management import sql
from django.db import connection
from django.core.management.color import no_style
cursor = connection.cursor()
def execute(statements):
for statement in statements:
logging.debug(('Executing: ' + statement))
cursor.execute(statement)
STYLE... | null | null | null | all tables
| codeqa | def create tables model from django core management import sqlfrom django db import connectionfrom django core management color import no stylecursor connection cursor def execute statements for statement in statements logging debug ' Executing ' + statement cursor execute statement STYLE no style execute connection cr... | null | null | null | null | Question:
What does the code create ?
Code:
def create_tables(model):
from django.core.management import sql
from django.db import connection
from django.core.management.color import no_style
cursor = connection.cursor()
def execute(statements):
for statement in statements:
logging.debug(('Executing: ' +... |
null | null | null | What does the code run ?
| def command_succeeds(cmd):
import subprocess
with open(os.devnull, 'w') as f:
try:
subprocess.Popen(cmd, stdout=f, stderr=subprocess.STDOUT).wait()
except OSError:
return False
return True
| null | null | null | the command
| codeqa | def command succeeds cmd import subprocesswith open os devnull 'w' as f try subprocess Popen cmd stdout f stderr subprocess STDOUT wait except OS Error return Falsereturn True
| null | null | null | null | Question:
What does the code run ?
Code:
def command_succeeds(cmd):
import subprocess
with open(os.devnull, 'w') as f:
try:
subprocess.Popen(cmd, stdout=f, stderr=subprocess.STDOUT).wait()
except OSError:
return False
return True
|
null | null | null | What does the code apply ?
| def apply_rollback(datastore, name):
return _proxy_cmd('apply_rollback', datastore, name)
| null | null | null | a system rollback
| codeqa | def apply rollback datastore name return proxy cmd 'apply rollback' datastore name
| null | null | null | null | Question:
What does the code apply ?
Code:
def apply_rollback(datastore, name):
return _proxy_cmd('apply_rollback', datastore, name)
|
null | null | null | How do the i d and output bucket of a cluster retrieve ?
| def get_cluster_id_by_name(cluster_list, cluster_name):
cluster = [c for c in cluster_list if (c['clusterName'] == cluster_name)][0]
return (cluster['clusterUuid'], cluster['config']['configBucket'])
| null | null | null | by name
| codeqa | def get cluster id by name cluster list cluster name cluster [c for c in cluster list if c['cluster Name'] cluster name ][ 0 ]return cluster['cluster Uuid'] cluster['config']['config Bucket']
| null | null | null | null | Question:
How do the i d and output bucket of a cluster retrieve ?
Code:
def get_cluster_id_by_name(cluster_list, cluster_name):
cluster = [c for c in cluster_list if (c['clusterName'] == cluster_name)][0]
return (cluster['clusterUuid'], cluster['config']['configBucket'])
|
null | null | null | When is an error raised ?
| def test_rus_sample_wrong_X():
rus = RandomUnderSampler(random_state=RND_SEED)
rus.fit(X, Y)
assert_raises(RuntimeError, rus.sample, np.random.random((100, 40)), np.array((([0] * 50) + ([1] * 50))))
| null | null | null | when x is different at fitting and sampling
| codeqa | def test rus sample wrong X rus Random Under Sampler random state RND SEED rus fit X Y assert raises Runtime Error rus sample np random random 100 40 np array [0 ] * 50 + [1 ] * 50
| null | null | null | null | Question:
When is an error raised ?
Code:
def test_rus_sample_wrong_X():
rus = RandomUnderSampler(random_state=RND_SEED)
rus.fit(X, Y)
assert_raises(RuntimeError, rus.sample, np.random.random((100, 40)), np.array((([0] * 50) + ([1] * 50))))
|
null | null | null | What does the code install ?
| def install(app_id, enable=True):
ge_el_capitan = (True if (LooseVersion(__grains__['osrelease']) >= '10.11') else False)
client_type = _client_type(app_id)
enable_str = ('1' if enable else '0')
cmd = 'sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" "INSERT or REPLACE INTO access VALUES(\'kTCCSe... | null | null | null | a bundle i d or command
| codeqa | def install app id enable True ge el capitan True if Loose Version grains ['osrelease'] > '10 11 ' else False client type client type app id enable str '1 ' if enable else '0 ' cmd 'sqlite 3 "/ Library/ Application Support/com apple TCC/TCC db""INSER Tor REPLACEINT Oaccess VALUES \'k TCC Service Accessibility\' \'{ 0 }... | null | null | null | null | Question:
What does the code install ?
Code:
def install(app_id, enable=True):
ge_el_capitan = (True if (LooseVersion(__grains__['osrelease']) >= '10.11') else False)
client_type = _client_type(app_id)
enable_str = ('1' if enable else '0')
cmd = 'sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" "I... |
null | null | null | What does the code get out of a module file ?
| def synopsis(filename, cache={}):
mtime = os.stat(filename).st_mtime
(lastupdate, result) = cache.get(filename, (None, None))
if ((lastupdate is None) or (lastupdate < mtime)):
info = inspect.getmoduleinfo(filename)
try:
file = open(filename)
except IOError:
return None
if (info and ('b' in info[2])):
... | null | null | null | the one - line summary
| codeqa | def synopsis filename cache {} mtime os stat filename st mtime lastupdate result cache get filename None None if lastupdate is None or lastupdate < mtime info inspect getmoduleinfo filename try file open filename except IO Error return Noneif info and 'b' in info[ 2 ] try module imp load module ' temp ' file filename i... | null | null | null | null | Question:
What does the code get out of a module file ?
Code:
def synopsis(filename, cache={}):
mtime = os.stat(filename).st_mtime
(lastupdate, result) = cache.get(filename, (None, None))
if ((lastupdate is None) or (lastupdate < mtime)):
info = inspect.getmoduleinfo(filename)
try:
file = open(filename)
... |
null | null | null | What does the code create ?
| def delete_ip(call=None, kwargs=None):
global netconn
if (not netconn):
netconn = get_conn(NetworkManagementClient)
if (kwargs.get('resource_group') is None):
kwargs['resource_group'] = config.get_cloud_config_value('resource_group', {}, __opts__, search_global=True)
return netconn.public_ip_addresses.delete(kw... | null | null | null | a network interface
| codeqa | def delete ip call None kwargs None global netconnif not netconn netconn get conn Network Management Client if kwargs get 'resource group' is None kwargs['resource group'] config get cloud config value 'resource group' {} opts search global True return netconn public ip addresses delete kwargs['resource group'] kwargs[... | null | null | null | null | Question:
What does the code create ?
Code:
def delete_ip(call=None, kwargs=None):
global netconn
if (not netconn):
netconn = get_conn(NetworkManagementClient)
if (kwargs.get('resource_group') is None):
kwargs['resource_group'] = config.get_cloud_config_value('resource_group', {}, __opts__, search_global=Tru... |
null | null | null | What do a decorator timeout ?
| def timeout(timeout):
def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
key = '{0}:{1}:{2}:{3}'.format(id(func), func.__name__, args, kwargs)
if (key in _thread_by_func):
worker = _thread_by_func[key]
else:
worker = ThreadMethod(func, args, kwargs)
_thread_by_func[key] ... | null | null | null | a function
| codeqa | def timeout timeout def decorator func @functools wraps func def wrapper *args **kwargs key '{ 0 } {1 } {2 } {3 }' format id func func name args kwargs if key in thread by func worker thread by func[key]else worker Thread Method func args kwargs thread by func[key] workerworker join timeout if worker is alive raise Tim... | null | null | null | null | Question:
What do a decorator timeout ?
Code:
def timeout(timeout):
def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
key = '{0}:{1}:{2}:{3}'.format(id(func), func.__name__, args, kwargs)
if (key in _thread_by_func):
worker = _thread_by_func[key]
else:
worker = ThreadMe... |
null | null | null | What timeouts a function ?
| def timeout(timeout):
def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
key = '{0}:{1}:{2}:{3}'.format(id(func), func.__name__, args, kwargs)
if (key in _thread_by_func):
worker = _thread_by_func[key]
else:
worker = ThreadMethod(func, args, kwargs)
_thread_by_func[key] ... | null | null | null | a decorator
| codeqa | def timeout timeout def decorator func @functools wraps func def wrapper *args **kwargs key '{ 0 } {1 } {2 } {3 }' format id func func name args kwargs if key in thread by func worker thread by func[key]else worker Thread Method func args kwargs thread by func[key] workerworker join timeout if worker is alive raise Tim... | null | null | null | null | Question:
What timeouts a function ?
Code:
def timeout(timeout):
def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
key = '{0}:{1}:{2}:{3}'.format(id(func), func.__name__, args, kwargs)
if (key in _thread_by_func):
worker = _thread_by_func[key]
else:
worker = ThreadMetho... |
null | null | null | What does the code evaluate ?
| def getBracketsExist(evaluators):
bracketBeginIndex = None
for negativeIndex in xrange((- len(evaluators)), 0):
bracketEndIndex = (negativeIndex + len(evaluators))
evaluatorEnd = evaluators[bracketEndIndex]
evaluatorWord = evaluatorEnd.word
if (evaluatorWord in ['(', '[', '{']):
bracketBeginIndex = bracket... | null | null | null | the expression value
| codeqa | def get Brackets Exist evaluators bracket Begin Index Nonefor negative Index in xrange - len evaluators 0 bracket End Index negative Index + len evaluators evaluator End evaluators[bracket End Index]evaluator Word evaluator End wordif evaluator Word in [' ' '[' '{'] bracket Begin Index bracket End Indexelif evaluator W... | null | null | null | null | Question:
What does the code evaluate ?
Code:
def getBracketsExist(evaluators):
bracketBeginIndex = None
for negativeIndex in xrange((- len(evaluators)), 0):
bracketEndIndex = (negativeIndex + len(evaluators))
evaluatorEnd = evaluators[bracketEndIndex]
evaluatorWord = evaluatorEnd.word
if (evaluatorWord i... |
null | null | null | How d the code get security group ?
| def security_group_get(context, security_group_id, columns_to_join=None):
return IMPL.security_group_get(context, security_group_id, columns_to_join)
| null | null | null | by its i d
| codeqa | def security group get context security group id columns to join None return IMPL security group get context security group id columns to join
| null | null | null | null | Question:
How d the code get security group ?
Code:
def security_group_get(context, security_group_id, columns_to_join=None):
return IMPL.security_group_get(context, security_group_id, columns_to_join)
|
null | null | null | What d the code get by its i d ?
| def security_group_get(context, security_group_id, columns_to_join=None):
return IMPL.security_group_get(context, security_group_id, columns_to_join)
| null | null | null | security group
| codeqa | def security group get context security group id columns to join None return IMPL security group get context security group id columns to join
| null | null | null | null | Question:
What d the code get by its i d ?
Code:
def security_group_get(context, security_group_id, columns_to_join=None):
return IMPL.security_group_get(context, security_group_id, columns_to_join)
|
null | null | null | How do connection info to galaxy initialize ?
| def g_connect(method):
def wrapped(self, *args, **kwargs):
if (not self.initialized):
display.vvvv(('Initial connection to galaxy_server: %s' % self._api_server))
server_version = self._get_server_api_version()
if (server_version not in self.SUPPORTED_VERSIONS):
raise AnsibleError(('Unsupported Gal... | null | null | null | lazily
| codeqa | def g connect method def wrapped self *args **kwargs if not self initialized display vvvv ' Initialconnectiontogalaxy server %s' % self api server server version self get server api version if server version not in self SUPPORTED VERSIONS raise Ansible Error ' Unsupported Galaxyserver AP Iversion %s' % server version s... | null | null | null | null | Question:
How do connection info to galaxy initialize ?
Code:
def g_connect(method):
def wrapped(self, *args, **kwargs):
if (not self.initialized):
display.vvvv(('Initial connection to galaxy_server: %s' % self._api_server))
server_version = self._get_server_api_version()
if (server_version not in s... |
null | null | null | What does the code get in a list table ?
| def getListTableElements(listDictionary):
listDictionaryElements = []
for listDictionaryValue in listDictionary.values():
listDictionaryElements += listDictionaryValue
return listDictionaryElements
| null | null | null | all the element
| codeqa | def get List Table Elements list Dictionary list Dictionary Elements []for list Dictionary Value in list Dictionary values list Dictionary Elements + list Dictionary Valuereturn list Dictionary Elements
| null | null | null | null | Question:
What does the code get in a list table ?
Code:
def getListTableElements(listDictionary):
listDictionaryElements = []
for listDictionaryValue in listDictionary.values():
listDictionaryElements += listDictionaryValue
return listDictionaryElements
|
null | null | null | Where does the code get all the element ?
| def getListTableElements(listDictionary):
listDictionaryElements = []
for listDictionaryValue in listDictionary.values():
listDictionaryElements += listDictionaryValue
return listDictionaryElements
| null | null | null | in a list table
| codeqa | def get List Table Elements list Dictionary list Dictionary Elements []for list Dictionary Value in list Dictionary values list Dictionary Elements + list Dictionary Valuereturn list Dictionary Elements
| null | null | null | null | Question:
Where does the code get all the element ?
Code:
def getListTableElements(listDictionary):
listDictionaryElements = []
for listDictionaryValue in listDictionary.values():
listDictionaryElements += listDictionaryValue
return listDictionaryElements
|
null | null | null | How does the code generate the file names in a stored directory tree ?
| def walk_storage(path, topdown=True, onerror=None, followlinks=False, storage=private_storage):
if (not topdown):
raise NotImplementedError
if onerror:
raise NotImplementedError
roots = [path]
while len(roots):
new_roots = []
for root in roots:
(dirs, files) = storage.listdir(root)
files = [smart_str(... | null | null | null | by walking the tree top - down
| codeqa | def walk storage path topdown True onerror None followlinks False storage private storage if not topdown raise Not Implemented Errorif onerror raise Not Implemented Errorroots [path]while len roots new roots []for root in roots dirs files storage listdir root files [smart str f for f in files]dirs [smart str d for d in... | null | null | null | null | Question:
How does the code generate the file names in a stored directory tree ?
Code:
def walk_storage(path, topdown=True, onerror=None, followlinks=False, storage=private_storage):
if (not topdown):
raise NotImplementedError
if onerror:
raise NotImplementedError
roots = [path]
while len(roots):
new_root... |
null | null | null | What does the code generate by walking the tree top - down ?
| def walk_storage(path, topdown=True, onerror=None, followlinks=False, storage=private_storage):
if (not topdown):
raise NotImplementedError
if onerror:
raise NotImplementedError
roots = [path]
while len(roots):
new_roots = []
for root in roots:
(dirs, files) = storage.listdir(root)
files = [smart_str(... | null | null | null | the file names in a stored directory tree
| codeqa | def walk storage path topdown True onerror None followlinks False storage private storage if not topdown raise Not Implemented Errorif onerror raise Not Implemented Errorroots [path]while len roots new roots []for root in roots dirs files storage listdir root files [smart str f for f in files]dirs [smart str d for d in... | null | null | null | null | Question:
What does the code generate by walking the tree top - down ?
Code:
def walk_storage(path, topdown=True, onerror=None, followlinks=False, storage=private_storage):
if (not topdown):
raise NotImplementedError
if onerror:
raise NotImplementedError
roots = [path]
while len(roots):
new_roots = []
f... |
null | null | null | How does the code walk the tree ?
| def walk_storage(path, topdown=True, onerror=None, followlinks=False, storage=private_storage):
if (not topdown):
raise NotImplementedError
if onerror:
raise NotImplementedError
roots = [path]
while len(roots):
new_roots = []
for root in roots:
(dirs, files) = storage.listdir(root)
files = [smart_str(... | null | null | null | top - down
| codeqa | def walk storage path topdown True onerror None followlinks False storage private storage if not topdown raise Not Implemented Errorif onerror raise Not Implemented Errorroots [path]while len roots new roots []for root in roots dirs files storage listdir root files [smart str f for f in files]dirs [smart str d for d in... | null | null | null | null | Question:
How does the code walk the tree ?
Code:
def walk_storage(path, topdown=True, onerror=None, followlinks=False, storage=private_storage):
if (not topdown):
raise NotImplementedError
if onerror:
raise NotImplementedError
roots = [path]
while len(roots):
new_roots = []
for root in roots:
(dirs,... |
null | null | null | What runs prefetches on all instances ?
| def prefetch_one_level(instances, prefetcher, attname):
(rel_qs, rel_obj_attr, instance_attr, single, cache_name) = prefetcher.get_prefetch_queryset(instances)
additional_prl = getattr(rel_qs, '_prefetch_related_lookups', [])
if additional_prl:
rel_qs._prefetch_related_lookups = []
all_related_objects = list(rel_... | null | null | null | helper function for prefetch_related_objects
| codeqa | def prefetch one level instances prefetcher attname rel qs rel obj attr instance attr single cache name prefetcher get prefetch query set instances additional prl getattr rel qs ' prefetch related lookups' [] if additional prl rel qs prefetch related lookups []all related objects list rel qs rel obj cache {}for rel obj... | null | null | null | null | Question:
What runs prefetches on all instances ?
Code:
def prefetch_one_level(instances, prefetcher, attname):
(rel_qs, rel_obj_attr, instance_attr, single, cache_name) = prefetcher.get_prefetch_queryset(instances)
additional_prl = getattr(rel_qs, '_prefetch_related_lookups', [])
if additional_prl:
rel_qs._pr... |
null | null | null | What does the code get ?
| def getEvaluatedLinkValue(elementNode, word):
if (word == ''):
return ''
if getStartsWithCurlyEqualRoundSquare(word):
return getEvaluatedExpressionValue(elementNode, word)
return word
| null | null | null | the evaluated link value
| codeqa | def get Evaluated Link Value element Node word if word '' return ''if get Starts With Curly Equal Round Square word return get Evaluated Expression Value element Node word return word
| null | null | null | null | Question:
What does the code get ?
Code:
def getEvaluatedLinkValue(elementNode, word):
if (word == ''):
return ''
if getStartsWithCurlyEqualRoundSquare(word):
return getEvaluatedExpressionValue(elementNode, word)
return word
|
null | null | null | What does the code create ?
| def create_node(args):
node = query(method='servers', args=args, http_method='post')
action = query(method='servers', server_id=node['server']['id'], command='action', args={'action': 'poweron'}, http_method='post')
return node
| null | null | null | a node
| codeqa | def create node args node query method 'servers' args args http method 'post' action query method 'servers' server id node['server']['id'] command 'action' args {'action' 'poweron'} http method 'post' return node
| null | null | null | null | Question:
What does the code create ?
Code:
def create_node(args):
node = query(method='servers', args=args, http_method='post')
action = query(method='servers', server_id=node['server']['id'], command='action', args={'action': 'poweron'}, http_method='post')
return node
|
null | null | null | What does the code add to the media ?
| def libvlc_media_add_option(p_md, psz_options):
f = (_Cfunctions.get('libvlc_media_add_option', None) or _Cfunction('libvlc_media_add_option', ((1,), (1,)), None, None, Media, ctypes.c_char_p))
return f(p_md, psz_options)
| null | null | null | an option
| codeqa | def libvlc media add option p md psz options f Cfunctions get 'libvlc media add option' None or Cfunction 'libvlc media add option' 1 1 None None Media ctypes c char p return f p md psz options
| null | null | null | null | Question:
What does the code add to the media ?
Code:
def libvlc_media_add_option(p_md, psz_options):
f = (_Cfunctions.get('libvlc_media_add_option', None) or _Cfunction('libvlc_media_add_option', ((1,), (1,)), None, None, Media, ctypes.c_char_p))
return f(p_md, psz_options)
|
null | null | null | How is given distribution object installed ?
| def dist_is_local(dist):
return is_local(dist_location(dist))
| null | null | null | locally
| codeqa | def dist is local dist return is local dist location dist
| null | null | null | null | Question:
How is given distribution object installed ?
Code:
def dist_is_local(dist):
return is_local(dist_location(dist))
|
null | null | null | What do translation files provide ?
| def get_date_formats():
warnings.warn("'django.utils.translation.get_date_formats' is deprecated. Please update your code to use the new i18n aware formatting.", PendingDeprecationWarning)
from google.appengine._internal.django.conf import settings
date_format = ugettext('DATE_FORMAT')
datetime_format ... | null | null | null | a translation for some technical message i d to store date and time formats
| codeqa | def get date formats warnings warn "'django utils translation get date formats'isdeprecated Pleaseupdateyourcodetousethenewi 18 nawareformatting " Pending Deprecation Warning from google appengine internal django conf import settingsdate format ugettext 'DATE FORMAT' datetime format ugettext 'DATETIME FORMAT' time form... | null | null | null | null | Question:
What do translation files provide ?
Code:
def get_date_formats():
warnings.warn("'django.utils.translation.get_date_formats' is deprecated. Please update your code to use the new i18n aware formatting.", PendingDeprecationWarning)
from google.appengine._internal.django.conf import settings
... |
null | null | null | What provide a translation for some technical message i d to store date and time formats ?
| def get_date_formats():
warnings.warn("'django.utils.translation.get_date_formats' is deprecated. Please update your code to use the new i18n aware formatting.", PendingDeprecationWarning)
from google.appengine._internal.django.conf import settings
date_format = ugettext('DATE_FORMAT')
datetime_format ... | null | null | null | translation files
| codeqa | def get date formats warnings warn "'django utils translation get date formats'isdeprecated Pleaseupdateyourcodetousethenewi 18 nawareformatting " Pending Deprecation Warning from google appengine internal django conf import settingsdate format ugettext 'DATE FORMAT' datetime format ugettext 'DATETIME FORMAT' time form... | null | null | null | null | Question:
What provide a translation for some technical message i d to store date and time formats ?
Code:
def get_date_formats():
warnings.warn("'django.utils.translation.get_date_formats' is deprecated. Please update your code to use the new i18n aware formatting.", PendingDeprecationWarning)
from ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.