parameters: (oid)
return_statement: return 0 == cursor.fetchone()[0]
docstring: Returns True if the parent group of the given element ID is the root group.
docstring_summary: Returns True if the parent group of the given element ID is the root group.
docstring_tokens: Returns True if the parent group of the given element ID is the root group .
function: def _root_as_parent(oid):
      """ Returns True if the parent group of the given element ID is the root group. """
      cursor = connection.cursor()
      # Try to select the parent group of the parent group;
      # if none, then the parent group is the root group.
      cursor.execute('''
      SELECT count(*)
      FROM class_instance_class_instance cici1,
           class_instance_class_instance cici2,
           relation r
      WHERE cici1.class_instance_a = %s
        AND cici1.class_instance_b = cici2.class_instance_a
        AND cici1.relation_id = r.id
        AND r.relation_name = 'part_of'
        AND cici2.class_instance_a = cici1.class_instance_b
        AND cici2.relation_id = r.id
      ''' % int(oid))
      return 0 == cursor.fetchone()[0]
function_tokens: def _root_as_parent ( oid ) : cursor = connection . cursor ( ) # Try to select the parent group of the parent group; # if none, then the parent group is the root group. cursor . execute ( '''
      SELECT count(*)
      FROM class_instance_class_instance cici1,
           class_instance_class_instance cici2,
           relation r
      WHERE cici1.class_instance_a = %s
        AND cici1.class_instance_b = cici2.class_instance_a
        AND cici1.relation_id = r.id
        AND r.relation_name = 'part_of'
        AND cici2.class_instance_a = cici1.class_instance_b
        AND cici2.relation_id = r.id
      ''' % int ( oid ) ) return 0 == cursor . fetchone ( ) [ 0 ]