Determines report ID and number of LEDs for the report

@private
@method _determineReportId
@return {object} data.reportId and data.ledCount
775002
function _determineReportId(ledCount)
{
    var reportId = 9;
    var maxLeds = 64;

    if (ledCount < 8 * 3) {
        reportId = 6;
        maxLeds = 8;
    } else if (ledCount < 16 * 3) {
        reportId = 7;
        maxLeds = 16;
    } else if (ledCount < 32 * 3) {
        reportId = 8;
        maxLeds = 32;
    }

    return { 'reportId': reportId, 'maxLeds': maxLeds };
}
126320
function consoleReporter(reports, options = {}) {
  var hide = options.hide || {};
  (function _consoleReporter(reports) {
    reports.forEach(
      ({children, desc, status, counts, time, code, error}) => {
        let countStr = makeCounts(counts);
        let color    = statusInfo[status].color;
        let colorStr = `color: ${color}`;
        if (children) {
          let msg = desc;
          let collapse = hide.children || hide.passed && status === 'pass';
          if (!hide.counts) { msg = `${msg} (${countStr})`; }
          console[collapse ? 'groupCollapsed' : 'group']('%c' + msg, colorStr);
          _consoleReporter(children);
          console.groupEnd();
        } else {
          if (error) console.log('%c %s (%O)', colorStr, desc, error);
          else console.log('%c %s', colorStr, desc);
        }
      }
    );
  })(reports);
}
29396
function rndid(len) {
  len = len || 8;
  const id = rndm(len);

  if (document.getElementById(id)) {
    return rndid(len);
  }

  return id;
}
1247400
function () {
        var data = this.data;
        var nodes = this._nodes;

        for (var i = 0, len = nodes.length; i < len; i++) {
            nodes[i].dataIndex = -1;
        }

        for (var i = 0, len = data.count(); i < len; i++) {
            nodes[data.getRawIndex(i)].dataIndex = i;
        }
    }
165504
function getAuthorId() {
	var url = getParsedUrl();
	var splitPath = url.path.split('/');
	var isTeam = splitPath[1] == 'team';
	var id = isTeam ? 'team-' + splitPath[2] : splitPath[1];
	return id;
}
1172034
function checkForDuplicateIds( page ) {
      const idCount = {};
      forEachArea( page, items => {
         items.forEach( ({ id }) => {
            idCount[ id ] = idCount[ id ] ? idCount[ id ] + 1 : 1;
         } );
      } );

      const duplicates = Object.keys( idCount ).filter( id => idCount[ id ] > 1 );
      if( duplicates.length ) {
         throw formatError( page, `Duplicate widget/composition/layout ID(s): ${duplicates.join( ', ' )}` );
      }
   }
607350
function() {
                // return this._mgr.getStats.apply( this._mgr, arguments );
                var stats = this.request('get-stats');
    
                return {
                    successNum: stats.numOfSuccess,
    
                    // who care?
                    // queueFailNum: 0,
                    cancelNum: stats.numOfCancel,
                    invalidNum: stats.numOfInvalid,
                    uploadFailNum: stats.numOfUploadFailed,
                    queueNum: stats.numOfQueue
                };
            }
887423
function ()
	{
		var that = this;
		var dt = this.s.dt;

		// Find how many columns are hidden
		var hiddenColumns = dt.columns().indexes().filter( function ( idx ) {
			var col = dt.column( idx );

			if ( col.visible() ) {
				return null;
			}

			// Only counts as hidden if it doesn't have the `never` class
			return $( col.header() ).hasClass( 'never' ) ? null : idx;
		} );
		var haveHidden = true;

		if ( hiddenColumns.length === 0 || ( hiddenColumns.length === 1 && this.s.columns[ hiddenColumns[0] ].control ) ) {
			haveHidden = false;
		}

		if ( haveHidden ) {
			// Show all existing child rows
			dt.rows( { page: 'current' } ).eq(0).each( function (idx) {
				var row = dt.row( idx );

				if ( row.child() ) {
					var info = that.c.details.renderer( dt, row[0] );

					// The renderer can return false to have no child row
					if ( info === false ) {
						row.child.hide();
					}
					else {
						row.child( info, 'child' ).show();
					}
				}
			} );
		}
		else {
			// Hide all existing child rows
			dt.rows( { page: 'current' } ).eq(0).each( function (idx) {
				dt.row( idx ).child.hide();
			} );
		}
	}
