text stringlengths 3 1.05M |
|---|
const mongoose = require('mongoose');
const trackSchema = new mongoose.Schema({
userId : {
type: mongoose.Schema.Types.ObjectId,
ref: 'User'
},
trackNum : {
type : Number
},
status : {
type : String
},
lastUpdate : {
type : String
},
nextDeadline : {
type : String
},
img :... |
import numpy as np
from .hamiltonian import SpinHamiltonian, read_spin_ham_from_file
#from minimulti.spin.mover import SpinMover
class SpinModel():
def __init__(self, fname=None, sc_matrix=None):
if fname is not None:
self.read_from_file(fname)
else:
self._ham = SpinHamilto... |
const chalk = require("chalk")
const clear = require("clear")
const connection = require("../database/connection")
const foreignQ = {
resetServer: async function () {
clear();
await connection.query("DROP DATABASE IF EXISTS foreign_toolboxDB", function (err, res) {
i... |
/// Copyright (c) 2012 Ecma International. All rights reserved.
/// Ecma International makes this code available under the terms and conditions set
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
/// "Use Terms"). Any redistribution of this code must retain the above
/// copyrigh... |
# library functions for handling job data
import re
import datetime
CAUSE_ACTION_CLASS = {
'timer': 'hudson.triggers.TimerTrigger$TimerTriggerCause',
'user': 'hudson.model.Cause$UserIdCause',
'upstream': 'hudson.model.Cause$UpstreamCause'
}
def get_stage_failure(build_stages):
''' takes in build stages dict
r... |
'use strict'
const Page = require('./page')
class ReviewPage extends Page {
get url () {
return '/review'
}
clickCancel () {
const clickCancel = browser.element('#return-summary')
clickCancel.click()
}
}
module.exports = new ReviewPage()
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[1618],{3030:function(t,e,r){"use strict";r.r(e);var a=r(19),o=Object(a.a)({},(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[r("h1",{attrs:{id:"中间件"}},[r("a",{staticClass:"header-anc... |
from matplotlib import pyplot as plt
from matplotlib import image as pltImg
import numpy as np
import pprint as pp
refCodes = { # Barcode language(for reading from right end to center)
'0' : [0, 0, 0, 1, 1, 0, 1],
'1' : [0, 0, 1, 1, 0, 0, 1],
'2' : [0, 0, 1, 0, 0, 1, 1],
'3' : [0, 1, 1, 1, 1, 0, 1],
... |
MobData = {
33: [{ id: "0",name:"ゾンビ",type:2,inid:0,repop:30,isptboss:0,posx:51.56,posy:13.56, lv_min:0, lv_max:0, is_npc: false },
{ id: "1",name:"ゾンビ",type:2,inid:0,repop:30,isptboss:0,posx:42.13,posy:17.56, lv_min:0, lv_max:0, is_npc: false },
{ id: "2",name:"ゾンビ",type:2,inid:0,repop:30,isptboss:0,posx:53.00,posy:... |
import argparse
from datetime import datetime
from decimal import Decimal
import json
import logging
import math
import os
import pathlib
from perfsize.perfsize import (
lt,
gte,
Condition,
Plan,
Workflow,
)
from perfsize.reporter.mock import MockReporter
from perfsize.result.gatling import GatlingR... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var METADATA_KEY = require("../constants/metadata_keys");
var MetadataReader = (function () {
function MetadataReader() {
}
MetadataReader.prototype.getConstructorMetadata = function (constructorFunc) {
var compilerGenerate... |
"""
Medium puzzle
Algorithm to find scores while climbing the leaderboard
Given 2 sorted lists:
- Scoreboard: [100, 100, 80, 60]
- Alice: [50, 60, 75, 105]
Find the scores of alice
Ans: [3, 2, 2, 1]
"""
def countRankings(arr):
# Gets initial rankings
count = 1
if len(arr) == 1:
return count
... |
import React from "react"
import useActiveMenu from "../hooks/ActiveMenu"
const MenuCancelIcon = () => {
const { setMenuOpen, giftOpen, setGiftOpen } = useActiveMenu()
const handleClick = () => {
if (giftOpen) {
setGiftOpen(false)
} else {
setMenuOpen(false)
}
}
return (
<svg
... |
import pytest
import pandas as pd
from laptimize.curve_approximation import CurveApproximator
problem = pd.DataFrame({'objective': {'x1': lambda x: 12*x if x > 0 else 2, 'x2':lambda x: 7*x - x**2},
'constraints_1': {'x1': lambda x: -2*(x**4), 'x2': lambda x: -x, 'value': -2},
... |
'use strict';
var SwaggerParser = require('swagger-parser'),
InputValidationError = require('./inputValidationError'),
schemaPreprocessor = require('./utils/schema-preprocessor'),
swagger3 = require('./swagger3/open-api3'),
swagger2 = require('./swagger2'),
ajvUtils = require('./utils/ajv-utils'),
... |
function hasAnyoneSeenImportBabelPolyfill() { return false };
|
import './SpeechToText.css'
import { getTokenOrRefresh } from './token_util';
import { ResultReason } from 'microsoft-cognitiveservices-speech-sdk';
import symObjSpeechToText from './symObjSpeechToText.js'
const speechsdk = require('microsoft-cognitiveservices-speech-sdk')
export default function SpeechToText({ setCu... |
#!/usr/bin/env node
var Workshopper = require('workshopper');
var path = require('path');
var credits = require('./credits');
var name = 'kick-off-koa';
function fpath (f) {
return path.join(__dirname, f);
}
Workshopper({
name : name,
appDir : __dirname,
languages : ['en', 'fr'],
helpFile : fpath('... |
import React from 'react'
import * as PropTypes from 'prop-types'
import * as generalUtils from 'common/utils/general.utils'
import { BiChair } from 'react-icons/bi'
import Button from 'common/components/button'
import './OfficeCard.scss'
const OfficeCard = ({ time, seat, onBook, translate }) => {
const timeForma... |
window.EVENTDATA = {};
newModel('GlobalEvent', function(trigger, options) {
var self = getSelf(this, 'GlobalEvent');
self.inherit(BaseModel);
self.queue = [];
self.init = () => {
if ( trigger.constructor == Array ) {
trigger.forEach(t=>new GlobalEvent(t, options)... |
import React from 'react';
import { toast } from 'react-toastify'
import axio from 'commons/axios';
import axios from 'commons/axios';
class EditInventory extends React.Component{
state={
id:'',
name: '',
price: '',
tags: '',
image: '',
status: 'available'
}
... |
// COPYRIGHT © 2017 Esri
//
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
//
// This material is licensed for use under the Esri Master License
// Agreement (MLA), and is bound by the terms of that agreement.
// You may redistribute... |
#!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
import dayjs from "dayjs";
/**
* Return date in form of "15 September 2021 17:09"
*
* @param {number} timestamp
* @returns {string}
*/
export default function getFormattedDate(timestamp) {
return dayjs(timestamp).format("DD MMMM YYYY HH:MM");
} |
import { area } from 'd3-shape';
import { dArea, dLine, dSpline } from '../plugins/series/computeds';
import {
createAreaHitTester, createLineHitTester, createSplineHitTester,
createBarHitTester, createScatterHitTester, createPieHitTester,
changeSeriesState,
} from './series';
jest.mock('d3-shape', () => ({
ar... |
/*
KULeuven/LIBIS (c) 2022
Mehmet Celik mehmet(dot)celik(at)kuleuven(dot)be
*/
import './generalMessage'
export default 'generalMessage' |
"""
Low-level implementations for the external functions of the 'os' module.
"""
# Implementation details about those functions
# might be found in doc/rffi.txt
import os, sys, errno
import py
from rpython.rtyper.module.support import (
UNDERSCORE_ON_WIN32, _WIN32, StringTraits, UnicodeTraits)
from rpython.tool.s... |
var book = {
"name": "Deuteronoma",
"numChapters": 34,
"chapters": {
"1": {
"1": "<sup>1</sup> Ke wona mantswe ao Moshe a kileng a a bolella Baiseraele kaofela, mose o kwana ho Jordane, feelleng, thoteng e lebaneng le Sufe, mahareng a Parane le Tofele, le Labane, le Hatserothe, le Di-Sahabe.",
"2": "<sup>2</... |
export const REQUEST = 'REQUEST';
export const SUCCESS = 'SUCCESS';
export const ERROR = 'ERROR';
|
/* https://stackoverflow.com/questions/33145762/parse-a-srt-file-with-jquery-javascript/33147421 */
var PF_SRT = function () {
var pattern = /(\d+)\n([\d:,]+)\s+-{2}\>\s+([\d:,]+)\n([\s\S]*?(?=\n{2}|$))/gm;
var _regExp;
var init = function () {
_regExp = new RegExp(pattern);
};
var ... |
from collections import defaultdict
from django.conf import settings
from mongodbforms.documentoptions import DocumentMetaWrapper, LazyDocumentMetaWrapper
from mongodbforms.fieldgenerator import MongoDefaultFormFieldGenerator
try:
from django.utils.module_loading import import_by_path
except ImportError:
# t... |
/**
* @fileoverview EventEmitter
*/
/**
* @augments JsSIP
* @class Class creating an event emitter.
*/
(function(JsSIP) {
var
EventEmitter,
Event,
LOG_PREFIX = JsSIP.name +' | '+ 'EVENT EMITTER' +' | ';
EventEmitter = function(){};
EventEmitter.prototype = {
/**
* Initialize events dictionary.
* @p... |
from openpyxl.drawing.image import Image
from openpyxl.styles import Border, Side, Font
import openpyxl
import os
# 目录路径
currentPath = os.path.dirname(os.path.abspath(__file__))
wb = openpyxl.Workbook()
for root, dirs, files in os.walk("."):
dirs.sort()
for name in dirs:
# print(name)
ws = wb.create_sheet(name)... |
import React from 'react'
import { graphql, StaticQuery, Link } from 'gatsby'
import Layout from '../components/layout'
const getImageData = graphql`
{
allFile {
edges {
node {
relativePath
size
extension
birthTime
}
}
}
}`
export de... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import lo... |
"use strict";
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { ... |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Field } from 'redux-form';
import { FormattedMessage, intlShape, injectIntl } from 'react-intl';
import { RadioButton, RadioButtonGroup } from '@folio/stripes/components';
import styles from './visibility-field.css';
class Visibilit... |
import React from "react";
import { connect } from "react-redux";
import { updateRequest } from "../actions";
import "./RequestForm.css";
class UpdateForm extends React.Component {
state = {
request: this.props.activeRequest || {
food_location: "",
food_amount: "",
food_type: "",
food_... |
""" template for python scripts following Pauliuk et al 2015 - Fig 1
In the file there is only one place to define/specify folders - the function
file_folder_specs().
Notes
------
The docstrings follow roughly the guidelines for numpy docstrings: http://sphinx-doc.org/latest/ext/example_numpy.h... |
$(function(){
var eventClick = new MouseEvent('click', {
'bubbles': true,
'cancelable': true
});
/*chrome.extension.sendRequest({which:'12306', cmd: 'get_person'}, function(response) {
});*/
g_person = sessionStorage.getItem('pass_person');
if (!g_person)
return;
var persons = ... |
var searchData=
[
['x',['X',['../class_joystick.html#ac84ba4b69b1aa3d6082025bc8ac82f2b',1,'Joystick::X()'],['../class_keyboard.html#ae0234dd8601eeffdb3ed87ffe8a23322',1,'Keyboard::X()'],['../class_motion_controller.html#ab10eb9ead64b5bdff110bf95a9b1504a',1,'MotionController::X()'],['../class_mouse.html#adc7051776b157... |
'use strict'
import SCNConstraint from './SCNConstraint'
/**
*
* @access public
* @extends {SCNConstraint}
* @see https://developer.apple.com/documentation/scenekit/scnaccelerationconstraint
*/
export default class SCNAccelerationConstraint extends SCNConstraint {
/**
* constructor
* @access public
... |
"""Test Z-Wave locks."""
from unittest.mock import MagicMock, patch
import pytest
from homeassistant import config_entries
from homeassistant.components.zwave import const, lock
from tests.mock.zwave import MockEntityValues, MockNode, MockValue, value_changed
# Integration is disabled
pytest.skip("Integration has b... |
data = (
'ddwim', # 0x00
'ddwib', # 0x01
'ddwibs', # 0x02
'ddwis', # 0x03
'ddwiss', # 0x04
'ddwing', # 0x05
'ddwij', # 0x06
'ddwic', # 0x07
'ddwik', # 0x08
'ddwit', # 0x09
'ddwip', # 0x0a
'ddwih', # 0x0b
'ddyu', # 0x0c
'ddyug', # 0x0d
'ddyugg', # 0x0e
'ddyugs... |
/*
---------------------------------------
| All rights reserved to KIGNAMN |
| If there is any error, just visit the|
| KINGMANDEV Discord Server |
| Phone Number: +962792914245 |
---------------------------------------
______███████████████████████
______█████████████████████████
__... |
import { pluginActivate, pluginDeactivate } from '../../commonMethods/controller'
import constants from '../../commonMethods/constants'
import { getKeyCodeDetails } from '../../commonMethods/remoteControl'
export default {
title: 'RemoteControl Key - 004',
description: 'Validate Thunder response when Key is invoke... |
# Copyright 2014 Hewlett-Packard Development Company, L.P.
# 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... |
/* eslint no-console: "off"*/
require('colors');
let async = require('async');
let express = require('express');
let glob = require('glob');
let merge = require('merge');
let passport = require('passport');
let path = require('path');
let sass_middleware = require('node-sass-middleware');
let cleanup = require('./middl... |
const express = require("express");
const router = express.Router();
const {
createUser,
getUserById,
getAllUsers,
deleteAllCartItems,
getUserCartItems,
removeCartItemById,
addToCart,
userLogin,
getClientSecretKey,
productOrdered,
useReferral,
} = require("../controllers/userController");
router... |
ContinueContractForm = Ext
.extend(
Ext.Window,
{
formPanel : null,
constructor : function(a) {
Ext.applyIf(this, a);
this.initUIComponents();
ContinueContractForm.superclass.constructor
.call(this,
{
id : "ContinueContractFormWin",
layout : ... |
r"""
Symbolic Equations and Inequalities
Sage can solve symbolic equations and inequalities. For
example, we derive the quadratic formula as follows::
sage: a,b,c = var('a,b,c')
sage: qe = (a*x^2 + b*x + c == 0)
sage: qe
a*x^2 + b*x + c == 0
sage: print(solve(qe, x))
[
x == -1/2*(b + sqrt(... |
"""
This module demonstrates various patterns
for ITERATING through SEQUENCES, including:
-- Beginning to end
-- Other ranges (e.g., backwards and every-3rd-item)
-- The COUNT/SUM/etc pattern
-- The FIND pattern (via LINEAR SEARCH)
-- The MAX/MIN pattern
-- Looking two places in the sequence at once
-- Lo... |
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{123:function(e,t,n){"use strict";var o=n(1),r=n(188),c=n.n(r);o.a.use(c.a,{space:0})},163:function(e,t,n){var content=n(237);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[e.i,content,""]]),content.locals&&(e.exports=content.lo... |
/*
* Copyright 2019 Verapi Inc
*
* 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 law or agreed to i... |
const webpack = require('webpack')
const merge = require('webpack-merge')
const base = require('./webpack.base.config')
const HTMLPlugin = require('html-webpack-plugin')
const SWPrecachePlugin = require('sw-precache-webpack-plugin')
const config = merge(base, {
plugins: [
// 全局变量
new webpack.DefinePlugin({
... |
/*
Massively by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
*/
(function($) {
var $window = $(window),
$body = $('body'),
$wrapper = $('#wrapper'),
$header = $('#header'),
$nav = $('#nav'),
$main = $('#main'),
$navPanelToggle, $nav... |
try:
import influxdb
INFLUXDB_SUPPORTED = True
except ImportError:
INFLUXDB_SUPPORTED = False
class Database(object):
def Close(self):
raise NotImplementedError
def Initialize(self):
raise NotImplementedError
def Write(self, metrics):
raise NotImplementedError
clas... |
import streamlit as st
import streamlit.components.v1 as components
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import joblib
import yaml
import shap
with open("./artifacts.yaml", "r") as stream:
try:
data = yaml.safe_load(stream)
except yaml.YAMLError as exc:
prin... |
#!/usr/bin/env python3
from .variational_elbo import VariationalELBO
class VariationalMarginalLogLikelihood(VariationalELBO):
def __init__(self, likelihood, model, num_data, combine_terms=True):
"""
A special MLL designed for variational inference
Args:
- likelihood: (Likelihood)... |
import React from "react";
import { BrowserRouter as Router, Switch } from "react-router-dom";
import PageRoute from "./page-route";
const PageRouter = ({
children,
config = [],
isUserSignedIn = false,
defaultPath = "/",
}) => {
return (
<Router>
{children}
<Switch>
{config &&
... |
'use strict';
exports.__esModule = true;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _isEqual = require(... |
webpackHotUpdate(1,{
/***/ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
false,
/***/ "./node_modules/@babel/runtime/helpers/arrayWithHoles.js":
false,
/***/ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js":
false,
/***/ "./node_modules/@babel/runtime/helpers/construct.js":
false,
/***/ "... |
import argparse
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from tools.text import clean_text
def parse_arguments(parser):
parser.add_argument('--data_dir', type=str, default='C:/data/niosh_ifund/')
parser.add_argument('--test_file', type=str, default='test.csv... |
import React from "react";
import _ from "lodash";
import moment from "moment";
import Link from "gatsby-link";
import Helmet from "react-helmet";
import { Page, Row, Column } from "hedron";
import Thumbnail from "../components/Thumbnail";
import Breadcrumb from "../components/Breadcrumb";
import SectionTitle from "../... |
/**
* Taken from Material UI [https://github.com/mui-org/material-ui]
*/
/* eslint-disable no-use-before-define */
import warning from 'warning';
/**
* Returns a number whose value is limited to the given range.
*
* @param {number} value The value to be clamped
* @param {number} min The lower boundary of the o... |
/**
* @param {number} n
* @return {string[]}
* Write a program that outputs the string representation of numbers from 1 to n.
But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”.
For numbers which are multiples of both three and five output “FizzBuzz”... |
# MenuTitle: Scribble
# -*- coding: utf-8 -*-
__doc__ = """
Scribble
"""
import GlyphsApp
from NaNGFGraphikshared import *
from NaNGFAngularizzle import *
from NaNGFSpacePartition import *
from NaNGFNoise import *
from NaNFilter import NaNFilter
from NaNGlyphsEnvironment import glyphsEnvironment as G
import random
c... |
const path = require('path');
module.exports = {
entry: {
app: './search//index.js'
},
output: {
path: path.join(__dirname, 'src/static/js/'),
filename: 'bundle.js',
},
module: {
loaders: [{
// Test for js or jsx files
test: /\.jsx?$/,
loader: 'babel-loader',
query: {
... |
var mongodb = require("../../lib/mongodb"),
ReplicaSetManager = require('../../test/tools/replica_set_manager').ReplicaSetManager;
var options = {
auto_reconnect: true,
poolSize: 4,
socketOptions: { keepAlive: 100, timeout:30000 }
};
var userObjects = [];
var counter = 0;
var counter2 = 0;
// Build user arra... |
class Solution:
def findMedianSortedArrays(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: float
"""
nums = nums1+nums2
nums.sort()
length = len(nums)
if length%2 == 0 :
return (nums[int(length/... |
//= require jquery
//= require jquery_ujs
//= require back/plugins/bootstrap/bootstrap.min
//= require back/plugins/bootstrap-tagsinput/bootstrap-tagsinput.min
//= require back/plugins/datatables/jquery.dataTables.min
//= require back/plugins/datatables/dataTables.bootstrap.min
//= require ckeditor/init
//= require bac... |
"""A library to evaluate MDM on a single GPU.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
from pathlib import Path
import data_provider
import menpo
import matplotlib
import matplotlib.pyplot as plt
import mdm_model
imp... |
Roblox = Roblox || {};
if (typeof Roblox.CancelSubscriptionModal === 'undefined') {
Roblox.CancelSubscriptionModal = (function () {
var open = function () {
var options = {
titleText: Roblox.CancelSubscriptionModal.Resources.title,
bodyContent: Roblox.CancelSubscriptionModal.Resources.body,
allowHtm... |
#!/usr/bin/python
import sys
import os
import re
import fnmatch
import string
workload_dir = "/Users/xiyuexiang/GoogleDrive/NOCulator/hring/src/bin/"
workload = "mix_app"
insns_count = 1000000
ipc_alone = [2.16, 2.75, 2.08, 1.91, 2.16, 2.75, 2.08, 1.91, 2.16, 2.75, 2.08, 1.91, 2.16, 2.75, 2.08, 1.91]
ip... |
import React,{Component} from 'react';
import {Tile,Button} from 'tinper-bee';
import style from './index.css';
import errorPoolImg from '../../assets/img/error-pool.png';
class SuccessOne extends Component {
constructor(props) {
super(props);
this.apply=this.apply.bind(this);
}
componentDi... |
(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{247:function(r,t,o){var content=o(256);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[r.i,content,""]]),content.locals&&(r.exports=content.locals);(0,o(25).default)("01a13bf0",content,!0,{sourceMap:!1})},255:function(r,t,o){"u... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "StaticDatePicker", {
enumerable: true,
get: function () {
return _StaticDatePicker.StaticDatePicker;
}
});
var _StaticDatePicker = require("./StaticDatePicker"); |
const log = new (require('./logger'))('Roleypoly')
const Sequelize = require('sequelize')
const fetchModels = require('./models')
const fetchApis = require('./api')
class Roleypoly {
constructor(router, io, app) {
this.router = router
this.io = io
this.ctx = {}
this.ctx.config = {
appUrl: proc... |
# Generated by Django 3.1.7 on 2021-02-27 10:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('grapesjs', '0003_auto_20210227_1050'),
]
operations = [
migrations.AddField(
model_name='user_content',
name='active... |
import React from "react";
import swal from 'sweetalert';
// reactstrap components
import {
Button,
Card,
CardHeader,
CardBody,
FormGroup,
Form,
Input,
InputGroupAddon,
InputGroupText,
InputGroup,
Container,
Row,
Col,
UncontrolledAlert
} from "re... |
// Imports the Google Cloud client library
const Translate = require('@google-cloud/translate');
const getClient = () => {
// Your Google Cloud Platform project ID
const projectId = 'bac76e25e74d770f7bcb42110d91af6d25f37125';
// Instantiates a client
const translate = new Translate({
projectId... |
/**
* @author ZhangHuihua@msn.com
*/
(function($){
$.fn.extend({
checkboxCtrl: function(parent){
return this.each(function(){
var $trigger = $(this);
$trigger.click(function(){
var group = $trigger.attr("group");
... |
'use strict';
// const adminLogin = 'admin';
// const adminPassword = 'm4ng0h4ckz';
// const cansel = 'Отменено пользователем!';
// const wrongLogin = 'Доступ запрещен, неверный логин!';
// const wrongPassword = 'Доступ запрещен, неверный пароль!';
// const welcome = 'Добро пожаловать!';
// const inputLogin = prompt('В... |
# -*- coding: utf-8 -*-
"""
Multi-GPU Examples
==================
Data Parallelism is when we split the mini-batch of samples into
multiple smaller mini-batches and run the computation for each of the
smaller mini-batches in parallel.
Data Parallelism is implemented using ``torch.nn.DataParallel``.
One can wrap a Mod... |
export default {
props: {
canaryDeploymentFeatureId: {
type: String,
required: false,
default: '',
},
showCanaryDeploymentCallout: {
type: Boolean,
required: false,
default: false,
},
userCalloutsPath: {
type: String,
required: false,
default: ... |
// #region DRB.Logic
/**
* Logic - Console To Results Editor
* @param {any} message Message
*/
DRB.Logic.ConsoleToResultsEditor = function (message) {
console.log(message);
var indentedMessage = message;
try { indentedMessage = JSON.parse(indentedMessage); } catch { }
indentedMessage = JSON.s... |
const db = require('quick.db')
const Discord = require('discord.js')
const colors = require('../../../Storage/json/colors.json')
module.exports = {
name: "HelpFight",
run: async(client, interaction) => {
var prefix = db.get(`prefix_${interaction.guild.id}`) || 'u!'
let lang = client.langs.get(d... |
/* jshint esversion: 6 */
module.exports = class Controller {
constructor (
roomOptionsService,
newroomDefaults
) {
"ngInject";
Object.assign(this, {
roomOptionsService,
newroomDefaults
});
({placesOptions: this.placesOptions, timeOptions: this.timeOptions} = this.newroomDefaul... |
// COPYRIGHT © 201 Esri
//
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
//
// This material is licensed for use under the Esri Master License
// Agreement (MLA), and is bound by the terms of that agreement.
// You may redistribute ... |
angular
.module('app', [
'ui.router',
'app.directives.contactCard'
])
.config(['$urlRouterProvider', '$stateProvider','$httpProvider', function($urlRouterProvider, $stateProvider, $httpProvider) {
$urlRouterProvider.otherwise('/');
$httpProvider.defaults.useXDomain = true;
delete $httpProvider... |
class FacebookQuickReplyItemTypeText {
constructor (title = '', payload = '') {
this.title = title;
this.payload = payload;
}
get response () {
return {
content_type: 'text',
title: this.title,
payload: (this.payload !== '' ? this.payload : this.t... |
""" Module to access the Search endpoints """
# pylint: disable=too-many-lines,too-many-locals,too-many-public-methods,too-few-public-methods
from typing import Dict, Union
from ...models import FileInfoList, SearchFilesMultipartData
from ..base import ApiBaseClass
class SearchApi(ApiBaseClass):
""" """
as... |
class Kid:
def __init__(self, name=None, age=-1):
self.name = name
self.age = age
class Family:
def __init__(self, parents=[]):
self.parents = parents
self.kids = []
def __str__(self):
return_str = "Family:\n"
return_str += " Parents:\n"
for pare... |
//@flow
const watchPathIgnorePatterns = [
'<rootDir>/node_modules/',
'<rootDir>/tools/',
'<rootDir>/npm/',
'<rootDir>/packages/',
'<rootDir>/flow/',
'<rootDir>/flow-typed/',
'<rootDir>/examples/',
]
const createDefaultConfig = () => ({
automock: false,
browser: false,
testEnvironment: 'node',
tra... |
import Projection from '../../../../src/ol/proj/Projection.js';
import WMTS, {optionsFromCapabilities} from '../../../../src/ol/source/WMTS.js';
import WMTSCapabilities from '../../../../src/ol/format/WMTSCapabilities.js';
import WMTSTileGrid from '../../../../src/ol/tilegrid/WMTS.js';
import {getBottomLeft, getTopRigh... |
import * as React from 'react';
import {PureComponent} from 'react';
const eventNames = ['onDragStart', 'onDrag', 'onDragEnd'];
function round5(value) {
return (Math.round(value * 1e5) / 1e5).toFixed(5);
}
export default class ControlPanel extends PureComponent {
renderEvent = eventName => {
const {events = ... |
"""Fonduer learning utils' unit tests."""
from fonduer.candidates.models import Candidate
from fonduer.learning.utils import confusion_matrix
def test_confusion_matrix():
"""Test the confusion matrix."""
# Synthesize candidates
cand1 = Candidate(id=1, type="type")
cand2 = Candidate(id=2, type="type")
... |
'use strict'
const semver = require('semver')
const harness = require('./harness')
const H = harness
async function startWorker(workerData) {
/* eslint-disable-next-line node/no-unsupported-features/node-builtins */
const worker = require('worker_threads')
return await new Promise((resolve, reject) => {
l... |
/**
*
* FormOperacion
*
*/
import React from 'react';
import PropTypes from 'prop-types';
import {
Box,
Container,
Title,
} from 'bloomer';
import { FormattedMessage } from 'react-intl';
import Button from 'components/Button';
import DropList from 'components/DropField';
import Input from 'components/FieldInput... |
import pygame
import os
pygame.init()
pygame.display.set_caption("TEST")
w = 700
h = 600
screensize = (w,h)
screen = pygame.display.set_mode(screensize)
black = (0, 0, 0)
xa = 0
ya = 0
while True:
player = pygame.image.load(os.path.join("Images", "run", "run0.gif"))
playern = pygame.transform.flip(... |