topic: a category of data index: a pointer to a specific piece of data for a given topic (alt: "index")
420298
function VaultValue(topic, index, mediaType) {
	// mediaType is optional, and may be set on setData

	this.operation = null; // null (no change), 'set', 'touch', 'delete'
	this.readMisses = [];

	this.topic = parseTopic(topic);
	this.index = parseIndex(index);
	this.expirationTime = undefined;
	this.mediaType = mediaType || undefined;
	this.didExist = undefined;
	this.willExist = undefined;

	this.data = undefined;
	this.encoding = undefined;

	// cache for all differently encoded versions of this.mediaType (holds only data)
	this.encodings = {};

	// data/encoding match the latest selected encoding
	// all encoded versions however can be found in this.encodings[]

	this.liveVersionUninit = undefined;
	this.liveDiff = undefined;
}
386715
function listTopics(next, done) {
    let params = next? {NextToken:next} : {}
    sns.listTopics(params, function _listTopics(err, result) {
      if (err) {
        done(err)
      }
      else {
        // keep track of our current iteration
        let index = 0
        let tidy = t=> t.TopicArn.split(':').reverse().shift()
        // iterate the topics seeking our name
        result.Topics.map(tidy).forEach(t=> {
          if (t === name) {
            found = result.Topics[index].TopicArn
          }
          index += 1
        })
        // if there are more pages walk those
        let more = result.NextToken && !found
        if (more) {
          listTopics(result.NextToken, done)
        }
        else {
          // otherwise we're done walking
          done()
        }
      }
    })
  }
556830
def add_data_point(self, value, number_format=None):
        
        data_point = CategoryDataPoint(self, value, number_format)
        self.append(data_point)
        return data_point
152879
def topics(self):
        
        topics_sorted = sorted(self._topics.items(), key=lambda t: t[0])
        return MappingProxyType(OrderedDict(topics_sorted))
1140700
def topic
      if @topic
        @topic
      else
        connected do
          fiber = Fiber.current
          callbacks = {}
          [331, 332, 403, 442].each do |numeric|
            callbacks[numeric] = @thaum.on(numeric) do |event_data|
              topic = event_data[:params].match(':(.*)').captures.first
              fiber.resume topic
            end
          end

          raw "TOPIC #{@name}"
          @topic = Fiber.yield
          callbacks.each do |type, callback|
            @thaum.callbacks[type].delete(callback)
          end

          @topic
        end
      end
    end
479638
def category(self, title, pageid=None, cparams=None, namespace=None):
        
        query = self.LIST.substitute(
            WIKI=self.uri,
            ENDPOINT=self.endpoint,
            LIST='categorymembers')
        status = pageid or title

        query += "&cmlimit=500"

        if namespace is not None:
            query += "&cmnamespace=%d" % namespace

        if title and pageid:
            title = None

        if title:
            query += "&cmtitle=" + safequote(title)

        if pageid:
            query += "&cmpageid=%d" % pageid

        if cparams:
            query += cparams
            status += ' (%s)' % cparams

        self.set_status('categorymembers', status)

        return query
269131
def searchFilesIndex(self, nameData, fileData, fileIndex, searchString, category="", math=False, game=False, extension=""):
		""""""
		try:
			fileFile = open(fileIndex, 'rt')
		except IOError:
			self.repo.printd("Error: Unable to read index file " + self.fileIndex)
			return None, None
			
		count = 1
		for line in fileFile:
			count += 1
			try:
				if nameData[count] != None:
					#category argument
					if category in line:
						fileData[count] = line[:len(line) - 1]
					else:
						nameData[count] = None
						fileData[count] = None
					#extension argument
					if extension in line:
						fileData[count] = line[:len(line) - 1]
					else:
						nameData[count] = None
						fileData[count] = None
					#Both game and math
					if (game and math):
						if ("/games/" in line or "/math/" in line or "/science" in line):
							nameData[count] = line[:len(line) - 1]
						else:
							nameData[count] = None
					#game option switch
					elif game:
						if "/games/" in line:
							fileData[count] = line[:len(line) - 1]
						else:
							nameData[count] = None
							fileData[count] = None
					#math option switch
					elif math:
						if ("/math/" in line or "/science/" in line):
							fileData[count] = line[:len(line) - 1]
						else:
							nameData[count] = None
							fileData[count] = None
			except:
				pass
				
		#Close the file and return
		fileFile.close()
		return fileData, nameData
26284
def topic(self):
        
        if self.api and self.topic_id:
            return self.api._get_topic(self.topic_id)
297318
def set_category(self, infohash_list, category):
        
        data = self._process_infohash_list(infohash_list)
        data['category'] = category
        return self._post('command/setCategory', data=data)