888456
function report() {
      return Object.keys(eventsByFilename)
        .filter(testIncluded)
        .reduce(reduceFilenames, {});

      function testIncluded(filename) {
        return !excludeRegex || !excludeRegex.test(filename);
      }

      function reduceFilenames(reduced, filename) {
        var totalsByKey = {},
            list        = eventsByFilename[filename],
            lastKey     = null,
            lastTime    = NaN;

        // events consist of time,key pairs
        for (var i = 0; i < list.length; i += 2) {
          var time = list[i],
              key  = list[i + 1];
          if (lastKey) {
            var initial = totalsByKey[key] || 0,
                delta   = ((time - lastTime) / 1000) || 0;
            totalsByKey[lastKey] = initial + delta;
          }
          lastKey = key;
          lastTime = time;
        }

        // total at the end to guarantee consistency
        var total = 0;
        for (var key in totalsByKey) {
          total += totalsByKey[key];
        }
        totalsByKey.total = total;

        // store by the short filename
        var short = path.relative(process.cwd(), filename);
        reduced[short] = totalsByKey;
        return reduced;
      }
    }
431583
function countChildren(pipelineId) {
  var current = STATUS_MAP.pipelines[pipelineId];
  if (!current) {
    return [0, 0];
  }
  var total = 1;
  var done = 0;
  if (current.status == 'done') {
    done += 1;
  }
  for (var i = 0, n = current.children.length; i < n; i++) {
    var parts = countChildren(current.children[i]);
    total += parts[0];
    done += parts[1];
  }
  return [total, done];
}
889872
private Report getReport(ReportType reportType) {
        String type = null;
        String primaryColumn = null;
        Properties properties = new Properties();
        if (reportType != null) {
            type = reportType.getType();
            primaryColumn = reportType.getPrimaryColumn();
            for (PropertyType propertyType : reportType.getProperty()) {
                properties.setProperty(propertyType.getName(), propertyType.getValue());
            }
        }
        Report.ReportBuilder reportBuilder = Report.builder().primaryColumn(primaryColumn).properties(properties);
        if (type != null) {
            reportBuilder.selectedTypes(Report.selectTypes(type));
        }
        return reportBuilder.build();
    }
165907
function(oTable) {
			if (!oTable || !oTable._aRowHeights) {
				return 0;
			}

			var aRowHeights = oTable._aRowHeights;
			var iEstimatedViewportHeight = oTable._getDefaultRowHeight() * oTable.getVisibleRowCount();

			// Only sum rows filled with data, ignore empty rows.
			if (oTable.getVisibleRowCount() >= oTable._getTotalRowCount()) {
				aRowHeights = aRowHeights.slice(0, oTable._getTotalRowCount());
			}

			var iInnerVerticalScrollRange = aRowHeights.reduce(function(a, b) { return a + b; }, 0) - iEstimatedViewportHeight;
			if (iInnerVerticalScrollRange > 0) {
				iInnerVerticalScrollRange = Math.ceil(iInnerVerticalScrollRange);
			}

			return Math.max(0, iInnerVerticalScrollRange);
		}
841897
function getNextID () {
				var max = 0;
				_.forEach(newPages, function(page){
					if(page.id) max = Math.max(max, page.id*1);
				});
				var next = max*1+1;
				return next;
			}
720316
function () {
            var state = this.state;
            return (state.viewportDimensions.clientHeight < state.totalHeight) ||
                   (state.viewportDimensions.clientWidth < state.totalWidth);
        }
311081
def getFeatureReport(self, report_num=0, length=63):
        
        length += 1
        buf = bytearray(length)
        buf[0] = report_num
        self._ioctl(
            _HIDIOCGFEATURE(length),
            (ctypes.c_char * length).from_buffer(buf),
            True,
        )
        return buf
693654
function(){
            var fields = {};
            // Iterate over the calculations, get their fields
            var keys = this.calculationIDs();
            var calculations = this.calculations;
            for (var i = 0; i < keys.length; i++) {
                var calculation = calculations[keys[i]];
                for (var f = 0; f < calculation.outputFieldNames().length; f++) {
                    fields[calculation.outputFieldNames()[f]] = calculation.outputFields[calculation.outputFieldNames()[f]];
                }
            }
            return fields;
        }
903083
function () {
            var delegate = THIS[ this.hash ],
                i,
                len = delegate.activePointersLists.length,
                count = 0;

            for ( i = 0; i < len; i++ ) {
                count += delegate.activePointersLists[ i ].getLength();
            }

            return count;
        }