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 | How does multiple asynchronous operations run ?
| def multi(children, quiet_exceptions=()):
if _contains_yieldpoint(children):
return MultiYieldPoint(children, quiet_exceptions=quiet_exceptions)
else:
return multi_future(children, quiet_exceptions=quiet_exceptions)
| null | null | null | in parallel
| codeqa | def multi children quiet exceptions if contains yieldpoint children return Multi Yield Point children quiet exceptions quiet exceptions else return multi future children quiet exceptions quiet exceptions
| null | null | null | null | Question:
How does multiple asynchronous operations run ?
Code:
def multi(children, quiet_exceptions=()):
if _contains_yieldpoint(children):
return MultiYieldPoint(children, quiet_exceptions=quiet_exceptions)
else:
return multi_future(children, quiet_exceptions=quiet_exceptions)
|
null | null | null | Does the code get a character and integer string ?
| def getCharacterIntegerString(character, offset, splitLine, stepLength):
floatValue = getFloatFromCharacterSplitLine(character, splitLine)
if (floatValue == None):
return None
floatValue += offset
integerValue = int(round(float((floatValue / stepLength))))
return (character + str(integerValue))
| null | null | null | Yes
| codeqa | def get Character Integer String character offset split Line step Length float Value get Float From Character Split Line character split Line if float Value None return Nonefloat Value + offsetinteger Value int round float float Value / step Length return character + str integer Value
| null | null | null | null | Question:
Does the code get a character and integer string ?
Code:
def getCharacterIntegerString(character, offset, splitLine, stepLength):
floatValue = getFloatFromCharacterSplitLine(character, splitLine)
if (floatValue == None):
return None
floatValue += offset
integerValue = int(round(float((floatValue / stepLength))))
return (character + str(integerValue))
|
null | null | null | What does the code get ?
| def getCharacterIntegerString(character, offset, splitLine, stepLength):
floatValue = getFloatFromCharacterSplitLine(character, splitLine)
if (floatValue == None):
return None
floatValue += offset
integerValue = int(round(float((floatValue / stepLength))))
return (character + str(integerValue))
| null | null | null | a character and integer string
| codeqa | def get Character Integer String character offset split Line step Length float Value get Float From Character Split Line character split Line if float Value None return Nonefloat Value + offsetinteger Value int round float float Value / step Length return character + str integer Value
| null | null | null | null | Question:
What does the code get ?
Code:
def getCharacterIntegerString(character, offset, splitLine, stepLength):
floatValue = getFloatFromCharacterSplitLine(character, splitLine)
if (floatValue == None):
return None
floatValue += offset
integerValue = int(round(float((floatValue / stepLength))))
return (character + str(integerValue))
|
null | null | null | What does the code make ?
| def patch_signal():
patch_module('signal')
| null | null | null | the signal
| codeqa | def patch signal patch module 'signal'
| null | null | null | null | Question:
What does the code make ?
Code:
def patch_signal():
patch_module('signal')
|
null | null | null | Does the code make the signal ?
| def patch_signal():
patch_module('signal')
| null | null | null | Yes
| codeqa | def patch signal patch module 'signal'
| null | null | null | null | Question:
Does the code make the signal ?
Code:
def patch_signal():
patch_module('signal')
|
null | null | null | When did thread create ?
| def track_thread_created_event(request, course, thread, followed):
event_name = _EVENT_NAME_TEMPLATE.format(obj_type='thread', action_name='created')
event_data = {'commentable_id': thread.commentable_id, 'group_id': thread.get('group_id'), 'thread_type': thread.thread_type, 'title': thread.title, 'anonymous': thread.anonymous, 'anonymous_to_peers': thread.anonymous_to_peers, 'options': {'followed': followed}}
track_created_event(request, event_name, course, thread, event_data)
| null | null | null | newly
| codeqa | def track thread created event request course thread followed event name EVENT NAME TEMPLATE format obj type 'thread' action name 'created' event data {'commentable id' thread commentable id 'group id' thread get 'group id' 'thread type' thread thread type 'title' thread title 'anonymous' thread anonymous 'anonymous to peers' thread anonymous to peers 'options' {'followed' followed}}track created event request event name course thread event data
| null | null | null | null | Question:
When did thread create ?
Code:
def track_thread_created_event(request, course, thread, followed):
event_name = _EVENT_NAME_TEMPLATE.format(obj_type='thread', action_name='created')
event_data = {'commentable_id': thread.commentable_id, 'group_id': thread.get('group_id'), 'thread_type': thread.thread_type, 'title': thread.title, 'anonymous': thread.anonymous, 'anonymous_to_peers': thread.anonymous_to_peers, 'options': {'followed': followed}}
track_created_event(request, event_name, course, thread, event_data)
|
null | null | null | In which direction did any non - string objects pass to strings ?
| def html_escape(s):
if (s is None):
return ''
if (not isinstance(s, basestring)):
if hasattr(s, '__unicode__'):
s = unicode(s)
else:
s = str(s)
s = cgi.escape(s, True)
if isinstance(s, unicode):
s = s.encode('ascii', 'xmlcharrefreplace')
return s
| null | null | null | into it
| codeqa | def html escape s if s is None return ''if not isinstance s basestring if hasattr s ' unicode ' s unicode s else s str s s cgi escape s True if isinstance s unicode s s encode 'ascii' 'xmlcharrefreplace' return s
| 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 ''
if (not isinstance(s, basestring)):
if hasattr(s, '__unicode__'):
s = unicode(s)
else:
s = str(s)
s = cgi.escape(s, True)
if isinstance(s, unicode):
s = s.encode('ascii', 'xmlcharrefreplace')
return s
|
null | null | null | What converts any non - string objects passed into it to strings actually ?
| def html_escape(s):
if (s is None):
return ''
if (not isinstance(s, basestring)):
if hasattr(s, '__unicode__'):
s = unicode(s)
else:
s = str(s)
s = cgi.escape(s, True)
if isinstance(s, unicode):
s = s.encode('ascii', 'xmlcharrefreplace')
return s
| null | null | null | this
| codeqa | def html escape s if s is None return ''if not isinstance s basestring if hasattr s ' unicode ' s unicode s else s str s s cgi escape s True if isinstance s unicode s s encode 'ascii' 'xmlcharrefreplace' return s
| null | null | null | null | Question:
What converts any non - string objects passed into it to strings actually ?
Code:
def html_escape(s):
if (s is None):
return ''
if (not isinstance(s, basestring)):
if hasattr(s, '__unicode__'):
s = unicode(s)
else:
s = str(s)
s = cgi.escape(s, True)
if isinstance(s, unicode):
s = s.encode('ascii', 'xmlcharrefreplace')
return 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 ''
if (not isinstance(s, basestring)):
if hasattr(s, '__unicode__'):
s = unicode(s)
else:
s = str(s)
s = cgi.escape(s, True)
if isinstance(s, unicode):
s = s.encode('ascii', 'xmlcharrefreplace')
return s
| null | null | null | Yes
| codeqa | def html escape s if s is None return ''if not isinstance s basestring if hasattr s ' unicode ' s unicode s else s str s s cgi escape s True if isinstance s unicode s s encode 'ascii' 'xmlcharrefreplace' return s
| 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 ''
if (not isinstance(s, basestring)):
if hasattr(s, '__unicode__'):
s = unicode(s)
else:
s = str(s)
s = cgi.escape(s, True)
if isinstance(s, unicode):
s = s.encode('ascii', 'xmlcharrefreplace')
return s
|
null | null | null | Does the code send an image ?
| def image_send_notification(bytes_written, expected_size, image_meta, request, notifier):
try:
context = request.context
payload = {'bytes_sent': bytes_written, 'image_id': image_meta['id'], 'owner_id': image_meta['owner'], 'receiver_tenant_id': context.tenant, 'receiver_user_id': context.user, 'destination_ip': request.remote_addr}
if (bytes_written != expected_size):
notify = notifier.error
else:
notify = notifier.info
notify('image.send', payload)
except Exception as err:
msg = (_LE('An error occurred during image.send notification: %(err)s') % {'err': err})
LOG.error(msg)
| null | null | null | Yes
| codeqa | def image send notification bytes written expected size image meta request notifier try context request contextpayload {'bytes sent' bytes written 'image id' image meta['id'] 'owner id' image meta['owner'] 'receiver tenant id' context tenant 'receiver user id' context user 'destination ip' request remote addr}if bytes written expected size notify notifier errorelse notify notifier infonotify 'image send' payload except Exception as err msg LE ' Anerroroccurredduringimage sendnotification % err s' % {'err' err} LOG error msg
| null | null | null | null | Question:
Does the code send an image ?
Code:
def image_send_notification(bytes_written, expected_size, image_meta, request, notifier):
try:
context = request.context
payload = {'bytes_sent': bytes_written, 'image_id': image_meta['id'], 'owner_id': image_meta['owner'], 'receiver_tenant_id': context.tenant, 'receiver_user_id': context.user, 'destination_ip': request.remote_addr}
if (bytes_written != expected_size):
notify = notifier.error
else:
notify = notifier.info
notify('image.send', payload)
except Exception as err:
msg = (_LE('An error occurred during image.send notification: %(err)s') % {'err': err})
LOG.error(msg)
|
null | null | null | What does the code send ?
| def image_send_notification(bytes_written, expected_size, image_meta, request, notifier):
try:
context = request.context
payload = {'bytes_sent': bytes_written, 'image_id': image_meta['id'], 'owner_id': image_meta['owner'], 'receiver_tenant_id': context.tenant, 'receiver_user_id': context.user, 'destination_ip': request.remote_addr}
if (bytes_written != expected_size):
notify = notifier.error
else:
notify = notifier.info
notify('image.send', payload)
except Exception as err:
msg = (_LE('An error occurred during image.send notification: %(err)s') % {'err': err})
LOG.error(msg)
| null | null | null | an image
| codeqa | def image send notification bytes written expected size image meta request notifier try context request contextpayload {'bytes sent' bytes written 'image id' image meta['id'] 'owner id' image meta['owner'] 'receiver tenant id' context tenant 'receiver user id' context user 'destination ip' request remote addr}if bytes written expected size notify notifier errorelse notify notifier infonotify 'image send' payload except Exception as err msg LE ' Anerroroccurredduringimage sendnotification % err s' % {'err' err} LOG error msg
| null | null | null | null | Question:
What does the code send ?
Code:
def image_send_notification(bytes_written, expected_size, image_meta, request, notifier):
try:
context = request.context
payload = {'bytes_sent': bytes_written, 'image_id': image_meta['id'], 'owner_id': image_meta['owner'], 'receiver_tenant_id': context.tenant, 'receiver_user_id': context.user, 'destination_ip': request.remote_addr}
if (bytes_written != expected_size):
notify = notifier.error
else:
notify = notifier.info
notify('image.send', payload)
except Exception as err:
msg = (_LE('An error occurred during image.send notification: %(err)s') % {'err': err})
LOG.error(msg)
|
null | null | null | What do the template engine render ?
| @register.tag
def verbatim(parser, token):
nodelist = parser.parse((u'endverbatim',))
parser.delete_first_token()
return VerbatimNode(nodelist.render(Context()))
| null | null | null | the contents of this block tag
| codeqa | @register tagdef verbatim parser token nodelist parser parse u'endverbatim' parser delete first token return Verbatim Node nodelist render Context
| null | null | null | null | Question:
What do the template engine render ?
Code:
@register.tag
def verbatim(parser, token):
nodelist = parser.parse((u'endverbatim',))
parser.delete_first_token()
return VerbatimNode(nodelist.render(Context()))
|
null | null | null | What does the code stop from rendering the contents of this block tag ?
| @register.tag
def verbatim(parser, token):
nodelist = parser.parse((u'endverbatim',))
parser.delete_first_token()
return VerbatimNode(nodelist.render(Context()))
| null | null | null | the template engine
| codeqa | @register tagdef verbatim parser token nodelist parser parse u'endverbatim' parser delete first token return Verbatim Node nodelist render Context
| null | null | null | null | Question:
What does the code stop from rendering the contents of this block tag ?
Code:
@register.tag
def verbatim(parser, token):
nodelist = parser.parse((u'endverbatim',))
parser.delete_first_token()
return VerbatimNode(nodelist.render(Context()))
|
null | null | null | What is rendering the contents of this block tag ?
| @register.tag
def verbatim(parser, token):
nodelist = parser.parse((u'endverbatim',))
parser.delete_first_token()
return VerbatimNode(nodelist.render(Context()))
| null | null | null | the template engine
| codeqa | @register tagdef verbatim parser token nodelist parser parse u'endverbatim' parser delete first token return Verbatim Node nodelist render Context
| null | null | null | null | Question:
What is rendering the contents of this block tag ?
Code:
@register.tag
def verbatim(parser, token):
nodelist = parser.parse((u'endverbatim',))
parser.delete_first_token()
return VerbatimNode(nodelist.render(Context()))
|
null | null | null | Does the code stop the template engine from rendering the contents of this block tag ?
| @register.tag
def verbatim(parser, token):
nodelist = parser.parse((u'endverbatim',))
parser.delete_first_token()
return VerbatimNode(nodelist.render(Context()))
| null | null | null | Yes
| codeqa | @register tagdef verbatim parser token nodelist parser parse u'endverbatim' parser delete first token return Verbatim Node nodelist render Context
| null | null | null | null | Question:
Does the code stop the template engine from rendering the contents of this block tag ?
Code:
@register.tag
def verbatim(parser, token):
nodelist = parser.parse((u'endverbatim',))
parser.delete_first_token()
return VerbatimNode(nodelist.render(Context()))
|
null | null | null | Do the template engine render the contents of this block tag ?
| @register.tag
def verbatim(parser, token):
nodelist = parser.parse((u'endverbatim',))
parser.delete_first_token()
return VerbatimNode(nodelist.render(Context()))
| null | null | null | Yes
| codeqa | @register tagdef verbatim parser token nodelist parser parse u'endverbatim' parser delete first token return Verbatim Node nodelist render Context
| null | null | null | null | Question:
Do the template engine render the contents of this block tag ?
Code:
@register.tag
def verbatim(parser, token):
nodelist = parser.parse((u'endverbatim',))
parser.delete_first_token()
return VerbatimNode(nodelist.render(Context()))
|
null | null | null | What does the code add to all supplied numbers ?
| @shared_task(bind=True)
def add_to_all(self, nums, val):
subtasks = [add.s(num, val) for num in nums]
raise self.replace(group(*subtasks))
| null | null | null | the given value
| codeqa | @shared task bind True def add to all self nums val subtasks [add s num val for num in nums]raise self replace group *subtasks
| null | null | null | null | Question:
What does the code add to all supplied numbers ?
Code:
@shared_task(bind=True)
def add_to_all(self, nums, val):
subtasks = [add.s(num, val) for num in nums]
raise self.replace(group(*subtasks))
|
null | null | null | Does the code add the given value to all supplied numbers ?
| @shared_task(bind=True)
def add_to_all(self, nums, val):
subtasks = [add.s(num, val) for num in nums]
raise self.replace(group(*subtasks))
| null | null | null | Yes
| codeqa | @shared task bind True def add to all self nums val subtasks [add s num val for num in nums]raise self replace group *subtasks
| null | null | null | null | Question:
Does the code add the given value to all supplied numbers ?
Code:
@shared_task(bind=True)
def add_to_all(self, nums, val):
subtasks = [add.s(num, val) for num in nums]
raise self.replace(group(*subtasks))
|
null | null | null | Does the code get a list of inventories ?
| @webob.dec.wsgify
@util.check_accept('application/json')
def get_inventories(req):
context = req.environ['placement.context']
uuid = util.wsgi_path_item(req.environ, 'uuid')
try:
resource_provider = objects.ResourceProvider.get_by_uuid(context, uuid)
except exception.NotFound as exc:
raise webob.exc.HTTPNotFound((_('No resource provider with uuid %(uuid)s found : %(error)s') % {'uuid': uuid, 'error': exc}), json_formatter=util.json_error_formatter)
inventories = objects.InventoryList.get_all_by_resource_provider_uuid(context, resource_provider.uuid)
return _send_inventories(req.response, resource_provider, inventories)
| null | null | null | Yes
| codeqa | @webob dec wsgify@util check accept 'application/json' def get inventories req context req environ['placement context']uuid util wsgi path item req environ 'uuid' try resource provider objects Resource Provider get by uuid context uuid except exception Not Found as exc raise webob exc HTTP Not Found ' Noresourceproviderwithuuid% uuid sfound % error s' % {'uuid' uuid 'error' exc} json formatter util json error formatter inventories objects Inventory List get all by resource provider uuid context resource provider uuid return send inventories req response resource provider inventories
| null | null | null | null | Question:
Does the code get a list of inventories ?
Code:
@webob.dec.wsgify
@util.check_accept('application/json')
def get_inventories(req):
context = req.environ['placement.context']
uuid = util.wsgi_path_item(req.environ, 'uuid')
try:
resource_provider = objects.ResourceProvider.get_by_uuid(context, uuid)
except exception.NotFound as exc:
raise webob.exc.HTTPNotFound((_('No resource provider with uuid %(uuid)s found : %(error)s') % {'uuid': uuid, 'error': exc}), json_formatter=util.json_error_formatter)
inventories = objects.InventoryList.get_all_by_resource_provider_uuid(context, resource_provider.uuid)
return _send_inventories(req.response, resource_provider, inventories)
|
null | null | null | What does the code get ?
| @webob.dec.wsgify
@util.check_accept('application/json')
def get_inventories(req):
context = req.environ['placement.context']
uuid = util.wsgi_path_item(req.environ, 'uuid')
try:
resource_provider = objects.ResourceProvider.get_by_uuid(context, uuid)
except exception.NotFound as exc:
raise webob.exc.HTTPNotFound((_('No resource provider with uuid %(uuid)s found : %(error)s') % {'uuid': uuid, 'error': exc}), json_formatter=util.json_error_formatter)
inventories = objects.InventoryList.get_all_by_resource_provider_uuid(context, resource_provider.uuid)
return _send_inventories(req.response, resource_provider, inventories)
| null | null | null | a list of inventories
| codeqa | @webob dec wsgify@util check accept 'application/json' def get inventories req context req environ['placement context']uuid util wsgi path item req environ 'uuid' try resource provider objects Resource Provider get by uuid context uuid except exception Not Found as exc raise webob exc HTTP Not Found ' Noresourceproviderwithuuid% uuid sfound % error s' % {'uuid' uuid 'error' exc} json formatter util json error formatter inventories objects Inventory List get all by resource provider uuid context resource provider uuid return send inventories req response resource provider inventories
| null | null | null | null | Question:
What does the code get ?
Code:
@webob.dec.wsgify
@util.check_accept('application/json')
def get_inventories(req):
context = req.environ['placement.context']
uuid = util.wsgi_path_item(req.environ, 'uuid')
try:
resource_provider = objects.ResourceProvider.get_by_uuid(context, uuid)
except exception.NotFound as exc:
raise webob.exc.HTTPNotFound((_('No resource provider with uuid %(uuid)s found : %(error)s') % {'uuid': uuid, 'error': exc}), json_formatter=util.json_error_formatter)
inventories = objects.InventoryList.get_all_by_resource_provider_uuid(context, resource_provider.uuid)
return _send_inventories(req.response, resource_provider, inventories)
|
null | null | null | How do a frame relation type print ?
| def _pretty_frame_relation_type(freltyp):
outstr = u'<frame relation type ({0.ID}): {0.superFrameName} -- {0.name} -> {0.subFrameName}>'.format(freltyp)
return outstr
| null | null | null | pretty
| codeqa | def pretty frame relation type freltyp outstr u'<framerelationtype {0 ID} {0 super Frame Name}--{ 0 name}->{ 0 sub Frame Name}>' format freltyp return outstr
| null | null | null | null | Question:
How do a frame relation type print ?
Code:
def _pretty_frame_relation_type(freltyp):
outstr = u'<frame relation type ({0.ID}): {0.superFrameName} -- {0.name} -> {0.subFrameName}>'.format(freltyp)
return outstr
|
null | null | null | Does the code delete a role policy ?
| def delete_role_policy(role_name, policy_name, region=None, key=None, keyid=None, profile=None):
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
_policy = get_role_policy(role_name, policy_name, region, key, keyid, profile)
if (not _policy):
return True
try:
conn.delete_role_policy(role_name, policy_name)
msg = 'Successfully deleted {0} policy for role {1}.'
log.info(msg.format(policy_name, role_name))
return True
except boto.exception.BotoServerError as e:
log.debug(e)
msg = 'Failed to delete {0} policy for role {1}.'
log.error(msg.format(policy_name, role_name))
return False
| null | null | null | Yes
| codeqa | def delete role policy role name policy name region None key None keyid None profile None conn get conn region region key key keyid keyid profile profile policy get role policy role name policy name region key keyid profile if not policy return Truetry conn delete role policy role name policy name msg ' Successfullydeleted{ 0 }policyforrole{ 1 } 'log info msg format policy name role name return Trueexcept boto exception Boto Server Error as e log debug e msg ' Failedtodelete{ 0 }policyforrole{ 1 } 'log error msg format policy name role name return False
| null | null | null | null | Question:
Does the code delete a role policy ?
Code:
def delete_role_policy(role_name, policy_name, region=None, key=None, keyid=None, profile=None):
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
_policy = get_role_policy(role_name, policy_name, region, key, keyid, profile)
if (not _policy):
return True
try:
conn.delete_role_policy(role_name, policy_name)
msg = 'Successfully deleted {0} policy for role {1}.'
log.info(msg.format(policy_name, role_name))
return True
except boto.exception.BotoServerError as e:
log.debug(e)
msg = 'Failed to delete {0} policy for role {1}.'
log.error(msg.format(policy_name, role_name))
return False
|
null | null | null | What does the code delete ?
| def delete_role_policy(role_name, policy_name, region=None, key=None, keyid=None, profile=None):
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
_policy = get_role_policy(role_name, policy_name, region, key, keyid, profile)
if (not _policy):
return True
try:
conn.delete_role_policy(role_name, policy_name)
msg = 'Successfully deleted {0} policy for role {1}.'
log.info(msg.format(policy_name, role_name))
return True
except boto.exception.BotoServerError as e:
log.debug(e)
msg = 'Failed to delete {0} policy for role {1}.'
log.error(msg.format(policy_name, role_name))
return False
| null | null | null | a role policy
| codeqa | def delete role policy role name policy name region None key None keyid None profile None conn get conn region region key key keyid keyid profile profile policy get role policy role name policy name region key keyid profile if not policy return Truetry conn delete role policy role name policy name msg ' Successfullydeleted{ 0 }policyforrole{ 1 } 'log info msg format policy name role name return Trueexcept boto exception Boto Server Error as e log debug e msg ' Failedtodelete{ 0 }policyforrole{ 1 } 'log error msg format policy name role name return False
| null | null | null | null | Question:
What does the code delete ?
Code:
def delete_role_policy(role_name, policy_name, region=None, key=None, keyid=None, profile=None):
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
_policy = get_role_policy(role_name, policy_name, region, key, keyid, profile)
if (not _policy):
return True
try:
conn.delete_role_policy(role_name, policy_name)
msg = 'Successfully deleted {0} policy for role {1}.'
log.info(msg.format(policy_name, role_name))
return True
except boto.exception.BotoServerError as e:
log.debug(e)
msg = 'Failed to delete {0} policy for role {1}.'
log.error(msg.format(policy_name, role_name))
return False
|
null | null | null | Are keys are line numbers in the line number table where ?
| def find_executable_linenos(filename):
try:
prog = open(filename, 'rU').read()
except IOError as err:
print >>sys.stderr, ('Not printing coverage data for %r: %s' % (filename, err))
return {}
code = compile(prog, filename, 'exec')
strs = find_strings(filename)
return find_lines(code, strs)
| null | null | null | Yes
| codeqa | def find executable linenos filename try prog open filename 'r U' read except IO Error as err print >>sys stderr ' Notprintingcoveragedatafor%r %s' % filename err return {}code compile prog filename 'exec' strs find strings filename return find lines code strs
| null | null | null | null | Question:
Are keys are line numbers in the line number table where ?
Code:
def find_executable_linenos(filename):
try:
prog = open(filename, 'rU').read()
except IOError as err:
print >>sys.stderr, ('Not printing coverage data for %r: %s' % (filename, err))
return {}
code = compile(prog, filename, 'exec')
strs = find_strings(filename)
return find_lines(code, strs)
|
null | null | null | Where are keys are line numbers in the line number table ?
| def find_executable_linenos(filename):
try:
prog = open(filename, 'rU').read()
except IOError as err:
print >>sys.stderr, ('Not printing coverage data for %r: %s' % (filename, err))
return {}
code = compile(prog, filename, 'exec')
strs = find_strings(filename)
return find_lines(code, strs)
| null | null | null | where
| codeqa | def find executable linenos filename try prog open filename 'r U' read except IO Error as err print >>sys stderr ' Notprintingcoveragedatafor%r %s' % filename err return {}code compile prog filename 'exec' strs find strings filename return find lines code strs
| null | null | null | null | Question:
Where are keys are line numbers in the line number table ?
Code:
def find_executable_linenos(filename):
try:
prog = open(filename, 'rU').read()
except IOError as err:
print >>sys.stderr, ('Not printing coverage data for %r: %s' % (filename, err))
return {}
code = compile(prog, filename, 'exec')
strs = find_strings(filename)
return find_lines(code, strs)
|
null | null | null | How do that commit ?
| def autocommit(func):
def _autocommit(*args, **kw):
try:
enter_transaction_management()
managed(False)
return func(*args, **kw)
finally:
leave_transaction_management()
return _autocommit
| null | null | null | on save
| codeqa | def autocommit func def autocommit *args **kw try enter transaction management managed False return func *args **kw finally leave transaction management return autocommit
| null | null | null | null | Question:
How do that commit ?
Code:
def autocommit(func):
def _autocommit(*args, **kw):
try:
enter_transaction_management()
managed(False)
return func(*args, **kw)
finally:
leave_transaction_management()
return _autocommit
|
null | null | null | Does the code get the project root directory ?
| def get_project_root():
settings_mod = __import__(settings.SETTINGS_MODULE, {}, {}, [''])
return os.path.dirname(os.path.abspath(settings_mod.__file__))
| null | null | null | Yes
| codeqa | def get project root settings mod import settings SETTINGS MODULE {} {} [''] return os path dirname os path abspath settings mod file
| null | null | null | null | Question:
Does the code get the project root directory ?
Code:
def get_project_root():
settings_mod = __import__(settings.SETTINGS_MODULE, {}, {}, [''])
return os.path.dirname(os.path.abspath(settings_mod.__file__))
|
null | null | null | What does the code get ?
| def get_project_root():
settings_mod = __import__(settings.SETTINGS_MODULE, {}, {}, [''])
return os.path.dirname(os.path.abspath(settings_mod.__file__))
| null | null | null | the project root directory
| codeqa | def get project root settings mod import settings SETTINGS MODULE {} {} [''] return os path dirname os path abspath settings mod file
| null | null | null | null | Question:
What does the code get ?
Code:
def get_project_root():
settings_mod = __import__(settings.SETTINGS_MODULE, {}, {}, [''])
return os.path.dirname(os.path.abspath(settings_mod.__file__))
|
null | null | null | What splits a command line into a list of arguments ?
| def split_command_line(command_line):
arg_list = []
arg = ''
state_basic = 0
state_esc = 1
state_singlequote = 2
state_doublequote = 3
state_whitespace = 4
state = state_basic
for c in command_line:
if ((state == state_basic) or (state == state_whitespace)):
if (c == '\\'):
state = state_esc
elif (c == "'"):
state = state_singlequote
elif (c == '"'):
state = state_doublequote
elif c.isspace():
if (state == state_whitespace):
None
else:
arg_list.append(arg)
arg = ''
state = state_whitespace
else:
arg = (arg + c)
state = state_basic
elif (state == state_esc):
arg = (arg + c)
state = state_basic
elif (state == state_singlequote):
if (c == "'"):
state = state_basic
else:
arg = (arg + c)
elif (state == state_doublequote):
if (c == '"'):
state = state_basic
else:
arg = (arg + c)
if (arg != ''):
arg_list.append(arg)
return arg_list
| null | null | null | this
| codeqa | def split command line command line arg list []arg ''state basic 0state esc 1state singlequote 2state doublequote 3state whitespace 4state state basicfor c in command line if state state basic or state state whitespace if c '\\' state state escelif c "'" state state singlequoteelif c '"' state state doublequoteelif c isspace if state state whitespace Noneelse arg list append arg arg ''state state whitespaceelse arg arg + c state state basicelif state state esc arg arg + c state state basicelif state state singlequote if c "'" state state basicelse arg arg + c elif state state doublequote if c '"' state state basicelse arg arg + c if arg '' arg list append arg return arg list
| null | null | null | null | Question:
What splits a command line into a list of arguments ?
Code:
def split_command_line(command_line):
arg_list = []
arg = ''
state_basic = 0
state_esc = 1
state_singlequote = 2
state_doublequote = 3
state_whitespace = 4
state = state_basic
for c in command_line:
if ((state == state_basic) or (state == state_whitespace)):
if (c == '\\'):
state = state_esc
elif (c == "'"):
state = state_singlequote
elif (c == '"'):
state = state_doublequote
elif c.isspace():
if (state == state_whitespace):
None
else:
arg_list.append(arg)
arg = ''
state = state_whitespace
else:
arg = (arg + c)
state = state_basic
elif (state == state_esc):
arg = (arg + c)
state = state_basic
elif (state == state_singlequote):
if (c == "'"):
state = state_basic
else:
arg = (arg + c)
elif (state == state_doublequote):
if (c == '"'):
state = state_basic
else:
arg = (arg + c)
if (arg != ''):
arg_list.append(arg)
return arg_list
|
null | null | null | What does this split into a list of arguments ?
| def split_command_line(command_line):
arg_list = []
arg = ''
state_basic = 0
state_esc = 1
state_singlequote = 2
state_doublequote = 3
state_whitespace = 4
state = state_basic
for c in command_line:
if ((state == state_basic) or (state == state_whitespace)):
if (c == '\\'):
state = state_esc
elif (c == "'"):
state = state_singlequote
elif (c == '"'):
state = state_doublequote
elif c.isspace():
if (state == state_whitespace):
None
else:
arg_list.append(arg)
arg = ''
state = state_whitespace
else:
arg = (arg + c)
state = state_basic
elif (state == state_esc):
arg = (arg + c)
state = state_basic
elif (state == state_singlequote):
if (c == "'"):
state = state_basic
else:
arg = (arg + c)
elif (state == state_doublequote):
if (c == '"'):
state = state_basic
else:
arg = (arg + c)
if (arg != ''):
arg_list.append(arg)
return arg_list
| null | null | null | a command line
| codeqa | def split command line command line arg list []arg ''state basic 0state esc 1state singlequote 2state doublequote 3state whitespace 4state state basicfor c in command line if state state basic or state state whitespace if c '\\' state state escelif c "'" state state singlequoteelif c '"' state state doublequoteelif c isspace if state state whitespace Noneelse arg list append arg arg ''state state whitespaceelse arg arg + c state state basicelif state state esc arg arg + c state state basicelif state state singlequote if c "'" state state basicelse arg arg + c elif state state doublequote if c '"' state state basicelse arg arg + c if arg '' arg list append arg return arg list
| null | null | null | null | Question:
What does this split into a list of arguments ?
Code:
def split_command_line(command_line):
arg_list = []
arg = ''
state_basic = 0
state_esc = 1
state_singlequote = 2
state_doublequote = 3
state_whitespace = 4
state = state_basic
for c in command_line:
if ((state == state_basic) or (state == state_whitespace)):
if (c == '\\'):
state = state_esc
elif (c == "'"):
state = state_singlequote
elif (c == '"'):
state = state_doublequote
elif c.isspace():
if (state == state_whitespace):
None
else:
arg_list.append(arg)
arg = ''
state = state_whitespace
else:
arg = (arg + c)
state = state_basic
elif (state == state_esc):
arg = (arg + c)
state = state_basic
elif (state == state_singlequote):
if (c == "'"):
state = state_basic
else:
arg = (arg + c)
elif (state == state_doublequote):
if (c == '"'):
state = state_basic
else:
arg = (arg + c)
if (arg != ''):
arg_list.append(arg)
return arg_list
|
null | null | null | Does this split a command line into a list of arguments ?
| def split_command_line(command_line):
arg_list = []
arg = ''
state_basic = 0
state_esc = 1
state_singlequote = 2
state_doublequote = 3
state_whitespace = 4
state = state_basic
for c in command_line:
if ((state == state_basic) or (state == state_whitespace)):
if (c == '\\'):
state = state_esc
elif (c == "'"):
state = state_singlequote
elif (c == '"'):
state = state_doublequote
elif c.isspace():
if (state == state_whitespace):
None
else:
arg_list.append(arg)
arg = ''
state = state_whitespace
else:
arg = (arg + c)
state = state_basic
elif (state == state_esc):
arg = (arg + c)
state = state_basic
elif (state == state_singlequote):
if (c == "'"):
state = state_basic
else:
arg = (arg + c)
elif (state == state_doublequote):
if (c == '"'):
state = state_basic
else:
arg = (arg + c)
if (arg != ''):
arg_list.append(arg)
return arg_list
| null | null | null | Yes
| codeqa | def split command line command line arg list []arg ''state basic 0state esc 1state singlequote 2state doublequote 3state whitespace 4state state basicfor c in command line if state state basic or state state whitespace if c '\\' state state escelif c "'" state state singlequoteelif c '"' state state doublequoteelif c isspace if state state whitespace Noneelse arg list append arg arg ''state state whitespaceelse arg arg + c state state basicelif state state esc arg arg + c state state basicelif state state singlequote if c "'" state state basicelse arg arg + c elif state state doublequote if c '"' state state basicelse arg arg + c if arg '' arg list append arg return arg list
| null | null | null | null | Question:
Does this split a command line into a list of arguments ?
Code:
def split_command_line(command_line):
arg_list = []
arg = ''
state_basic = 0
state_esc = 1
state_singlequote = 2
state_doublequote = 3
state_whitespace = 4
state = state_basic
for c in command_line:
if ((state == state_basic) or (state == state_whitespace)):
if (c == '\\'):
state = state_esc
elif (c == "'"):
state = state_singlequote
elif (c == '"'):
state = state_doublequote
elif c.isspace():
if (state == state_whitespace):
None
else:
arg_list.append(arg)
arg = ''
state = state_whitespace
else:
arg = (arg + c)
state = state_basic
elif (state == state_esc):
arg = (arg + c)
state = state_basic
elif (state == state_singlequote):
if (c == "'"):
state = state_basic
else:
arg = (arg + c)
elif (state == state_doublequote):
if (c == '"'):
state = state_basic
else:
arg = (arg + c)
if (arg != ''):
arg_list.append(arg)
return arg_list
|
null | null | null | What does a generator yield ?
| def split_buffer(stream, splitter=None, decoder=(lambda a: a)):
splitter = (splitter or line_splitter)
buffered = six.text_type(u'')
for data in stream_as_text(stream):
buffered += data
while True:
buffer_split = splitter(buffered)
if (buffer_split is None):
break
(item, buffered) = buffer_split
(yield item)
if buffered:
(yield decoder(buffered))
| null | null | null | strings and a splitter function
| codeqa | def split buffer stream splitter None decoder lambda a a splitter splitter or line splitter buffered six text type u'' for data in stream as text stream buffered + datawhile True buffer split splitter buffered if buffer split is None break item buffered buffer split yield item if buffered yield decoder buffered
| null | null | null | null | Question:
What does a generator yield ?
Code:
def split_buffer(stream, splitter=None, decoder=(lambda a: a)):
splitter = (splitter or line_splitter)
buffered = six.text_type(u'')
for data in stream_as_text(stream):
buffered += data
while True:
buffer_split = splitter(buffered)
if (buffer_split is None):
break
(item, buffered) = buffer_split
(yield item)
if buffered:
(yield decoder(buffered))
|
null | null | null | Does a generator yield strings and a splitter function ?
| def split_buffer(stream, splitter=None, decoder=(lambda a: a)):
splitter = (splitter or line_splitter)
buffered = six.text_type(u'')
for data in stream_as_text(stream):
buffered += data
while True:
buffer_split = splitter(buffered)
if (buffer_split is None):
break
(item, buffered) = buffer_split
(yield item)
if buffered:
(yield decoder(buffered))
| null | null | null | Yes
| codeqa | def split buffer stream splitter None decoder lambda a a splitter splitter or line splitter buffered six text type u'' for data in stream as text stream buffered + datawhile True buffer split splitter buffered if buffer split is None break item buffered buffer split yield item if buffered yield decoder buffered
| null | null | null | null | Question:
Does a generator yield strings and a splitter function ?
Code:
def split_buffer(stream, splitter=None, decoder=(lambda a: a)):
splitter = (splitter or line_splitter)
buffered = six.text_type(u'')
for data in stream_as_text(stream):
buffered += data
while True:
buffer_split = splitter(buffered)
if (buffer_split is None):
break
(item, buffered) = buffer_split
(yield item)
if buffered:
(yield decoder(buffered))
|
null | null | null | What yields strings and a splitter function ?
| def split_buffer(stream, splitter=None, decoder=(lambda a: a)):
splitter = (splitter or line_splitter)
buffered = six.text_type(u'')
for data in stream_as_text(stream):
buffered += data
while True:
buffer_split = splitter(buffered)
if (buffer_split is None):
break
(item, buffered) = buffer_split
(yield item)
if buffered:
(yield decoder(buffered))
| null | null | null | a generator
| codeqa | def split buffer stream splitter None decoder lambda a a splitter splitter or line splitter buffered six text type u'' for data in stream as text stream buffered + datawhile True buffer split splitter buffered if buffer split is None break item buffered buffer split yield item if buffered yield decoder buffered
| null | null | null | null | Question:
What yields strings and a splitter function ?
Code:
def split_buffer(stream, splitter=None, decoder=(lambda a: a)):
splitter = (splitter or line_splitter)
buffered = six.text_type(u'')
for data in stream_as_text(stream):
buffered += data
while True:
buffer_split = splitter(buffered)
if (buffer_split is None):
break
(item, buffered) = buffer_split
(yield item)
if buffered:
(yield decoder(buffered))
|
null | null | null | What does the code return ?
| def dist(x, y):
d = (x - y)
return np.sqrt(np.dot(d, d))
| null | null | null | the distance between two points
| codeqa | def dist x y d x - y return np sqrt np dot d d
| null | null | null | null | Question:
What does the code return ?
Code:
def dist(x, y):
d = (x - y)
return np.sqrt(np.dot(d, d))
|
null | null | null | Does the code return the distance between two points ?
| def dist(x, y):
d = (x - y)
return np.sqrt(np.dot(d, d))
| null | null | null | Yes
| codeqa | def dist x y d x - y return np sqrt np dot d d
| null | null | null | null | Question:
Does the code return the distance between two points ?
Code:
def dist(x, y):
d = (x - y)
return np.sqrt(np.dot(d, d))
|
null | null | null | When does drivers compute ?
| def stub_set_host_enabled(context, host_name, enabled):
results = {True: 'enabled', False: 'disabled'}
if (host_name == 'notimplemented'):
raise NotImplementedError()
elif (host_name == 'dummydest'):
raise exception.ComputeHostNotFound(host=host_name)
elif (host_name == 'service_not_available'):
raise exception.ComputeServiceUnavailable(host=host_name)
elif (host_name == 'host_c2'):
return results[(not enabled)]
else:
return results[enabled]
| null | null | null | when enabling or disabling a host
| codeqa | def stub set host enabled context host name enabled results { True 'enabled' False 'disabled'}if host name 'notimplemented' raise Not Implemented Error elif host name 'dummydest' raise exception Compute Host Not Found host host name elif host name 'service not available' raise exception Compute Service Unavailable host host name elif host name 'host c2 ' return results[ not enabled ]else return results[enabled]
| null | null | null | null | Question:
When does drivers compute ?
Code:
def stub_set_host_enabled(context, host_name, enabled):
results = {True: 'enabled', False: 'disabled'}
if (host_name == 'notimplemented'):
raise NotImplementedError()
elif (host_name == 'dummydest'):
raise exception.ComputeHostNotFound(host=host_name)
elif (host_name == 'service_not_available'):
raise exception.ComputeServiceUnavailable(host=host_name)
elif (host_name == 'host_c2'):
return results[(not enabled)]
else:
return results[enabled]
|
null | null | null | How do chunks return from file ?
| def iterate_file(file):
while 1:
chunk = file.read(CHUNK_SIZE)
if (not chunk):
break
(yield chunk)
| null | null | null | progressively
| codeqa | def iterate file file while 1 chunk file read CHUNK SIZE if not chunk break yield chunk
| null | null | null | null | Question:
How do chunks return from file ?
Code:
def iterate_file(file):
while 1:
chunk = file.read(CHUNK_SIZE)
if (not chunk):
break
(yield chunk)
|
null | null | null | Does the code save an array as an image ?
| def imsave(name, arr, format=None):
im = toimage(arr, channel_axis=2)
if (format is None):
im.save(name)
else:
im.save(name, format)
return
| null | null | null | Yes
| codeqa | def imsave name arr format None im toimage arr channel axis 2 if format is None im save name else im save name format return
| null | null | null | null | Question:
Does the code save an array as an image ?
Code:
def imsave(name, arr, format=None):
im = toimage(arr, channel_axis=2)
if (format is None):
im.save(name)
else:
im.save(name, format)
return
|
null | null | null | What does the code save as an image ?
| def imsave(name, arr, format=None):
im = toimage(arr, channel_axis=2)
if (format is None):
im.save(name)
else:
im.save(name, format)
return
| null | null | null | an array
| codeqa | def imsave name arr format None im toimage arr channel axis 2 if format is None im save name else im save name format return
| null | null | null | null | Question:
What does the code save as an image ?
Code:
def imsave(name, arr, format=None):
im = toimage(arr, channel_axis=2)
if (format is None):
im.save(name)
else:
im.save(name, format)
return
|
null | null | null | What lib folder ?
| def copy_modified_jars(app_name):
appscale_home = constants.APPSCALE_HOME
app_dir = (('/var/apps/' + app_name) + '/app/')
lib_dir = locate_dir(app_dir, 'lib')
if (not lib_dir):
web_inf_dir = locate_dir(app_dir, 'WEB-INF')
lib_dir = ((web_inf_dir + os.sep) + 'lib')
logging.info('Creating lib directory at: {0}'.format(lib_dir))
mkdir_result = subprocess.call(('mkdir ' + lib_dir), shell=True)
if (mkdir_result != 0):
logging.error('Failed to create missing lib directory in: {0}.'.format(web_inf_dir))
return False
try:
copy_files_matching_pattern(((appscale_home + '/AppServer_Java/') + 'appengine-java-sdk-repacked/lib/user/*.jar'), lib_dir)
copy_files_matching_pattern(((appscale_home + '/AppServer_Java/') + 'appengine-java-sdk-repacked/lib/impl/appscale-*.jar'), lib_dir)
copy_files_matching_pattern('/usr/share/appscale/ext/*', lib_dir)
except IOError as io_error:
logging.error(((('Failed to copy modified jar files to lib directory of ' + app_name) + ' due to:') + str(io_error)))
return False
return True
| null | null | null | the apps
| codeqa | def copy modified jars app name appscale home constants APPSCALE HOM Eapp dir '/var/apps/' + app name + '/app/' lib dir locate dir app dir 'lib' if not lib dir web inf dir locate dir app dir 'WEB-INF' lib dir web inf dir + os sep + 'lib' logging info ' Creatinglibdirectoryat {0 }' format lib dir mkdir result subprocess call 'mkdir' + lib dir shell True if mkdir result 0 logging error ' Failedtocreatemissinglibdirectoryin {0 } ' format web inf dir return Falsetry copy files matching pattern appscale home + '/ App Server Java/' + 'appengine-java-sdk-repacked/lib/user/* jar' lib dir copy files matching pattern appscale home + '/ App Server Java/' + 'appengine-java-sdk-repacked/lib/impl/appscale-* jar' lib dir copy files matching pattern '/usr/share/appscale/ext/*' lib dir except IO Error as io error logging error ' Failedtocopymodifiedjarfilestolibdirectoryof' + app name + 'dueto ' + str io error return Falsereturn True
| null | null | null | null | Question:
What lib folder ?
Code:
def copy_modified_jars(app_name):
appscale_home = constants.APPSCALE_HOME
app_dir = (('/var/apps/' + app_name) + '/app/')
lib_dir = locate_dir(app_dir, 'lib')
if (not lib_dir):
web_inf_dir = locate_dir(app_dir, 'WEB-INF')
lib_dir = ((web_inf_dir + os.sep) + 'lib')
logging.info('Creating lib directory at: {0}'.format(lib_dir))
mkdir_result = subprocess.call(('mkdir ' + lib_dir), shell=True)
if (mkdir_result != 0):
logging.error('Failed to create missing lib directory in: {0}.'.format(web_inf_dir))
return False
try:
copy_files_matching_pattern(((appscale_home + '/AppServer_Java/') + 'appengine-java-sdk-repacked/lib/user/*.jar'), lib_dir)
copy_files_matching_pattern(((appscale_home + '/AppServer_Java/') + 'appengine-java-sdk-repacked/lib/impl/appscale-*.jar'), lib_dir)
copy_files_matching_pattern('/usr/share/appscale/ext/*', lib_dir)
except IOError as io_error:
logging.error(((('Failed to copy modified jar files to lib directory of ' + app_name) + ' due to:') + str(io_error)))
return False
return True
|
null | null | null | Did the code pass a string ?
| def guess_language(text):
(guess, confidence) = classify(text)
if (confidence < 0.7):
return None
elif (confidence < 0.9):
word_count = len(re.findall("[\\w']+", text))
if (word_count <= 3):
return None
return guess
| null | null | null | Yes
| codeqa | def guess language text guess confidence classify text if confidence < 0 7 return Noneelif confidence < 0 9 word count len re findall "[\\w']+" text if word count < 3 return Nonereturn guess
| null | null | null | null | Question:
Did the code pass a string ?
Code:
def guess_language(text):
(guess, confidence) = classify(text)
if (confidence < 0.7):
return None
elif (confidence < 0.9):
word_count = len(re.findall("[\\w']+", text))
if (word_count <= 3):
return None
return guess
|
null | null | null | What did the code pass ?
| def guess_language(text):
(guess, confidence) = classify(text)
if (confidence < 0.7):
return None
elif (confidence < 0.9):
word_count = len(re.findall("[\\w']+", text))
if (word_count <= 3):
return None
return guess
| null | null | null | a string
| codeqa | def guess language text guess confidence classify text if confidence < 0 7 return Noneelif confidence < 0 9 word count len re findall "[\\w']+" text if word count < 3 return Nonereturn guess
| null | null | null | null | Question:
What did the code pass ?
Code:
def guess_language(text):
(guess, confidence) = classify(text)
if (confidence < 0.7):
return None
elif (confidence < 0.9):
word_count = len(re.findall("[\\w']+", text))
if (word_count <= 3):
return None
return guess
|
null | null | null | How do plugin filter expired pages ?
| @pytest.mark.django_db
@pytest.mark.parametrize('show_all_pages', [True, False])
def test_page_links_plugin_hide_expired(show_all_pages):
context = get_jinja_context()
page = create_page(eternal=True, visible_in_menu=True)
another_page = create_page(eternal=True, visible_in_menu=True)
plugin = PageLinksPlugin({'pages': [page.pk, another_page.pk], 'show_all_pages': show_all_pages})
assert (page in plugin.get_context_data(context)['pages'])
page.available_from = None
page.available_to = None
page.save()
assert (page in plugin.get_context_data(context)['pages'])
plugin.config['hide_expired'] = True
pages_in_context = plugin.get_context_data(context)['pages']
assert (page not in pages_in_context)
assert (another_page in pages_in_context)
| null | null | null | correctly
| codeqa | @pytest mark django db@pytest mark parametrize 'show all pages' [ True False] def test page links plugin hide expired show all pages context get jinja context page create page eternal True visible in menu True another page create page eternal True visible in menu True plugin Page Links Plugin {'pages' [page pk another page pk] 'show all pages' show all pages} assert page in plugin get context data context ['pages'] page available from Nonepage available to Nonepage save assert page in plugin get context data context ['pages'] plugin config['hide expired'] Truepages in context plugin get context data context ['pages']assert page not in pages in context assert another page in pages in context
| null | null | null | null | Question:
How do plugin filter expired pages ?
Code:
@pytest.mark.django_db
@pytest.mark.parametrize('show_all_pages', [True, False])
def test_page_links_plugin_hide_expired(show_all_pages):
context = get_jinja_context()
page = create_page(eternal=True, visible_in_menu=True)
another_page = create_page(eternal=True, visible_in_menu=True)
plugin = PageLinksPlugin({'pages': [page.pk, another_page.pk], 'show_all_pages': show_all_pages})
assert (page in plugin.get_context_data(context)['pages'])
page.available_from = None
page.available_to = None
page.save()
assert (page in plugin.get_context_data(context)['pages'])
plugin.config['hide_expired'] = True
pages_in_context = plugin.get_context_data(context)['pages']
assert (page not in pages_in_context)
assert (another_page in pages_in_context)
|
null | null | null | Does the code add a test case to this class ?
| def add_test(cls, test_name, func, *args, **kwargs):
setattr(cls, test_name, feed_data(func, test_name, *args, **kwargs))
| null | null | null | Yes
| codeqa | def add test cls test name func *args **kwargs setattr cls test name feed data func test name *args **kwargs
| null | null | null | null | Question:
Does the code add a test case to this class ?
Code:
def add_test(cls, test_name, func, *args, **kwargs):
setattr(cls, test_name, feed_data(func, test_name, *args, **kwargs))
|
null | null | null | What does the code add to this class ?
| def add_test(cls, test_name, func, *args, **kwargs):
setattr(cls, test_name, feed_data(func, test_name, *args, **kwargs))
| null | null | null | a test case
| codeqa | def add test cls test name func *args **kwargs setattr cls test name feed data func test name *args **kwargs
| null | null | null | null | Question:
What does the code add to this class ?
Code:
def add_test(cls, test_name, func, *args, **kwargs):
setattr(cls, test_name, feed_data(func, test_name, *args, **kwargs))
|
null | null | null | What does a traditional - style method take ?
| def cr_context(method):
method._api = 'cr_context'
return method
| null | null | null | cr
| codeqa | def cr context method method api 'cr context'return method
| null | null | null | null | Question:
What does a traditional - style method take ?
Code:
def cr_context(method):
method._api = 'cr_context'
return method
|
null | null | null | What named tuple ?
| def PackLocation(location):
packed = struct.pack('>ddd', *[float(x) for x in location])
return base64hex.B64HexEncode(packed)
| null | null | null | location
| codeqa | def Pack Location location packed struct pack '>ddd' *[float x for x in location] return base 64 hex B64 Hex Encode packed
| null | null | null | null | Question:
What named tuple ?
Code:
def PackLocation(location):
packed = struct.pack('>ddd', *[float(x) for x in location])
return base64hex.B64HexEncode(packed)
|
null | null | null | How are serial communications working ?
| def testComms():
p = snap.Packet(snap.localAddress, snap.localAddress, 0, 1, [255, 0])
p.send()
notif = _getNotification(serialPort)
if (notif.dataBytes[0] == 255):
return True
return False
| null | null | null | properly
| codeqa | def test Comms p snap Packet snap local Address snap local Address 0 1 [255 0] p send notif get Notification serial Port if notif data Bytes[ 0 ] 255 return Truereturn False
| null | null | null | null | Question:
How are serial communications working ?
Code:
def testComms():
p = snap.Packet(snap.localAddress, snap.localAddress, 0, 1, [255, 0])
p.send()
notif = _getNotification(serialPort)
if (notif.dataBytes[0] == 255):
return True
return False
|
null | null | null | What does the code find from a source node ?
| def single_source_dijkstra_path_length(G, source, cutoff=None, weight='weight'):
return multi_source_dijkstra_path_length(G, {source}, cutoff=cutoff, weight=weight)
| null | null | null | shortest weighted path lengths in g
| codeqa | def single source dijkstra path length G source cutoff None weight 'weight' return multi source dijkstra path length G {source} cutoff cutoff weight weight
| null | null | null | null | Question:
What does the code find from a source node ?
Code:
def single_source_dijkstra_path_length(G, source, cutoff=None, weight='weight'):
return multi_source_dijkstra_path_length(G, {source}, cutoff=cutoff, weight=weight)
|
null | null | null | How do binary function apply to a sequence ?
| def accumulate(binop, seq, initial=no_default):
seq = iter(seq)
result = (next(seq) if (initial == no_default) else initial)
(yield result)
for elem in seq:
result = binop(result, elem)
(yield result)
| null | null | null | repeatedly
| codeqa | def accumulate binop seq initial no default seq iter seq result next seq if initial no default else initial yield result for elem in seq result binop result elem yield result
| null | null | null | null | Question:
How do binary function apply to a sequence ?
Code:
def accumulate(binop, seq, initial=no_default):
seq = iter(seq)
result = (next(seq) if (initial == no_default) else initial)
(yield result)
for elem in seq:
result = binop(result, elem)
(yield result)
|
null | null | null | What raises an exception just ?
| def broken_view(request):
raise KeyError('Oops! Looks like you wrote some bad code.')
| null | null | null | a view
| codeqa | def broken view request raise Key Error ' Oops Lookslikeyouwrotesomebadcode '
| null | null | null | null | Question:
What raises an exception just ?
Code:
def broken_view(request):
raise KeyError('Oops! Looks like you wrote some bad code.')
|
null | null | null | Does a view raise an exception just ?
| def broken_view(request):
raise KeyError('Oops! Looks like you wrote some bad code.')
| null | null | null | Yes
| codeqa | def broken view request raise Key Error ' Oops Lookslikeyouwrotesomebadcode '
| null | null | null | null | Question:
Does a view raise an exception just ?
Code:
def broken_view(request):
raise KeyError('Oops! Looks like you wrote some bad code.')
|
null | null | null | What does a view raise just ?
| def broken_view(request):
raise KeyError('Oops! Looks like you wrote some bad code.')
| null | null | null | an exception
| codeqa | def broken view request raise Key Error ' Oops Lookslikeyouwrotesomebadcode '
| null | null | null | null | Question:
What does a view raise just ?
Code:
def broken_view(request):
raise KeyError('Oops! Looks like you wrote some bad code.')
|
null | null | null | How d the code get volume type ?
| def volume_type_get(context, id):
return IMPL.volume_type_get(context, id)
| null | null | null | by i d
| codeqa | def volume type get context id return IMPL volume type get context id
| null | null | null | null | Question:
How d the code get volume type ?
Code:
def volume_type_get(context, id):
return IMPL.volume_type_get(context, id)
|
null | null | null | D the code get volume type by i d ?
| def volume_type_get(context, id):
return IMPL.volume_type_get(context, id)
| null | null | null | Yes
| codeqa | def volume type get context id return IMPL volume type get context id
| null | null | null | null | Question:
D the code get volume type by i d ?
Code:
def volume_type_get(context, id):
return IMPL.volume_type_get(context, id)
|
null | null | null | What d the code get by i d ?
| def volume_type_get(context, id):
return IMPL.volume_type_get(context, id)
| null | null | null | volume type
| codeqa | def volume type get context id return IMPL volume type get context id
| null | null | null | null | Question:
What d the code get by i d ?
Code:
def volume_type_get(context, id):
return IMPL.volume_type_get(context, id)
|
null | null | null | In which direction do all reference paths trace ?
| def describeObj(obj, depth=4, path=None, ignore=None):
if (path is None):
path = [obj]
if (ignore is None):
ignore = {}
ignore[id(sys._getframe())] = None
ignore[id(path)] = None
gc.collect()
refs = gc.get_referrers(obj)
ignore[id(refs)] = None
printed = False
for ref in refs:
if (id(ref) in ignore):
continue
if (id(ref) in list(map(id, path))):
print(('Cyclic reference: ' + refPathString(([ref] + path))))
printed = True
continue
newPath = ([ref] + path)
if (len(newPath) >= depth):
refStr = refPathString(newPath)
if ('[_]' not in refStr):
print(refStr)
printed = True
else:
describeObj(ref, depth, newPath, ignore)
printed = True
if (not printed):
print(('Dead end: ' + refPathString(path)))
| null | null | null | backward
| codeqa | def describe Obj obj depth 4 path None ignore None if path is None path [obj]if ignore is None ignore {}ignore[id sys getframe ] Noneignore[id path ] Nonegc collect refs gc get referrers obj ignore[id refs ] Noneprinted Falsefor ref in refs if id ref in ignore continueif id ref in list map id path print ' Cyclicreference ' + ref Path String [ref] + path printed Truecontinuenew Path [ref] + path if len new Path > depth ref Str ref Path String new Path if '[ ]' not in ref Str print ref Str printed Trueelse describe Obj ref depth new Path ignore printed Trueif not printed print ' Deadend ' + ref Path String path
| null | null | null | null | Question:
In which direction do all reference paths trace ?
Code:
def describeObj(obj, depth=4, path=None, ignore=None):
if (path is None):
path = [obj]
if (ignore is None):
ignore = {}
ignore[id(sys._getframe())] = None
ignore[id(path)] = None
gc.collect()
refs = gc.get_referrers(obj)
ignore[id(refs)] = None
printed = False
for ref in refs:
if (id(ref) in ignore):
continue
if (id(ref) in list(map(id, path))):
print(('Cyclic reference: ' + refPathString(([ref] + path))))
printed = True
continue
newPath = ([ref] + path)
if (len(newPath) >= depth):
refStr = refPathString(newPath)
if ('[_]' not in refStr):
print(refStr)
printed = True
else:
describeObj(ref, depth, newPath, ignore)
printed = True
if (not printed):
print(('Dead end: ' + refPathString(path)))
|
null | null | null | What does the code remove ?
| def remove_taps(module, brew_path, taps):
(failed, unchanged, removed, msg) = (False, 0, 0, '')
for tap in taps:
(failed, changed, msg) = remove_tap(module, brew_path, tap)
if failed:
break
if changed:
removed += 1
else:
unchanged += 1
if failed:
msg = ('removed: %d, unchanged: %d, error: ' + msg)
msg = (msg % (removed, unchanged))
elif removed:
changed = True
msg = ('removed: %d, unchanged: %d' % (removed, unchanged))
else:
msg = ('removed: %d, unchanged: %d' % (removed, unchanged))
return (failed, changed, msg)
| null | null | null | one or more taps
| codeqa | def remove taps module brew path taps failed unchanged removed msg False 0 0 '' for tap in taps failed changed msg remove tap module brew path tap if failed breakif changed removed + 1else unchanged + 1if failed msg 'removed %d unchanged %d error ' + msg msg msg % removed unchanged elif removed changed Truemsg 'removed %d unchanged %d' % removed unchanged else msg 'removed %d unchanged %d' % removed unchanged return failed changed msg
| null | null | null | null | Question:
What does the code remove ?
Code:
def remove_taps(module, brew_path, taps):
(failed, unchanged, removed, msg) = (False, 0, 0, '')
for tap in taps:
(failed, changed, msg) = remove_tap(module, brew_path, tap)
if failed:
break
if changed:
removed += 1
else:
unchanged += 1
if failed:
msg = ('removed: %d, unchanged: %d, error: ' + msg)
msg = (msg % (removed, unchanged))
elif removed:
changed = True
msg = ('removed: %d, unchanged: %d' % (removed, unchanged))
else:
msg = ('removed: %d, unchanged: %d' % (removed, unchanged))
return (failed, changed, msg)
|
null | null | null | Does the code remove one or more taps ?
| def remove_taps(module, brew_path, taps):
(failed, unchanged, removed, msg) = (False, 0, 0, '')
for tap in taps:
(failed, changed, msg) = remove_tap(module, brew_path, tap)
if failed:
break
if changed:
removed += 1
else:
unchanged += 1
if failed:
msg = ('removed: %d, unchanged: %d, error: ' + msg)
msg = (msg % (removed, unchanged))
elif removed:
changed = True
msg = ('removed: %d, unchanged: %d' % (removed, unchanged))
else:
msg = ('removed: %d, unchanged: %d' % (removed, unchanged))
return (failed, changed, msg)
| null | null | null | Yes
| codeqa | def remove taps module brew path taps failed unchanged removed msg False 0 0 '' for tap in taps failed changed msg remove tap module brew path tap if failed breakif changed removed + 1else unchanged + 1if failed msg 'removed %d unchanged %d error ' + msg msg msg % removed unchanged elif removed changed Truemsg 'removed %d unchanged %d' % removed unchanged else msg 'removed %d unchanged %d' % removed unchanged return failed changed msg
| null | null | null | null | Question:
Does the code remove one or more taps ?
Code:
def remove_taps(module, brew_path, taps):
(failed, unchanged, removed, msg) = (False, 0, 0, '')
for tap in taps:
(failed, changed, msg) = remove_tap(module, brew_path, tap)
if failed:
break
if changed:
removed += 1
else:
unchanged += 1
if failed:
msg = ('removed: %d, unchanged: %d, error: ' + msg)
msg = (msg % (removed, unchanged))
elif removed:
changed = True
msg = ('removed: %d, unchanged: %d' % (removed, unchanged))
else:
msg = ('removed: %d, unchanged: %d' % (removed, unchanged))
return (failed, changed, msg)
|
null | null | null | Where are exceptions verify ?
| def test_module_exceptions():
normal_types = ['sys', 'clr', 'exceptions', '__builtin__', '_winreg', 'mmap', 'nt', 'posix']
builtins = [x for x in sys.builtin_module_names if (x not in normal_types)]
for module in builtins:
mod = __import__(module)
for attrName in dir(mod):
val = getattr(mod, attrName)
if (isinstance(val, type) and issubclass(val, Exception)):
if ('BlockingIOError' not in repr(val)):
Assert(repr(val).startswith('<class '))
val.x = 2
AreEqual(val.x, 2)
else:
Assert(repr(val).startswith('<type '))
| null | null | null | in modules
| codeqa | def test module exceptions normal types ['sys' 'clr' 'exceptions' ' builtin ' ' winreg' 'mmap' 'nt' 'posix']builtins [x for x in sys builtin module names if x not in normal types ]for module in builtins mod import module for attr Name in dir mod val getattr mod attr Name if isinstance val type and issubclass val Exception if ' Blocking IO Error' not in repr val Assert repr val startswith '<class' val x 2 Are Equal val x 2 else Assert repr val startswith '<type'
| null | null | null | null | Question:
Where are exceptions verify ?
Code:
def test_module_exceptions():
normal_types = ['sys', 'clr', 'exceptions', '__builtin__', '_winreg', 'mmap', 'nt', 'posix']
builtins = [x for x in sys.builtin_module_names if (x not in normal_types)]
for module in builtins:
mod = __import__(module)
for attrName in dir(mod):
val = getattr(mod, attrName)
if (isinstance(val, type) and issubclass(val, Exception)):
if ('BlockingIOError' not in repr(val)):
Assert(repr(val).startswith('<class '))
val.x = 2
AreEqual(val.x, 2)
else:
Assert(repr(val).startswith('<type '))
|
null | null | null | Are exceptions verify in modules ?
| def test_module_exceptions():
normal_types = ['sys', 'clr', 'exceptions', '__builtin__', '_winreg', 'mmap', 'nt', 'posix']
builtins = [x for x in sys.builtin_module_names if (x not in normal_types)]
for module in builtins:
mod = __import__(module)
for attrName in dir(mod):
val = getattr(mod, attrName)
if (isinstance(val, type) and issubclass(val, Exception)):
if ('BlockingIOError' not in repr(val)):
Assert(repr(val).startswith('<class '))
val.x = 2
AreEqual(val.x, 2)
else:
Assert(repr(val).startswith('<type '))
| null | null | null | Yes
| codeqa | def test module exceptions normal types ['sys' 'clr' 'exceptions' ' builtin ' ' winreg' 'mmap' 'nt' 'posix']builtins [x for x in sys builtin module names if x not in normal types ]for module in builtins mod import module for attr Name in dir mod val getattr mod attr Name if isinstance val type and issubclass val Exception if ' Blocking IO Error' not in repr val Assert repr val startswith '<class' val x 2 Are Equal val x 2 else Assert repr val startswith '<type'
| null | null | null | null | Question:
Are exceptions verify in modules ?
Code:
def test_module_exceptions():
normal_types = ['sys', 'clr', 'exceptions', '__builtin__', '_winreg', 'mmap', 'nt', 'posix']
builtins = [x for x in sys.builtin_module_names if (x not in normal_types)]
for module in builtins:
mod = __import__(module)
for attrName in dir(mod):
val = getattr(mod, attrName)
if (isinstance(val, type) and issubclass(val, Exception)):
if ('BlockingIOError' not in repr(val)):
Assert(repr(val).startswith('<class '))
val.x = 2
AreEqual(val.x, 2)
else:
Assert(repr(val).startswith('<type '))
|
null | null | null | What does the code clean if attributes in data ?
| def _clean_data_if(match):
quote = match.group(1)
condition = match.group(2)
for (entity, replace) in _CLEAN_ENTITIES.iteritems():
condition = condition.replace(entity, replace)
return ('data-if=%s%s%s' % (quote, condition, quote))
| null | null | null | entities
| codeqa | def clean data if match quote match group 1 condition match group 2 for entity replace in CLEAN ENTITIES iteritems condition condition replace entity replace return 'data-if %s%s%s' % quote condition quote
| null | null | null | null | Question:
What does the code clean if attributes in data ?
Code:
def _clean_data_if(match):
quote = match.group(1)
condition = match.group(2)
for (entity, replace) in _CLEAN_ENTITIES.iteritems():
condition = condition.replace(entity, replace)
return ('data-if=%s%s%s' % (quote, condition, quote))
|
null | null | null | Does the code clean entities in data if attributes ?
| def _clean_data_if(match):
quote = match.group(1)
condition = match.group(2)
for (entity, replace) in _CLEAN_ENTITIES.iteritems():
condition = condition.replace(entity, replace)
return ('data-if=%s%s%s' % (quote, condition, quote))
| null | null | null | Yes
| codeqa | def clean data if match quote match group 1 condition match group 2 for entity replace in CLEAN ENTITIES iteritems condition condition replace entity replace return 'data-if %s%s%s' % quote condition quote
| null | null | null | null | Question:
Does the code clean entities in data if attributes ?
Code:
def _clean_data_if(match):
quote = match.group(1)
condition = match.group(2)
for (entity, replace) in _CLEAN_ENTITIES.iteritems():
condition = condition.replace(entity, replace)
return ('data-if=%s%s%s' % (quote, condition, quote))
|
null | null | null | Where does the code clean entities if attributes ?
| def _clean_data_if(match):
quote = match.group(1)
condition = match.group(2)
for (entity, replace) in _CLEAN_ENTITIES.iteritems():
condition = condition.replace(entity, replace)
return ('data-if=%s%s%s' % (quote, condition, quote))
| null | null | null | in data
| codeqa | def clean data if match quote match group 1 condition match group 2 for entity replace in CLEAN ENTITIES iteritems condition condition replace entity replace return 'data-if %s%s%s' % quote condition quote
| null | null | null | null | Question:
Where does the code clean entities if attributes ?
Code:
def _clean_data_if(match):
quote = match.group(1)
condition = match.group(2)
for (entity, replace) in _CLEAN_ENTITIES.iteritems():
condition = condition.replace(entity, replace)
return ('data-if=%s%s%s' % (quote, condition, quote))
|
null | null | null | Does the code clean entities if attributes in data ?
| def _clean_data_if(match):
quote = match.group(1)
condition = match.group(2)
for (entity, replace) in _CLEAN_ENTITIES.iteritems():
condition = condition.replace(entity, replace)
return ('data-if=%s%s%s' % (quote, condition, quote))
| null | null | null | Yes
| codeqa | def clean data if match quote match group 1 condition match group 2 for entity replace in CLEAN ENTITIES iteritems condition condition replace entity replace return 'data-if %s%s%s' % quote condition quote
| null | null | null | null | Question:
Does the code clean entities if attributes in data ?
Code:
def _clean_data_if(match):
quote = match.group(1)
condition = match.group(2)
for (entity, replace) in _CLEAN_ENTITIES.iteritems():
condition = condition.replace(entity, replace)
return ('data-if=%s%s%s' % (quote, condition, quote))
|
null | null | null | What do email notification regard ?
| def send_notification(device_name):
current_time = datetime.now()
sender = 'sender@twb-tech.com'
recipient = 'recipient@twb-tech.com'
subject = 'Device {0} was modified'.format(device_name)
message = '\nThe running configuration of {0} was modified. \n\nThis change was detected at: {1}\n\n'.format(device_name, current_time)
if send_mail(recipient, subject, message, sender):
print 'Email notification sent to {}'.format(recipient)
return True
| null | null | null | modified device
| codeqa | def send notification device name current time datetime now sender 'sender@twb-tech com'recipient 'recipient@twb-tech com'subject ' Device{ 0 }wasmodified' format device name message '\n Therunningconfigurationof{ 0 }wasmodified \n\n Thischangewasdetectedat {1 }\n\n' format device name current time if send mail recipient subject message sender print ' Emailnotificationsentto{}' format recipient return True
| null | null | null | null | Question:
What do email notification regard ?
Code:
def send_notification(device_name):
current_time = datetime.now()
sender = 'sender@twb-tech.com'
recipient = 'recipient@twb-tech.com'
subject = 'Device {0} was modified'.format(device_name)
message = '\nThe running configuration of {0} was modified. \n\nThis change was detected at: {1}\n\n'.format(device_name, current_time)
if send_mail(recipient, subject, message, sender):
print 'Email notification sent to {}'.format(recipient)
return True
|
null | null | null | What is regarding modified device ?
| def send_notification(device_name):
current_time = datetime.now()
sender = 'sender@twb-tech.com'
recipient = 'recipient@twb-tech.com'
subject = 'Device {0} was modified'.format(device_name)
message = '\nThe running configuration of {0} was modified. \n\nThis change was detected at: {1}\n\n'.format(device_name, current_time)
if send_mail(recipient, subject, message, sender):
print 'Email notification sent to {}'.format(recipient)
return True
| null | null | null | email notification
| codeqa | def send notification device name current time datetime now sender 'sender@twb-tech com'recipient 'recipient@twb-tech com'subject ' Device{ 0 }wasmodified' format device name message '\n Therunningconfigurationof{ 0 }wasmodified \n\n Thischangewasdetectedat {1 }\n\n' format device name current time if send mail recipient subject message sender print ' Emailnotificationsentto{}' format recipient return True
| null | null | null | null | Question:
What is regarding modified device ?
Code:
def send_notification(device_name):
current_time = datetime.now()
sender = 'sender@twb-tech.com'
recipient = 'recipient@twb-tech.com'
subject = 'Device {0} was modified'.format(device_name)
message = '\nThe running configuration of {0} was modified. \n\nThis change was detected at: {1}\n\n'.format(device_name, current_time)
if send_mail(recipient, subject, message, sender):
print 'Email notification sent to {}'.format(recipient)
return True
|
null | null | null | Do email notification regard modified device ?
| def send_notification(device_name):
current_time = datetime.now()
sender = 'sender@twb-tech.com'
recipient = 'recipient@twb-tech.com'
subject = 'Device {0} was modified'.format(device_name)
message = '\nThe running configuration of {0} was modified. \n\nThis change was detected at: {1}\n\n'.format(device_name, current_time)
if send_mail(recipient, subject, message, sender):
print 'Email notification sent to {}'.format(recipient)
return True
| null | null | null | Yes
| codeqa | def send notification device name current time datetime now sender 'sender@twb-tech com'recipient 'recipient@twb-tech com'subject ' Device{ 0 }wasmodified' format device name message '\n Therunningconfigurationof{ 0 }wasmodified \n\n Thischangewasdetectedat {1 }\n\n' format device name current time if send mail recipient subject message sender print ' Emailnotificationsentto{}' format recipient return True
| null | null | null | null | Question:
Do email notification regard modified device ?
Code:
def send_notification(device_name):
current_time = datetime.now()
sender = 'sender@twb-tech.com'
recipient = 'recipient@twb-tech.com'
subject = 'Device {0} was modified'.format(device_name)
message = '\nThe running configuration of {0} was modified. \n\nThis change was detected at: {1}\n\n'.format(device_name, current_time)
if send_mail(recipient, subject, message, sender):
print 'Email notification sent to {}'.format(recipient)
return True
|
null | null | null | What does the code generate ?
| def inport(port_name='', props=[], mac_name=None):
return __create_port_dict('in', port_name, mac_name, props)
| null | null | null | a
| codeqa | def inport port name '' props [] mac name None return create port dict 'in' port name mac name props
| null | null | null | null | Question:
What does the code generate ?
Code:
def inport(port_name='', props=[], mac_name=None):
return __create_port_dict('in', port_name, mac_name, props)
|
null | null | null | Does the code generate a ?
| def inport(port_name='', props=[], mac_name=None):
return __create_port_dict('in', port_name, mac_name, props)
| null | null | null | Yes
| codeqa | def inport port name '' props [] mac name None return create port dict 'in' port name mac name props
| null | null | null | null | Question:
Does the code generate a ?
Code:
def inport(port_name='', props=[], mac_name=None):
return __create_port_dict('in', port_name, mac_name, props)
|
null | null | null | What contains a t ?
| def contains_softmax(f):
apps = f.maker.fgraph.apply_nodes
for app in apps:
if isinstance(app.op, T.nnet.Softmax):
return True
return False
| null | null | null | f
| codeqa | def contains softmax f apps f maker fgraph apply nodesfor app in apps if isinstance app op T nnet Softmax return Truereturn False
| null | null | null | null | Question:
What contains a t ?
Code:
def contains_softmax(f):
apps = f.maker.fgraph.apply_nodes
for app in apps:
if isinstance(app.op, T.nnet.Softmax):
return True
return False
|
null | null | null | What does f contain ?
| def contains_softmax(f):
apps = f.maker.fgraph.apply_nodes
for app in apps:
if isinstance(app.op, T.nnet.Softmax):
return True
return False
| null | null | null | a t
| codeqa | def contains softmax f apps f maker fgraph apply nodesfor app in apps if isinstance app op T nnet Softmax return Truereturn False
| null | null | null | null | Question:
What does f contain ?
Code:
def contains_softmax(f):
apps = f.maker.fgraph.apply_nodes
for app in apps:
if isinstance(app.op, T.nnet.Softmax):
return True
return False
|
null | null | null | Does f contain a t ?
| def contains_softmax(f):
apps = f.maker.fgraph.apply_nodes
for app in apps:
if isinstance(app.op, T.nnet.Softmax):
return True
return False
| null | null | null | Yes
| codeqa | def contains softmax f apps f maker fgraph apply nodesfor app in apps if isinstance app op T nnet Softmax return Truereturn False
| null | null | null | null | Question:
Does f contain a t ?
Code:
def contains_softmax(f):
apps = f.maker.fgraph.apply_nodes
for app in apps:
if isinstance(app.op, T.nnet.Softmax):
return True
return False
|
null | null | null | What can user add to given translation ?
| @cache_permission
def can_suggest(user, translation):
if (not translation.subproject.enable_suggestions):
return False
if has_group_perm(user, 'trans.add_suggestion', translation):
return True
return check_permission(user, translation.subproject.project, 'trans.add_suggestion')
| null | null | null | suggestions
| codeqa | @cache permissiondef can suggest user translation if not translation subproject enable suggestions return Falseif has group perm user 'trans add suggestion' translation return Truereturn check permission user translation subproject project 'trans add suggestion'
| null | null | null | null | Question:
What can user add to given translation ?
Code:
@cache_permission
def can_suggest(user, translation):
if (not translation.subproject.enable_suggestions):
return False
if has_group_perm(user, 'trans.add_suggestion', translation):
return True
return check_permission(user, translation.subproject.project, 'trans.add_suggestion')
|
null | null | null | Can user add suggestions to given translation ?
| @cache_permission
def can_suggest(user, translation):
if (not translation.subproject.enable_suggestions):
return False
if has_group_perm(user, 'trans.add_suggestion', translation):
return True
return check_permission(user, translation.subproject.project, 'trans.add_suggestion')
| null | null | null | Yes
| codeqa | @cache permissiondef can suggest user translation if not translation subproject enable suggestions return Falseif has group perm user 'trans add suggestion' translation return Truereturn check permission user translation subproject project 'trans add suggestion'
| null | null | null | null | Question:
Can user add suggestions to given translation ?
Code:
@cache_permission
def can_suggest(user, translation):
if (not translation.subproject.enable_suggestions):
return False
if has_group_perm(user, 'trans.add_suggestion', translation):
return True
return check_permission(user, translation.subproject.project, 'trans.add_suggestion')
|
null | null | null | Did the code expect ?
| @register.inclusion_tag('inclusion.html')
def inclusion_unlimited_args(one, two='hi', *args):
return {'result': ('inclusion_unlimited_args - Expected result: %s' % ', '.join([six.text_type(arg) for arg in ([one, two] + list(args))]))}
| null | null | null | Yes
| codeqa | @register inclusion tag 'inclusion html' def inclusion unlimited args one two 'hi' *args return {'result' 'inclusion unlimited args- Expectedresult %s' % ' ' join [six text type arg for arg in [one two] + list args ] }
| null | null | null | null | Question:
Did the code expect ?
Code:
@register.inclusion_tag('inclusion.html')
def inclusion_unlimited_args(one, two='hi', *args):
return {'result': ('inclusion_unlimited_args - Expected result: %s' % ', '.join([six.text_type(arg) for arg in ([one, two] + list(args))]))}
|
null | null | null | By how much do precision label rank ?
| def label_ranking_average_precision_score(y_true, y_score):
check_consistent_length(y_true, y_score)
y_true = check_array(y_true, ensure_2d=False)
y_score = check_array(y_score, ensure_2d=False)
if (y_true.shape != y_score.shape):
raise ValueError('y_true and y_score have different shape')
y_type = type_of_target(y_true)
if ((y_type != 'multilabel-indicator') and (not ((y_type == 'binary') and (y_true.ndim == 2)))):
raise ValueError('{0} format is not supported'.format(y_type))
y_true = csr_matrix(y_true)
y_score = (- y_score)
(n_samples, n_labels) = y_true.shape
out = 0.0
for (i, (start, stop)) in enumerate(zip(y_true.indptr, y_true.indptr[1:])):
relevant = y_true.indices[start:stop]
if ((relevant.size == 0) or (relevant.size == n_labels)):
out += 1.0
continue
scores_i = y_score[i]
rank = rankdata(scores_i, 'max')[relevant]
L = rankdata(scores_i[relevant], 'max')
out += (L / rank).mean()
return (out / n_samples)
| null | null | null | average
| codeqa | def label ranking average precision score y true y score check consistent length y true y score y true check array y true ensure 2d False y score check array y score ensure 2d False if y true shape y score shape raise Value Error 'y trueandy scorehavedifferentshape' y type type of target y true if y type 'multilabel-indicator' and not y type 'binary' and y true ndim 2 raise Value Error '{ 0 }formatisnotsupported' format y type y true csr matrix y true y score - y score n samples n labels y true shapeout 0 0for i start stop in enumerate zip y true indptr y true indptr[ 1 ] relevant y true indices[start stop]if relevant size 0 or relevant size n labels out + 1 0continuescores i y score[i]rank rankdata scores i 'max' [relevant]L rankdata scores i[relevant] 'max' out + L / rank mean return out / n samples
| null | null | null | null | Question:
By how much do precision label rank ?
Code:
def label_ranking_average_precision_score(y_true, y_score):
check_consistent_length(y_true, y_score)
y_true = check_array(y_true, ensure_2d=False)
y_score = check_array(y_score, ensure_2d=False)
if (y_true.shape != y_score.shape):
raise ValueError('y_true and y_score have different shape')
y_type = type_of_target(y_true)
if ((y_type != 'multilabel-indicator') and (not ((y_type == 'binary') and (y_true.ndim == 2)))):
raise ValueError('{0} format is not supported'.format(y_type))
y_true = csr_matrix(y_true)
y_score = (- y_score)
(n_samples, n_labels) = y_true.shape
out = 0.0
for (i, (start, stop)) in enumerate(zip(y_true.indptr, y_true.indptr[1:])):
relevant = y_true.indices[start:stop]
if ((relevant.size == 0) or (relevant.size == n_labels)):
out += 1.0
continue
scores_i = y_score[i]
rank = rankdata(scores_i, 'max')[relevant]
L = rankdata(scores_i[relevant], 'max')
out += (L / rank).mean()
return (out / n_samples)
|
null | null | null | What does the code write ?
| def _write_file_iface(iface, data, folder, pattern):
filename = os.path.join(folder, pattern.format(iface))
if (not os.path.exists(folder)):
msg = '{0} cannot be written. {1} does not exist'
msg = msg.format(filename, folder)
log.error(msg)
raise AttributeError(msg)
with salt.utils.fopen(filename, 'w') as fp_:
fp_.write(data)
| null | null | null | a file to disk
| codeqa | def write file iface iface data folder pattern filename os path join folder pattern format iface if not os path exists folder msg '{ 0 }cannotbewritten {1 }doesnotexist'msg msg format filename folder log error msg raise Attribute Error msg with salt utils fopen filename 'w' as fp fp write data
| null | null | null | null | Question:
What does the code write ?
Code:
def _write_file_iface(iface, data, folder, pattern):
filename = os.path.join(folder, pattern.format(iface))
if (not os.path.exists(folder)):
msg = '{0} cannot be written. {1} does not exist'
msg = msg.format(filename, folder)
log.error(msg)
raise AttributeError(msg)
with salt.utils.fopen(filename, 'w') as fp_:
fp_.write(data)
|
null | null | null | Does the code write a file to disk ?
| def _write_file_iface(iface, data, folder, pattern):
filename = os.path.join(folder, pattern.format(iface))
if (not os.path.exists(folder)):
msg = '{0} cannot be written. {1} does not exist'
msg = msg.format(filename, folder)
log.error(msg)
raise AttributeError(msg)
with salt.utils.fopen(filename, 'w') as fp_:
fp_.write(data)
| null | null | null | Yes
| codeqa | def write file iface iface data folder pattern filename os path join folder pattern format iface if not os path exists folder msg '{ 0 }cannotbewritten {1 }doesnotexist'msg msg format filename folder log error msg raise Attribute Error msg with salt utils fopen filename 'w' as fp fp write data
| null | null | null | null | Question:
Does the code write a file to disk ?
Code:
def _write_file_iface(iface, data, folder, pattern):
filename = os.path.join(folder, pattern.format(iface))
if (not os.path.exists(folder)):
msg = '{0} cannot be written. {1} does not exist'
msg = msg.format(filename, folder)
log.error(msg)
raise AttributeError(msg)
with salt.utils.fopen(filename, 'w') as fp_:
fp_.write(data)
|
null | null | null | Does the code get the size of a disk image ?
| def get_disk_size(path):
size = images.qemu_img_info(path).virtual_size
return int(size)
| null | null | null | Yes
| codeqa | def get disk size path size images qemu img info path virtual sizereturn int size
| null | null | null | null | Question:
Does the code get the size of a disk image ?
Code:
def get_disk_size(path):
size = images.qemu_img_info(path).virtual_size
return int(size)
|
null | null | null | What does the code get ?
| def get_disk_size(path):
size = images.qemu_img_info(path).virtual_size
return int(size)
| null | null | null | the size of a disk image
| codeqa | def get disk size path size images qemu img info path virtual sizereturn int size
| null | null | null | null | Question:
What does the code get ?
Code:
def get_disk_size(path):
size = images.qemu_img_info(path).virtual_size
return int(size)
|
null | null | null | Does the code execute all types or general elements that we find in a statement ?
| def _execute_types_in_stmt(evaluator, stmt):
definitions = evaluator.eval_element(stmt)
return chain.from_iterable((_execute_array_values(evaluator, d) for d in definitions))
| null | null | null | Yes
| codeqa | def execute types in stmt evaluator stmt definitions evaluator eval element stmt return chain from iterable execute array values evaluator d for d in definitions
| null | null | null | null | Question:
Does the code execute all types or general elements that we find in a statement ?
Code:
def _execute_types_in_stmt(evaluator, stmt):
definitions = evaluator.eval_element(stmt)
return chain.from_iterable((_execute_array_values(evaluator, d) for d in definitions))
|
null | null | null | What does the code execute ?
| def _execute_types_in_stmt(evaluator, stmt):
definitions = evaluator.eval_element(stmt)
return chain.from_iterable((_execute_array_values(evaluator, d) for d in definitions))
| null | null | null | all types or general elements that we find in a statement
| codeqa | def execute types in stmt evaluator stmt definitions evaluator eval element stmt return chain from iterable execute array values evaluator d for d in definitions
| null | null | null | null | Question:
What does the code execute ?
Code:
def _execute_types_in_stmt(evaluator, stmt):
definitions = evaluator.eval_element(stmt)
return chain.from_iterable((_execute_array_values(evaluator, d) for d in definitions))
|
null | null | null | Where do we find all types or general elements ?
| def _execute_types_in_stmt(evaluator, stmt):
definitions = evaluator.eval_element(stmt)
return chain.from_iterable((_execute_array_values(evaluator, d) for d in definitions))
| null | null | null | in a statement
| codeqa | def execute types in stmt evaluator stmt definitions evaluator eval element stmt return chain from iterable execute array values evaluator d for d in definitions
| null | null | null | null | Question:
Where do we find all types or general elements ?
Code:
def _execute_types_in_stmt(evaluator, stmt):
definitions = evaluator.eval_element(stmt)
return chain.from_iterable((_execute_array_values(evaluator, d) for d in definitions))
|
null | null | null | Do we find all types or general elements in a statement ?
| def _execute_types_in_stmt(evaluator, stmt):
definitions = evaluator.eval_element(stmt)
return chain.from_iterable((_execute_array_values(evaluator, d) for d in definitions))
| null | null | null | Yes
| codeqa | def execute types in stmt evaluator stmt definitions evaluator eval element stmt return chain from iterable execute array values evaluator d for d in definitions
| null | null | null | null | Question:
Do we find all types or general elements in a statement ?
Code:
def _execute_types_in_stmt(evaluator, stmt):
definitions = evaluator.eval_element(stmt)
return chain.from_iterable((_execute_array_values(evaluator, d) for d in definitions))
|
null | null | null | What does the code execute ?
| def call(argv, wait=True, **kwargs):
if isWin:
si = subprocess.STARTUPINFO()
try:
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
except:
si.dwFlags |= subprocess._subprocess.STARTF_USESHOWWINDOW
else:
si = None
try:
o = subprocess.Popen(argv, startupinfo=si, **kwargs)
except OSError:
return (-1)
if wait:
while 1:
try:
ret = o.wait()
except OSError:
continue
break
else:
ret = 0
return ret
| null | null | null | a command
| codeqa | def call argv wait True **kwargs if is Win si subprocess STARTUPINFO try si dw Flags subprocess STARTF USESHOWWINDO Wexcept si dw Flags subprocess subprocess STARTF USESHOWWINDO Welse si Nonetry o subprocess Popen argv startupinfo si **kwargs except OS Error return -1 if wait while 1 try ret o wait except OS Error continuebreakelse ret 0return ret
| null | null | null | null | Question:
What does the code execute ?
Code:
def call(argv, wait=True, **kwargs):
if isWin:
si = subprocess.STARTUPINFO()
try:
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
except:
si.dwFlags |= subprocess._subprocess.STARTF_USESHOWWINDOW
else:
si = None
try:
o = subprocess.Popen(argv, startupinfo=si, **kwargs)
except OSError:
return (-1)
if wait:
while 1:
try:
ret = o.wait()
except OSError:
continue
break
else:
ret = 0
return ret
|
null | null | null | Does the code execute a command ?
| def call(argv, wait=True, **kwargs):
if isWin:
si = subprocess.STARTUPINFO()
try:
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
except:
si.dwFlags |= subprocess._subprocess.STARTF_USESHOWWINDOW
else:
si = None
try:
o = subprocess.Popen(argv, startupinfo=si, **kwargs)
except OSError:
return (-1)
if wait:
while 1:
try:
ret = o.wait()
except OSError:
continue
break
else:
ret = 0
return ret
| null | null | null | Yes
| codeqa | def call argv wait True **kwargs if is Win si subprocess STARTUPINFO try si dw Flags subprocess STARTF USESHOWWINDO Wexcept si dw Flags subprocess subprocess STARTF USESHOWWINDO Welse si Nonetry o subprocess Popen argv startupinfo si **kwargs except OS Error return -1 if wait while 1 try ret o wait except OS Error continuebreakelse ret 0return ret
| null | null | null | null | Question:
Does the code execute a command ?
Code:
def call(argv, wait=True, **kwargs):
if isWin:
si = subprocess.STARTUPINFO()
try:
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
except:
si.dwFlags |= subprocess._subprocess.STARTF_USESHOWWINDOW
else:
si = None
try:
o = subprocess.Popen(argv, startupinfo=si, **kwargs)
except OSError:
return (-1)
if wait:
while 1:
try:
ret = o.wait()
except OSError:
continue
break
else:
ret = 0
return ret
|
null | null | null | When are events not queued ?
| def enqueue_events_for_all_sites():
with frappe.init_site():
jobs_per_site = get_jobs()
sites = get_sites()
for site in sites:
try:
enqueue_events_for_site(site=site, queued_jobs=jobs_per_site[site])
except:
print frappe.get_traceback()
| null | null | null | already
| codeqa | def enqueue events for all sites with frappe init site jobs per site get jobs sites get sites for site in sites try enqueue events for site site site queued jobs jobs per site[site] except print frappe get traceback
| null | null | null | null | Question:
When are events not queued ?
Code:
def enqueue_events_for_all_sites():
with frappe.init_site():
jobs_per_site = get_jobs()
sites = get_sites()
for site in sites:
try:
enqueue_events_for_site(site=site, queued_jobs=jobs_per_site[site])
except:
print frappe.get_traceback()
|
null | null | null | Does the code retrieve memory information ?
| def get_memory_info():
try:
with open(MEMORY_INFO_PATH) as fp:
content = fp.read()
except IOError:
return {}
lines = content.split('\n')
result = {}
for line in lines:
line = line.strip()
if (not line):
continue
split = line.split(':')
name = split[0].strip()
value = split[1].replace('kB', '').strip()
try:
value = int(value)
except Exception:
continue
result[name] = value
return result
| null | null | null | Yes
| codeqa | def get memory info try with open MEMORY INFO PATH as fp content fp read except IO Error return {}lines content split '\n' result {}for line in lines line line strip if not line continuesplit line split ' ' name split[ 0 ] strip value split[ 1 ] replace 'k B' '' strip try value int value except Exception continueresult[name] valuereturn result
| null | null | null | null | Question:
Does the code retrieve memory information ?
Code:
def get_memory_info():
try:
with open(MEMORY_INFO_PATH) as fp:
content = fp.read()
except IOError:
return {}
lines = content.split('\n')
result = {}
for line in lines:
line = line.strip()
if (not line):
continue
split = line.split(':')
name = split[0].strip()
value = split[1].replace('kB', '').strip()
try:
value = int(value)
except Exception:
continue
result[name] = value
return result
|
null | null | null | What does the code retrieve ?
| def get_memory_info():
try:
with open(MEMORY_INFO_PATH) as fp:
content = fp.read()
except IOError:
return {}
lines = content.split('\n')
result = {}
for line in lines:
line = line.strip()
if (not line):
continue
split = line.split(':')
name = split[0].strip()
value = split[1].replace('kB', '').strip()
try:
value = int(value)
except Exception:
continue
result[name] = value
return result
| null | null | null | memory information
| codeqa | def get memory info try with open MEMORY INFO PATH as fp content fp read except IO Error return {}lines content split '\n' result {}for line in lines line line strip if not line continuesplit line split ' ' name split[ 0 ] strip value split[ 1 ] replace 'k B' '' strip try value int value except Exception continueresult[name] valuereturn result
| null | null | null | null | Question:
What does the code retrieve ?
Code:
def get_memory_info():
try:
with open(MEMORY_INFO_PATH) as fp:
content = fp.read()
except IOError:
return {}
lines = content.split('\n')
result = {}
for line in lines:
line = line.strip()
if (not line):
continue
split = line.split(':')
name = split[0].strip()
value = split[1].replace('kB', '').strip()
try:
value = int(value)
except Exception:
continue
result[name] = value
return result
|
null | null | null | Does the code display the commands ?
| def display(filename=''):
if (filename == ''):
displayFiles(getGCodeFilesWhichAreNotLogFiles())
return
displayFile(filename)
| null | null | null | Yes
| codeqa | def display filename '' if filename '' display Files get G Code Files Which Are Not Log Files returndisplay File filename
| null | null | null | null | Question:
Does the code display the commands ?
Code:
def display(filename=''):
if (filename == ''):
displayFiles(getGCodeFilesWhichAreNotLogFiles())
return
displayFile(filename)
|
null | null | null | What does the code display ?
| def display(filename=''):
if (filename == ''):
displayFiles(getGCodeFilesWhichAreNotLogFiles())
return
displayFile(filename)
| null | null | null | the commands
| codeqa | def display filename '' if filename '' display Files get G Code Files Which Are Not Log Files returndisplay File filename
| null | null | null | null | Question:
What does the code display ?
Code:
def display(filename=''):
if (filename == ''):
displayFiles(getGCodeFilesWhichAreNotLogFiles())
return
displayFile(filename)
|
null | null | null | What does the code find from a source node ?
| def single_source_dijkstra(G, source, target=None, cutoff=None, weight='weight'):
return multi_source_dijkstra(G, {source}, cutoff=cutoff, target=target, weight=weight)
| null | null | null | shortest weighted paths and lengths
| codeqa | def single source dijkstra G source target None cutoff None weight 'weight' return multi source dijkstra G {source} cutoff cutoff target target weight weight
| null | null | null | null | Question:
What does the code find from a source node ?
Code:
def single_source_dijkstra(G, source, target=None, cutoff=None, weight='weight'):
return multi_source_dijkstra(G, {source}, cutoff=cutoff, target=target, weight=weight)
|
null | null | null | How did paths weight ?
| def single_source_dijkstra(G, source, target=None, cutoff=None, weight='weight'):
return multi_source_dijkstra(G, {source}, cutoff=cutoff, target=target, weight=weight)
| null | null | null | shortest
| codeqa | def single source dijkstra G source target None cutoff None weight 'weight' return multi source dijkstra G {source} cutoff cutoff target target weight weight
| null | null | null | null | Question:
How did paths weight ?
Code:
def single_source_dijkstra(G, source, target=None, cutoff=None, weight='weight'):
return multi_source_dijkstra(G, {source}, cutoff=cutoff, target=target, weight=weight)
|
null | null | null | How do user information return ?
| def _format_info(data):
return {'gid': data.pw_gid, 'groups': list_groups(data.pw_name), 'home': data.pw_dir, 'name': data.pw_name, 'shell': data.pw_shell, 'uid': data.pw_uid, 'fullname': data.pw_gecos}
| null | null | null | in a pretty way
| codeqa | def format info data return {'gid' data pw gid 'groups' list groups data pw name 'home' data pw dir 'name' data pw name 'shell' data pw shell 'uid' data pw uid 'fullname' data pw gecos}
| null | null | null | null | Question:
How do user information return ?
Code:
def _format_info(data):
return {'gid': data.pw_gid, 'groups': list_groups(data.pw_name), 'home': data.pw_dir, 'name': data.pw_name, 'shell': data.pw_shell, 'uid': data.pw_uid, 'fullname': data.pw_gecos}
|
null | null | null | Does the code remove a security group from a server ?
| @utils.arg('server', metavar='<server>', help=_('Name or ID of server.'))
@utils.arg('secgroup', metavar='<secgroup>', help=_('Name of Security Group.'))
def do_remove_secgroup(cs, args):
server = _find_server(cs, args.server)
server.remove_security_group(args.secgroup)
| null | null | null | Yes
| codeqa | @utils arg 'server' metavar '<server>' help ' Nameor I Dofserver ' @utils arg 'secgroup' metavar '<secgroup>' help ' Nameof Security Group ' def do remove secgroup cs args server find server cs args server server remove security group args secgroup
| null | null | null | null | Question:
Does the code remove a security group from a server ?
Code:
@utils.arg('server', metavar='<server>', help=_('Name or ID of server.'))
@utils.arg('secgroup', metavar='<secgroup>', help=_('Name of Security Group.'))
def do_remove_secgroup(cs, args):
server = _find_server(cs, args.server)
server.remove_security_group(args.secgroup)
|
null | null | null | What does the code remove from a server ?
| @utils.arg('server', metavar='<server>', help=_('Name or ID of server.'))
@utils.arg('secgroup', metavar='<secgroup>', help=_('Name of Security Group.'))
def do_remove_secgroup(cs, args):
server = _find_server(cs, args.server)
server.remove_security_group(args.secgroup)
| null | null | null | a security group
| codeqa | @utils arg 'server' metavar '<server>' help ' Nameor I Dofserver ' @utils arg 'secgroup' metavar '<secgroup>' help ' Nameof Security Group ' def do remove secgroup cs args server find server cs args server server remove security group args secgroup
| null | null | null | null | Question:
What does the code remove from a server ?
Code:
@utils.arg('server', metavar='<server>', help=_('Name or ID of server.'))
@utils.arg('secgroup', metavar='<secgroup>', help=_('Name of Security Group.'))
def do_remove_secgroup(cs, args):
server = _find_server(cs, args.server)
server.remove_security_group(args.secgroup)
|
null | null | null | Does the code retrieve all default quotas ?
| def quota_class_get_default(context):
return IMPL.quota_class_get_default(context)
| null | null | null | Yes
| codeqa | def quota class get default context return IMPL quota class get default context
| null | null | null | null | Question:
Does the code retrieve all default quotas ?
Code:
def quota_class_get_default(context):
return IMPL.quota_class_get_default(context)
|
null | null | null | What does the code retrieve ?
| def quota_class_get_default(context):
return IMPL.quota_class_get_default(context)
| null | null | null | all default quotas
| codeqa | def quota class get default context return IMPL quota class get default context
| null | null | null | null | Question:
What does the code retrieve ?
Code:
def quota_class_get_default(context):
return IMPL.quota_class_get_default(context)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.