722666
def percentile_index(category, x, inclusive = false)
      total_encountered = 0
      @categories[category][:buckets].each_with_index do |count, index|
        total_encountered += count
        percentage = ((total_encountered.to_f / hits(category).to_f) * 100).floor
        return index if (inclusive && percentage >= x) || (!inclusive && percentage > x)
      end
    end
1222806
function indexWords( $contentObject, $indexArray, $wordIDArray, $placement = 0 )
    {
        $db = eZDB::instance();

        $contentObjectID = $contentObject->attribute( 'id' );

        // Count the total words in index text
        $totalWordCount = count( $indexArray );

        /* // Needs to be rewritten

        // Count the number of instances of each word
        $wordCountArray = array_count_values( $indexArray );

        // Strip double words
        $uniqueIndexArray = array_unique( $indexArray );

        // Count unique words
        $uniqueWordCount = count( $uniqueIndexArray );
        */

        // Initialize transformation system
        $trans = eZCharTransform::instance();

        $prevWordID = 0;
        $nextWordID = 0;
        $classID = $contentObject->attribute( 'contentclass_id' );
        $sectionID = $contentObject->attribute( 'section_id' );
        $published = $contentObject->attribute( 'published' );
        $valuesStringList = array();
        for ( $i = 0; $i < count( $indexArray ); $i++ )
        {
            $indexWord = $indexArray[$i]['Word'];
            $contentClassAttributeID = $indexArray[$i]['ContentClassAttributeID'];
            $identifier = $indexArray[$i]['identifier'];
            $integerValue = min( $indexArray[$i]['integer_value'], eZDBInterface::MAX_INT );
            $integerValue = max( $integerValue, eZDBInterface::MIN_INT );
            $wordID = $wordIDArray[$indexWord];

            if ( isset( $indexArray[$i+1] ) )
            {
                $nextIndexWord = $indexArray[$i+1]['Word'];
                $nextWordID = $wordIDArray[$nextIndexWord];
            }
            else
                $nextWordID = 0;
//            print( "indexing word : $indexWord <br> " );

            // Calculate the relevans ranking for this word
//            $frequency = ( $wordCountArray[$indexWord] / $totalWordCount );
            $frequency = 0;
            $valuesStringList[] = " ( '$wordID', '$contentObjectID', '$frequency', '$placement', '$nextWordID', '$prevWordID', '$classID', '$contentClassAttributeID', '$published', '$sectionID', '$identifier', '$integerValue' ) ";

            $prevWordID = $wordID;
            $placement++;
        }
        $dbName = $db->databaseName();

        if ( $dbName == 'mysql' )
        {
            if ( count( $valuesStringList ) > 0 )
            {
                $valuesString = implode( ',', $valuesStringList );
                $db->query( "INSERT INTO
                           ezsearch_object_word_link
                        ( word_id,
                          contentobject_id,
                          frequency,
                          placement,
                          next_word_id,
                          prev_word_id,
                          contentclass_id,
                          contentclass_attribute_id,
                          published,
                          section_id,
                          identifier,
                          integer_value )
                          VALUES $valuesString" );
            }
        }
        else
        {
            $db->begin();
            foreach ( array_keys( $valuesStringList ) as $key )
            {
                $valuesString = $valuesStringList[$key];
                $db->query("INSERT INTO
                           ezsearch_object_word_link
                           ( word_id,
                             contentobject_id,
                             frequency,
                             placement,
                             next_word_id,
                             prev_word_id,
                             contentclass_id,
                             contentclass_attribute_id,
                             published,
                             section_id,
                             identifier,
                             integer_value )
                             VALUES $valuesString"  );
            }
            $db->commit();
        }

        return $placement;
    }
1318483
def categories(self):
        
        r = [ch for ch in self._channels.values() if isinstance(ch, CategoryChannel)]
        r.sort(key=lambda c: (c.position, c.id))
        return r
1358053
public function index()
    {
        $this->paginate = [
            'contain' => ['CmsTermTaxonomy', 'CmsContent']
        ];
        $this->set('data', $this->paginate($this->CmsTermRelation));
        $this->set('_serialize', ['data']);
    }
980204
def topic_exists(name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    topics = list_topics(region=region, key=key, keyid=keyid, profile=profile)
    return name in list(topics.values() + topics.keys())
490419
public void index( final ByteBuffer index, final int position) {
			index.putInt( tag).putInt( getType()).putInt( position).putInt( count);
		}
902260
function (e) {
    if (e.index == null) {
      this.hovering = null
    } else {
      this.hovering = this.chart.categoryAxis.data[e.index]
    }
  }
802014
def _index_and_mapping(self, namespace):
        """"""
        index, doc_type = namespace.split(".", 1)
        return index.lower(), doc_type