TODO: should return a base class for TimelineVx
353021
@SuppressWarnings("unused") // called through reflection by RequestServer
  public TimelineV3 fetch(int version, TimelineV3 s) {
    Timeline t = s.createAndFillImpl();
    t.snapshot = new TimelineSnapshot(H2O.CLOUD,TimeLine.system_snapshot());
    return s.fillFromImpl(t);
  }
366659
def create(cls, h:int, w:int, bboxes:Collection[Collection[int]], labels:Collection=None, classes:dict=None,
               pad_idx:int=0, scale:bool=True)->'ImageBBox':
        ""
        if isinstance(bboxes, np.ndarray) and bboxes.dtype == np.object: bboxes = np.array([bb for bb in bboxes])
        bboxes = tensor(bboxes).float()
        tr_corners = torch.cat([bboxes[:,0][:,None], bboxes[:,3][:,None]], 1)
        bl_corners = bboxes[:,1:3].flip(1)
        bboxes = torch.cat([bboxes[:,:2], tr_corners, bl_corners, bboxes[:,2:]], 1)
        flow = FlowField((h,w), bboxes.view(-1,2))
        return cls(flow, labels=labels, classes=classes, pad_idx=pad_idx, y_first=True, scale=scale)
1114195
def time_context_from_ref(self, timex):
        """"""
        # If the timex has a value set, it means that it refers to a DCT or
        # a TimeExpression e.g. "value": {"@id": "_:DCT_1"} and the parameters
        # need to be taken from there
        value = timex.get('value')
        if value:
            # Here we get the TimeContext directly from the stashed DCT
            # dictionary
            tc = self.doc.timexes.get(value['@id'])
            return tc
        return None
236008
@Override  // override with covariant return type
    public MinguoDate date(TemporalAccessor temporal) {
        if (temporal instanceof MinguoDate) {
            return (MinguoDate) temporal;
        }
        return new MinguoDate(LocalDate.from(temporal));
    }
