Extract track 1 data

@param pRawTrack1
track1 raw data
@return EmvTrack1 object
516067
public static EmvTrack1 extractTrack1Data(final byte[] pRawTrack1) {
		EmvTrack1 ret = null;

		if (pRawTrack1 != null) {
			EmvTrack1 track1 = new EmvTrack1();
			track1.setRaw(pRawTrack1);
			Matcher m = TRACK1_PATTERN.matcher(new String(pRawTrack1));
			// Check pattern
			if (m.find()) {
				// Set format code
				track1.setFormatCode(m.group(1));
				// Set card number
				track1.setCardNumber(m.group(2));
				// Extract holder name
				String[] name = StringUtils.split(m.group(4).trim(), CARD_HOLDER_NAME_SEPARATOR);
				if (name != null && name.length == 2) {
					track1.setHolderLastname(StringUtils.trimToNull(name[0]));
					track1.setHolderFirstname(StringUtils.trimToNull(name[1]));
				}
				// Read expire date
				SimpleDateFormat sdf = new SimpleDateFormat("yyMM", Locale.getDefault());
				try {
					track1.setExpireDate(DateUtils.truncate(sdf.parse(m.group(5)), Calendar.MONTH));
				} catch (ParseException e) {
					LOGGER.error("Unparsable expire card date : {}", e.getMessage());
					return ret;
				}
				// Read service
				track1.setService(new Service(m.group(6)));
				ret = track1;
			}
		}
		return ret;
	}
246139
def Extract_Checkpoints(self):
		'''
			
		'''
		soup = BeautifulSoup(self.page,'xml')

		if soup.find('result').string.strip() == 'failed':
			raise ValueError('The Tracking number is invalid.')

		status = soup.find('DOCKET_STATUS').string.strip()

		if status == 'Delivered':
			self.status = 'C'
		elif status == 'Rebooked':
			self.status = 'R'
		else:
			self.status = 'T'

		# Checkpoints extraction begins here
		rows = soup.findAll('ROW')

		for row in rows:
			'''
				Each row has four columns:
					date --- time --- location --- status
				Merge #1 and #2
				Append the 3 to self.tracking_data
			'''
			date = row.find('INTRANSIT_DATE').string.strip()
			time = row.find('INTRANSIT_TIME').string.strip()
			try:
				location = row.find('INTRANSIT_LOCATION').string.strip()
			except AttributeError:
				location = ''
			status = row.find('INTRANSIT_STATUS').string.strip()
			date_time = datetime.strptime(' '.join([date,time]),"%d-%b-%Y %H:%M")

			self.tracking_data.append({'status':status,'date':date_time,'location':location})

		# Sort the checkpoints based on Date and Time --- this is important
		self.tracking_data = sorted(self.tracking_data, key=lambda k: k['date'])
860685
function extractSrt (buffer) {
  const zip = new AdmZip(buffer)
  const srtZipEntry = zip
    .getEntries()
    .find(zipEntry =>
      zipEntry.entryName.endsWith('.srt')
    )
  return zip.readAsText(srtZipEntry)
}
507756
def create_track(self, path_in_ipod=None, checksum=None):
        
        if bool(path_in_ipod) == bool(checksum):
            raise Exception

        if not path_in_ipod:
            path_in_ipod = self.audiodb.get_voice(checksum)

        track = Track(self, path_in_ipod=path_in_ipod)

        return track
789965
public SoundCloudTrack getCurrentTrack() {
        if (mCurrentTrackIndex > -1 && mCurrentTrackIndex < mSoundCloudPlaylist.getTracks().size()) {
            return mSoundCloudPlaylist.getTracks().get(mCurrentTrackIndex);
        }
        return null;
    }
262458
public static Track2 from(final String rawTrackData)
  {
    final Matcher matcher = track2Pattern.matcher(trimToEmpty(rawTrackData));

    final String rawTrack2Data;
    final AccountNumber pan;
    final ExpirationDate expirationDate;
    final ServiceCode serviceCode;
    final String discretionaryData;

    if (matcher.matches())
    {
      rawTrack2Data = getGroup(matcher, 1);
      pan = new AccountNumber(getGroup(matcher, 2));
      expirationDate = new ExpirationDate(getGroup(matcher, 3));
      serviceCode = new ServiceCode(getGroup(matcher, 4));
      discretionaryData = getGroup(matcher, 5);
    }
    else
    {
      rawTrack2Data = null;
      pan = new AccountNumber();
      expirationDate = new ExpirationDate();
      serviceCode = new ServiceCode();
      discretionaryData = "";
    }

    return new Track2(rawTrack2Data,
                      pan,
                      expirationDate,
                      serviceCode,
                      discretionaryData);
  }
1090114
public long[] getTrackNumbers() {

        List<TrackFragmentBox> trackBoxes = this.getBoxes(TrackFragmentBox.class, false);
        long[] trackNumbers = new long[trackBoxes.size()];
        for (int trackCounter = 0; trackCounter < trackBoxes.size(); trackCounter++) {
            TrackFragmentBox trackBoxe = trackBoxes.get(trackCounter);
            trackNumbers[trackCounter] = trackBoxe.getTrackFragmentHeaderBox().getTrackId();
        }
        return trackNumbers;
    }
803535
public Map<String, String> extractTypes(XTrace trace) {
		return XCostType.instance().extractValues(trace);
	}
