one entry for such objects.
486235
static public function fetchKeyword( $alphabet,
                           $classid,
                           $offset,
                           $limit,
                           $owner = false,
                           $sortBy = array(),
                           $parentNodeID = false,
                           $includeDuplicates = true,
                           $strictMatching = false,
                           $depth = 1 )
    {
        $classIDArray = array();
        if ( is_numeric( $classid ) )
        {
            $classIDArray = array( $classid );
        }
        else if ( is_array( $classid ) )
        {
            $classIDArray = $classid;
        }

        $showInvisibleNodesCond = eZContentObjectTreeNode::createShowInvisibleSQLString( true, false );
        $limitation = false;
        $limitationList = eZContentObjectTreeNode::getLimitationList( $limitation );
        $sqlPermissionChecking = eZContentObjectTreeNode::createPermissionCheckingSQL( $limitationList );

        $db_params = array();
        $db_params['offset'] = $offset;
        $db_params['limit'] = $limit;

        $keywordNodeArray = array();
        $lastKeyword = '';

        $db = eZDB::instance();

        //in SELECT clause below we will use a full keyword value
        //or just a part of ezkeyword.keyword matched to $alphabet respective to $includeDuplicates parameter.
        //In the case $includeDuplicates = ture we need only a part
        //of ezkeyword.keyword to be fetched in field to allow DISTINCT to remove rows with the same node id's
        $sqlKeyword = 'ezkeyword.keyword';
        if ( !$includeDuplicates )
        {
            $sqlKeyword = $db->subString('ezkeyword.keyword', 1, strlen( $alphabet ) ) . ' AS keyword ';
        }

        $alphabet = $db->escapeString( $alphabet );

        $sortingInfo = array();
        $sortingInfo['attributeFromSQL'] = '';
        $sqlTarget = $sqlKeyword.',ezcontentobject_tree.node_id';

        if ( is_array( $sortBy ) && count ( $sortBy ) > 0 )
        {
            switch ( $sortBy[0] )
            {
                case 'keyword':
                case 'name':
                    $sortingString = '';
                    if ( $sortBy[0] == 'name' )
                    {
                        $sortingString = 'ezcontentobject.name';
                    }
                    elseif ( $sortBy[0] == 'keyword' )
                    {
                        if ( $includeDuplicates )
                            $sortingString = 'ezkeyword.keyword';
                        else
                            $sortingString = 'keyword';
                    }

                    $sortOrder = true; // true is ascending
                    if ( isset( $sortBy[1] ) )
                        $sortOrder = $sortBy[1];
                    $sortingOrder = $sortOrder ? ' ASC' : ' DESC';
                    $sortingInfo['sortingFields'] = $sortingString . $sortingOrder;
                    break;
                default:
                    $sortingInfo = eZContentObjectTreeNode::createSortingSQLStrings( $sortBy );
            }

            // Fixing the attributeTargetSQL
            switch ( $sortBy[0] )
            {
                case 'keyword':
                    $sortingInfo['attributeTargetSQL'] = '';
                    break;
                case 'name':
                    $sortingInfo['attributeTargetSQL'] = ', ezcontentobject.name';
                    break;
                case 'attribute':
                case 'class_name':
                    break;
                default:
                    $sortingInfo['attributeTargetSQL'] .= ', ' . strtok( $sortingInfo["sortingFields"], " " );
            }

            $sqlTarget .= $sortingInfo['attributeTargetSQL'];
        }
        else
        {
            $sortingInfo['sortingFields'] = 'ezkeyword.keyword ASC';
        }

        //Adding DISTINCT to avoid duplicates,
        //check if DISTINCT keyword was added before providing clauses for sorting.
        if ( !$includeDuplicates && substr( $sqlTarget, 0, 9) != 'DISTINCT ' )
        {
            $sqlTarget = 'DISTINCT ' . $sqlTarget;
        }

        $sqlOwnerString = is_numeric( $owner ) ? "AND ezcontentobject.owner_id = '$owner'" : '';
        $parentNodeIDString = '';
        if ( is_numeric( $parentNodeID ) )
        {
            $notEqParentString  = '';
            // If the node(s) doesn't exist we return null.
            if ( !eZContentObjectTreeNode::createPathConditionAndNotEqParentSQLStrings( $parentNodeIDString, $notEqParentString, $parentNodeID, $depth ) )
            {
                return null;
            }
        }

        $sqlClassIDString = '';
        if ( is_array( $classIDArray ) and count( $classIDArray ) )
        {
            $sqlClassIDString = 'AND ' . $db->generateSQLINStatement( $classIDArray, 'ezkeyword.class_id', false, false, 'int' ) . ' ';
        }

        // composing sql for matching tag word, it could be strict equiality or LIKE clause
        // dependent of $strictMatching parameter.
        $sqlMatching = "ezkeyword.keyword LIKE '$alphabet%'";
        if ( $strictMatching )
        {
            $sqlMatching = "ezkeyword.keyword = '$alphabet'";
        }

        $query = "SELECT $sqlTarget
                  FROM ezkeyword
                       INNER JOIN ezkeyword_attribute_link ON (ezkeyword_attribute_link.keyword_id = ezkeyword.id)
                       INNER JOIN ezcontentobject_attribute ON (ezcontentobject_attribute.id = ezkeyword_attribute_link.objectattribute_id)
                       INNER JOIN ezcontentobject ON (ezcontentobject_attribute.version = ezcontentobject.current_version AND ezcontentobject_attribute.contentobject_id = ezcontentobject.id)
                       INNER JOIN ezcontentobject_tree ON (ezcontentobject_tree.contentobject_id = ezcontentobject.id)
                       INNER JOIN ezcontentclass ON (ezcontentclass.id = ezcontentobject.contentclass_id)
                       $sortingInfo[attributeFromSQL]
                       $sqlPermissionChecking[from]
                  WHERE
                  $parentNodeIDString
                  $sqlMatching
                  $showInvisibleNodesCond
                  $sqlPermissionChecking[where]
                  $sqlClassIDString
                  $sqlOwnerString
                  AND ezcontentclass.version = 0
                  AND ezcontentobject.status = ".eZContentObject::STATUS_PUBLISHED."
                  AND ezcontentobject_tree.main_node_id = ezcontentobject_tree.node_id
                  ORDER BY {$sortingInfo['sortingFields']}";

        $keyWords = $db->arrayQuery( $query, $db_params );

        $trans = eZCharTransform::instance();

        foreach ( $keyWords as $keywordArray )
        {
            $keyword = $keywordArray['keyword'];
            $nodeID = $keywordArray['node_id'];
            $nodeObject = eZContentObjectTreeNode::fetch( $nodeID );

            if ( $nodeObject != null )
            {
                $keywordLC = $trans->transformByGroup( $keyword, 'lowercase' );
                if ( $lastKeyword == $keywordLC )
                    $keywordNodeArray[] = array( 'keyword' => '', 'link_object' => $nodeObject );
                else
                    $keywordNodeArray[] = array( 'keyword' => $keyword, 'link_object' => $nodeObject );

                $lastKeyword = $keywordLC;
            }
            else
            {
                $lastKeyword = $trans->transformByGroup( $keyword, 'lowercase' );
            }
        }
        return array( 'result' => $keywordNodeArray );
    }