16979
function factoryObjectGraph(ParentClassGraph) {
  /**
   * Inherited class. Class with methods for control links in graph.
   * Adapted for array collection.
   * 
   * @class
   * @description `import { ObjectGraph as Graph } from 'ancient-graph';`
   */
  class ObjectGraph extends ParentClassGraph {
    
    /**
     * Construct new graph and checks for required adaptation methods.
     * @param {Array[]} collection
     * @param {Object.<string, string>} fields - matching of fields in the link with fields in document
     * @param {Object} [config] - Additional config.
     * @param {Object} [config.aliases]
     * @param {String} [config.aliases.$]
     * @throws {Error} if the adapter methods is not complete
     */
    constructor(collection, fields, config) {
      super(...arguments);
      this.emitter = new EventEmitter();
    }
    
    /**
     * Specifies the id field on insert
     * 
     * @param {number} index
     * @param {Link} link
     * @return {number|string} id;
     */
    _idGenerator(index, link) {
      return ""+index;
    };
    
    /**
     * Generate insert modifier.
     * 
     * @param {number} index
     * @param {Link} link
     * @return {number|string} id;
     */
    _insertModifier(link) {
      var _modifier = {};
      for (var f in link) {
        if (this.fields[f]) {
          _modifier[this.fields[f]] = link[this.config.aliases[f]];
        }
      }
      return _modifier;
    };
    
    /**
     * Should insert new link into graph.
     * Return a synchronous result. This can be useful in your application. But for writing generic code, it is recommended to only use the callback result.
     * 
     * @param {Link} link
     * @param {Graph~insertCallback} [callback]
     * @param {Object} [context]
     * @return {number|string} [id]
     */
    insert(link, callback, context) {
      this.callback
      var _modifier = this._insertModifier(link);
      var index, error, id;
      try {
        index = this.collection.push(_modifier) - 1;
        if (!this.collection[index].hasOwnProperty(this.fields[this.config.aliases['id']])) {
          id = this.collection[index][this.fields[this.config.aliases['id']]] = this._idGenerator(index, this.collection[index]);
        }
        this.emitter.emit('insert', this.collection[index]);
      } catch(_error) {
        error = _error;
      }
      if (callback) {
        callback(error, id)
      }
      return id;
    }
    
    /**
     * Optional callback. If present, called with an error object as the first argument and, if no error, the unique id of inserted link as the second.
     *
     * @callback Graph~insertCallback
     * @param {Error} [error]
     * @param {number|string} [id]
     */
    
    /**
     * Push into link value some item/items.
     * 
     * @param {Array} data
     * @param {string|number|string[]|number[]} item
     */
    _updateModifierPush(data, item) {
      data.push(item);
    }
    
    /**
     * Push into link value some item/items if not already exists.
     * 
     * @param {Array} data
     * @param {string|number|string[]|number[]} item
     */
    _updateModifierAdd(data, item) {
      if (lodash.isArray(item)) {
        for (var i in item) {
          this._updateModifierAdd(data, item[i]);
        }
      } else {
        var index = lodash.indexOf(data, item);
        if (index < 0) {
          this._updateModifierPush(data, item);
        }
      }
    }
     
    /**
     * Remove from link value some item/items.
     * 
     * @param {Array} data
     * @param {string|number|string[]|number[]} item
     */
    _updateModifierRemove(data, item) {
      if (lodash.isArray(item)) {
        for (var i in item) {
          this._updateModifierRemove(data, item[i]);
        }
      } else {
        lodash.remove(data, function(value) {
          return value == item;
        });
      }
    }
  
    /**
     * Generate update modifier.
     * 
     * @param {LinkModifier} modifier 
     * @param {Object} result
     * @return {number|string} id;
     */
    _updateModifier(modifier, result) {
      for (var m in modifier) {
        if (this.fields[m]) {
          if (typeof(modifier[m]) == 'undefined') {
            delete result[this.fields[m]];
          } else {
            if (typeof(modifier[m]) == 'object') {
              if (lodash.isArray(modifier[m])) {
                result[this.fields[m]] = modifier[m];
              } else {
                if (!lodash.isArray(result[this.fields[m]])) {
                  result[this.fields[m]] = result[this.fields[m]]?[result[this.fields[m]]]:[];
                }
                for (var key in modifier[m]) {
                  if (key == 'add') {
                    this._updateModifierAdd(result[this.fields[m]], modifier[m][key]);
                  }
                  if (key == 'push') {
                    this._updateModifierPush(result[this.fields[m]], modifier[m][key]);
                  }
                  if (key == 'remove') {
                    this._updateModifierRemove(result[this.fields[m]], modifier[m][key]);
                  }
                }
              }
            } else {
              result[this.fields[m]] = modifier[m];
            }
          }
        }
      }
    };
    
    /**
     * Should update to new state of modifier object link by unique id or by link query object.
     * If the database allows, it is recommended to return a synchronous result. This can be useful in your application. But for writing generic code, it is recommended to only use the callback result.
     * 
     * @param {string|LinkSelector} selector
     * @param {LinkModifier} modifier
     * @param {Graph~updateCallback} [callback]
     * @param {Object} [context]
     * @return {number} [count]
     */
    update(selector, modifier, callback, context) {
      var results = this._fetch(selector);
      for (var r in results) {
        var oldResult = lodash.cloneDeep(results[r]);
        this._updateModifier(modifier, results[r]);
        this.emitter.emit('update', results[r], oldResult);
      }
      if (callback) callback(undefined, results.length);
      return results.length;
    }
    
    /**
     * Optional callback. If present, called with an error object as the first argument and, if no error, the number of affected documents as the second.
     *
     * @callback Graph~updateCallback
     * @param {Error} [error]
     * @param {number} [count]
     */
    
    /**
     * Should remove link by unique id or by link query object.
     * 
     * @param {string|LinkSelector} selector
     * @param {Graph~removeCallback} [callback]
     * @param {Object} [context]
     */
    remove(selector, callback, context) {
      var oldLength = this.collection.length;
      var removed = [];
      lodash.remove(this.collection, (result) => {
        var _query = this.query(selector)(result);
        if (_query) removed.push(result)
        return _query;
      });
      for (var r in removed) {
        this.emitter.emit('remove', removed[r]);
      }
      var newLength = this.collection.length;
      if (callback) callback(undefined, oldLength - newLength);
    }
    
    /**
     * Optional callback. If present, called with an error object as the first argument.
     *
     * @callback Graph~removeCallback
     * @param {Error} [error]
     * @param {number} [count]
     */
    
    /**
     * Generate adapter for database query for links search by unique id or by link query object.
     * 
     * @param {string|LinkSelector} selector
     * @return {*} query
     */
    query(selector) {
      var type = typeof(selector);
      if (type == 'string' || type == 'number') {
        return (doc) => { return doc[this.fields[this.config.aliases['id']]] == selector };
      } else if (type == 'object') {
        return (doc) => {
          if (typeof(doc) != 'object') return false;
          for (var m in selector) {
            if (this.fields[m]) {
              if (typeof(selector[m]) == 'undefined') {
                if (doc.hasOwnProperty(this.fields[m])) return false;
              } else {
                if (lodash.isArray(doc[this.fields[m]])) {
                  if (lodash.isArray(selector[m])) {
                    for (var s in selector[m]) {
                      if (!lodash.includes(doc[this.fields[m]], selector[m][s])) {
                        return false;
                      }
                    }
                  } else {
                    if (!lodash.includes(doc[this.fields[m]], selector[m])) {
                      return false;
                    }
                  }
                } else {
                  if (doc[this.fields[m]] != selector[m]) return false;
                }
              }
            }
          }
          return true;
        }
      }
    }
    
    /**
     * Generate adapted for database options object.
     * 
     * @param {Object} [options]
     * @return {*} options - a options suitable for the database
     */
    options(options) {
      var _options = {};
      if (options) {
        if (options.sort) {
          _options.sort = { keys: [], orders: [] };
          for (var s in options.sort) {
            if (this.fields[s]) {
              _options.sort.keys.push(this.fields[s]);
              _options.sort.orders.push(options.sort[s]?'asc':'desc');
            }
          }
        }
        if (typeof(options.skip) == 'number') {
          _options.skip = options.skip;
        }
        if (typeof(options.limit) == 'number') {
          _options.limit = options.limit;
        }
      }
      return _options;
    }
    
    /**
     * Generate Link from document by fields.
     * 
     * @param {Object} document
     * @return {Link} link
     */
    _generateLink(document) {
      var link = {};
      for (var f in this.fields) {
        if (document.hasOwnProperty(this.fields[f])) {
          link[f] = document[this.fields[f]];
        }
      }
      return link;
    }
    
    /**
     * Get one first matching link.
     * 
     * @param {string|LinkSelector} selector
     * @param {SelectOptions} [options]
     * @param {Graph~getCallback} [callback]
     * @return {Link} link - result link object
     */
    get(selector, options, callback) {
      var results = this.fetch(selector, options, (error, results) => {
        if (callback) callback(error, results?results[0]:undefined);
      });
      if (results) return results[0];
    }
    
    /**
     * Fetch native database documents.
     * 
     * @param {string|linkSelector} selector
     * @param {SelectOptions} [options]
     * @return {Object[]} documents - result documents
     */
    _fetch(selector, options) {
      var query = this.query(selector);
      var documents = lodash.filter(this.collection, query); 
      var _options = this.options(options);
      if (_options.sort) documents = lodash.orderBy(documents, _options.sort.keys, _options.orders);
      var skip = _options.skip?_options.skip:0;
      var limit = _options.limit?skip+_options.limit:_options.limit;
      documents = documents.slice(skip, limit);
      return documents;
    }
    
    /**
     * Find and all matching links as an Array.
     * 
     * @param {string|LinkSelector} selector
     * @param {SelectOptions} [options]
     * @param {Graph~fetchCallback} [callback]
     * @return {Link[]} links - result links objects in array
     */
    fetch(selector, options, callback) {
      var documents = this._fetch(selector, options);
      var links = [];
      for (var d in documents) {
        links.push(this._generateLink(documents[d]));
      }
      if (callback) callback(undefined, links);
      return links;
    }
    
    /**
     * Optional callback. If present, called with an error object as the first argument and, if no error, the result links objects in array.
     *
     * @callback Graph~fetchCallback
     * @param {Error} [error]
     * @param {Link[]} [links]
     */
    
    /**
     * Should call callback once for each matching document, sequentially and synchronously.
     * 
     * @param {string|LinkSelector} selector
     * @param {SelectOptions} [options]
     * @param {Graph~eachCallback} [callback]
     */
    each(selector, options, callback) {
      var links = this.fetch(selector, options);
      for (var l in links) {
        callback(links[l]);
      }
    }
    
    /**
     * @callback Graph~eachCallback
     * @param {Link} [link]
     */
    
    /**
     * Map callback over all matching documents. Returns an Array.
     * 
     * @param {string|LinkSelector} selector
     * @param {SelectOptions} [options]
     * @param {Graph~mapCallback} [callback]
     * @return {Array} results
     */
    map(selector, options, callback) {
      var links = this.fetch(selector, options);
      return links.map(callback);
    }
    
    /**
     * @callback Graph~mapCallback
     * @param {Link} [link]
     * @return {*} result
     */
    
    /**
     * Count all matching documents.
     * 
     * @param {string|LinkSelector} selector
     * @param {SelectOptions} [options]
     * @param {Graph~countCallback} [callback]
     * @return {number} [count]
     */
    count(selector, options, callback) {
      var links = this.fetch(selector, options);
      if (callback) callback(undefined, links.length);
      return links.length;
    }
    
    /**
     * @callback Graph~countCallback
     * @param {Error} [error]
     * @param {number} [count]
     */
    
    /**
     * Should subscribe to the events: link, unlink, insert, update, remove.
     * 
     * @param {string} event - One event name
     * @param {Graph~onCallback} callback
     * @returns {Function} Stops event subscription.
     * @example
     * var counter = 0;
     * var stop = graph.on('update', (oldData, newData) => {
     *   if (oldData.id == '1') console.log(oldData.id, 'is changed');
     *   counter++;
     *   if (counter == 3) stop();
     * });
     */
    on(event, callback) {
      var subscriptions = [];
      
      if (event == 'insert') {
        subscriptions.push(this.emitter.addListener('insert', (document) => {
          callback(undefined, this._generateLink(document));
        }));
      }
      if (event == 'update') {
        subscriptions.push(this.emitter.addListener('update', (newDocument, oldDocument) => {
          callback(this._generateLink(oldDocument), this._generateLink(newDocument));
        }));
      }
      if (event == 'remove') {
        subscriptions.push(this.emitter.addListener('remove', (document) => {
          callback(this._generateLink(document), undefined);
        }));
      }
      if (event == 'link') {
        subscriptions.push(this.emitter.addListener('insert', (document) => {
          callback(undefined, this._generateLink(document));
        }));
        subscriptions.push(this.emitter.addListener('update', (newDocument, oldDocument) => {
          callback(this._generateLink(oldDocument), this._generateLink(newDocument));
        }));
      }
      if (event == 'unlink') {
        subscriptions.push(this.emitter.addListener('update', (newDocument, oldDocument) => {
          callback(this._generateLink(oldDocument), this._generateLink(newDocument));
        }));
        subscriptions.push(this.emitter.addListener('remove', (document) => {
          callback(this._generateLink(document), undefined);
        }));
      }
      
      return () => {
        for (var subscription of subscriptions) {
          subscription.remove();
        }
      };
    }
    
    /**
     * @callback Graph~onCallback
     * @param {Link} [oldLink] - can be undefined on link and insert events
     * @param {Link} [newLink] - can be undefined on unlink and remove events
     * @param {Object} [context] - additional app information, such as context.userId
     */
  }
  
  return ObjectGraph;
}
696383
function (elem, timeline_config, options, init) {
		// DOM ELEMENTS
		this._el = {
			parent: {},
			container: {},
			slider: {},
			slider_background: {},
			line: {},
			marker_container_mask: {},
			marker_container: {},
			marker_item_container: {},
			timeaxis: {},
			timeaxis_background: {},
			attribution: {}
		};

		this.collapsed = false;

		if (typeof elem === 'object') {
			this._el.container = elem;
		} else {
			this._el.container = TL.Dom.get(elem);
		}

		this.config = timeline_config;

		//Options
		this.options = {
			width: 					600,
			height: 				600,
			duration: 				1000,
			ease: 					TL.Ease.easeInOutQuint,
			has_groups: 			false,
			optimal_tick_width: 	50,
			scale_factor: 			2, 				// How many screen widths wide should the timeline be
			marker_padding: 		5,
			timenav_height_min: 	150, 			// Minimum timenav height
			marker_height_min: 		30, 			// Minimum Marker Height
			marker_width_min: 		100, 			// Minimum Marker Width
			zoom_sequence:          [0.5, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] // Array of Fibonacci numbers for TimeNav zoom levels http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/fibtable.html
		};

		// Animation
		this.animator = null;

		// Ready state
		this.ready = false;

		// Markers Array
		this._markers = [];

		// Eras Array
		this._eras = [];
		this.has_eras = false;

		// Groups Array
		this._groups = [];

		// Row Height
		this._calculated_row_height = 100;

		// Current Marker
		this.current_id = "";

		// TimeScale
		this.timescale = {};

		// TimeAxis
		this.timeaxis = {};
		this.axishelper = {};

		// Max Rows
		this.max_rows = 6;

		// Animate CSS
		this.animate_css = false;

		// Swipe Object
		this._swipable;

		// Merge Data and Options
		TL.Util.mergeData(this.options, options);

		if (init) {
			this.init();
		}
	}
