Cut out bands outside the range (emin,emax)
180204
def bandana(self, emin=-np.inf, emax=np.inf):
        """"""
        bandmin = np.min(self.ebands, axis=1)
        bandmax = np.max(self.ebands, axis=1)
        ii = np.nonzero(bandmin < emax)
        nemax = ii[0][-1]
        ii = np.nonzero(bandmax > emin)
        nemin = ii[0][0]
        # BoltzTraP2.misc.info("BANDANA output")
        # for iband in range(len(self.ebands)):
        # BoltzTraP2.misc.info(iband, bandmin[iband], bandmax[iband], (
        # (bandmin[iband] < emax) & (bandmax[iband] > emin)))
        self.ebands = self.ebands[nemin:nemax]

        if isinstance(self.proj, np.ndarray):
            self.proj = self.proj[:,nemin:nemax,:,:]

        if self.mommat is not None:
            self.mommat = self.mommat[:, nemin:nemax, :]
        # Removing bands may change the number of valence electrons
        if self.nelect is not None:
            self.nelect -= self.dosweight * nemin
        return nemin, nemax
921720
def _apply_ranges(self, pat, hosts):
         

        (loose_pattern, limits) = self._enumeration_info(pat)
        if not limits:
            return hosts

        (left, right) = limits
        enumerated = enumerate(hosts)
        if left == '':
            left = 0
        if right == '':
            right = 0
        left=int(left)
        right=int(right)
        enumerated = [ h for (i,h) in enumerated if i>=left and i<=right ]
        return enumerated
1037949
def get_band_gap(self):
        """"""
        if self.outcar is not None and self.eignval is not None:
            bandgap = VaspParser._get_bandgap_eigenval(self.eignval, self.outcar)
        elif self.doscar is not None:
            bandgap = VaspParser._get_bandgap_doscar(self.doscar)
        else:
            return None
        return Property(scalars=[Scalar(value=round(bandgap, 3))], units='eV')
89566
def set_bounds(self, start, stop):
        
        for instrument in self.instruments:
            instrument.bounds = (start, stop)
1019298
private void mixChannelIntoBuffers(final int[] leftBuffer, final int[] rightBuffer, final int startIndex, final int endIndex, final ChannelMemory actMemo)
	{
		for (int i=startIndex; i<endIndex; i++)
		{
			// Retrieve the Sampledata for this point (interpolated, if necessary)
			long sample = actMemo.currentSample.getInterpolatedSample(doISP, actMemo.currentSamplePos, actMemo.currentTuningPos);

			// Resonance Filters
			if (actMemo.filterOn) sample = doResonance(actMemo, sample);

			// Volume Ramping (deClick) Left!
			long volL = actMemo.actRampVolLeft;
			if ((actMemo.deltaVolLeft>0 && volL>actMemo.actVolumeLeft) ||
				(actMemo.deltaVolLeft<0 && volL<actMemo.actVolumeLeft))
			{
				volL = actMemo.actRampVolLeft = actMemo.actVolumeLeft;
				actMemo.deltaVolLeft = 0;
			}
			else
			{
				actMemo.actRampVolLeft += actMemo.deltaVolLeft;
			}
			// Volume Ramping (deClick) Right!
			long volR = actMemo.actRampVolRight;
			if ((actMemo.deltaVolRight>0 && volR>actMemo.actVolumeRight) ||
				(actMemo.deltaVolRight<0 && volR<actMemo.actVolumeRight))
			{
				volR = actMemo.actRampVolRight = actMemo.actVolumeRight;
				actMemo.deltaVolRight = 0;
			}
			else
			{
				actMemo.actRampVolRight += actMemo.deltaVolRight;
			}
			
			// Fit into volume for the two channels
			leftBuffer[i] += (int)((sample * volL) >> Helpers.MAXVOLUMESHIFT);
			rightBuffer[i]+= (int)((sample * volR) >> Helpers.MAXVOLUMESHIFT);

			// Now fit the loops of the current Sample
			fitIntoLoops(actMemo);
			if (actMemo.instrumentFinished) break;
		}
	}
753895
def downto(min)
      if block_given?
        super {|dt| yield dt.clear_timezone_offset }
      else
        enum = super
        enum.each {|dt| dt.clear_timezone_offset }
        enum
      end
    end