654494
def count(self, item):
        """"""
        if not isinstance(item, str):
            return 0
        count = 0
        for entry in self:
            if item.lower() == entry.lower():
                count += 1
        return count
1337477
def get_one(self):
        """"""
        self.default_val = None
        o = self.default_val
        d = self._query('get_one')
        if d:
            o = self.orm_class(d, hydrate=True)
        return o
1084110
def add_ones(a):
    """"""
    arr = N.ones((a.shape[0],a.shape[1]+1))
    arr[:,:-1] = a
    return arr
477669
def entries(self):
        
        layout = self._entryWidget.layout()
        output = []
        for i in range(layout.count() - 1):
            widget = layout.itemAt(i).widget()
            if not isinstance(widget, XOrbQueryEntryWidget):
                continue
            output.append(widget)
        return output
994809
def entry_key(*entry):
    """"""
    if len(entry) == 1:
        return (entry[0].path, entry[0].stage)
    else:
        return tuple(entry)
656543
private Entry<K, V> returnEntry(final Entry<K, V> e) {
    touchEntry(e.getKey());
    return e;
  }
1058947
def get_one(cls, db, *args, **kwargs):
        
        data = db[cls.collection].find_one(*args, **kwargs)
        if data:
            return cls.wrap_incoming(data, db)
        else:
            return None
293746
def objectcount(data, key):
    """"""
    objkey = key.upper()
    return len(data.dt[objkey])
204594
def primitive(self):
        """"""
        primitive = {}
        if self.entry_number is not None:
            primitive['entry-number'] = self.entry_number

        if self.item_hash is not None:
            primitive['item-hash'] = self.item_hash

        primitive['timestamp'] = self.timestamp.strftime(fmt)
        return primitive
242920
def one_of(self, items):
        
        return self._generate_test(
            lambda value: value in items,
            ('one_of', self._path, freeze(items))
        )
71944
function entries() {
  var result = []

  this.forEach(function(val, key) {
    result.push( [ key, val ] )
  })

  return result
}
1062087
private final void offerEntry(ChartEntry entry, double probability, int spanStart, int spanEnd) {
    int nextEntryIndex = chartSizes[spanStart][spanEnd];
    if (nextEntryIndex == chart[spanStart][spanEnd].length) {
      // Resize the arrays to fit the new entry.
      ChartEntry[] spanChart = chart[spanStart][spanEnd];
      double[] spanProbs = probabilities[spanStart][spanEnd];
      chart[spanStart][spanEnd] = Arrays.copyOf(spanChart, spanChart.length * 2);
      probabilities[spanStart][spanEnd] = Arrays.copyOf(spanProbs, spanChart.length * 2);
    }

    chart[spanStart][spanEnd][nextEntryIndex] = entry;
    probabilities[spanStart][spanEnd][nextEntryIndex] = probability;
    chartSizes[spanStart][spanEnd]++;
    totalChartSize++;
  }
114289
def ones(self, name, **kwargs):
        """"""
        return self._write_op(self._ones_nosync, name, **kwargs)
687493
def find_one(cls, *args, **kwargs):
        """"""
        database, collection = cls._collection_key.split('.')
        return current()[database][collection].find_one(*args, **kwargs)
230970
def containerFor(self, entry):
        
        try:
            index = self._compoundStack.index(entry)
        except ValueError:
            return None
        
        return self.widget(index + 1)
779941
def entry():
    """"""
    parser = argparse.ArgumentParser()
    parser.add_argument(
        'action', help='Action to take',
        choices=['from_hex', 'to_rgb', 'to_hex'],
    )
    parser.add_argument(
        'value', help='Value for the action',
    )
    parsed = parser.parse_args()
    if parsed.action != "from_hex":
        try:
            parsed.value = int(parsed.value)
        except ValueError:
            raise argparse.ArgumentError(
                "Value for this action should be an integer",
            )
    print(globals()[parsed.action](parsed.value))