1135046
function createPythonClass (className, baseClass, body, methods, async = false) {

    const pythonStandardLibraries = {
        'base64': 'base64',
        'hashlib': 'hashlib',
        'math': 'math',
        'json.loads': 'json',
    }

    async = async ? 'async_support.' : ''

    const importFrom = (baseClass == 'Exchange') ?
        ('ccxt.' + async + 'base.exchange') :
        ('ccxt.' + async + baseClass)

    let bodyAsString = body.join ("\n")

    let header = [
        "# -*- coding: utf-8 -*-\n",
        "# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:",
        "# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code\n",
        'from ' + importFrom + ' import ' + baseClass,
        ... (bodyAsString.match (/basestring/) ? [
            "\n# -----------------------------------------------------------------------------\n",
            "try:",
            "    basestring  # Python 3",
            "except NameError:",
            "    basestring = str  # Python 2",
        ] : [])
    ]

    const libraries = []

    for (let library in pythonStandardLibraries) {
        const regex = new RegExp ("[^\\']" + library + "[^\\'a-zA-Z]")
        if (bodyAsString.match (regex))
            libraries.push ('import ' + pythonStandardLibraries[library])
    }

    const errorImports = []

    for (let error in errors) {
        const regex = new RegExp ("[^\\'\"]" + error + "[^\\'\"]")
        if (bodyAsString.match (regex))
            errorImports.push ('from ccxt.base.errors import ' + error)
    }

    const precisionImports = []

    for (let constant in precisionConstants) {
        if (bodyAsString.indexOf (constant) >= 0) {
            precisionImports.push ('from ccxt.base.decimal_to_precision import ' + constant)
        }
    }

    header = header.concat (libraries, errorImports, precisionImports)

    for (let method of methods) {
        const regex = new RegExp ('self\\.(' + method + ')\\s*\\(', 'g')
        bodyAsString = bodyAsString.replace (regex,
            (match, p1) => ('self.' + unCamelCase (p1) + '('))
    }

    header.push ("\n\nclass " + className + ' (' + baseClass + '):')

    const footer = [
        '', // footer (last empty line)
    ]

    const result = header.join ("\n") + "\n" + bodyAsString + "\n" + footer.join ('\n')
    return result
}
324746
function(sx, sy) {
                this.callBase({
                    beginValue: 0,
                    finishValue: 1,
                    setter: function(target, value, timeline) {
                        var delta = timeline.getDelta();
                        var kx = Math.pow(sx, delta);
                        var ky = Math.pow(sy, delta);
                        target.scale(ky, kx);
                    }
                });
            }
