! @brief Program by performing sector erases.
189712
def _sector_erase_program(self, progress_cb=_stub_progress):
        """"""
        actual_sector_erase_count = 0
        actual_sector_erase_weight = 0
        progress = 0

        progress_cb(0.0)

        # Fill in same flag for all pages. This is done up front so we're not trying
        # to read from flash while simultaneously programming it.
        progress = self._scan_pages_for_same(progress_cb)
        
        for sector in self.sector_list:
            if sector.are_any_pages_not_same():
                # Erase the sector
                self.flash.init(self.flash.Operation.ERASE)
                self.flash.erase_sector(sector.addr)
                self.flash.uninit()

                actual_sector_erase_weight += sector.erase_weight

                # Update progress
                if self.sector_erase_weight > 0:
                    progress_cb(float(progress) / float(self.sector_erase_weight))
                
                # The sector was erased, so we must program all pages in the sector
                # regardless of whether they were the same or not.
                for page in sector.page_list:

                    progress += page.get_program_weight()

                    self.flash.init(self.flash.Operation.PROGRAM)
                    self.flash.program_page(page.addr, page.data)
                    self.flash.uninit()
            
                    actual_sector_erase_count += 1
                    actual_sector_erase_weight += page.get_program_weight()

                    # Update progress
                    if self.sector_erase_weight > 0:
                        progress_cb(float(progress) / float(self.sector_erase_weight))

        progress_cb(1.0)

        LOG.debug("Estimated sector erase programmed page count: %i", self.sector_erase_count)
        LOG.debug("Actual sector erase programmed page count: %i", actual_sector_erase_count)

        return FlashBuilder.FLASH_SECTOR_ERASE
249386
def erase(self, message=None):
        """"""
        if not message:
            message = self.last_message
        # Move cursor to the beginning of line
        super(Animation, self).write("\033[G")
        # Erase in line from cursor
        super(Animation, self).write("\033[K")
625691
def purge():
    """"""
    print("Purging the Blended files!")

    # Remove the templates folder
    templ_dir = os.path.join(cwd, "templates")
    if os.path.exists(templ_dir):
        shutil.rmtree(templ_dir)

    # Remove the content folder
    cont_dir = os.path.join(cwd, "content")
    if os.path.exists(cont_dir):
        shutil.rmtree(cont_dir)

    # Remove the  build folder
    build_dir = os.path.join(cwd, "build")
    if os.path.exists(build_dir):
        shutil.rmtree(build_dir)

    # Remove config.py
    config_file_dir = os.path.join(cwd, "config.py")
    if os.path.exists(config_file_dir):
        os.remove(config_file_dir)

    # Remove config.pyc
    config2_file_dir = os.path.join(cwd, "config.pyc")
    if os.path.exists(config2_file_dir):
        os.remove(config2_file_dir)

    # Remove config.py
    config3_file_dir = os.path.join(cwd, "config.py.oldbak")
    if os.path.exists(config3_file_dir):
        os.remove(config3_file_dir)
583162
function purge( $printCallback = false, $microsleep = false, $max = false, $expiry = false )
    {
        $file = $this->filePath;
        if ( $max === false )
            $max = 100;
        $count = 0;
        $list = array();
        if ( is_file( $file ) )
        {
            $list = array( $file );
        }
        else
        {
            $globResult = glob( $file . "/*" );
            if ( is_array( $globResult ) )
            {
                $list = $globResult;
            }
        }
        do
        {
            if ( ( $count % $max ) == 0 && $microsleep )
                usleep( $microsleep ); // Sleep a bit to make the filesystem happier

            $count = 0;
            $file = array_shift( $list );

            if ( is_file( $file ) )
            {
                $mtime = @filemtime( $file );
                if ( $expiry === false ||
                     $mtime < $expiry ) // remove it if it is too old
                {
                    @unlink( $file );

                    eZClusterFileHandler::cleanupEmptyDirectories( $file );
                }
                ++$count;
            }
            else if ( is_dir( $file ) )
            {
                $globResult = glob( $file . "/*" );
                if ( is_array( $globResult ) )
                {
                    $list = array_merge( $globResult, $list );
                }
            }

            if ( $printCallback )
                call_user_func_array( $printCallback,
                                      array( $file, 1 ) );
        } while ( count( $list ) > 0 );
    }
