text stringlengths 3 1.05M |
|---|
const router = require("express").Router();
const { Room, Amenities } = require("../models");
router.get("/", (req, res) => {
Room.findAll({
attributes: [
"id",
"room_name",
"room_price",
"room_img",
"room_description",
],
})
.then((dbRoomData) => {
const rooms = dbR... |
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include "mscorlib_System_Object2689449295.h"
// System.Byte[]
struct ByteU5BU5D_t3397334013;
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagn... |
import pandas as pd
from visualization import *
from chameleon import *
if __name__ == "__main__":
# get a set of data points
df = pd.read_csv('./datasets/Aggregation.csv', sep=' ',
header=None)
# returns a pands.dataframe of cluster
res = cluster(df, 7, knn_params=dict(n_neighbo... |
import os
import sys
from pathlib import Path
def replace_file_extension(input_file):
"""
read {train/val/test/trainval}.txt file (downloaded from https://github.com/fxia22/pointnet.pytorch/issues/52#issuecomment-561013797)
These files contain list of .ply models. ModelNet40 dataset now contains .off file... |
"""Add sentences for understanding the context of matched terms."""
import csv
import os
import re
from glob import glob
from typing import List
import nltk
import pandas as pd
import textdistance
from nltk import ne_chunk, pos_tag, word_tokenize
from nltk.stem.wordnet import WordNetLemmatizer
from ontorunner.post.ut... |
#include <stdbool.h>
#define ONYX_CHAR_TAG 0xA
struct object* onyx_char_tag(char);
char onyx_char_untag(struct object*);
bool onyx_is_char(struct object*);
|
// flow-typed signature: 5d4e04838fec1f4406da93fbe7e1a4e9
// flow-typed version: 2b421a3da9/chai_v4.x.x/flow_>=v0.15.0
declare module "chai" {
declare type ExpectChain<T> = {
and: ExpectChain<T>,
at: ExpectChain<T>,
be: ExpectChain<T>,
been: ExpectChain<T>,
have: ExpectChain<T>,
has... |
// Copyright (c) 2009-2018 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_CLIENTVERSION_H
#define BITCOIN_CLIENTVERSION_H
#if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h... |
/*
* Backpack - Skyscanner's Design System
*
* Copyright 2016-2020 Skyscanner Ltd
*
* 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
*
... |
# Generated by Django 3.1.13 on 2021-08-21 18:39
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Product',
fields=[
('id', models.AutoField... |
/*-------------------------------------------------------------------------
*
* storage.c
* code to create and destroy physical storage for relations
*
* Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFI... |
"""Download Files to your local server
Syntax:
.download
.download url | file.name to download files from a Public Link"""
import asyncio
import math
import os
import time
from datetime import datetime
from pySmartDL import SmartDL
from uniborg.util import admin_cmd, humanbytes, progress
@borg.on(admin_cmd(pattern="d... |
try:
from ciscosparkapi import CiscoSparkAPI, DEFAULT_BASE_URL
except ImportError:
message = ('Missing "ciscosparkapi", please install it using pip:\n'
'pip install ciscosparkapi')
raise ImportError(message)
from st2actions.runners.pythonrunner import Action
__all__ = [
'CiscoSparkActio... |
self.addEventListener('install', function(e) {
e.waitUntil(
caches.open('shosho-canel-store').then(function(cache) {
return cache.addAll([
'/packages/bootstrap/dist/index.html',
'/packages/bootstrap/dist/bundle.min.js',
'/packages/bootstrap/dist/icon/fox-icon.png',
'/packages/bootst... |
""" Hashtable """
class Hashtable:
def __init__(self, size):
self.size = size
self.slots = [None] * self.size
self.data = [None] * self.size
def put(self, key, data):
hashvalue = self.hashfunction(key, len(self.slots))
if not self.slots[hashvalue]: # Add new value
... |
import re
import os
import sys
from math import log
re_eng = re.compile('[a-zA-Z0-9]', re.U)
re_han = re.compile("([\u4E00-\u9FD5a-zA-Z0-9+#&\._%\-]+)", re.U)
re_skip = re.compile("(\r\n|\s)", re.U)
class Segment:
def __init__(self):
self.vocab = {}
self.max_word_len = 0
self.max_freq = 0
self.total_freq = ... |
#!/usr/bin/env python
""" See the file "LICENSE" for the full license governing this code.
Copyright 2011,2012,2013,2017 Ken Farmer
"""
#adjust pylint for pytest oddities:
#pylint: disable=missing-docstring
#pylint: disable=unused-argument
#pylint: disable=attribute-defined-outside-init
#pylint: disable=protected-a... |
import { createStore, applyMiddleware } from "redux";
import { createPlayMiddleware } from "redux-play";
import rootReducer from "./reducers";
import * as rootPlay from "./plays";
const errorHandler = error => store.dispatch({ type: ":device--unexpected-error", error });
const playMiddleware = createPlayMiddleware(ro... |
import attr
from .utils import listify
@attr.s(frozen=True)
class Version:
"""A version number of the form 1.0.0-1."""
major = attr.ib(default=0)
minor = attr.ib(default=0)
patch = attr.ib(default=0)
downstream = attr.ib(default=0)
@classmethod
def parse(cls, rep):
"""Parse the ... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v1/proto/errors/conversion_adjustment_upload_error.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from goo... |
from django.utils.translation import ugettext as _
from django.utils.timezone import now as timezone_now
from django.conf import settings
from django.core import validators
from django.core.exceptions import ValidationError
from django.db import connection
from django.http import HttpRequest, HttpResponse
from typing ... |
import { createActions } from 'redux-actions'
export const GET_CLASSES_REQUEST = 'GET_CLASSES_REQUEST'
export const GET_CLASSES_SUCCESS = 'GET_CLASSES_SUCCESS'
export const GET_CLASSES_FAILURE = 'GET_CLASSES_FAILURE'
export const {
getClassesRequest,
getClassesSuccess,
getClassesFailure
} = createActions({
GE... |
/*
* MHNodeInsertionProbability.h
*
* Created on: Jul 30, 2012
* Author: jchen
*/
#ifndef MHNODEINSERTIONPROBABILITY_H_
#define MHNODEINSERTIONPROBABILITY_H_
#include <tr1/unordered_map>
class patMultiModalPath;
class patRouter;
class patNetworkBase;
class MHWeightFunction;
class patNode;
class MHNodeInser... |
/*
* Copyright 2010, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditio... |
/**
* This file uses the Page Object pattern to define the main page for tests
* https://docs.google.com/presentation/d/1B6manhG0zEXkC-H-tPo2vwU06JhL8w9-XCF9oehXzAQ
*/
'use strict';
var OauthButtons = function() {
var oauthButtons = this.oauthButtons = element(by.css('oauth-buttons'));
oauthButtons.twitter = o... |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
"""Defines an explainable linear model."""
import numpy as np
from scipy.sparse import csr_matrix, issparse
from sklearn.linear_model impo... |
# exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('C6A', ['C8pro'])
Monomer('BaxA', ['BaxM', 'BaxA_1', 'BaxA_2', 'SmacM'])
Monomer('Ligand', ['Receptor'])
Monomer('C6pro', ['C3A'])
Monome... |
const crypto = require('crypto')
const Sequelize = require('sequelize')
const db = require('../db')
const User = db.define('user', {
name: {
type: Sequelize.STRING
},
email: {
type: Sequelize.STRING,
unique: true,
allowNull: false,
validate: {
isEmail: true
}
},
phone: {
typ... |
Molpy.DefineGUI = function() {
function InnerMolpify(number, raftcastle, shrinkify) {
if(isNaN(number)) return 'Mustard';
if(!isFinite(parseFloat(number))) return 'Infinite';
if(number < 0) return '-' + InnerMolpify(-number, raftcastle, shrinkify);
var molp = '';
if(shrinkify == 2)
shrinkify = 0;
else ... |
#!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1mOD2BYeca0vjKXdfYVHi5EhoqOSSiYzVPAqYAEQBVKs'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
|
# GGearing
# Simple encryption script for text
# This was one my first versions of this script
# 09/07/2017
from __future__ import print_function
import math
import sys
input_fun = None
key = int(math.pi * 1e14)
if sys.version_info.major >= 3:
input_fun = input
else:
input_fun = raw_input
text = input_fun("... |
from icarus_backend.user.UserController import UserController
from icarus_backend.pilot.PilotModel import Pilot
from users.models import IcarusUser as User
from icarus_backend.pilot.PilotData import PilotRegistrationData
class PilotController:
@staticmethod # Used to register an existing user as a Pilot
def... |
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_REVOCABLE_STORE_H__
#define BASE_REVOCABLE_STORE_H__
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/ref_coun... |
import glob
import os
import pathlib
import subprocess
from talon import Context, Module, actions, settings
mod = Module()
mod.tag("obs_studio_global", desc="tag that's active if oba-studio is running")
mod.setting(
"obs_recording_folder",
type=str,
default=None,
desc="the default location to record f... |
/*
* System Control Driver
*
* Copyright (C) 2012 Freescale Semiconductor, Inc.
* Copyright (C) 2012 Linaro Ltd.
*
* Author: Dong Aisheng <dong.aisheng@linaro.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* ... |
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef SHELL_BROWSER_NATIVE_WINDOW_MAC_H_
#define SHELL_BROWSER_NATIVE_WINDOW_MAC_H_
#import <Cocoa/Cocoa.h>
#include <memory>
#include <queue>
#include <string>
#include <tuple>
#i... |
"""Amazon Product Advertising API wrapper for Python"""
__version__ = '3.2.0'
__author__ = 'Sergio Abad'
|
const crypto = require('crypto')
/**
* @module Util
*/
module.exports = {
/**
* Performs string formatting for things like custom nicknames.
*
* @param {string} formatString The string to format (contains replacement strings)
* @param {object} data The data to replace the string replacements with
* ... |
$(document).ready(function () {
$('#payment-check-all').click(function () {
$('.payment-checkbox').prop('checked', this.checked);
});
$('#create-new-payment').click(function() {
location.href = '/payment/create';
});
$('#split-payments').click(function() {
let paymentId... |
var data = {
"body": "<g fill=\"currentColor\"><path d=\"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8a8 8 0 0 1-8 8z\"/><path d=\"M15 11h-2V9a1 1 0 0 0-2 0v2H9a1 1 0 0 0 0 2h2v2a1 1 0 0 0 2 0v-2h2a1 1 0 0 0 0-2z\"/></g>",
"width": 24,
"height": 24
};
export default data;
|
/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
... |
// 身份验证
import Taro, { Component } from '@tarojs/taro'
import { View, Image, Text } from '@tarojs/components'
import { connect } from '@tarojs/redux'
import { AtButton, AtInput } from 'taro-ui'
import BackHeader from '../../../../components/BackHead'
import Info from '../../../../images/user/authentication/info.png'
i... |
'use strict'
const Joi = require('@hapi/joi')
const { isBuildStatus } = require('../build-status')
const keywords = ['vso', 'vsts', 'azure-devops']
const schema = Joi.object({
message: Joi.alternatives()
.try(
isBuildStatus,
Joi.equal('unknown'),
Joi.equal('set up now'),
Joi.equal('neve... |
# gunicorn configuration file
import os
bind = "{}:{}".format(os.getenv("FLASK_HOST", "0.0.0.0"), os.getenv("FLASK_PORT", 5080))
# Run the web service on container startup. Here we use the gunicorn
# webserver, with one worker process and 8 threads.
# For environments with multiple CPU cores, increase the number of w... |
from django.conf.urls import url, include
from django.contrib import admin
from django.urls import path
from apps.endpoints.urls import urlpatterns as endpoints_urlpatterns
urlpatterns = [
path('admin/', admin.site.urls),
]
urlpatterns += endpoints_urlpatterns
|
import sys
import os
import sty
from autopalette import BasicTheme
from autopalette.colormatch import ColorPoint
from autopalette.colortrans import rgb2short
from autopalette.utils import (
terminal_colors,
select_render_engine,
parse_color,
select_palette,
)
class ColoredString(str):
def __new_... |
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
const jade = require("jade")
const path = require("path")
const fs = require("fs")
const Backbone = require("backbone")
con... |
this.wp=this.wp||{},this.wp.formatLibrary=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefin... |
from werkzeug.utils import import_string
import errno
import os
import types
import typing as t
""" This file was borrowed from the Flask project - BSD-3-Clause License """
class ConfigAttribute:
"""Makes an attribute forward to the config"""
def __init__(self, name: str, get_converter: t.Optional[t.Callabl... |
/****************************************************************************
**
** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt3D module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL3$
** Commercial License Usage
** Licensees ho... |
# Generated from src/blackbird.g4 by ANTLR 4.8
from antlr4 import *
if __name__ is not None and "." in __name__:
from .blackbirdParser import blackbirdParser
else:
from blackbirdParser import blackbirdParser
# This class defines a complete listener for a parse tree produced by blackbirdParser.
class blackbirdL... |
#include "encrypt.h"
#include "lora/lora.h"
#include <math.h>
//#define TIMER_KEY_GENERATION 500000 //interval between each symetric key generation (in ms)
#define TIMER_MESURE 3000 //interval between each sample (in ms)
//#define BUFF_SIZE_MAX 8 //24... |
import time
import torch
from NVLL.util.util import GVar
from NVLL.util.gpu_flag import device
print(device)
#
# start = time.time()
# hard = torch.nn.Hardtanh()
# softmax = torch.nn.Softmax()
# for i in range(100):
# x = torch.zeros(100000).cuda()
# y = torch.rand(100000).cuda()
# z = y * y * y
# c... |
/*
* Copyright (c) 2020 MariaDB Corporation Ab
*
* Use of this software is governed by the Business Source License included
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
*
* Change Date: 2025-03-24
*
* On the date above, in accordance with the Business Source License, use
* of this software will be g... |
const v1 = require('./v1');
module.exports = { v1 };
|
# -*- coding: utf-8 -*-
from lib import logger, linkedin_scraper, role_occurrence, o365_validation
from time import sleep
import json
def run(data):
cookie = data.cookie
company_id = data.company_id
email_format = data.email_format
keyword = data.keyword
domain = data.domain
validation = data.validation
api_k... |
// config.js -- !!!!!!!!!!!!!!! USE ENV VARIABLE FOR secret AND db
module.exports = {
'secret': '<Insert secret word for Jwt>',
'db': '<MongoDB url>'
}
|
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/satya/Workspace/Projects/navigation-ex/packages/native/src/NavigationContainer.tsx";import*as React from'react';import{BaseNavigationContainer}from'@react-na... |
class Ninjakiwi: pass |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
#pragma once
#include "pch.h"
#include "common.h"
#include "AnimatedVisuals/ProgressRingIndeterminate.h"
#include "AnimatedVisuals/ProgressRingDeterminate... |
import 'isomorphic-fetch';
import { callApi } from '../utils/api';
import config from '../config';
export const SELECT_USERS_PAGE = 'SELECT_USERS_PAGE';
export const USERS_QUERY = 'USERS_QUERY';
export const CLEAR_USERS = 'CLEAR_USERS';
export const INVALIDATE_USERS_PAGE = 'INVALIDATE_USERS_PAGE';
export co... |
const { promisify } = require('util');
const { isEmpty } = require('lodash');
const jwt = require('jsonwebtoken');
const { User } = require('../../resources/models');
const ErrorMessages = require('../../constants/errors');
const config = require('../../config');
module.exports = (ctx, next) => {
const { authoriza... |
const x = require('./xendit.test');
const { QrCode } = x;
const q = new QrCode({});
module.exports = function() {
return q
.createCode({
externalID: Date.now().toString(),
type: QrCode.Type.Dynamic,
callbackURL: 'https://httpstat.us/200',
amount: 10000,
})
.then(r => q.getCode({ ... |
"""A Python module for interacting with Slack's Web API."""
import copy
import hashlib
import hmac
import io
import json
import logging
import mimetypes
import urllib
import uuid
import warnings
from base64 import b64encode
from http.client import HTTPResponse
from ssl import SSLContext
from typing import BinaryIO, Di... |
#define REPT_IRPC__C
/*
.REPT
.IRPC streams
*/
#include <stdlib.h>
#include <string.h>
#include "rept_irpc.h" /* my own definitions */
#include "util.h"
#include "assemble_aux.h"
#include "parse.h"
#include "listing.h"
#include "macros.h"
#include "assemble_globals.h"
/* *** implem... |
# The basic djangorecipebook tests were taken from djangorecipe,
# (c) Roland van Laar, BSD license, [https://github.com/rvanlaar/djangorecipe]
# and were simply adapted to the needs of djangorecipebook
import sys
import os
import shutil
import tempfile
import unittest
try:
from unittest import mock
e... |
import React from 'react';
import { Icon } from './Icon';
export var SharpViewWeek =
/*#__PURE__*/
function SharpViewWeek(props) {
return React.createElement(Icon, props, React.createElement("path", {
d: "M7 5H2v14h5zm14 0h-5v14h5zm-7 0H9v14h5z"
}));
}; |
CKEDITOR.plugins.setLang("language","gl",{button:"Estabelezer o idioma",remove:"Retirar o idioma"}); |
# 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
__a... |
define(["utils/utils","mvc/ui/ui-misc"],function(a){return Backbone.View.extend({colors:{standard:["c00000","ff0000","ffc000","ffff00","92d050","00b050","00b0f0","0070c0","002060","7030a0"],base:["ffffff","000000","eeece1","1f497d","4f81bd","c0504d","9bbb59","8064a2","4bacc6","f79646"],theme:[["f2f2f2","7f7f7f","ddd9c3... |
from dataclasses import dataclass, field
from enum import Enum
from typing import Optional
__NAMESPACE__ = "NISTSchema-SV-IV-list-integer-enumeration-1-NS"
class NistschemaSvIvListIntegerEnumeration1Type(Enum):
VALUE_19789855_80316791588179803_3753891915009565_85394693894_2740498569495700_383_50766809891822_7192... |
#ifndef CPP_HTMLPARSER_STRINGS_H_
#define CPP_HTMLPARSER_STRINGS_H_
#include <optional>
#include <sstream>
#include <string>
#include <string_view>
#include <vector>
namespace htmlparser {
class Strings {
public:
// One of:
// U+0009 CHARACTER TABULATION,
// U+000A LINE FEED (LF),
// U+000C FORM FEED (FF),
... |
//
// Created by Andrew Podkovyrin
// Copyright © 2019 Dash Core Group. All rights reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// Unless ... |
import sys
class Matchers(object):
def __init__(self, driver, verification_errors):
self.driver = driver
self.verification_erorrs = verification_errors
#
# unittest.TestCase provided
#
def assert_equal(self, first, second, msg=""):
"""
Hard assert for equality
... |
// Styles
import "./App.css";
// Components
import Routes from "./pages/Routes";
import { HashRouter } from "react-router-dom";
import { Container } from "react-bootstrap";
function App() {
return (
<HashRouter>
<Container fluid>
<Routes />
</Container>
</HashRouter>
);
}
export defa... |
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Refl... |
# -*- coding: utf-8 -*-
"""
Implementation of the JSON-LD Context structure. See:
http://json-ld.org/
"""
from collections import namedtuple
from rdflib.namespace import RDF
from ._compat import basestring, unicode
from .keys import (BASE, CONTAINER, CONTEXT, GRAPH, ID, INDEX, LANG, LIST,
REV, SET, TYPE,... |
// Init App
var myApp = new Framework7({
modalTitle: 'Framework7',
// Enable Material theme
material: true,
});
// Expose Internal DOM library
var $$ = Dom7;
// Add main view
var mainView = myApp.addView('.view-main', {
});
// Add another view, which is in right panel
var rightView = myApp.addView('.view-... |
/*
* Copyright 2018 dialog LLC <info@dlg.im>
* @flow
*/
import type { Call } from '@dlghq/dialog-types';
function hasTheirVideos(call: Call): boolean {
return Boolean(call.theirVideos.length);
}
function hasOwnVideos(call: Call): boolean {
return Boolean(call.ownVideos.length);
}
function hasVideos(call: Cal... |
# coding: utf-8
n, m = [int(i) for i in input().split()]
d = {}
for i in range(m):
tmp = input().split()
d[tmp[0]] = tmp[1]
s = input().split()
for i in range(n):
if len(s[i])>len(d[s[i]]):
s[i] = d[s[i]]
print(' '.join(s))
|
const parameter = require("./app/parameter");
const errorVerify = require("./app/error"); // error verify
function validate(rules, data) {
return (proto, propertyKey, descriptor) => {
const oldFunc = descriptor.value;
descriptor.value = async function validateWrap(ctx, next) {
// 从获取 query body
... |
import os
from tkinter import *
from tkinter import ttk
from PIL import ImageTk, Image
def option_menu_value(*args):
v = menu.get()
menu.set('MENU')
print(v)
a = Tk()
a.geometry('1350x720')
tvs_image_location = os.path.abspath('../tvs_project/tvs logo.png')
image_frame = Frame(a, bg='or... |
import React from "react";
import Layout from '../components/layout';
import IndexHeader from "../components/index/indexHeader";
import MainContentIndex from "../components/index/mainContentIndex";
const IndexPage = () => {
return (
<Layout>
<IndexHeader />
<MainContentIndex />
... |
# coding=utf-8
import unittest
from smallinvoice.commons import Recipient, Mail, PREVIEW_SIZE
from smallinvoice.offers import Offer, OfferState
from smallinvoice.tests import get_smallinvoice, generate_address, \
generate_customer, generate_position
def generate_offer():
return Offer(
client_id='',
... |
import time
from bs4 import BeautifulSoup
import requests
import pymysql.cursors
import unittest
import warnings
class UnitTestsDataMinerYellowPagesPoland(unittest.TestCase):
def test_extract_one_email(self):
headers = {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML,... |
/**
* @license
* Copyright 2012 Google LLC
*
* 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 ... |
Ext.define('AM.model.User', {
extend: 'Ext.data.Model',
fields: ['name', 'email']
});
|
import { createElement } from 'lwc';
import Container from 'x/container';
// synthetic shadow can't do this kind of style encapsulation
if (process.env.DISABLE_SYNTHETIC === true) {
describe('Light DOM styling with :host', () => {
it(':host can style a containing shadow component', () => {
cons... |
const {Rule} = require('../src')
describe('child rules', () => {
// --- ALL ---
test('all() rules - single failure', async () => {
const rule = Rule.string().all([
Rule.string()
.regex(/^[A-Z]/)
.error('Must start with an uppercase character'),
Rule.string()
.regex(/[a-z]+/)... |
function calcDiagonalsSums(matrix) {
let mainDiagonal = 0;
let secondaryDiagonal = 0;
for (let row = 0; row < matrix.length; row++) {
mainDiagonal += matrix[row][row];
secondaryDiagonal += matrix[row][matrix.length - 1 - row];
}
console.log(mainDiagonal + ' ' + secondaryDiagonal);
... |
/*
* BSD LICENSE
*
* Copyright(c) 2020-2021 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* ... |
import { Helmet } from "react-helmet";
import PageBody from "../components/PageBody";
export default function NotFound() {
return (
<PageBody>
<Helmet>
<title>404: Not Found</title>
</Helmet>
<h1>404: Not Found</h1>
</PageBody>
);
} |
import {STORAGE_KEY} from './mutations';
const localStoragePlugin = store => {
store.subscribe((mutation, {user}) => {
window.localStorage.setItem(STORAGE_KEY, JSON.stringify(user));
});
};
export default [localStoragePlugin]; |
var express = require('express');
var app = express();
app.use(express.static(__dirname + '/public'));
app.listen(process.env.PORT || 3000);
|
import os
import sys
import django
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'travis_ci_test',
'USER': 'postgres' if os.ge... |
#
# 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 writing, software
# ... |
#include "ble.h"
#include <stdio.h>
#include <string.h>
int ble_adv_set_txpower(BLE_TX_Power_t power) {
return command(DRIVER_RADIO, BLE_CFG_TX_POWER, power);
}
int ble_adv_set_interval(uint16_t interval) {
return command(DRIVER_RADIO, BLE_CFG_ADV_INTERVAL, interval);
}
int ble_adv_data(uint8_t type, const unsig... |
from django.db import models
class Subject(models.Model):
subject_code = models.CharField(max_length=10)
name = models.CharField(max_length=100)
slug = models.SlugField(max_length=150, blank=True, null=True)
description = models.TextField(blank=True, null=True)
profile = models.URLField(blank=True... |
/**
* @file lv_test_slider.h
*
*/
#ifndef LV_TEST_SLIDER_H
#define LV_TEST_SLIDER_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../../../../lv_ex_conf.h"
#include "../../../../lvgl/lvgl.h"
#if USE_LV_SLIDER && USE_LV_TESTS
/****************... |
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2021, OpenNebula Project, OpenNebula Systems */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may ... |