981146
def get_frame(self, idx, history_length=1):
        
        if idx >= self.current_size:
            raise VelException("Requested frame beyond the size of the buffer")

        if history_length > 1:
            assert self.state_buffer.shape[-1] == 1, \
                "State buffer must have last dimension of 1 if we want frame history"

        accumulator = []

        last_frame = self.state_buffer[idx]
        accumulator.append(last_frame)

        for i in range(history_length - 1):
            prev_idx = (idx - 1) % self.buffer_capacity

            if prev_idx == self.current_idx:
                raise VelException("Cannot provide enough history for the frame")
            elif self.dones_buffer[prev_idx]:
                # If previous frame was done - just append zeroes
                accumulator.append(np.zeros_like(last_frame))
            else:
                idx = prev_idx
                accumulator.append(self.state_buffer[idx])

        # We're pushing the elements in reverse order
        return np.concatenate(accumulator[::-1], axis=-1)
407471
function getBabelFrameIndexes(frames) {
  const startIndexes = frames.reduce((accumulator, frame, index) => {
    if (
      getFrameUrl(frame).match(/regenerator-runtime/i) &&
      frame.displayName === "tryCatch"
    ) {
      return [...accumulator, index];
    }
    return accumulator;
  }, []);

  const endIndexes = frames.reduce((accumulator, frame, index) => {
    if (
      getFrameUrl(frame).match(/_microtask/i) &&
      frame.displayName === "flush"
    ) {
      return [...accumulator, index];
    }
    if (frame.displayName === "_asyncToGenerator/<") {
      return [...accumulator, index + 1];
    }
    return accumulator;
  }, []);

  if (startIndexes.length != endIndexes.length || startIndexes.length === 0) {
    return frames;
  }

  // Receives an array of start and end index tuples and returns
  // an array of async call stack index ranges.
  // e.g. [[1,3], [5,7]] => [[1,2,3], [5,6,7]]
  // $FlowIgnore
  return flatMap(zip(startIndexes, endIndexes), ([startIndex, endIndex]) =>
    range(startIndex, endIndex + 1)
  );
}
828247
def timeline(self):
        """"""
        rev = int(self.db.get('site:rev'))
        if rev != self.revision:
            self.reload_site()

        return self._timeline
