text stringlengths 3 1.05M |
|---|
from django.shortcuts import render, redirect
from django.http import HttpResponse, JsonResponse
def routapp(request):
if request.method == "GET":
try:
if request.session.has_key('phoneno'):
return render(request, 'dash_mobilev3.html')
else:
return ... |
import os
import sys
def is_gpu_instance():
return True if os.system("nvidia-smi") == 0 else False
def is_conda_env():
return True if os.system("conda") == 0 else False
def check_python_version():
req_version = (3, 6)
cur_version = sys.version_info
if not (cur_version.major == req_version[0] ... |
import torch
import torch.nn.functional as F
def xcorr_slow(x, kernel, padding=0):
"""for loop to calculate cross correlation, slow version
"""
batch = x.size()[0]
out = []
for i in range(batch):
px = x[i]
pk = kernel[i]
px = px.view(1, px.size()[0], px.size()[1], px.size()... |
from .nn_structure import make_ope_networks
from .learner import TerminalDFIVLearner
|
# -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/EventDefinition
Release: R4
Version: 4.0.1
Build ID: 9346c8cc45
Last updated: 2019-11-01T09:29:23.356+11:00
"""
import io
import json
import os
import unittest
import pytest
from .. import eventdefinition
from ..fhirdate import FHIRDate
fro... |
/* Copyright (c) 2003-2011, The Ohio State University. All rights
* reserved.
*
* This file is part of the MVAPICH2 software package developed by the
* team members of The Ohio State University's Network-Based Computing
* Laboratory (NBCL), headed by Professor Dhabaleswar K. (DK) Panda.
*
* For detailed copyrigh... |
dpd.devices.get(function(result, error) {
var devices = [];
var length = result.length;
for (var i = 0; i < length; i++) {
var device = result[i];
devices.push(device.apnToken);
}
dpd.apndev.post(
{
payload: {
n: {
t: "del",
... |
/* global describe, beforeEach, it, expect */
describe('typeMismatch', function () {
const typeMismatch = require('../src/routines/typeMismatch')
describe('input[type=tel]', function () {
let input
beforeEach(function () {
input = document.createElement('input')
input.setAttribute('type', 'te... |
from . import twoplayergame
class LocalCoopGame(twoplayergame.TwoPlayerGame):
def __init__(self, users, possible_words, teams=None):
pass
|
const resourceRouter = require('../../../src/controllers/resource-controller');
const roleRouter = require('../../../src/controllers/role-controller');
describe('Routes', () => {
// resource routes setup ok
test('resource routes setup ok', () => {
const routes = resourceRouter.stack
.filter(layer => lay... |
from django.test import TestCase
from django.utils import timezone
import datetime
from django.core.exceptions import ValidationError
from BasicBusinessManager.models.order_related_objects.company import Sector,Company
from BasicBusinessManager.models.order_related_objects.product import Product
# Create your tests he... |
// This file was procedurally generated from the following sources:
// - src/annex-b-fns/eval-func-existing-var-update.case
// - src/annex-b-fns/eval-func/direct-switch-dflt.template
/*---
description: Variable-scoped binding is updated following evaluation (Funtion declaration in the `default` clause of a `switch` sta... |
# The intention is to make the test names descriptive enough to not need any docstrings for most of them
#pylint: disable=missing-docstring
# It seems better to have all tests for one module in the same file than to split across multiple files,
# so accepting many public methods and many lines makes sense
#pylint: disa... |
import React from "react";
import classnames from "classnames";
import PropTypes from "prop-types";
const TextAreaInputGroup = ({
id,
name,
error,
placeholder,
value,
onChange,
label,
defaultClasses
}) => {
return (
<div className="input-group">
<label htmlFor={name} className="sr-only labe... |
print('-'* 80)
print('{:' '^80}'.format('CAIXA ELETRÔNICO'))
print('-'* 80)
valor = int(input('Quanto quer sacar? R$'))
total = valor
nota = i = 100
totalnota = 0
while True:
if total >= nota:
total -= nota
totalnota += 1
else:
if totalnota != 0:
print(f'Total de {totalnota} ... |
// Dependencies
const Command = require('../../structures/Command.js');
module.exports = class Random extends Command {
constructor(bot) {
super(bot, {
name: 'random',
dirname: __dirname,
botPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'],
description: 'Replies with a random number.',
usage: 'random <L... |
!function(e){const t=e.lv=e.lv||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 no %1","Align center":"Centrēt","Align left":"Pa kreisi","Align right":"Pa labi",Aquamarine:"Akvamarīns",Big:"Liels",Black:"Melns","Block quote":"Citāts",Blue:"Zils",Bold:"Trekns","Break text":"","Bulleted List":"Nenumurēts S... |
import tcod as libtcod
from enum import Enum
from game_states import GameStates
from menus import inventory_menu, level_up_menu, character_screen
class RenderOrder(Enum):
STAIRS = 1
CORPSE = 2
ITEM = 3
ACTOR = 4
def get_names_under_mouse(mouse, entities, fov_map):
(x, y) = mouse.cx, mouse.cy
... |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2020 Huawei Technologies Co., Ltd.
# oec-hardware is licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# TH... |
import pytest
from inputimeout import inputimeout, TimeoutOccurred
def test_inputimeout():
with pytest.raises(TimeoutOccurred):
inputimeout('>>', 3)
|
import pytest
from saleor.order.emails import (
send_order_confirmation, send_payment_confirmation)
@pytest.mark.integration
def test_email_sending_asynchronously(
transactional_db, celery_app, celery_worker, order_with_lines):
order = send_order_confirmation.delay(order_with_lines.pk)
payment = ... |
class ArrayDevice(object):
def __init__(self, name, type, *args, **kwargs):
self.name = name
self.type = type
class ArrayDevice():
def __init__(self, name, type):
self.name = name
self.type = type |
from __future__ import annotations
import ast
import functools
from typing import Iterable
from tokenize_rt import Offset
from pyupgrade._ast_helpers import ast_to_offset
from pyupgrade._data import register
from pyupgrade._data import State
from pyupgrade._data import TokenFunc
from pyupgrade._token_helpers import ... |
from dataclasses import dataclass
from aws_cdk import aws_apigatewayv2 as apigw
from aws_cdk import aws_lambda as lambda_
from aws_cdk import aws_s3 as s3
from aws_cdk import aws_sqs as sqs
from aws_cdk import core
from aws_cdk.aws_lambda_event_sources import ApiEventSource, SqsEventSource
# create two lambdas to ha... |
from django.conf import settings
from oms_cms.backend.utils.models import EmailsFeedback
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail
def send_mail_contact(subject, message):
"""Отправка письма через SendGrid"""
message = Mail(
from_email=settings.DEFAULT_FROM_EMAIL,
... |
import pyhecdss
import datetime
if __name__=='__main__':
pyhecdss.set_message_level(0)
d=pyhecdss.DSSFile('./ITP_PP_out_ec.dss')
s=datetime.datetime.now()
catdf=d.read_catalog()
print('catalog read in :', datetime.datetime.now()-s )
plist=d.get_pathnames()
print('Reading ',len(plist... |
from enum import IntEnum, auto
class Opcode(IntEnum):
ADD = auto()
SUB = auto()
CMP = auto()
AND = auto()
OR = auto()
XOR = auto()
SRL = auto()
SRA = auto()
SLL = auto()
NOT = auto()
NEG = auto()
MOVE = auto()
SEXT = auto()
LDA = auto()
LDP = a... |
"use strict";
// ---------------------------------------------------------------------------
const Exchange = require ('./base/Exchange')
const { ExchangeError, AuthenticationError, InvalidOrder, InsufficientFunds, OrderNotFound, DDoSProtection } = require ('./base/errors')
// -------------------------------------... |
import numpy
import pytest
from rdkit import Chem
from chainer_chemistry.dataset.preprocessors import common
@pytest.fixture
def sample_molecule():
return Chem.MolFromSmiles('CN=C=O')
class TestGetAtomicNumbers(object):
def test_normal(self, sample_molecule):
actual = common.construct_atomic_numbe... |
import React from 'react';
import { mount } from 'enzyme';
import Form, { Field } from '../../src';
import { Input } from '../common/InfoField';
import { changeValue, getField } from '../common';
import timeout from '../common/timeout';
describe('legacy.async-validation', () => {
let wrapper;
let form;
const ch... |
import React, { useEffect, useState } from 'react';
import Layout from '../components/layout';
import SEO from '../components/seo';
import TitleBar from '../components/theme/titleBar';
import Link from 'next/link';
import CookieConsent from '../components/cookieConsent';
const Branding = () => (
<Layout>
<SEO t... |
// Copyright 2016 Zipscene, LLC
// Licensed under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
const pasync = require('pasync');
const request = require('request');
const XError = require('xerror');
const _ = require('lodash');
const zstreams = require('zstreams');
const PassThrough = ... |
s1= 'Pulchitudrinous'
print(s1[0:6]) # -- SL1
print(s1[0:6:1]) # -- SL2
print(s1[:6]) # -- SL3
print(s1[1:6:2]) # -- SL4
print(s1[6:]) # -- SL5
print(s1[::]) # -- SL6
print(s1[:]) # -- SL7
print(s1[::-1]) # -- SL8
print(s1[::-2]) # -- SL9
print(s1[-1:-13:-2]) # -- SL10
print(s1[1:13:-2]) # -- SL11
print(s1[... |
# fp16 settings
fp16 = dict(loss_scale=512.)
import sys
scale = float(sys.argv[-1][8:])
# model settings
model = dict(
type='MaskRCNN',
pretrained='torchvision://resnet101',
backbone=dict(
type='ResNet',
depth=101,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages... |
// ==========================================================================
// SeqAn - The Library for Sequence Analysis
// ==========================================================================
// Copyright (c) 2006-2013, Knut Reinert, FU Berlin
// Copyright (c) 2013 NVIDIA Corporation
// All rig... |
/**
* Created by Sergej Görzen on 04.09.2016.
*/
(function () {
var app = angular.module('boolean-algebra');
app.directive('boolKvBlockInput', function($timeout){
return {
restrict: 'E',
replace:true,
scope:{
layer: "=bindLayer"
},
... |
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(React.createElement("path", {
d: "M8.12 19.3c.39.39 1.02.39 1.41 0L12 16.83l2.47 2.47c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41l-3.17-3.17a.9959.9959 0 00-1.41 0l-3.17 3.17c-.4.38-.4 1.02-.01 1.41zm7.76-14.6a... |
import threading
import time
import random
import socket
def client():
try:
cs = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print("[C]: Client socket created")
except socket.error as err:
print('socket open error: {} \n'.format(err))
exit()
# Define the port on whi... |
class Pessoa:
olhos = 2
def __init__(self, nome, idade = 35, *filhos): #*filhos para aceitar qualquer quantidade de filhos
self.idade = idade
self.nome = nome #quando tiver o .nome é o nome do objeto, o atributo nome do objeto. quando não tiver é apenas o parâmetro ou variável dentro do método
... |
import React, { Component } from "react";
import CartScrollBar from "./CartScrollBar";
import EmptyCart from "./empty-states/EmptyCart";
import {TransitionGroup} from "react-transition-group";
import "./Product";
class Header extends Component {
constructor(props) {
super(props);
this.handleClick = this.h... |
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is dis... |
/*
* This file is part of the µOS++ distribution.
* (https://github.com/micro-os-plus)
* Copyright (c) 2021 Liviu Ionescu.
*
* 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 without
... |
from dataclasses import dataclass
from typing import Callable
from agents_playground.simulation.tag import Tag
@dataclass
class RenderLayer:
id: Tag
label: str
menu_item: Tag
layer: Callable |
from functools import reduce
from pprint import pformat
from six import viewkeys
from six.moves import map, zip
from toolz import curry, flip
from .sentinel import sentinel
@curry
def apply(f, *args, **kwargs):
"""Apply a function to arguments.
Parameters
----------
f : callable
The functio... |
/* Copyright 2021 The TensorFlow 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 law or a... |
from django.urls import path
from .import views
urlpatterns = [
path('', views.index)
]
|
#!/usr/bin/env python
import json
import os
import re
import subprocess
from docker import Client
from docker import errors
from drivers.common.apidriver import API
class DockerApiDriver( API ):
def __init__( self ):
"""
Initialize client
"""
self.name = None
self.home = N... |
import './module.js';
import GeoJSON from 'ol/format/GeoJSON.js'
angular.module('anol.print')
/**
* @ngdoc directive
* @name anol.print.directive:anolPrint
*
* @requires anol.map.MapService
* @requires anol.map.LayersService
* @requires anol.print.PrintService
* @requires anol.print.PrintPageService
*
* @desc... |
#!/usr/bin/env node
const path = require('path');
const {Server, config} = require('karma');
const karmaConfig = config.parseConfig(
path.resolve(__dirname, '../karma.conf.js')
);
const server = new Server(karmaConfig, exitCode => {
console.log('Karma has exited with ' + exitCode);
process.exit(exitCode);... |
import { sequelize, DataTypes, Model } from "../config/sequelize";
class users_addresses extends Model {}
users_addresses.init(
{
id_users_addresses: {
type: DataTypes.INTEGER,
primaryKey: true,
allowNull: false,
autoIncrement: true,
},
id_us... |
"""pearl URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based v... |
"""
Train our RNN on extracted features or images.
"""
from tensorflow.keras.callbacks import TensorBoard, ModelCheckpoint, EarlyStopping, CSVLogger, ReduceLROnPlateau
from models import ResearchModels
from data import DataSet
import time
import os.path
from utils.common import get_config
def train(data_type, seq_leng... |
import re
import sys
from OpenSSL import crypto
# get prefix for DQ2
def getDQ2Prefix(dq2SiteID):
try:
# prefix of DQ2 ID
tmpDQ2IDPrefix = re.sub('_[A-Z,0-9]+DISK$','',dq2SiteID)
# remove whitespace
tmpDQ2IDPrefix = tmpDQ2IDPrefix.strip()
# patchfor MWT2
if tmpDQ2ID... |
from flask import render_template, flash, Markup, request, redirect, url_for, g, session
from flask_login import login_user, login_required, current_user, UserMixin, logout_user
from app import app, logman
from .forms import AuthForm, EditForm
import os
import markdown
import frontmatter
from operator import itemgetter... |
import React from 'react';
import { getPokemonInheritance } from '../helpers';
import { BattlePokedex } from '../pokedex';
import SkyLight from 'react-skylight';
import FeelingHype from './FeelingHype';
import PokeSprite from 'react-poke-sprites';
import '../css/App.css';
import searchLogo from '../search-logo.svg';
... |
//Pop-Up
function newtabherenow() {
var chromeponypopup = window.open(chrome.extension.getURL('index.html'), "chromeponypopup", "width=1250,height=700");
chromeponypopup.focus();
};
chrome.browserAction.onClicked.addListener(function(tab) {
var chromeponypopup = window.open(chrome.extension.getURL... |
#include <leveldb/c.h>
#include "application.h"
struct leveldb_ctx {
leveldb_t *db;
leveldb_options_t *options;
leveldb_readoptions_t *roptions;
leveldb_writeoptions_t *woptions;
};
struct leveldb_ctx* new_leveldb_context();
void open_db(struct leveldb_ctx *ctx, char* db_name);
void destroy_db(struct l... |
var satoshi = 100000000;
var DELAY_CAP = 20000;
var lastBlockHeight = 0;
var provider_name = "zerocurrency.io";
var transactionSocketDelay = 1000;
/** @constructor */
function TransactionSocket() {
}
function dump(obj) {
var out = '';
for (var i in obj) {
out += i + ": " + obj[i] + "\n";
}
alert(out);
}
... |
'use strict';
var Message = require('../message');
var inherits = require('util').inherits;
var bitcore = require('bitcore-lib-terracoin');
var BufferUtil = bitcore.util.buffer;
/**
* Request information about active peers
* @extends Message
* @param {Object} options
* @constructor
*/
function GetaddrMessage(arg... |
# -*- coding: utf-8 -*-
"""Identity Services Engine updateNetworkAccessTimeConditionById data model.
Copyright (c) 2021 Cisco and/or its affiliates.
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 Softwar... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestIncomeTaxSlab(unittest.TestCase):
pass
|
from compiler.lexer.lexer import Lexer
from compiler.parser.expressions import Expression, Program
from compiler.parser.parse import Parser
from compiler.lexer.readers import StringReader
def test_arithmetic():
code = "(begin (+ 5 6 7))"
program = new_program(code)
check_expression_type(program.values[0]... |
#ifndef BITCOIN_CHAINPARAMSSEEDS_H
#define BITCOIN_CHAINPARAMSSEEDS_H
/**
* List of fixed seed nodes for the bitcoin network
* AUTOGENERATED by contrib/seeds/generate-seeds.py
*
* Each line contains a 16-byte IPv6 address and a port.
* IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly.
... |
//// [tests/cases/compiler/commentsExternalModules.ts] ////
//// [commentsExternalModules_0.ts]
/** Module comment*/
export module m1 {
/** b's comment*/
export var b: number;
/** foo's comment*/
function foo() {
return b;
}
/** m2 comments*/
export module m2 {
/** class ... |
/**
* <!--------------------------------------------------------------------------
* This file is part of libSBMLSim. Please visit
* http://fun.bio.keio.ac.jp/software/libsbmlsim/ for more
* information about libSBMLSim and its latest version.
*
* Copyright (C) 2011-2013 by the Keio University, Yokohama, Japan
... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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, overload
from .. import... |
/**
* @overview Create ETL process run test
* @author Richard Ayotte
* @copyright Copyright © 2019 Richard Ayotte
* @license MIT License
*/
'use strict'
const connectionPool = require('./get-db-connection-pool')
const createEtlProcessRun = require('./create-etl-process-run')
const populateTestDatab... |
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from intro_pkg1/Equ.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class Equ(genpy.Message):
_md5sum = "cbbb65bba7b391acb2e0a0d07ce1c8e4"
_type = "intro_pkg1/Equ"
... |
from pathlib import Path
from manim import *
class Radiation(Scene):
def construct(self):
offset=3.5*LEFT
img = Path.home()/"Documents" /"manim_resources"/ "earth.png"
earth= ImageMobject(str(img))
heading= Tex(r"Earth radiation spectrum").to_edge(UP).scale(2)
self.add(head... |
require("dotenv").config({
path: '.env',
})
module.exports = {
siteMetadata: {
title: `Gatsby Default Starter`,
description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`,
author: `@gatsbyjs`,
... |
from .user import (UserForm,UserListForm,UserFilterForm,UserEditForm,UserViewForm)
|
from django.db import models
from django.contrib.auth.models import User
from cloudinary.models import CloudinaryField
from django.dispatch import receiver
from django.db.models.signals import post_save
from django.core.exceptions import ObjectDoesNotExist
from django.http import Http404
from django.core.validators imp... |
"""
A Printer for generating executable code.
The most important function here is srepr that returns a string so that the
relation eval(srepr(expr))=expr holds in an appropriate environment.
"""
from typing import Any, Dict
from sympy.core.function import AppliedUndef
from sympy.core.mul import Mul
from mpmath.libmp... |
#
# Copyright (c) 2008-2016 Citrix Systems, 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 l... |
import Vue from 'vue'
import Vuex from 'vuex'
import middlewares from './middlewares'
import * as actions from './actions'
import * as getters from './getters'
import mutations from './mutations'
const debug = process.env.NODE_ENV !== 'production'
Vue.use(Vuex)
export default new Vuex.Store({
actions,
getters,
... |
import React, {Component} from "react";
class Maggie extends Component {
constructor(props) {
super(props);
}
render() {
return <div id="maggie">
<div className="head">
<div className="no-border body head-main"></div>
<div className="body hair ... |
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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
*
* h... |
#include "base/build_info.h"
const char* kBuildEmbedLabel = BUILD_EMBED_LABEL;
const char* kBuildHost = BUILD_HOST;
const char* kBuildUser = BUILD_USER;
const char* kBuildScmRevision = BUILD_SCM_REVISION;
const char* kBuildScmStatus = BUILD_SCM_STATUS;
const time_t kBuildTimestamp = (time_t)(BUILD_TIMESTAMP / 1000.0);... |
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2016-2017 The HealthyWorm developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef worm_DB_H
#define wor... |
#!/usr/bin/python3
"""
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
"""
import asyncio
import base64
import configparser
import datetime
import hashlib
import http.server
import importlib
import io
import multiprocessing
import os
import platform
import shutil
import signa... |
export class Attachment {
constructor(displayName, timestamp) {
this.displayName = displayName;
this.date = new Date(timestamp);
}
getFormatedTime() {
var d = this.date;
return d.getDate() + "/" + d.getMonth() + "/" + d.getFullYear() + " " + d.getHours() + ":" + d.getMinutes... |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Anler Hernández ... |
export function a({ name = '' }) {
const out = name ? `Hi ${name}!` : 'Hello!';
console.log(out);
}
export function b({ name = '' }) {
return new Promise(
resolve => resolve(name ? `Hi ${name}!` : 'Hello!')
);
}
export function c() {
return <div />;
}
|
const MAX_FAV = 10;
function initializeFavs() {
const selectFav = document.querySelector("#favorite");
selectFav.addEventListener("change", e => {
const url = document.querySelector("#favorite").value;
if (!sbUrl.inScrapbox(url)) return;
if (!tabGroup.activateIfOpened(url)) {
tabGroup.openUrl(ur... |
"""Configuration file for the Sphinx documentation builder.
https://www.sphinx-doc.org/en/master/usage/configuration.html
"""
import ast
import re
from pathlib import Path
import tomlkit
root = Path(__file__).parent.parent.absolute()
toml = tomlkit.loads((root / "pyproject.toml").read_text(encoding="utf8"))
def f... |
/**
*
*/
$(function(){
$('#musicList').mp3editor();
});
|
webpackJsonp([1],{"+LJZ":function(t,e){},"+cgG":function(t,e){},"4dOR":function(t,e){},"899/":function(t,e){},Ar3W:function(t,e){},AwQT:function(t,e){},F1SW:function(t,e){},N0MC:function(t,e){},NHnr:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=i("7+uW"),s={render:function(){var t=... |
const mongoose = require('mongoose');
const cities = require('./cities');
const { places, descriptors } = require('./seedHelpers');
const Campground = require('../models/campground');
mongoose.connect('mongodb://localhost:27017/yelp-camp', {
useNewUrlParser: true,
useCreateIndex: true,
useUnifiedTo... |
from typing import List, Tuple
from ...pipeline import Lemmatizer
from ...tokens import Token
class FrenchLemmatizer(Lemmatizer):
"""
French language lemmatizer applies the default rule based lemmatization
procedure with some modifications for better French language support.
The parts of speech 'ADV... |
// 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/Swipe/nls/strings":{_widgetLabel:"Swipe",swipeText:"Capa con funci\u00f3n swipe",spyg... |
"""Add include_in_timeline field
Revision ID: f17f01e2f2c5
Revises: ff66e16c21ef
Create Date: 2021-04-23 15:04:32.156950+00:00
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "f17f01e2f2c5"
down_revision = "ff66e16c21ef"
branch_labels = None
depends_on = None
... |
exports.seed = (knex, Promise) => {
// Deletes ALL existing entries
return knex('meats').del()
.then(function () {
// Inserts seed entries
return knex('meats').insert([
{id: 1, type: 'Beef'},
{id: 2, type: 'Pork'},
{id: 3, type: 'Lamb'},
{id: 4, type: 'Mutton/Goat'},
... |
var f5 = require('f5-nodejs');
var dns = require('dns');
//var net = require('net');
var server = new f5.ILXServer();
var NXDOMAIN_FAIL = "NXDOMAIN/SERVER FAIL";
// set DNS server
dns.setServers(['10.1.10.50']);
function isValidDomain(value) {
// base on https://www.ietf.org/rfc/rfc1035.txt, the domain name... |
// Canvas Asteroids
//
// Copyright (c) 2010 Doug McInnes
//
KEY_CODES = {
32: 'space',
37: 'left',
38: 'up',
39: 'right',
40: 'down',
70: 'f',
71: 'g',
72: 'h',
77: 'm',
80: 'p'
}
KEY_STATUS = { keyDown:false };
for (code in KEY_CODES) {
KEY_STATUS[KEY_CODES[code]] = false;
}
$(window).keydown... |
//
// zHuoYuanMangerController.h
// ZhuangBei
//
// Created by aa on 2020/5/7.
// Copyright © 2020 aa. All rights reserved.
//
#import "baseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface zHuoYuanMangerController : baseViewController
@end
NS_ASSUME_NONNULL_END
|
# -*- coding: utf-8 -*-
from tests import TestOpensearchmock, INDEX_NAME, DOC_TYPE, BODY
UPDATED_BODY = {
'author': 'vrcmarcos',
'text': 'Updated Text'
}
class TestIndex(TestOpensearchmock):
def test_should_index_document(self):
data = self.os.index(index=INDEX_NAME, doc_type=DOC_TYPE, body=BOD... |
import argparse
import sys
from . base_command import Command
from ..render.excel_render import ExcelRender, ExcelRenderContext
class ExcelCommand(Command):
HELP_SHEETS = """read sheets range ('1' sheet1 only. '1:4' read 1 to 4. '1:' read 1 to all)"""
HELP_READ_RANGE = """read cells range ('A1:D4' read ... |
import requests
import io
import matplotlib.pyplot as plt
from PIL import Image
import base64
from collections import OrderedDict
class Deck:
def __init__(self, deck_count=1):
self.BASE_URL = 'http://deckofcardsapi.com/api/'
endpoint = 'deck/new/shuffle/'
parameters = '?deck_count=' + str... |
# Copyright (c) 2014 Ahmed H. Ismail
# 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 in writin... |
const request = require('request-promise-native')
const config = require('config')
const fetchTokenPrice = async (tokenAddress) => {
const response = await request.get(`${config.get('fuseswap.api.url')}/price/${tokenAddress}`)
const { data } = JSON.parse(response)
return data.price
}
module.exports = {
fetchT... |