156707
def lower_band(data, period, env_percentage):
    
    cb = center_band(data, period)
    lb = [val * (1 - float(env_percentage)) for val in cb]
    return lb
1173628
def emit(self, sound, exclude=set()):
        """"""
        nearby = self.nearby()
        try:
            exclude = set(exclude)
        except TypeError:
            exclude = set([exclude])
        exclude.add(self.entity)
        listeners = nearby - exclude
        for listener in listeners:
            listener.tell(sound)
432575
public static void insertBand( GrayS32 input, int band , InterleavedS32 output) {

		final int numBands = output.numBands;
		for (int y = 0; y < input.height; y++) {
			int indexIn = input.getStartIndex() + y * input.getStride();
			int indexOut = output.getStartIndex() + y * output.getStride() + band;
			int end = indexOut + output.width*numBands - band;
			for (; indexOut < end; indexOut += numBands , indexIn++ ) {
				output.data[indexOut] = input.data[indexIn];
			}
		}
	}
775381
public void zeroOut() {
    for (long off = baseOffset; off < baseOffset + length * WIDTH; off += WIDTH) {
      Platform.putLong(baseObj, off, 0);
    }
  }
611366
public void removeRange(int first, int last) {
        int ele;

        for (ele = first; ele <= last; ele++) {
            remove(ele);
        }
    }
435570
@Override
  public void skip(InH3Amp in)
  {
    int ch = read();
    
    switch (ch) {
    case 0x00: case 0x01: case 0x02: case 0x03: 
    case 0x04: case 0x05: case 0x06: case 0x07:
    case 0x08: case 0x09: case 0x0a: case 0x0b:
    case 0x0c: case 0x0d: case 0x0e: case 0x0f:
      
    case 0x10: case 0x11: case 0x12: case 0x13: 
    case 0x14: case 0x15: case 0x16: case 0x17:
    case 0x18: case 0x19: case 0x1a: case 0x1b:
    case 0x1c: case 0x1d: case 0x1e: case 0x1f:
      
    case 0x20: case 0x21: case 0x22: case 0x23: 
    case 0x24: case 0x25: case 0x26: case 0x27:
    case 0x28: case 0x29: case 0x2a: case 0x2b:
    case 0x2c: case 0x2d: case 0x2e: case 0x2f:
      
    case 0x30: case 0x31: case 0x32: case 0x33: 
    case 0x34: case 0x35: case 0x36: case 0x37:
    case 0x38: case 0x39: case 0x3a: case 0x3b:
    case 0x3c: case 0x3d: case 0x3e: case 0x3f:
      return;
      
    case 0x40: case 0x41: case 0x42: case 0x43: 
    case 0x44: case 0x45: case 0x46: case 0x47:
    case 0x48: case 0x49: case 0x4a: case 0x4b:
    case 0x4c: case 0x4d: case 0x4e: case 0x4f:
      
    case 0x50: case 0x51: case 0x52: case 0x53: 
    case 0x54: case 0x55: case 0x56: case 0x57:
    case 0x58: case 0x59: case 0x5a: case 0x5b:
    case 0x5c: case 0x5d: case 0x5e: case 0x5f:
      
    case 0x60: case 0x61: case 0x62: case 0x63: 
    case 0x64: case 0x65: case 0x66: case 0x67:
    case 0x68: case 0x69: case 0x6a: case 0x6b:
    case 0x6c: case 0x6d: case 0x6e: case 0x6f:
      
    case 0x70: case 0x71: case 0x72: case 0x73: 
    case 0x74: case 0x75: case 0x76: case 0x77:
    case 0x78: case 0x79: case 0x7a: case 0x7b:
    case 0x7c: case 0x7d: case 0x7e: case 0x7f:
      readLong(0,0);
      return;
      
    case 0x80: case 0x81: case 0x82: case 0x83: 
    case 0x84: case 0x85: case 0x86: case 0x87:
    case 0x88: case 0x89: case 0x8a: case 0x8b:
    case 0x8c: case 0x8d: case 0x8e: case 0x8f:
      
    case 0x90: case 0x91: case 0x92: case 0x93: 
    case 0x94: case 0x95: case 0x96: case 0x97:
    case 0x98: case 0x99: case 0x9a: case 0x9b:
    case 0x9c: case 0x9d: case 0x9e: case 0x9f:
      skipString(ch - 0x80);
      return;
      
    case 0xa0: case 0xa1: case 0xa2: case 0xa3: 
    case 0xa4: case 0xa5: case 0xa6: case 0xa7:
    case 0xa8: case 0xa9: case 0xaa: case 0xab:
    case 0xac: case 0xad: case 0xae: case 0xaf:
      
    case 0xb0: case 0xb1: case 0xb2: case 0xb3: 
    case 0xb4: case 0xb5: case 0xb6: case 0xb7:
    case 0xb8: case 0xb9: case 0xba: case 0xbb:
    case 0xbc: case 0xbd: case 0xbe: case 0xbf:
      skipString((int) readLong(ch - 0xa0, 5));
      return;
      
    case 0xc0: case 0xc1: case 0xc2: case 0xc3: 
    case 0xc4: case 0xc5: case 0xc6: case 0xc7:
      skip(ch - 0xc0);
      return;
      
    case 0xc8: case 0xc9: case 0xca: case 0xcb:
    case 0xcc: case 0xcd: case 0xce: case 0xcf:
      skip((int) readLong(ch - 0xc8, 3));
      return;
      
    case 0xd0:
      readDefinition(in);
      skip(in);
      return;
      
    case 0xd1: case 0xd2: case 0xd3: 
    case 0xd4: case 0xd5: case 0xd6: case 0xd7:
    case 0xd8: case 0xd9: case 0xda: case 0xdb:
    case 0xdc: case 0xdd: case 0xde: case 0xdf:
    {
      int id = ch - 0xd0;
      
      in.serializer(id).skip(this, in);
      return;
    }
      
    case 0xe0: case 0xe1: case 0xe2: case 0xe3: 
    case 0xe4: case 0xe5: case 0xe6: case 0xe7:
    case 0xe8: case 0xe9: case 0xea: case 0xeb:
    case 0xec: case 0xed: case 0xee: case 0xef:
    {
      int id = (int) readLong(ch - 0xe0, 4);
      
      in.serializer(id).skip(this, in);
    }
    
    case 0xf0: case 0xf1: case 0xf2:
      return;
      
    case 0xf3:
      skip(8);
      return;
      
    case 0xf4:
      skip(4);
      return;
      
    default:
      throw error(L.l("Unexpected opcode 0x{0} while skipping",
                      Integer.toHexString(ch)));
    }
  }
