Show information on a single track assigned to a respondent
199602
public function showTrackAction()
    {
        if ($this->showTrackSnippets) {
            $params = $this->_processParameters($this->showTrackParameters);

            $this->addSnippets($this->showTrackSnippets, $params);
        }
    }
571456
def show(self, start_date, end_date):
        """"""

        # title in the report file name
        vars = {"title": _("Time track"),
                "start": start_date.strftime("%x").replace("/", "."),
                "end": end_date.strftime("%x").replace("/", ".")}
        if start_date != end_date:
            filename = "%(title)s, %(start)s - %(end)s.html" % vars
        else:
            filename = "%(title)s, %(start)s.html" % vars

        self.dialog.set_current_name(filename)

        response = self.dialog.run()

        if response != gtk.ResponseType.OK:
            self.emit("report-chooser-closed")
            self.dialog.destroy()
            self.dialog = None
        else:
            self.on_save_button_clicked()
1129305
def value(self, name):
        """"""
        return self.tracks.get(name).row_value(self.controller.row)
490045
def handle_set_key(self):
        """"""
        track_id = self.reader.int()
        row = self.reader.int()
        value = self.reader.float()
        kind = self.reader.byte()
        logger.info(" -> track=%s, row=%s, value=%s, type=%s", track_id, row, value, kind)

        # Add or update track value
        track = self.tracks.get_by_id(track_id)
        track.add_or_update(row, value, kind)
1324117
public Track getTrack(int trackID) throws MusixMatchException {
		Track track = new Track();
		Map<String, Object> params = new HashMap<String, Object>();

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

		track = getTrackResponse(Methods.TRACK_GET, params);

		return track;
	}
392867
function getTrackInfo( list, keyOf ){

  var untrack = [], trackMap = {};

  for(var i = 0, len = list.length; i < len ; i++){

    var item = list[i];
    var trackKey = keyOf(list[i]);

    // can be stringify
    if( !trackMap.hasOwnProperty(trackKey) ){

      trackMap[ trackKey ] = i
    }else{

      untrack.push( i )
    }
  }

  return {
    untrack: untrack,
    trackMap: trackMap
  }
}
950947
def song_detail(ids):
    
    if not isinstance(ids, list):
        raise ParamsError()
    c = []
    for id in ids:
        c.append({'id': id})
    r = NCloudBot()
    r.method = 'SONG_DETAIL'
    r.data = {'c': json.dumps(c), 'ids': c, "csrf_token": ""}
    r.send()

    return r.response
1365360
def upload track
      if track.playlist_id and track.playlist_token
        response = JSON.parse(RestClient.post(UPLOAD_BASE, audioFile: track.file, title: track.title, playlistId: track.playlist_id,
                  playlistUploadToken: track.playlist_token, order: track.order, description: track.description,
                  longitude: track.longitude, latitude: track.latitude))
      else
        response = JSON.parse(RestClient.post(UPLOAD_BASE, audioFile: track.file, title: track.title,
                  order: track.order, description: track.description, longitude: track.longitude, latitude: track.latitude))
      end
      TrackUser.new(response)
    end
479203
def tracks(appears_on=nil,start=nil,count=nil,extras=nil)
      api.getTracksForArtist self,appears_on,start,count,extras
    end
837843
def updateTraceCount(self):
        """"""
        self.ui.ntracesLbl.setNum(self.ui.trackview.model().traceCount())
606282
def __stringify_body(self, request_or_response):
        '''  '''
        headers = self.__track_info['{}_headers'.format(request_or_response)]
        body = self.__track_info.get('{}_body'.format(request_or_response))
    
        if isinstance(body, CaseInsensitiveDict):
            body = json.dumps(dict(body), ensure_ascii=False)
    
        elif isinstance(body, (dict, list)):
            body = json.dumps(body, indent=2, ensure_ascii=False)
    
        elif isinstance(body, bytes):
            resp_content_type = headers.get("Content-Type", "")
            try:
                if "image" in resp_content_type:
                    self.__track_info["response_data_type"] = "image"
                    body = "data:{};base64,{}".format(
                        resp_content_type,
                        b64encode(body).decode('utf-8')
                    )
                else:
                    body = escape(body.decode("utf-8"))
            except UnicodeDecodeError:
                pass
    
        elif not isinstance(body, (basestring, numeric_types, Iterable)):
            # class instance, e.g. MultipartEncoder()
            body = repr(body)
    
        self.__track_info['{}_body'.format(request_or_response)] = body