725209
def libvlc_media_tracks_release(p_tracks, i_count):
    '''
    '''
    f = _Cfunctions.get('libvlc_media_tracks_release', None) or \
        _Cfunction('libvlc_media_tracks_release', ((1,), (1,),), None,
                    None, ctypes.POINTER(MediaTrack), ctypes.c_uint)
    return f(p_tracks, i_count)
185529
def get_top_tracks(self, limit=None, cacheable=True):
        """"""
        params = self._get_params()
        if limit:
            params["limit"] = limit

        return self._get_things("getTopTracks", "track", Track, params, cacheable)
930447
protected List<EmvTransactionRecord> extractLogEntry(final byte[] pLogEntry) throws CommunicationException {
		List<EmvTransactionRecord> listRecord = new ArrayList<EmvTransactionRecord>();
		// If log entry is defined
		if (template.get().getConfig().readTransactions && pLogEntry != null) {
			List<TagAndLength> tals = getLogFormat();
			if (tals != null && !tals.isEmpty()) {
				// read all records
				for (int rec = 1; rec <= pLogEntry[1]; rec++) {
					byte[] response = template.get().getProvider()
							.transceive(new CommandApdu(CommandEnum.READ_RECORD, rec, pLogEntry[0] << 3 | 4, 0).toBytes());
					// Extract data
					if (ResponseUtils.isSucceed(response)) {
						try {
							EmvTransactionRecord record = new EmvTransactionRecord();
							record.parse(response, tals);

							if (record.getAmount() != null) {
								// Fix artifact in EMV VISA card
								if (record.getAmount() >= 1500000000) {
									record.setAmount(record.getAmount() - 1500000000);
								}

								// Skip transaction with null amount
								if (record.getAmount() == null || record.getAmount() <= 1) {
									continue;
								}
							}

							if (record != null) {
								// Unknown currency
								if (record.getCurrency() == null) {
									record.setCurrency(CurrencyEnum.XXX);
								}
								listRecord.add(record);
							}
						} catch (Exception e) {
							LOGGER.error("Error in transaction format: " + e.getMessage(), e);
						}
					} else {
						// No more transaction log or transaction disabled
						break;
					}
				}
			}
		}
		return listRecord;
	}
1112490
public function _hydrateTrackData(HpsTrackData $trackData, $xml)
    {
        $trackDataElement = $xml->createElement('hps:TrackData', $trackData->value);
        $trackDataElementMethod = $xml->createAttribute('method');
        $trackDataElementMethod->value = $trackData->method;
        $trackDataElement->appendChild($trackDataElementMethod);
        return $trackDataElement;
    }
1077608
def tracks_in_collection(start=nil,count=nil,sort=nil,
                             query=nil,extras=nil)
      api.getTracksInCollection self,start,count,sort,query,extras
    end
732977
public static ArrayList<Trajectory> splitTrackInSubTracks(Trajectory t, int windowWidth, boolean overlapping){
		int increment = 1;
		if(overlapping==false){
			increment=windowWidth;
		}
		ArrayList<Trajectory> subTrajectories = new ArrayList<Trajectory>();
		boolean trackEndReached = false;
		
		for(int i = 0; i < t.size(); i=i+increment)
		{
			int upperBound = i+(windowWidth);
			if(upperBound>t.size()){
				upperBound=t.size();
				trackEndReached=true;
			}
			Trajectory help = new Trajectory(2, i);
			for(int j = i; j < upperBound; j++){
				help.add(t.get(j));
			}
			subTrajectories.add(help);
			if(trackEndReached){
				i=t.size();
			}
		}
		return subTrajectories;
	}
295524
private void pruneTracks(SetTrackInfo<Desc> info, GrowQueue_I32 unassociated) {
		if( unassociated.size > maxInactiveTracks ) {
			// make the first N elements the ones which will be dropped
			int numDrop = unassociated.size-maxInactiveTracks;
			for (int i = 0; i < numDrop; i++) {
				int selected = rand.nextInt(unassociated.size-i)+i;
				int a = unassociated.get(i);
				unassociated.data[i] = unassociated.data[selected];
				unassociated.data[selected] = a;
			}
			List<PointTrack> dropList = new ArrayList<>();
			for (int i = 0; i < numDrop; i++) {
				dropList.add( info.tracks.get(unassociated.get(i)) );
			}
			for (int i = 0; i < dropList.size(); i++) {
				dropTrack(dropList.get(i));
			}
		}
	}
1125615
public long[] getTrackNumbers() {

        List<TrackBox> trackBoxes = this.getBoxes(TrackBox.class);
        long[] trackNumbers = new long[trackBoxes.size()];
        for (int trackCounter = 0; trackCounter < trackBoxes.size(); trackCounter++) {
            trackNumbers[trackCounter] = trackBoxes.get(trackCounter).getTrackHeaderBox().getTrackId();
        }
        return trackNumbers;
    }
1118880
public Subtitle getSubtitle(int trackID) throws MusixMatchException {
        Subtitle subtitle = null;
        SubtitleGetMessage message = null;
        Map<String, Object> params = new HashMap<String, Object>();

        params.put(Constants.API_KEY, apiKey);
        params.put(Constants.TRACK_ID, new String("" + trackID));

        String response = null;

        response = MusixMatchRequest.sendRequest(Helper.getURLString(
				Methods.TRACK_SUBTITLE_GET, params));

        Gson gson = new Gson();

        try {
            message = gson.fromJson(response, SubtitleGetMessage.class);
        } catch (JsonParseException jpe) {
            jpe.printStackTrace();
            handleErrorResponse(response);
        }

        subtitle = message.getContainer().getBody().getSubtitle();

        return subtitle;
    }