Removes empty or incomplete answers.
425752
def clean(self, elements):
		'''  '''

		cleanelements = []
		for i in xrange(len(elements)):
			if isempty(elements[i]):
				return []
			next = elements[i]
			if isinstance(elements[i], (list, tuple)):
				next = self.clean(elements[i])
			if next:
				cleanelements.append(elements[i])
		return cleanelements
572181
final void cleanStack() {
        for (Completion p = null, q = stack; q != null;) {
            Completion s = q.next;
            if (q.isLive()) {
                p = q;
                q = s;
            }
            else if (p == null) {
                casStack(q, s);
                q = stack;
            }
            else {
                p.next = s;
                if (p.isLive())
                    q = s;
                else {
                    p = null;  // restart
                    q = stack;
                }
            }
        }
    }
964233
def trim_empty_rows(self):
    """"""
    if self.nrows != 0:
      row_index = 0
      for row_index, row in enumerate(reversed(self.rows)):
        if not self.is_row_empty(row):
          break
      self.nrows = len(self.rows) - row_index
      self.rows = self.rows[:self.nrows]
    return self
100492
def clean(self, value):
        """"""

        if isinstance(value, six.string_types) and value.lower() == 'false':
            return False

        return bool(value)
1247025
def clear_completion(self):
        
        # Implemented from template for osid.grading.GradeSystemForm.clear_lowest_numeric_score
        if (self.get_completion_metadata().is_read_only() or
                self.get_completion_metadata().is_required()):
            raise errors.NoAccess()
        self._my_map['completion'] = self._completion_default
626980
public function cleanTerms()
    {
        // Remove any terms that were created.
        foreach ($this->terms as $term) {
            $this->getDriver()->termDelete($term);
        }
        $this->terms = array();
    }
719249
def clean(self):
        """"""
        terms = list(self)

        for t in terms:
            self.doc.remove_term(t)
1061521
public function removeEmptyCapabilities()
    {
        $this->db->query("DELETE FROM " . $this->db->usermeta . " WHERE meta_key LIKE '%" . $this->db->base_prefix . "_%capabilities%' AND meta_value = 'a:0:{}'");

        wp_cache_flush();
    }
1095814
def remove_empties
      self.keys.each do |key|
        if (self[key].kind_of?(Array) && self[key].empty?) || self[key].nil?
          self.delete(key)
        end
      end
    end
1255907
def clear(self, results=True, errors=True):
        '''
        
        '''
        if results:
            self.results = []
        if errors:
            self.errors = []
1067959
def _handle_empty(self, user, response):
        """"""
        if len(response.keys()) == 0:
            response = self.show_user(user)

            # And sometimes show_user can return nothing. Ask again...
            if len(response) == 0:
                response = self.show_user(user)
        return response
487960
def filter_empty(values, default=None):
    

    if values is None:
        return default
    elif hasattr(values, '__len__') and len(values) == 0:
        return default
    elif hasattr(values, '__iter__') and not isinstance(values, _filtered_types):
        filtered = type(values) if isinstance(values, _filter_types) else list
        values = filtered(
            v for v in values if not (v is None or (hasattr(v, '__len__') and len(v) == 0))
        )
        return default if len(values) == 0 else values

    return values
197606
def _clean_fields(self, omit_fields, sparse_fields, next_level_omits):
        
        sparse = len(sparse_fields) > 0
        to_remove = []

        if not sparse and len(omit_fields) == 0:
            return

        for field_name in self.fields:
            is_present = self._should_field_exist(
                field_name, omit_fields, sparse_fields, next_level_omits
            )

            if not is_present:
                to_remove.append(field_name)

        for remove_field in to_remove:
            self.fields.pop(remove_field)
996285
def blank?(str)
      str.nil? or (str.is_a? String and str.strip.empty?)
    end
1024901
function removeEmptySources (sources) {
    return _.reject(sources, function (obj) {
        return _.isEmpty(obj.transformed);
    });
}
987314
def _blank(*objs):
    """"""
    for o in objs:
        if bool(o):
            return BooleanValue(False)
    return BooleanValue(True)
910259
def _clear_minimum_terms(self, match_key):
        """"""
        try:  # clear match = True case
            del self._query_terms[match_key]['$gte']
        except KeyError:
            pass
        try:  # clear match = False case
            del self._query_terms[match_key]['$lt']
        except KeyError:
            pass
        try:
            if self._query_terms[match_key] == {}:
                del self._query_terms[match_key]
        except KeyError:
            pass