text stringlengths 3 1.05M |
|---|
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Lood Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test loodd with different proxy configuration.
Test plan:
- Start loodd's with different proxy configurat... |
var mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel applica... |
import axios from "axios";
export default {
// Gets all events
getEvents: function () {
return axios.get("/api/events");
},
// Gets the event with the given id
getEvent: function (id) {
return axios.get("/api/events/" + id);
},
// Deletes the event with the given id
deleteEvent: function (id) {... |
'use strict';
const SAVE_MODE_MAX = 25;
const SAVE_MODE_OFF_MAX = 32;
const DEFAULT_TEMP = 20;
const MIN_TEMP = 10;
const LOW_USAGE_LIMIT = 18;
const MEDIUM_USAGE_LIMIT = 25;
class Thermostat {
constructor() {
this._temp = DEFAULT_TEMP;
this._MINIMUM_TEMP = MIN_TEMP;
this._maxTemp = SAVE_MODE_MAX;
... |
from __future__ import unicode_literals
import logging
from django.utils import six
from django.utils.html import escape, strip_tags
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from djblets.markdown import iter_markdown_lines
from djblets.registries.errors import I... |
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.15/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.
//>>built
define({"widgets/Screening/nls/strings":{_widgetLabel:"Klasyfikowanie",geometryServicesNotFound:"Us\u0... |
import { Matrix3 } from '../../math/Matrix3.js';
import { Plane } from '../../math/Plane.js';
function WebGLClipping( properties ) {
const scope = this;
let globalState = null,
numGlobalPlanes = 0,
localClippingEnabled = false,
renderingShadows = false;
const plane = new Plane(),
viewNormalM... |
// This is the "Offline page" service worker
importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.0.0/workbox-gpcasas_sw.js');
const CACHE = "pwabuilder-page";
// TODO: replace the following with the correct offline fallback page i.e.: const offlineFallbackPage = "offline.html";
const offlineFallback... |
""" Utilities app."""
# Django
from django.apps import AppConfig
class UtilsConfig(AppConfig):
name = 'locfilm.utils'
verbose_name = 'Utilities'
|
var CTD1list = [[36.8, -0.797], [36.846, -0.799], [36.892, -0.799], [36.94, -0.798], [36.985, -0.796], [37.031, -0.797], [37.077, -0.799], [37.077, -0.684], [37.03, -0.681], [36.985, -0.681], [36.938, -0.683], [36.891, -0.681], [36.846, -0.683], [36.8, -0.681], [36.8, -0.567], [36.847, -0.562], [36.892, -0.568], [36.93... |
import FeedItem from "./feed-item";
import { getContent, excerpt, getContentAttr, html2text } from './util';
export default class AtomFeedItem extends FeedItem {
constructor() {
super();
}
static fromAtomXmlItem = (url, xmlItem) => {
var title = excerpt(getContent(xmlItem, 'title'), 200);
... |
/**
* @param { Array } arr
* @param { number } depth
* @returns { Array }
*/
function flat(arr, depth = 1) {
return arr.reduce((acc, item) => {
if (depth && Array.isArray(item)) {
return [...acc, ...flat(item, depth - 1)];
}
return [...acc, item];
}, []);
}
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } }... |
#
# Copyright (c) 2003-2010 Greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
from rdkit import RDConfig
i... |
import React from "react";
import { Link, Redirect, Route } from "react-router-dom";
// reactstrap components
import { } from "reactstrap";
import AuthService from "services/AuthService.js"
function PrivateRoute({ component: Component, ...rest }) {
return (
<Route {...rest} render={(props) => (
... |
const crypto = require('crypto')
const fs = require('fs')
const path = require('path')
const { SignedXml } = require('xml-crypto')
const { encrypt } = require('xml-encryption')
const xpath = require('xpath')
module.exports = (serviceProvider) => {
// NOTE - the typo in keyEncryptionAlgorighm is deliberate
const EN... |
const mongoose = require('mongoose');
const { setupApp } = require('../helper-functions');
const translationsService = require('../../modules/translations/translations.service');
const { translations, newTranslations } = require('./translations.variables');
let firstTranslationsId;
let secondTranslationsId;
let respon... |
#!/usr/bin/env python2
# Copyright 2011 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""emcc - compiler helper script
=============... |
'use strict';
module.exports = {
event: state => socket => {
socket.write("Welcome to the game!\r\n");
return socket.emit('login', socket);
},
};
|
const keystone = require('keystone');
const Types = keystone.Field.Types;
const User = keystone.list('User');
const ObjectId = require('mongoose').Types.ObjectId;
const logger = keystone.get('logs').mail;
let Mail = new keystone.List('Mail', {
nocreate: true,
noedit: true,
track: true
});
Mail.add({
template:... |
#!/usr/bin/env python3
# -*- coding: utf8 -*-
# SPDX-FileCopyrightText: 2022 UdS AES <https://www.uni-saarland.de/lehrstuhl/frey.html>
# SPDX-License-Identifier: MIT
"""Software agent for hypermedia API composition and execution."""
import os
import re
from urllib.parse import urlparse
import rdflib
import reques... |
import React from "react"
// importを追記
import { useStaticQuery, graphql, Link } from "gatsby"
import Layout from "../components/layout"
import Image from "../components/image"
import SEO from "../components/seo"
const IndexPage = () => {
// queryの取得処理を追加
const data = useStaticQuery(graphql`
query MyQuery {
... |
const path = require("path")
// Generate a slug for markdown files
// module.exports.onCreateNode = ({ node, actions }) => {
// const { createNodeField } = actions
// if (node.internal.type === "MarkdownRemark") {
// const slug = path.basename(node.fileAbsolutePath, ".md")
// createNodeField({
// n... |
"use strict";(self.webpackChunkz_paging_doc=self.webpackChunkz_paging_doc||[]).push([[301],{1606:(n,s,a)=>{a.r(s),a.d(s,{data:()=>e});const e={key:"v-d4a7df0c",path:"/api/props/global-config.html",title:"",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"支持全局配置",slug:"支持全局配置",children:[{level:3,title:"",... |
import React from "react";
import { Route, Redirect } from "react-router-dom";
import { useIsAuthenticated } from "../utils/auth";
const PrivateRoute = ({ component: Component, children, redirectTo = "/", ...props }) => {
const isAuth = useIsAuthenticated();
const render = ({ location }) => (
isAuth
... |
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
requir... |
/**
* @author @tatocaster <kutaliatato@gmail.com>
* Translated default messages for the jQuery validation plugin.
* Locale: GE (Georgian; ქართული)
*/
$.extend($.validator.messages, {
required: "ეს ველი სავალდებულოა",
remote: "გთხოვთ შეასწოროთ.",
email: "გთხოვთ შეიყვანოთ სწორი ფორმატით.",
url:... |
import React from 'react';
import { withStyles, makeStyles } from '@material-ui/core/styles';
import MuiAccordion from '@material-ui/core/Accordion';
import MuiAccordionSummary from '@material-ui/core/AccordionSummary';
import MuiAccordionDetails from '@material-ui/core/AccordionDetails';
import Typography from '@mater... |
__copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import operator
from functools import reduce
import numpy as np
from jina.logging.base import get_logger
class MilvusDBException(Exception):
"""Any time Milvus client returns Status not OK"""
class MilvusDBHa... |
import json
from collections import OrderedDict
from django import forms
from django.core.files.uploadedfile import UploadedFile
from django.db.models import Prefetch
from django.utils.functional import cached_property
from pretix.base.forms.questions import (
BaseInvoiceAddressForm, BaseQuestionsForm,
)
from pre... |
var str;
console.log(str); // undefined
str = 'My name';
console.log(typeof str); // string
str = 12;
console.log(typeof str); // number
str = true;
console.log(typeof str); // string
str = Symbol.iterator;
console.log(typeof str); // symbol
str = {};
console.log(typeof str); // object
str = null;
console.log(ty... |
module.exports = function(grunt) {
grunt.initConfig({
uglify: {
options: {
mangle: true,
banner: '/**\n * Shower HTML presentation engine: github.com/shower/shower\n * @copyright 2010–<%= grunt.template.today("yyyy") %> Vadim Makeev, pepelsbey.net\n * @license MIT license: github.com/shower/shower/wiki/M... |
/*!
* FormValidation (http://formvalidation.io)
* The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, Pure, SemanticUI, UIKit and custom frameworks
*
* @version v0.6.3-dev, built on 2015-04-05 6:17:56 PM
* @author https://twitter.com/formvalidation
* @copyright (c) 2013... |
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[137],{
/***/ "./frontend/src/assets/images/banner/banner.png":
/*!******************************************************!*\
!*** ./frontend/src/assets/images/banner/banner.png ***!
\******************************************************/
/*! no static ... |
from setuptools import setup, find_packages
setup(name='molSim', version='1.0', packages=find_packages()) |
$(document).ready(function () {
// Get the modal
var modal = document.getElementById("createModal");
// Get the button that opens the modal
var btn = document.getElementById("createModalBtn");
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0... |
// @flow
import * as React from "react";
import {
View,
Text,
Image,
ScrollView,
ImageBackground
} from "react-native";
import i18n from "../../i18n";
import { colors } from "../../styles/global";
import { viewStyles, textStyles, imageStyles } from "../../styles/auth/loginOrSignup";
import logoImages from "... |
"""
WSGI config for edd project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application # noqa: E402
os.environ.setdefault("DJ... |
import Vue from 'vue';
import App from './App.vue';
import router from './routes';
Vue.config.productionTip = false
new Vue({
router,
render: h => h(App),
}).$mount('#app')
|
import React, { useContext } from "react"
import styled, { ThemeContext } from "styled-components"
import { useIntl } from "gatsby-plugin-intl"
import Link from "../Link"
import Translation from "../Translation"
import { translateMessageId } from "../../utils/translations"
import { trackCustomEvent } from "../../util... |
// Copyright (C) 2013 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 25.3.1.4
description: >
When a generator is paused within the `catch` block of a `try..catch`
statement, `throw` should interrupt control flow as if a `throw` st... |
let crypto = require('crypto');
let util = require('util');
let path = require('path');
let fs = require('fs');
let utils = module.exports;
/**
* Check and invoke callback
*/
utils.invokeCallback = function(cb) {
if (!!cb && typeof cb === 'function') {
cb.apply(null, Array.prototype.slice.call(arguments... |
/****************************************************************************
Copyright (c) 2013 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software withou... |
import axios from 'axios';
export function request(config) {
// axios实例
const instance = axios.create({
baseURL: '/api/',
timeout: 2000
})
return instance(config);
}
|
'use strict';
const supertest = require('supertest');
const defaultConf = require('./testDefaultConfig');
const testUtils = require('./testUtils');
const middleware = require('../lib/middleware');
exports.createServer = () => {
const app = middleware(defaultConf());
const httpServer = app.listen();
const reque... |
const fs = require('fs')
const path = require('path')
const execa = require('execa')
describe('nuxt3-webpack', () => {
test('build works', async() => {
// Note: this is a hacky solution
await execa('yarn', ['run', 'nuxt', 'build'], { cwd: __dirname })
expect(fs.existsSync(path.join(__dirname, '.output', ... |
import {
FETCH_PRODUCT_LIST,
FETCH_PRODUCT
} from './mutation-types'
import axios from 'axios'
export default {
fetchProductList ({ commit }) {
return axios.get('http://localhost:7777/vueproduct/list')
.then((res) => {
commit(FETCH_PRODUCT_LIST, res.data)
})... |
const multer = require('multer');
const { v4: uuidv4 } = require("uuid");
const MIME_TYPE_MAP = {
"image/png": "png",
"image/jpeg": "jpeg",
"image/jpg": "jpg"
};
const fileUpload = multer({
limits: 500000, //max file size in bytes
storage: multer.diskStorage({
destination: (req, file, cb) ... |
const set = require('regenerate')(0xAA, 0xB5, 0xBA, 0x345, 0x37F, 0x386, 0x38C, 0x10C7, 0x10CD, 0x1F59, 0x1F5B, 0x1F5D, 0x1FBE, 0x2071, 0x207F, 0x2102, 0x2107, 0x2115, 0x2124, 0x2126, 0x2128, 0x2139, 0x214E, 0x2D27, 0x2D2D, 0x1D4A2, 0x1D4BB, 0x1D546);
set.addRange(0x41, 0x5A).addRange(0x61, 0x7A).addRange(0xC0, 0xD6).a... |
#! usr/bin/env python3
import os
def find_files(suffix, path):
"""
Find all files beneath path with file name suffix.
Note that a path may contain further subdirectories
and those subdirectories may also contain further subdirectories.
There are no limit to the depth of the subdirectories can b... |
! function(a) {
"function" == typeof define && define.amd ? define(["jquery", "moment"], a) : "object" == typeof exports ? module.exports = a(require("jquery"), require("moment")) : a(jQuery, moment)
}(function(a, e) {
! function() {
var a = {
1: "'inci",
5: "'inci",
8: "'inci",
70: "'inci",
80: "'in... |
# coding: utf-8
"""
No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use ... |
import tensorflow as tf
import numpy as np
from layers import *
from support import visualize_images
from global_definitions import *
def apply_gradient_descent(var_list, obj):
"""
Sets up the gradient descent optimizer
Args:
var_list: List of variables to optimizer over.
obj: Node... |
# -*- coding: utf-8 -*-
import pymongo
from modularodm import fields
from framework.auth.core import Auth
from website.addons.base import exceptions
from website.addons.base import AddonUserSettingsBase, AddonNodeSettingsBase, GuidFile
from website.addons.base import StorageAddonBase
from website.addons.s3 import u... |
const elements = [
'animate',
'circle',
'defs',
'ellipse',
'g',
'line',
'linearGradient',
'mask',
'path',
'pattern',
'polygon',
'polyline',
'radialGradient',
'rect',
'stop',
'svg',
'text',
'tspan',
];
export default name => elements.indexOf(name) !== -1;
|
function sensor(str){
return str.replace(/##/g,"--")
.replace(/system/g,"printf")
.replace(/freopen/g,"")
.replace(/fstream/g,"")
.replace(/windows.h/g,"")
.replace(/CON/g,"")
}
module.exports = {
sensor
}; |
# -*- coding: utf-8 -*-
import torch
from abc import abstractmethod
from torch.utils.tensorboard.writer import SummaryWriter
# from tensorboardX import SummaryWriter # use this if pytorch <= 1.2
def func(m):
m = torch.nn.DataParallel(m, device_ids=[0, 1])
return m
class BaseTrainer:
"""
Base class... |
import argparse
#from carla_game.carla_benchmark import CarlaBenchmark as CarlaEnv
from carla_game.carla_gamev09 import CarlaEnv
from common.utills import print_square
from model.test_agents import mathDriver, randomDriver, crashDriver
'''
"ClearNoon",
"WetCloudyNoon",
"MidRainyNoon",
... |
var group__group__smartio__functions__du =
[
[ "Cy_SmartIO_GetDuTr", "group__group__smartio__functions__du.html#gae59c99daba955d9d9e03ab439b59aaae", null ],
[ "Cy_SmartIO_SetDuTr", "group__group__smartio__functions__du.html#ga2791a66b980fdcc2e10703c5f16bb26d", null ],
[ "Cy_SmartIO_SetDuTrAll", "group__grou... |
function Star(ra, dec, mag, name) {
this.ra = ra;
this.dec = dec;
this.mag = mag;
this.name = name;
if(mag<0) { this.size=4.5; }
else if(mag < 1) { this.size=4; }
else if(mag < 2) { this.size=3.5; }
else if(mag < 3) { this.size=3; }
else if(mag < 4) { this.size=2; }
else if(mag < 5) { this.size=1.5; }
els... |
#basit shape detection
# kare ile dikdortgeni ayirt eder
#video uzerinde tespit yapar
import cv2 as cv
cap = cv.VideoCapture('dene.mp4')
ret, frame1 = cap.read()
ret, frame2 = cap.read()
while cap.isOpened() :
gray = cv.cvtColor(frame1, cv.COLOR_BGR2GRAY)
__, thresh = cv.threshold(gray, 110, 255, cv.THRES... |
class GenericTracker {
static forPhase(game, startingEvent) {
return new GenericTracker(game, startingEvent, 'onPhaseEnded');
}
constructor(game, startingEvent, endingEvent) {
this.events = [];
game.on(startingEvent, event => this.trackEvent(event));
game.on(endingEvent, ()... |
module.exports = {"344":{"id":"344","parentId":"28","name":"\u62c9\u8428"},"345":{"id":"345","parentId":"28","name":"\u963f\u91cc"},"346":{"id":"346","parentId":"28","name":"\u660c\u90fd"},"347":{"id":"347","parentId":"28","name":"\u6797\u829d"},"348":{"id":"348","parentId":"28","name":"\u90a3\u66f2"},"349":{"id":"349"... |
"""Role testing files using testinfra."""
def test_is_postgresql_runnnig_and_enabled(host):
postgresql = host.service('postgresql')
assert postgresql.is_running
assert postgresql.is_enabled
|
module.exports = function(grunt) {
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
compass: {
files: ['public/sass/{,*/}*.{scss,sass}'],
tasks: ['compass:server', 'autoprefixer']
},
... |
import { graphql } from "gatsby";
import PropTypes from "prop-types";
import React from "react";
import Loadable from "react-loadable";
import { Col, Container, Row } from "react-bootstrap";
import Footer from "../components/footer";
import Layout from "../components/layout";
import LightNavbar from "../components/ligh... |
// Copyright (C) 2021 Igalia S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.DateTimeFormat.prototype.resolvedOptions
description: >
Tests that Intl.DateTimeFormat.prototype.resolvedOptions calls
OrdinaryHasInstance instead of the instanceof ope... |
import AxiosWrapper from '@yandex-cloud/axios-wrapper';
import {backend as BACKEND} from '../store';
import {StorageTypes} from '../store/reducers/storage';
const config = {withCredentials: !window.custom_backend};
const {settingsApi} = window.web_version ? window.systemSettings : {};
export class YdbEmbeddedAPI ex... |
import os
import sys
from spec import eq_, skip, Spec, ok_, trap
from mock import patch, Mock
from invoke.cli import tasks_from_contexts
from invoke.collection import Collection
from invoke.context import Context
from invoke.parser import Parser
from invoke.tasks import task
import invoke
from _utils import (
_d... |
/* Copyright (C) 2016 NooBaa */
/** @typedef {typeof import('../sdk/nb')} nb */
'use strict';
const config = require('../../config');
const postgres_client = require('./postgres_client');
const mongo_client = require('./mongo_client');
const dbg = require('./debug_module')(__filename);
/**
* @returns { nb.DBClient }... |
/*
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'maximize', 'lv', {
maximize: 'Maksimizēt',
minimize: 'Minimizēt'
} );
|
import subprocess
def get_drive_letter():
return subprocess.getoutput('echo %CD%').split(':')[0]
def get_user_name():
return subprocess.getoutput('whoami').split('\\')[1]
|
// WebWorker.js
export default class WebWorker {
constructor(worker) {
let code = worker.toString();
code = code.substring(code.indexOf("{") + 1, code.lastIndexOf("}"));
const blob = new Blob([code], { type: "application/javascript" });
return new Worker(URL.createObjectURL(blob));
}
}
|
/*============================================================================================
File Name: form-typeahead.js
Description: The Typeahead plugin from Twitter's Bootstrap 2 ready to use with Bootstrap 4
------------------------------------------------------------------------------------------
Item N... |
/**
* adds implementation phase components in the graph
* @todo needs refactoring
*
* @param {Object} cy cytoscape instance
* @param {Object} event captured mouse event
* @param {number} nodeCounter id counter for nodes
*/
module.exports = function addDgnComponent (cy, event, nodeCounter) {
// get mouse positi... |
'use strict';
var exec = require('child_process').exec;
var chalk = require('chalk');
module.exports = function (grunt) {
grunt.registerMultiTask('shell', 'Run shell commands', function () {
var cb = this.async();
var options = this.options({
stdout: true,
stderr: true,
stdin: true,
failOnError: true
... |
import React from "react"
import { Item } from "semantic-ui-react"
import { OutboundLink } from "gatsby-plugin-google-analytics"
const Press = ({ articles }) => (
<Item.Group>
{articles.map(article => {
return (
<Item key={article.id}>
<Item.Content>
<Item.Header
... |
/**
* Created by 健勤 on 2016/7/9.
*/
$(function(){
var filmId = $.getUrlParam("filmId");
//为空或者不为数字时默认跳转主页
if( !filmId || (filmId && !/^\d+$/.test(filmId)) ){
window.location.href = "index.html";
}
$.ajax({
url: "/user/query/getFilmInfo.do",
data: {filmId: filmId},
... |
import React from 'react';
import { TabBar } from 'antd-mobile';
import { observer } from 'mobx-react';
// 静态数据
import { tabInfo } from './data';
// mobx数据
import state from './state';
// less样式
import './index.less';
// tab
@observer
class Index extends React.Component {
constructor(props) {
super(props)... |
function fishingBoat(arg1, arg2, arg3) {
let groupBudget = Number(arg1);
let season = arg2;
let countFishers = Number(arg3);
let boatPrice = 0;
switch (season) {
case "Spring":
boatPrice = 3000;
if (countFishers <= 6) {
boatPrice = boatPrice * 0.90;
... |
// Copyright (c) 2016-2018, BuckyCloud, Inc. and other BDT contributors.
// The BDT project is supported by the GeekChain Foundation.
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// ... |
const urlToFetch = "https://cfw-takehome.developers.workers.dev/api/variants";
let urls = [];
addEventListener("fetch", (event) => {
event.respondWith(handleRequest(event.request));
});
/**
* Respond with hello worker text
* @param {Request} request
*/
async function handleRequest(request) {
let option = {
... |
const path = require('path')
const fs = require('fs')
const cp = require('child_process')
let bookmarksDataCache = null
function getBookmarks (dataDir, browser) {
const profiles = ['Default', 'Profile 3', 'Profile 2', 'Profile 1']
const profile = profiles.find(profile => fs.existsSync(path.join(dataDir, profile, '... |
define(function (require, exports, module) {/** @jsx React.DOM */
var React = require('react');
var classSet = require('./utils/classSet');
var BootstrapMixin = require('./BootstrapMixin');
var Alert = React.createClass({displayName: 'Alert',
mixins: [BootstrapMixin],
propTypes: {
onDismiss: React.PropTypes... |
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvLayer(nn.Module):
def __init__(self, c_in):
super(ConvLayer, self).__init__()
padding = 1 if torch.__version__ >= '1.5.0' else 2
self.downConv = nn.Conv1d(in_channels=c_in,
out_ch... |
import Transaction from '../../transaction';
import inherits from 'inherits';
const debug = require('debug')('knex:tx')
import * as helpers from '../../helpers';
import { assign } from 'lodash'
function Transaction_MySQL2() {
Transaction.apply(this, arguments)
}
inherits(Transaction_MySQL2, Transaction)... |
/* Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government retains certain rights in this software. */
import d3 from "d3";
import "jquery-ui";
$.widget("sl... |
export const endpoint = `http://localhost:3000/api/graphql`;
export const prodEndpoint = `https://burgers-menu.herokuapp.com/api/graphql`;
|
#!/usr/bin/env python
from lxml import etree
import urllib2
import re
import json
class Instance(object):
def __init__(self):
self.vpc = None
self.arch = ['x86_64']
self.ECU = 0
self.linux_virtualization_types = []
self.ebs_throughput = 0
self.ebs_iops = 0
s... |
const express = require('express');
const moment = require('moment');
const nodemailer = require('nodemailer');
const router = express.Router();
const passport = require('passport');
const User = require('../models/user');
// index route
moment.locale();
router.get('/', (req, res) => {
res.render('index', { c... |
import React, {Component} from 'react';
const Home = React.createClass({
render() {
return (
<div className="#" style={{textAlign:"center"}}>
<h2>Search by GitHub UserName above</h2>
</div>
);
}
});
export default Home;
|
import React from 'react';
import CapsulingProfileProgressBar from '../../../../src/client/js/components/CapsulingProfileProgressBar';
import ReactTestUtils from 'react-testutils-additions';
describe('CapsulingProfileProgressBar', function () {
var instance;
describe('#render', function () {
beforeEach(functi... |
module.exports = {
presets: [
'@babel/preset-env',
'@babel/preset-flow',
'@babel/preset-react'
],
plugins: [
'flow-react-proptypes'
]
}
|
import cv2
import numpy as np
import math
class PossibleChar:
def __init__(self, _contour):
self.contour = _contour
self.boundingRect = cv2.boundingRect(self.contour)
[intX, intY, intWidth, intHeight] = self.boundingRect
self.intBoundingRectX = intX
self.intBoundingRectY... |
'use strict';
class Logger {
constructor(verbose) {
this.verbose = 3 - verbose;
const levels = ['trace', 'debug', 'info', 'warn', 'error', 'fatal'];
// normalize verbose level
if (this.verbose < 0 ) this.verbose = 0;
if (this.verbose >= levels.length ) this.verbose = levels.length - 1;
//
... |
"use strict";
// This icon file is generated automatically.
Object.defineProperty(exports, "__esModule", { value: true });
var BellTwoTone = { "icon": function render(primaryColor, secondaryColor) { return { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attr... |
import styled from 'styled-components/native';
export const Container = styled.View`
background-color: black;
align-items: center;
justify-content: center;
flex: 1;
`;
export const Img = styled.Image`
width: 100%;
min-height: 100%;
resize-mode: contain;
`;
|
'use strict';
requireApp('homescreen/test/unit/mock_xmlhttprequest.js');
requireApp('homescreen/test/unit/mock_homescreen.js');
requireApp('homescreen/test/unit/mock_iccHelper.js');
require('/shared/test/unit/mocks/mock_navigator_moz_settings.js');
// Unit tests for configurator library
requireApp('homescreen/js/conf... |
/**
* @module
* @description
* Provides API for working with Angular views.
*/
//# sourceMappingURL=view.js.map |
/*
* MainFooter Messages
*
* This contains all the text for the MainFooter component.
*/
import { defineMessages } from 'react-intl';
export const scope = 'app.components.MainFooter';
export default defineMessages({
header: {
id: `${scope}.header`,
defaultMessage: 'This is the MainFooter component!',
... |