text stringlengths 3 1.05M |
|---|
class Fruit {
constructor() {
this.x;
this.y;
}
pickLocation = () => {
this.x = (Math.floor(Math.random() * row - 1) + 1) * scale;
this.y = (Math.floor(Math.random() * columns - 1) + 1) * scale;
};
drw = () => {
ctx.fillStyle = "#8e2710";
ctx.fillRect(this.x, this.y, scale, scale);
... |
!function(t){const e=t.ja=t.ja||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"","Almost equal to":"",Angle:"","Approximately equal to":"",Aquamarine:"薄い青緑","Asterisk operator":"","Austral sign":"","back with leftwards arrow above":"","Bitcoin sign":"",Black:"黒","Block quote":"ブロッククオート(引用)",Blue:"青",Bold:"... |
//Test environment conditions
const helpers = require('./extras/helpers');
helpers.dependencyChecker();
//Requires
const { dir, log, logOk, logWarn, logError, cleanTerminal, setTTYTitle } = require('./extras/console');
const txAdmin = require('./txAdmin.js');
//==============================================... |
import lib from './lib';
window.onload = function () {
document.body.innerHTML += `<div>${window.location.href}</div><div>${lib}</div>`;
};
|
from django.template.response import TemplateResponse
from django.contrib.auth.models import User
from api.models import Account
import json
def base_view(request):
if not request.user.is_authenticated():
return TemplateResponse(request, 'login.html', {})
account = Account.objects.get(user_id=request.... |
/**
* These are private action types reserved by Redux.
* For any unknown actions, you must return the current state.
* If the current state is undefined, you must return the initial state.
* Do not reference these action types directly in your code.
*/
const randomString = () =>
// akashicはMath.random()を使えないので... |
var searchData=
[
['om_5fmerge_5ftraits',['OM_Merge_Traits',['../a04476.html#a746c83f2828928d4e7c4de0b2613e396',1,'Traits.hh']]],
['om_5fmerge_5ftraits_5fin_5ftemplate',['OM_Merge_Traits_In_Template',['../a04476.html#a97a9676df79fe2881136f983f3cf3b05',1,'Traits.hh']]]
];
|
import styled from 'styled-components/native';
export const Container = styled.View`
background-color: #fff;
border-radius: 4px;
margin-bottom: 15px;
padding: 20px;
`;
export const Title = styled.View`
align-items: center;
display: flex;
flex-direction: row;
justify-content: space-between;
`;
export ... |
import Utils from "../Utils"
export default class Wall extends Phaser.Physics.Arcade.Image {
constructor(scene, data) {
// const position = Utils.tiledRectanglePosition(data)
const texture = data.width > data.height ? 'wall_h' : 'wall_v'
super(scene, data.x, data.y, texture)
this.se... |
from django.db.models import Sum
from ...order import OrderStatus
from ...product import models
from ..utils import get_database_id, get_user_or_app_from_context
from ..utils.filters import filter_by_period
from .filters import (
filter_attributes_by_product_types,
filter_products_by_stock_availability,
)
de... |
import React from 'react'
import { FormattedMessage, injectIntl } from 'react-intl'
import classNames from 'classnames'
import _map from 'lodash/map'
import WithNominatimSearch from '../../HOCs/WithNominatimSearch/WithNominatimSearch'
import BusySpinner from '../../BusySpinner/BusySpinner'
import SvgSymbol from '../../... |
$(function () {
$('#notifications').popover({html: true, content: 'Loading...', trigger: 'manual'});
$("#notifications").click(function () {
if ($(".popover").is(":visible")) {
$("#notifications").popover('hide');
}
else {
$("#notifications").popover('show');
$.ajax({
url: '/n... |
from conans import ConanFile, tools, AutoToolsBuildEnvironment
from conans.errors import ConanInvalidConfiguration
import os
class LibmountConan(ConanFile):
name = "libmount"
description = "The libmount library is used to parse /etc/fstab, /etc/mtab and /proc/self/mountinfo files, manage the mtab file, evalua... |
import { __assign } from "tslib";
import * as React from 'react';
import { StyledIconBase } from '../../StyledIconBase';
export var Foggy = React.forwardRef(function (props, ref) {
var attrs = {
"fill": "currentColor",
"xmlns": "http://www.w3.org/2000/svg",
};
return (React.createElement(Sty... |
import PageWidth from "../../../components/PageWidth";
export default function Landing() {
return <section className="py-40 px-4">
<PageWidth>
<header className="text-7xl">What is Encounter?</header>
<p className="text-gray text-2xl mt-14">It is a three-day spiritual experience wherein the believer w... |
import calendar
import datetime
import json
import time
from datetime import date
from telethon import TelegramClient
try:
with open('forms.json', encoding='utf8') as json_file:
forms = json.load(json_file)
except json.decoder.JSONDecodeError:
print("something with Json forms")
try:
with open('co... |
import sys
import os
import yaml
import glob
import shutil
from conda_build.config import Config
config = Config()
with open(os.path.join(sys.argv[1], 'meta.yaml')) as f:
name = yaml.load(f)['package']['name']
binary_package_glob = os.path.join(config.bldpkgs_dir, '{0}*.tar.bz2'.format(name))
binary_package = gl... |
export { default as OverlayList } from './list';
|
/*eslint-env mocha*/
/*global BOOMR_test*/
describe("e2e/05-angular/105-hard-redirect", function() {
var tf = BOOMR.plugins.TestFramework;
var t = BOOMR_test;
var assert = window.chai.assert;
it("Should have sent one beacon", function() {
assert.isDefined(window.beacon);
});
it("Should have included the redi... |
define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = ... |
$(document).ready(function() {
$(".clickable-rainbow span").click(function() {
$("#rainbow").toggle();
});
$(".clickable-monkey span").click(function() {
$("#monkey").fadeToggle();
$("")
});
$(".clickable-lollipop span").click(function() {
$("#lollipop").slideToggle();
});
$("button#b... |
const { Command } = require("discord.js-commando");
const Discord = require("discord.js");
const Canvas = require("Canvas");
const snekfetch = require("snekfetch");
const { promisifyAll } = require("tsubaki");
module.exports = class InvertCommand extends Command {
constructor(client) {
super(client, {
name... |
/**
* @fileoverview This rule sets a specific indentation style and width for your code
*
* @author Teddy Katz
* @author Vitaly Puzrin
* @author Gyandeep Singh
*/
'use strict'
// ------------------------------------------------------------------------------
// Requirements
// -----------------------------------... |
/* Get prototype of an object.
*
* |Name |Desc |
* |------|---------------------------------------------|
* |obj |Target object |
* |return|Prototype of given object, null if not exists|
*/
/* example
* const a = {};
* getProto(Object.cr... |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------
# drawElements Quality Program utilities
# --------------------------------------
#
# Copyright 2015 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... |
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{1192:function(e,t,r){"use strict";r.r(t),r.d(t,"WithTooltipPure",(function(){return Ge})),r.d(t,"WithToolTipState",(function(){return Ke})),r.d(t,"WithTooltip",(function(){return Ke}));r(27),r(56),r(45),r(23),r(32),r(25),r(24),r(35),r(28),r(29),r(19),r(50),r(33),... |
import {Checkbox, TableCell, TableHead, TableRow, TableSortLabel} from "@mui/material";
import Box from "@mui/material/Box";
import {visuallyHidden} from "@mui/utils";
import * as PropTypes from "prop-types";
import React from "react";
import {useTranslation} from "react-i18next";
export function SortableTableHead(pro... |
// Copyright (c) 2021, Marcelo Jorge Vieira
// Licensed under the BSD 3-Clause License
import React from "react";
import PropTypes from "prop-types";
import { makeStyles } from "@material-ui/core/styles";
import { Typography } from "@material-ui/core";
const useStyles = makeStyles((theme) => ({
title: {
backgro... |
# -*- coding: utf-8 -*-
from flask import Flask, session, redirect, request, Response, render_template, url_for, jsonify
from flask.json import JSONEncoder
from model.User import *
from model.Repository import *
from Application import *
from controller.Draw import *
from datetime import datetime, timedelta
import simp... |
// emulate a DIAL device
var ssdp = require('../index.js');
ssdp.createDevice({
uuid: '2fac1234-31f8-11b4-a222-08002b34c003',
serviceList: ['upnp:rootdevice', 'urn:dial-multiscreen-org:device:dial:1', 'urn:dial-multiscreen-org:service:dial:1'],
location: 'http://url.to.your/device.description.xml'
}, fun... |
export function raceToSuccess (promises) {
return Promise.all(
promises.map(p =>
// If a request fails, count that as a resolution so it will keep
// waiting for other possible successes. If a request succeeds,
// treat it as a rejection so Promise.all immediately bails out.
p.then(val =>... |
function lowercase (string) {
return string.toLowerCase()
}
module.exports = lowercase
|
const { body, check } = require("express-validator");
const registerValidations = [
body("name").isLength({ min: 3 }),
body("surName").isLength({ min: 6 }),
body("email").isEmail().normalizeEmail(),
];
const accessTokenValidations = [body("email").isEmail().normalizeEmail()];
const registerAddressValidations =... |
export const checkUserAccess = (list, studyToCheck) => {};
export const reshapeSummary = controlledAccessSummary => (
[ // Sorting order for the modal, as per requirement
'controlled',
'open',
'in_process',
]
.reduce((acc, genesMutationsAccess) => ({
...acc,
[genesMutationsAccess]: cont... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import argparse
from glob import glob
from tqdm import tqdm
from multiprocessing import Pool
from toolkit.datasets import OTBDataset, UAVDataset, LaSOTDataset,... |
(function(){var supportsDirectProtoAccess=function(){var z=function(){}
z.prototype={p:{}}
var y=new z()
if(!(y.__proto__&&y.__proto__.p===z.prototype.p))return false
try{if(typeof navigator!="undefined"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Chrome/")>=0)return true
if(typeof version=="fun... |
__NUXT_JSONP__("/amp/26/25", (function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,$,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as){return {data:[{metaTitle:B,metaDesc:C,verseId:25,surahId:26,currentSurah:{number:"26",name:"الشعراۤء",name_latin:"A... |
import csv
import json
import pathlib
import typing
import attr
@attr.s(auto_attribs=True)
class FileDescriptor(object):
filename: str = ""
timestamp: str = ""
description: str = ""
file_type: str = ""
@attr.s(auto_attribs=True)
class FileDescriptors(object):
descriptors: typing.List[FileDescrip... |
from ubuntuk8s import ubuntuk8s
def main():
ubuntuk8s.main()
if __name__ == '__main__':
main()
|
"use strict";
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() {... |
import discord
from discord.ext import commands
import Database
class Events(commands.Cog):
def __init__(self, client: commands.AutoShardedBot):
self.client = client
@commands.Cog.listener(name="Вход на сервер")
async def on_guild_join(self, guild: discord.Guild):
Database.add_... |
import pytest
import optuna
import joblib
import numpy as np
from distributed import Client
from distributed.utils_test import gen_cluster
import dask_optuna
from .utils import get_storage_url
STORAGE_MODES = ["inmemory", "sqlite"]
def objective(trial):
x = trial.suggest_uniform("x", -10, 10)
return (x - 2... |
import { changeLocale } from '../languageProvider.action';
import { CHANGE_LOCALE } from '../languageProvider.constant';
describe('LanguageProvider actions', () => {
describe('Change Local Action', () => {
it('has a type of CHANGE_LOCALE', () => {
const expected = {
type: CHANGE_LOCALE,
lo... |
$(document).on('turbolinks:load', function () {
var windowWidth = $(window).width();
if (windowWidth <= 992) { //for iPad & smaller devices
$('#accordion .panel-collapse').collapse('hide');
$('#accordion .expand_caret').addClass('fa-rotate-180');
} else {
$('.toggle-all-facets .expand-text').hide()... |
import SimpleSchema from 'simpl-schema';
import languageEnum from '../../../../../lib/enum/language.enum.js';
import languageLevelEnum from '../../../../../lib/enum/language-level.enum.js';
export default new SimpleSchema({
language: [new SimpleSchema({
language: {
type: String,
opt... |
import argparse
import os
from utils.inference_helper import generate_inference
from utils.model_loader import load_custom_model
from glob import glob
from tqdm import tqdm
import yaml
def execute_inference():
parser = argparse.ArgumentParser()
parser.add_argument('-y', '--yaml', default='config/parameters.ya... |
import * as React from 'react';
import { Platform, StatusBar, StyleSheet, View } from 'react-native';
import { SplashScreen } from 'expo';
import * as Font from 'expo-font';
import { Ionicons } from '@expo/vector-icons';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } fro... |
/**
* Copyright (c) 2018 pirakansa
*/
import program from "commander";
import fs from "fs";
import config from "config";
import * as encrypt from "./EncryptionData";
/**
* xor
* @param {bool} a
* @param {bool} b
*/
function XOR(a, b) {
return (a || b) && !(a && b);
}
/**
* print error message
* @param {er... |
openFace.controller('login_ctrl', ['$scope', '$http', '$location', '$window', function($scope, $http, $location, $window) {
$scope.login = function() {
$http.post("http://localhost:3000/login", { email: $scope.email, password: $scope.password }).success(function(response) {
if (response.success)... |
import os
import sys
from dataclasses import dataclass, field
if sys.version_info < (3, 9):
from typing_extensions import Annotated
else:
from typing import Annotated
from di import AsyncExecutor, Container, Dependant
class AbstractDBConn:
def execute(self, query: str) -> str:
...
@dataclass
c... |
console.log(5 + 4);
console.log (9-4);
console.log (3*4);
console.log(7/2);
// Mod operator
console.log (7 % 2);
console.log (12.3 % 5);
let value = 2;
value++;
console.log(value);
++value;
console.log(value);
--value;
console.log(value);
value--;
console.log(value); |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
import '@storybook/addon-actions/register'
import 'storybook-addon-material-ui'
|
import MovingObject from "./moving_object";
import Util from "./util";
import Game from "./game.js";
import Ship from "./ship.js";
import Bullet from "./bullet.js";
const DEFAULTS = {
COLOR: "#5cdb94",
RADIUS: 25,
SPEED: 1,
};
class Cell extends MovingObject {
constructor(options = {}) {
options.speed = o... |
/// <reference path="../../typings/smorball/smorball.d.ts" />
var __extends = this.__extends || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
var AudienceMember = (function (_super) ... |
/**
* ## Testing ajax calls
* We have written a plugin called [jasmine-ajax](https://github.com/pivotal/jasmine-ajax) that allows ajax calls to be mocked out in tests.
* To use it, you need to download the `mock-ajax.js` file and add it to your jasmine helpers so it gets loaded before any specs that use it.
*/
desc... |
const { validationResult } = require('express-validator');
const { userValidationError, missingRequiredParams, unauthorized, forbidden } = require('../errors');
const { passwordRegexp, emailRegexp } = require('../helpers/constants');
const { decodeToken } = require('../helpers/authentication');
exports.validateCreateA... |
# Copyright 2019 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
"""
Support for zeptrion_air_api.smt_btn.
For more details about this Class, please refer to the documentation at
https://github.com/swissglider/zeptrionAirApi
"""
import json
import requests
from .button import Button
class SmartButton(Button):
"""The Smart Button represents a Zeptrion Air Smartbutton."""
... |
/*!
* Qoopido.js library v3.4.5, 2014-7-15
* https://github.com/dlueth/qoopido.js
* (c) 2014 Dirk Lueth
* Dual licensed under MIT and GPL
*/
!function(e){var r=[];document.querySelectorAll||r.push("./queryselectorall"),window.qoopido.register("polyfill/document/queryselector",e,r)}(function(e,r,l,t,o,u){"use strict";re... |
import createIconComponent from '../utils/createIconComponent';
const svg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="389 1870.3 70 43.4"><path d="M393.4 1892h2.2v21.7h-2.2zM397.7 1887.7h2.2v26h-2.2zM448.8 1889.1c-1.4 0-2.7.3-3.9 1-.8-11.1-8.5-19.8-17.8-19.8-2.3 0-4.5.5-6.5 1.5-.8.4-1 .7-1 1.4v39c0 .8.5 1.4 1.... |
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... |
import asyncore
import base64
import email.mime.text
from email.message import EmailMessage
from email.base64mime import body_encode as encode_base64
import email.utils
import hashlib
import hmac
import socket
import smtpd
import smtplib
import io
import re
import sys
import time
import select
import errno
import textw... |
const util = getApp().include('util');
Page({
/**
* 页面的初始数据
*/
data: {
list: [],
is_load: 1,
page: 1,
category_id: '',
load_other: 1,
cate_id: 0,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var t = this;
t.load_data();
},
change_category_id: funct... |
'use strict';
import React from 'react';
import {_} from 'underscore';
import $ from 'jquery';
var dropdownStyle = {
display: 'inline-block',
marginRight: '10px'
};
var dropdownButtonStyle = {
backgroundImage: 'none'
};
var clickableStyle = {
cursor: 'pointer'
};
var drillDownControlStyle = {
c... |
// This file was procedurally generated from the following sources:
// - src/declarations/redeclare-with-async-generator-declaration.case
// - src/declarations/redeclare/block-attempt-to-redeclare-async-generator-declaration.template
/*---
description: redeclaration with AsyncGeneratorDeclaration (AsyncGeneratorDeclara... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-25 22:23
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operatio... |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = r"""
---
module: circuit_termination
short_description: C... |
import React, {Fragment} from 'react';
class AppFooter extends React.Component {
render() {
return (
<Fragment>
<div className="app-footer">
<div className="app-footer__inner">
<div className="app-footer-left">
... |
// Imports
import { GraphQLInt, GraphQLString, GraphQLList } from 'graphql'
// App Imports
import { UserType, UserLoginType, UserGenderType } from './types'
import StyleType from '../style/types'
import { getAll, getById, login, getGenders, getUserStyle } from './resolvers'
// All
export const users = {
type: new G... |
import nodePath from 'path'
import chalk from 'chalk'
import glob from 'glob'
import { ensureFileSync, existsSync, outputFileSync, readFileSync, statSync } from 'fs-extra'
import { findKey, mapValues, trimStart } from 'lodash'
import * as emoji from './emoji'
import packageJson from '../../package.json'
/**
* Gets ... |
module.exports = {
stories: ['../stories/**/*.stories.(js|mdx)'],
addons: ['@storybook/addon-actions/register', '@storybook/addon-links/register'],
presets: [
{
name: '@storybook/addon-docs/preset',
options: { configureJSX: true },
},
],
webpack: async config => {
// do mutation to the... |
from synbioweaver.core import *
from synbioweaver.aspects.modelDefinitions import *
import numpy, os, copy
class PrintReactionNetwork(Aspect):
def mainAspect(self):
self.addWeaverOutput(self.printReactionNetwork)
def printReactionNetwork(self,weaverOutput):
# We are expecting either a set... |
/* eslint-disable no-shadow */
/* eslint-disable no-loop-func */
var should = require('chai').should();
var chance = require('chance').Chance();
var bufferFactory = require('buffer-factory');
var crc16 = require('../index');
function generateRandomStr(option) {
option = option || {};
var len = Math.ceil(Math.rando... |
//@flow
import React, { Fragment, useState, useCallback, useRef } from 'react';
import { StyleSheet, View, SafeAreaView, Text, Image, Modal } from 'react-native';
import { captureRef } from 'react-native-view-shot';
import Btn from './Btn';
import Desc from './Desc';
const styles = StyleSheet.create({
root: {
pa... |
/**
* Copyright IBM Corp. 2019, 2020
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* Code generated by @carbon/icon-build-helpers. DO NOT EDIT.
*/
'use strict';
var Icon = require('../Icon-1083255b.js');
var React = require... |
# --coding:utf-8--
#
# Copyright (c) 2020 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
import functools
import pytest
from tests.common.nebula_test_suite import NebulaTestSuite
from tests.commo... |
var getContext = function(display, infos) {
var language_strings = {
en: {
categories: {
database: 'Database'
},
label: {
loadTable: 'loadTable(%1)',
loadTableFromCsv: 'loadTableFromCsv(%1, %2)',
getRecords:... |
module.exports = function(modV) {
modV.prototype.CompositeOperationControl = function(settings) {
let self = this;
let id;
let Module;
self.getSettings = function() {
return settings;
};
self.getID = function() {
return id;
};
self.writeValue = function(value) {
let selectValue = this.no... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-02 21:12
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('instance_manager', '0004_auto_20161002_... |
# -*- coding: utf-8 -*-
#
# PipServiceRelation E2
#
# Coded by Dr.Best (c) 2011
# Support: www.dreambox-tools.info
#
# This plugin is licensed under the Creative Commons
# Attribution-NonCommercial-ShareAlike 3.0 Unported
# License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by... |
window.sf = window.sf || {};
var sfdatetimepicker = (function (exports) {
'use strict';
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.... |
'use strict';
var fs = require('fs');
var sysPath = require('path');
var readdirp = require('readdirp');
var isBinaryPath = require('./is-binary');
var isWindows = require('os').platform() === 'win32';
// fs.watch helpers
var FsWatchInstances = Object.create(null);
function createFsWatchInstance(item, o... |
# Assign the first element of the list to answer_1 on line 2
lst=[11, 100, 99, 1000, 999]
answer_1=lst[0]
print(answer_1)
#=====================================
#This time print the second element of the list directly on line 3. You should get 100.
lst=[11, 100, 101, 999, 1001]
print(lst[1])
#======================... |
'''
DECAY PREDICTION
Takes user input to predict the discharge energy (Wh).
'''
import sys
import copy
import pandas as pd
from sklearn.tree import DecisionTreeRegressor
import joblib
from decay_ml import ml_battery_dt
if __name__ == "__main__":
#battery_data = sys.argv[1]
cycle_num = sys.argv[... |
// tabs
$('.js-tabs a').click(function (e) {
e.preventDefault()
$(this).tab('show')
})
$('.js-popover, [data-toggle="dropdown"]').each(function() {
let
p = $(this),
isHtml = !!p.attr('data-content-selector');
/* p.popover({
html: isHtml,
content() {
return p.attr('data-content-selector')
... |
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.styles = void 0;
var _exte... |
import { tmpl, get, post } from '../utils.js'
import bus from '../bus.js';
const THR = 1000;
export default Vue.component('Info', async () => {
const resp = await tmpl('info');
const template = await resp.text();
return {
template,
props: {
user: Object,
},
data: () => ({
info: {},
... |
'use strict';
/**
* @const {Object} All supported options for theming and their corresponding
* CSS property names (JS-style)
*/
const supportedThemeProperties = {
accentColor: 'color',
appBackgroundColor: 'backgroundColor',
ctaBackgroundColor: 'backgroundColor',
ctaTextColor: 'color',
sel... |
/**
* Copyright 2016 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from mlcomp.contrib.segmentation.deeplabv3.aspp import build_aspp
from mlcomp.contrib.segmentation.deeplabv3.backbone import build_backbone
from mlcomp.contrib.segmentation.deeplabv3.decoder import build_decoder
class DeepLab(nn.Module):
def __in... |
module.exports = {
env: {
browser: true,
commonjs: true,
es2021: true,
node: true,
},
extends: ["eslint:recommended", "prettier"],
parserOptions: {
ecmaVersion: "latest",
},
rules: {},
};
|
"""NBT marshaling.
See https://wiki.vg/NBT for a specification of the format.
"""
import abc
import io
import struct
import gzip
import inspect
from . import util
from . import types
class Tag(abc.ABC):
"""An NBT tag.
:meta no-undoc-members:
Parameters
----------
value : any, optional
... |
const io = require('socket.io')(require('express')().listen(process.env.PORT || 3000));
// From https://en.wikipedia.org/wiki/Primality_test#Pseudocode
const isPrime = n => {
if (n <= 1) return false;
else if (n <= 3) return true;
else if (n % 2 === 0 || n % 3 === 0) return false;
let i = 5;
while (i * i <=... |
// pages/temp/temp.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: funct... |
!function(t){function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r=window.webpackJsonp;window.webpackJsonp=function(n,e,i){for(var u,c,f=0,a=[];f<n.length;f++)c=n[f],o[c]&&a.push(o[c][0]),o[c]=0;for(u in e)Object.prototype.hasOwnPrope... |
import React from 'react';
import { render } from 'enzyme';
import toJson from 'enzyme-to-json';
import SystemPolicyCard from './SystemPolicyCard';
import { IntlProvider } from 'react-intl';
describe('SystemPolicyCard component', () => {
it('should render', () => {
const currentTime = new Date();
c... |
define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,r){"use strict";var n=e("../lib/oop");var o=e("./text_highlight_rules").TextHighlightRules;var i=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},i.getTagRu... |
from ..core import Plugin
class Datasource(Plugin):
"""
The data source object. The object does not maintain any stateful information.
"""
@property
def protocol(self):
return self.conf.get_or_else('protocol', None)
@property
def host(self):
return self.conf.get_or_else('... |