49282
def clear(self):
        """"""
        self._points = _np.empty( (self.prealloc,self.dim) )
        self._slice_for_run_nr = []
        self.memleft = self.prealloc
903004
public void doLocalClear()
    {
        if(log.isDebugEnabled()) log.debug("Clear materialization cache");
        invokeCounter = 0;
        enabledReadCache = false;
        objectBuffer.clear();
    }
971417
public void resetWithShared(char[] buf, int start, int len)
    {
        // Let's first mark things we need about input buffer
        mInputBuffer = buf;
        mInputStart = start;
        mInputLen = len;

        // Then clear intermediate values, if any:
        mResultString = null;
        mResultArray = null;

        // And then reset internal input buffers, if necessary:
        if (mHasSegments) {
            clearSegments();
        }
    }
900348
def do_cleanup(self, subcmd, opts, *args):
        
        print "'svn %s' opts: %s" % (subcmd, opts)
        print "'svn %s' args: %s" % (subcmd, args)
1126264
def scrub_output_pre_save(model, **kwargs):
    """"""
    # only run on notebooks
    if model['type'] != 'notebook':
        return
    # only run on nbformat v4
    if model['content']['nbformat'] != 4:
        return

    for cell in model['content']['cells']:
        if cell['cell_type'] != 'code':
            continue
        cell['outputs'] = []
        cell['execution_count'] = None
531842
private void unloadSpectraConditionally(NavigableMap<Integer, IScan> scansInSubsetByNumber,
      LCMSDataSubset subset, Set<LCMSDataSubset> exlude) {
    boolean isOkToUnload;
    for (IScan scan : scansInSubsetByNumber.values()) {
      if (subset.isInSubset(scan)) {
        isOkToUnload = true;
        for (LCMSDataSubset exludedSubset : exlude) {
          if (exludedSubset.isInSubset(scan)) {
            isOkToUnload = false;
            break;
          }
        }
        if (isOkToUnload) {
          scan.setSpectrum(null, false);
        }
      }
    }
  }
949935
def clear(self):
        
        # The del_binfo() call here isn't necessary for normal execution,
        # but is for interactive mode, where we might rebuild the same
        # target and need to start from scratch.
        self.del_binfo()
        self.clear_memoized_values()
        self.ninfo = self.new_ninfo()
        self.executor_cleanup()
        try:
            delattr(self, '_calculated_sig')
        except AttributeError:
            pass
        self.includes = None
241058
private function CleanUp() {

		// remove possible empty keys
		$AVpossibleEmptyKeys = array('dataformat', 'bits_per_sample', 'encoder_options', 'streams', 'bitrate');
		foreach ($AVpossibleEmptyKeys as $dummy => $key) {
			if (empty($this->info['audio'][$key]) && isset($this->info['audio'][$key])) {
				unset($this->info['audio'][$key]);
			}
			if (empty($this->info['video'][$key]) && isset($this->info['video'][$key])) {
				unset($this->info['video'][$key]);
			}
		}

		// remove empty root keys
		if (!empty($this->info)) {
			foreach ($this->info as $key => $value) {
				if (empty($this->info[$key]) && ($this->info[$key] !== 0) && ($this->info[$key] !== '0')) {
					unset($this->info[$key]);
				}
			}
		}

		// remove meaningless entries from unknown-format files
		if (empty($this->info['fileformat'])) {
			if (isset($this->info['avdataoffset'])) {
				unset($this->info['avdataoffset']);
			}
			if (isset($this->info['avdataend'])) {
				unset($this->info['avdataend']);
			}
		}

		// remove possible duplicated identical entries
		if (!empty($this->info['error'])) {
			$this->info['error'] = array_values(array_unique($this->info['error']));
		}
		if (!empty($this->info['warning'])) {
			$this->info['warning'] = array_values(array_unique($this->info['warning']));
		}

		// remove "global variable" type keys
		unset($this->info['php_memory_limit']);

		return true;
	}