281825
def generate_timeline(usnjrnl, filesystem_content):
    
    journal_content = defaultdict(list)
    for event in usnjrnl:
        journal_content[event.inode].append(event)

    for event in usnjrnl:
        try:
            dirent = lookup_dirent(event, filesystem_content, journal_content)

            yield UsnJrnlEvent(
                dirent.inode, dirent.path, dirent.size, dirent.allocated,
                event.timestamp, event.changes, event.attributes)
        except LookupError as error:
            LOGGER.debug(error)
562794
def get_frame(self, index=None, onset=None):
        ''' 
        '''
        if onset:
            index = int(onset * self.fps)

        return super(VideoStim, self).get_frame(index)
562406
def timeline(self, uri):
        '''
        '''
        uri = self._uris["timeline"].format(uri)
        resp_json = self.get_parse(uri)

        return resp_json
1088372
function extendedCallback(res) {
        timeline.mark(`end:${id}`);
        // add full response data
        moduleData[id].response = getResDataObject(res);
        // flatten object for easy transformation/filtering later
        moduleData[id] = flatten(moduleData[id], { maxDepth: 5 });
        moduleData[id] = filterData(config, moduleData[id]);

        // if filter function returns falsey value, drop all data completely
        if (typeof moduleData[id] !== 'object') {
          timeline.data = timeline.data.filter(
            d => !new RegExp(id).test(d.name)
          );
          delete moduleData[id];
        }

        if (typeof originalCallback === 'function') {
          return originalCallback.apply(this, [res]);
        }
        return true;
      }
1140900
@SuppressWarnings("unchecked")
    @Override
    public ChronoLocalDateTimeImpl<D> with(TemporalAdjuster adjuster) {
        if (adjuster instanceof ChronoLocalDate) {
            // The Chronology is checked in with(date,time)
            return with((ChronoLocalDate) adjuster, time);
        } else if (adjuster instanceof LocalTime) {
            return with(date, (LocalTime) adjuster);
        } else if (adjuster instanceof ChronoLocalDateTimeImpl) {
            return ChronoLocalDateTimeImpl.ensureValid(date.getChronology(), (ChronoLocalDateTimeImpl<?>) adjuster);
        }
        return ChronoLocalDateTimeImpl.ensureValid(date.getChronology(), (ChronoLocalDateTimeImpl<?>) adjuster.adjustInto(this));
    }
919824
def home_timeline(self, delegate, params={}, extra_args=None):
        """"""
        return self.__get('/statuses/home_timeline.xml', delegate, params,
            txml.Statuses, extra_args=extra_args)