292739
def load_id3(self, track):
        
        if not isinstance(track, strack):
            raise TypeError('strack object required')

        timestamp = calendar.timegm(parse(track.get("created-at")).timetuple())

        self.mapper[TIT1] = TIT1(text=track.get("description"))
        self.mapper[TIT2] = TIT2(text=track.get("title"))
        self.mapper[TIT3] = TIT3(text=track.get("tags-list"))
        self.mapper[TDOR] = TDOR(text=str(timestamp))
        self.mapper[TLEN] = TLEN(text=track.get("duration"))
        self.mapper[TOFN] = TOFN(text=track.get("permalink"))
        self.mapper[TCON] = TCON(text=track.get("genre"))
        self.mapper[TCOP] = TCOP(text=track.get("license"))
        self.mapper[WOAS] = WOAS(url=track.get("permalink-url"))
        self.mapper[WOAF] = WOAF(url=track.get("uri"))
        self.mapper[TPUB] = TPUB(text=track.get("username"))
        self.mapper[WOAR] = WOAR(url=track.get("user-url"))
        self.mapper[TPE1] = TPE1(text=track.get("artist"))
        self.mapper[TALB] = TALB(text="%s Soundcloud tracks"
                                 % track.get("artist"))

        if track.get("artwork-path") is not None:
            self.mapper[APIC] = APIC(value=track.get("artwork-path"))
1066670
def playlist_detail(self, playlist_id):
        
        action = 'mtop.alimusic.music.list.collectservice.getcollectdetail'
        payload = {'listId': playlist_id}
        code, msg, rv = self.request(action, payload)
        return rv['data']['data']['collectDetail']
940168
private Track getTrackResponse(String methodName, Map<String, Object> params)
			throws MusixMatchException {
		Track track = new Track();
		String response = null;
		TrackGetMessage message = null;

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

		Gson gson = new Gson();

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

		TrackData data = message.getTrackMessage().getBody().getTrack();

		track.setTrack(data);

		return track;
	}
80566
def tracklist():
    '''
    '''
    _c = 0
    server = getServer()
    _current = server.core.tracklist.index()
    for t in server.core.tracklist.get_tl_tracks():
        logging.debug('Got tl trak: %r', t)
        currently = ' -- CURRENT' if t['tlid'] == _current else ''
        print('{}: {}{}'.format(t['tlid'], t['track']['name'], currently))
        _c = _c+1
    print('==='*6)
    print('{} tracks in tracklist'.format(_c))
1226349
def get_status
      @result['tracks'].collect {|track| track.name if track.failure?}.compact.count.zero? ? 'Success' : 'Failure'
    end
1149601
def extract_listing(pid):
    """"""
    print("Extracting tracklisting...")
    listing_etree = open_listing_page(pid + '/segments.inc')
    track_divs = listing_etree.xpath('//div[@class="segment__track"]')

    listing = []
    for track_div in track_divs:
        try:
            artist_names = track_div.xpath('.//span[@property="byArtist"]'
                                           '//span[@class="artist"]/text()')
        except ValueError:
            artist_names = ['']

        if not artist_names:
            artist_names = ['']

        if len(artist_names) > 1:
            artists = ', '.join(artist_names[:-1]) + ' & ' + artist_names[-1]
        else:
            artists = artist_names[0]

        try:
            title, = track_div.xpath('.//p/span[@property="name"]/text()')
        except ValueError:
            title = ''

        try:
            label, = track_div.xpath('.//abbr[@title="Record Label"]'
                                     '/span[@property="name"]/text()')
        except ValueError:
            label = ''
        listing.append((artists, title, label))
    return listing