554292
def _erase_buffer(self, output_buffer):
        """"""

        erase_size = self._model.get(u'buffer_erase_size')

        buffer_type = u'storage'
        if output_buffer:
            buffer_type = u'streaming'

        old_readings = self._engine.popn(buffer_type, erase_size)

        # Now go through all of our walkers that could match and
        # update their availability counts and data buffer pointers
        for reading in old_readings:
            stream = DataStream.FromEncoded(reading.stream)

            for walker in self._queue_walkers:
                # Only notify the walkers that are on this queue
                if walker.selector.output == output_buffer:
                    walker.notify_rollover(stream)
1347034
def _sector_erase_program_double_buffer(self, progress_cb=_stub_progress):
        """"""
        actual_sector_erase_count = 0
        actual_sector_erase_weight = 0
        progress = 0

        progress_cb(0.0)

        # Fill in same flag for all pages. This is done up front so we're not trying
        # to read from flash while simultaneously programming it.
        progress = self._scan_pages_for_same(progress_cb)

        # Erase all sectors up front.
        self.flash.init(self.flash.Operation.ERASE)
        for sector in self.sector_list:
            if sector.are_any_pages_not_same():
                # Erase the sector
                self.flash.erase_sector(sector.addr)
                
                # Update progress
                progress += sector.erase_weight
                if self.sector_erase_weight > 0:
                    progress_cb(float(progress) / float(self.sector_erase_weight))
        self.flash.uninit()

        # Set up page and buffer info.
        current_buf = 0
        next_buf = 1
        page, i = self._next_nonsame_page(0)

        # Make sure there are actually pages to program differently from current flash contents.
        if page is not None:
            self.flash.init(self.flash.Operation.PROGRAM)

            # Load first page buffer
            self.flash.load_page_buffer(current_buf, page.addr, page.data)

            while page is not None:
                assert page.same is not None

                # Kick off this page program.
                current_addr = page.addr
                current_weight = page.get_program_weight()

                self.flash.start_program_page_with_buffer(current_buf, current_addr)
                
                actual_sector_erase_count += 1
                actual_sector_erase_weight += page.get_program_weight()

                # Get next page and load it.
                page, i = self._next_nonsame_page(i)
                if page is not None:
                    self.flash.load_page_buffer(next_buf, page.addr, page.data)

                # Wait for the program to complete.
                result = self.flash.wait_for_completion()
                if result != 0:
                    raise FlashProgramFailure('program_page(0x%x) error: %i'
                            % (current_addr, result), current_addr, result)
                
                # Swap buffers.
                current_buf, next_buf = next_buf, current_buf

                # Update progress
                progress += current_weight
                if self.sector_erase_weight > 0:
                    progress_cb(float(progress) / float(self.sector_erase_weight))

            self.flash.uninit()

        progress_cb(1.0)

        LOG.debug("Estimated sector erase programmed page count: %i", self.sector_erase_count)
        LOG.debug("Actual sector erase programmed page count: %i", actual_sector_erase_count)

        return FlashBuilder.FLASH_SECTOR_ERASE
523812
function() {
    if( this.gl !== null ){
      this.gl.deleteProgram( this.program );
      this.gl.deleteShader(  this.fShader  );
      this.gl.deleteShader(  this.vShader  );
      this.gl = null;
    }
  }
536277
public static function clearOutput(): void
  {
    // Return immediately if skipClearOutput is set.
    if (self::$skipClearOutput) return;

    $level = ob_get_level();

    // The following manual level counting is to deal with zlib.output_compression set to On.
    for ($i = $level; $i>0; --$i)
    {
      if (!@ob_end_clean())
      {
        ob_clean();
      }
    }

    if ($level>0)
    {
      // Restart output buffer in order to allow modification of headers.
      ob_start();
    }
  }
66960
def erase
      children.each { |c|
        c.erase
      }

      @win.werase if @win

      component.component.erase if cdk? && component? && component.init?
    end