1196417
def axes_off(ax):
    
    ax.set_frame_on(False)
    ax.axes.get_yaxis().set_visible(False)
    ax.axes.get_xaxis().set_visible(False)
259050
private void fireOnCancelBasic(ChannelEvent e) {
        List<EventListener> listeners = changes.getListenerList(AMQP);
        for (EventListener listener : listeners) {
            ChannelListener amqpListener = (ChannelListener)listener;
            amqpListener.onCancelBasic(e);
        }
    }
1028291
def set_upper_lower_bands(self,e_lower,e_upper):
        
        lower_band = e_lower*np.ones((1,self.ebands.shape[1]))
        upper_band = e_upper*np.ones((1,self.ebands.shape[1]))

        self.ebands = np.vstack((lower_band,self.ebands,upper_band))
        if isinstance(self.proj,np.ndarray):
            proj_lower = self.proj[:,0:1,:,:]
            proj_upper = self.proj[:,-1:,:,:]
            self.proj = np.concatenate((proj_lower,self.proj,proj_upper),axis=1)
856548
function _off(sel, evt, fn) {
    $each(_bound(sel, evt, fn), (e) => {
        if (`on${e.evt}` in _doc) {
            e.el.removeEventListener(e.evt, e.cb);
        } else if (custom[e.evt]) {
            custom[e.evt][1](e.el, e.cb);
        }

        bound.splice(bound.indexOf(e), 1);
    });
}
491123
public static <T extends ImageGray<T>> void down(Planar<T> input ,
												  int sampleWidth , Planar<T> output )
	{
		for( int band = 0; band < input.getNumBands(); band++ ) {
			down(input.getBand(band), sampleWidth, output.getBand(band));
		}
	}