text stringlengths 3 1.05M |
|---|
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Use this to run several variants of the tests.
ALL_VARIANT_FLAGS = {
"assert_types": [["--assert-types"]],
"code_serializer": [["--cache=code"]],
"... |
import loadingAttributePolyfill from "./vendor/loading-attribute-polyfill/dist/loading-attribute-polyfill.module.js";
|
/**
* Converts colors from one color space to another.
*
* Based on TinyColor by Scott Cooper and originally Brian Grinstead:
* https://github.com/TypeCtrl/tinycolor (MIT licensed)
*
* See: https://stackoverflow.com/questions/2353211/hsl-to-rgb-color-conversion
*/
class Converter {
/**
* See: https://ww... |
'use strict';
angular.module('mjtestApp')
.factory('User', function ($resource) {
return $resource('/api/users/:id/:controller', {
id: '@_id'
},
{
changePassword: {
method: 'PUT',
params: {
controller:'password'
}
},
get: {
method: 'GET',
... |
import {
DoubleSide,
LinearFilter,
Mesh,
MeshBasicMaterial,
OrthographicCamera,
PlaneGeometry,
Scene,
ShaderMaterial,
Texture,
UniformsUtils,
} from 'three'
import { UnpackDepthRGBAShader } from '../shaders/UnpackDepthRGBAShader'
/**
* This is a helper for visualising a given light's shadow map.
... |
const router = require('express').Router();
const apiRoutes = require('./api');
router.use('/api', apiRoutes);
router.use((req, res) => {
res.status(404).send('<h1>404 Error....</h1>');
});
module.exports = router; |
'use strict';
const blueprintHelpers = require('ember-cli-blueprint-test-helpers/helpers');
const setupTestHooks = blueprintHelpers.setupTestHooks;
const emberNew = blueprintHelpers.emberNew;
const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
const setupPodConfig = blueprintHelpers.setupPodConfig;
con... |
const userFacade = require('../../model/user/facade')
const jwt = require('jsonwebtoken')
module.exports = async function authorize (req, res, next) {
let token = req.headers.authorization
console.log(token)
if (token === undefined) {
return next({message: 'There was no token in the header', statusCode: 401... |
# -*- coding: utf-8 -*-
# cython: language_level=3
# Copyright (c) 2020 Nekokatt
# Copyright (c) 2021 davfsa
#
# 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 restriction, including w... |
import json
import logging
from collections import OrderedDict
from decimal import ROUND_HALF_UP, Decimal
from typing import Any, Dict, Union
import pytz
from django import forms
from django.conf import settings
from django.contrib import messages
from django.core.exceptions import ImproperlyConfigured
from django.db ... |
import typescript from '@rollup/plugin-typescript';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import replace from '@rollup/plugin-replace';
import webWorkerLoader from 'rollup-plugin-web-worker-loader';
expo... |
"""
This is a simple script to test the Google calendar
"""
from __future__ import print_function
import datetime
import pickle
import os.path
import sys
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
# If modifyin... |
import React, { Component } from "react";
import PropTypes from "prop-types";
import ReactMarkdown from "react-markdown";
export class BigImageDisplay extends Component {
// Adapted from: https://github.com/rexxars/react-markdown/issues/65#issuecomment-288083389
// Used in order to make rendered Markdown have link... |
import { Audit, Comments, Button, List } from '@admin'
import PropTypes from 'prop-types'
import pluralize from 'pluralize'
import React from 'react'
import _ from 'lodash'
const Details = ({ audits, campaign }) => {
const config = {}
const design = {
label: _.includes(['active','draft','inactive'], campaign... |
# Copyright 2021 Huawei Technologies Co., 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
#
# Unless required by applicable law or agreed to... |
const Analytics = require('../../utils/Analytics')
function getTrackName(action) {
if (action === 'deleted') {
return 'Deleted'
} else if (action === 'created') {
return 'Created'
} else {
return 'Unknown'
}
}
async function trackInstall(payload) {
const analytics = new Ana... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("@styled-icons/boxicons-solid/HourglassTop"), exports);
|
/**
* Search Console Module Component Stories.
*
* Site Kit by Google, Copyright 2020 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
*
* https://www.apache.org/licens... |
/**
* Copyright IBM Corp. 2019, 2020
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* Code generated by @carbon/icon-build-helpers. DO NOT EDIT.
*/
'use strict';
function _interopDefault (ex) { return (ex && (typeof ex === '... |
#!/usr/bin/env python
# noinspection PyUnresolvedReferences
import vtkmodules.vtkRenderingOpenGL2
from vtkmodules.vtkCommonColor import vtkNamedColors
from vtkmodules.vtkCommonCore import vtkIdTypeArray
from vtkmodules.vtkCommonDataModel import (
vtkSelection,
vtkSelectionNode,
vtkUnstructuredGrid
)
from v... |
#!/usr/bin/env python3
"""Test hello executable."""
import logging
from hello import add_one, greet, main
def test_main(capsys) -> None:
"""Output of main()."""
main(["--greetee=everybody"])
captured = capsys.readouterr()
assert captured.out == "hello, everybody\n"
assert captured.err == "My fav... |
import { constCase, camelCase, formatQueryString, formatRequestBody } from '../util';
// deleteEntity(entityId, { p1, p2, ... })
export function name(entryKey) {
return camelCase(`delete_${entryKey}`);
}
export const mutation = true;
export function callUrl([entityId, extraParams], actionConfig, { url }, { rootUr... |
#!/bin/python
import logging
from multiprocessing import Process
import numpy as np
import time
from scipy.spatial import distance
from laser.laser import Laser
from embedder.labse import Labse
from utilities.alignmentutils import AlignmentUtils
from repository.alignmentrepository import AlignmentRepository
from valid... |
import Ember from 'ember';
export default Ember.Component.extend({
todoViews: Ember.computed(function() {
var todoViews = [];
this.childViews.map(function(childView) {
if (childView.__proto__._debugContainerKey.indexOf('todo-list-elem') != -1) {
todoViews.push(childView);
}
});
re... |
from scipy.spatial import distance as dist
from collections import OrderedDict
import numpy as np
from typing import Optional, List
# in most cases np.ndarray can be used instead of List
def calc_metric_xy(centroid1: Optional[List] = None, centroid2: Optional[List] = None, rect1: Optional[List] = None,
... |
module.exports.run = async(Tag, msg, args) => {
msg.channel.send(`Good evening ${msg.author.username}!`).then(msg.react("🌙"))
}
module.exports.help = {
name: 'evening'
}
module.exports.conf = {
aliases: ['ev']
} |
/*
* Copyright 2016 Rethink Robotics
*
* Copyright 2016 Chris Smith
*
* 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
*
... |
const { Schema, Instance } = require("@hyperjump/json-schema-core");
const compile = async (schema) => Schema.value(schema);
const interpret = (exclusiveMinimum, instance) => !Instance.typeOf(instance, "number") || Instance.value(instance) > exclusiveMinimum;
module.exports = { compile, interpret };
|
const db = require('../../data/db-config');
const findAll = async () => {
return await db('profiles');
};
const findBy = (filter) => {
return db('profiles').where(filter);
};
const findById = async (id) => {
const user = await db('profiles').where({ id }).first().select('*');
let book_marked_cases = await db... |
/*
Based in part on observable arrays from Motorola Mobility’s Montage
Copyright (c) 2012, Motorola Mobility LLC. All Rights Reserved.
3-Clause BSD License
https://github.com/motorola-mobility/montage/blob/master/LICENSE.md
*/
/*
This module is responsible for observing changes to owned properties ... |
const mongoose = require('mongoose');
const httpStatus = require('http-status');
const httpMocks = require('node-mocks-http');
const {
errorConverter,
errorHandler,
} = require('../../../src/middlewares/error');
const ApiError = require('../../../src/utils/ApiError');
const config = require('../../../src/config/con... |
import re
from typing import Dict, Any, Tuple, List
import inflect
from pyinflect import getInflection
from src.annotated_recipe import AnnotatedRecipe
from src.pipeline.interface_question_answering import QuestionAnsweringBase, QuestionAnswerRecipe, PredictedAnswer
from src.pipeline.question_category import Question... |
from pyke import *
|
import torch
import torch.nn as nn
import torch.nn.functional as F
from numbers import Integral
from collections import OrderedDict
def make_divisible(v, divisor=16, min_value=None):
if min_value is None:
min_value = divisor
new_v = max(min_value, int(v + divisor / 2) // divisor * divisor)
if new_v... |
ace.define("ace/mode/gherkin_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s="\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})",o=function(){var e=[{name:... |
from .magpis import *
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Owner: mike@famo.us
* @license MPL 2.0
* @copyright Famous Industries, Inc. 2014
*/
define(function(require,... |
var util = require('util');
module.exports.inspect = inspect;
// Better defaults for debugging
function inspect(obj, opts) {
return util.inspect(obj, opts || {colors:true, depth:null})
}
// sortedStringify: Based on stringify-object, but forcing quotes and sorting keys
// https://github.com/yeoman/stringify-object... |
from model.data_utils import CoNLLDataset
from model.ner_model import NERModel
from model.config import Config
import time
def align_data(data):
"""Given dict with lists, creates aligned strings
Adapted from Assignment 3 of CS224N
Args:
data: (dict) data["x"] = ["I", "love", "you"]
... |
# Copyright (C) 2005, Giovanni Bajo
# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
#
# 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 the Free Software Foundation; either version 2
# of the... |
import json
import os
from unittest.mock import mock_open, patch
import pytest
from satosa.exception import SATOSAConfigurationError
from satosa.exception import SATOSAConfigurationError
from satosa.satosa_config import SATOSAConfig
TEST_RESOURCE_BASE_PATH = os.path.join(os.path.dirname(__file__), "../test_resources... |
import json
import os
from pathlib import Path
from machina import (
get_apps as get_machina_apps,
MACHINA_MAIN_TEMPLATE_DIR,
MACHINA_MAIN_STATIC_DIR
)
PROJECT_PACKAGE = Path(__file__).resolve().parent.parent
BASE_DIR = PROJECT_PACKAGE.parent
DATA_DIR = Path(os.environ['DJANGOPROJECT_DATA_DIR']) if (
... |
import { addQuestion, removeQuestion, updateQuestionStatus } from "./action-creators";
export const reducer = (state = [], { type, payload } = {}) => {
switch (type) {
case addQuestion().type:
return [...state, payload];
case updateQuestionStatus().type:
return state.map((question) => {
re... |
const { SlashCommandBuilder } = require('@discordjs/builders');
module.exports = {
data: new SlashCommandBuilder()
.setName('server')
.setDescription('server info!'),
async execute(interaction) {
await interaction.reply(`Server name: ${interaction.guild.name}\nTotal members: ${interaction.guild.memberCount}`);... |
import React, { useEffect } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { setCurrentBoard } from '../../actions/actionCreators';
import { DEFAULT_BOARD_TYPE } from '../../constants';
import { getBoardConstructor } from './helpers';
import { StyledContainer, StyledNotFound, StyledNoBoa... |
"""
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... |
var searchData=
[
['borrarusuario_4',['borrarUsuario',['../a00136.html#ac08be54eb31f194fb1bdd1457a2c008e',1,'UsuarioPDO']]]
];
|
from collections import defaultdict
from apispec.ext.flask import FlaskPlugin
from apispec.ext.marshmallow import MarshmallowPlugin
import flask
from .operation import Operation
# -----------------------------------------------------------------------------
RESTY_PLUGIN_NAME = 'resty'
# ---------------------------... |
#importing public funtions here
from .utils.read_utils import read_trajectories,read_command_namelist, read_flex_dust_summary
from .utils.utils import region_slice
from .plot.maps import map_china, map_terrain_china
from .read_data import read_flexdust_output, read_flexpart_trajectories, read_multiple_flexpart_output... |
Dolittle.namespace("Dolittle",{
KnownArtifactInstancesDependencyResolver: function () {
var self = this;
var supportedArtifacts = {
readModels: Dolittle.read.ReadModelOf,
commands: Dolittle.commands.Command,
queries: Dolittle.read.Query
};
functi... |
const inquirer = require('inquirer')
const fs = require("fs");
const { profile } = require("console");
const Engineer = require("./lib/Engineer");
const Intern = require("./lib/Intern");
const Manager = require("./lib/Manager");
const options = ['engineer', 'intern']
function teamGenerator() {
inquirer
.promp... |
def mdc(a,b):
if b <= a and a % b == 0: return b
elif a < b: return mdc(b,a)
return mdc(b, a % b)
a = int(input("Digite o valor de A: "))
b = int(input("Digite o valor de B: "))
print(f"MDC = {mdc(a,b)}") |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _timezones = _interopRequireDefault(require("./constants/timezones.js"));
var _mimes2 = _interopRequireDefault(require("./constants/mimes.js"));
function _interopRequireDefault(obj) { return obj && obj.__esM... |
module.exports = class Calculadora {
suma(op1, op2) {
return op1 + op2;
}
resta(op1, op2) {
return op1 - op2;
}
} |
const { ApolloError } = require('apollo-server');
const createError = (message, statusCode) => new ApolloError(message, statusCode);
const DEFAULT_ERROR = 500,
BAD_REQUEST = 400,
UNAUTHORIZED = 401,
NOT_FOUND = 404,
CONNECTION_ERROR = 502,
DATABASE_ERROR = 503;
exports.defaultError = message => createError... |
# Copyright 2011 Justin Santa Barbara
# 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 requ... |
const Discord = require('discord.js')
const webpush = require('web-push')
module.exports = {
name: 'ban',
aliases: ['차단', '밴', 'ㅠ무', 'ckeks', 'qos'],
description: '유저를 차단해요. (봇 관리자만 사용 가능)',
usage: 'i.ban <유저 멘션> [차단 이유]',
run: async (client, message, args, ops) => {
if (!message.member.roles.cache.has(op... |
/**
* a HUD container and child items
*/
game.HUD = game.HUD || {};
game.HUD.Container = me.Container.extend({
init: function() {
// call the constructor
this._super(me.Container, 'init');
// persistent across level change
this.isPersistent = true;
// Use screen coo... |
// Redux Actions
export const REQUEST = "REQUEST";
export const SUCCESS = "SUCCESS";
export const ERROR = "ERROR";
export const CLEAR = "CLEAR";
export const OPEN_MODAL = "OPEN_MODAL";
export const CLOSE_MODAL = "CLOSE_MODAL";
export const AUTHENTICATE_USER = "AUTHENTICATE_USER";
export const STORE_KEYCLOAK_DATA = "ST... |
import React, {Component} from 'react';
import {Link} from 'react-router-dom';
import {Menu, Image} from 'semantic-ui-react';
import logo from '../assets/images/pineapplesfinished4-dark.svg';
export default class Navbar extends Component {
state = {};
handleItemClick = (e, { name }) => this.setState({ activeI... |
/* istanbul instrument in package npmdoc_mmmagic */
/*jslint
bitwise: true,
browser: true,
maxerr: 8,
maxlen: 96,
node: true,
nomen: true,
regexp: true,
stupid: true
*/
(function () {
'use strict';
var local;
// run shared js-env code - init-before
(function () {
... |
from db import database
from models import complaint, RoleType, State
class ComplaintManager:
@staticmethod
async def get_complaints(user):
q = complaint.select()
if user["role"] == RoleType.complainer:
q = q.where(complaint.c.complainer_id == user["id"])
elif user["role"] =... |
export default {
methods: {
/**
* Compute a new value for `sell_price` depending on which values can be found
* in `buy_price` / `markup` fields
*/
computeSellPrice (row, fieldName, currentFieldValue) {
currentFieldValue = parseFloat(currentFieldValue);
... |
/*
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.lang['bg']={"editor":"Текстов редактор за форматиран текст","editorPanel":"Rich Text Editor panel","common":{"editorHelp":"натиснете ALT 0 за помощ","browseServer":"... |
/*
Copyright 2019 The Tekton Authors
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... |
"""testappauto614_dev_23545 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/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='h... |
import { newKit } from '@celo/contractkit'
import { CeloContract } from '@celo/contractkit'
const kit = newKit('https://alfajores-forno.celo-testnet.org')
let accounts = await kit.web3.eth.getAccounts()
kit.defaultAccount = accounts[0]
// paid gas in cUSD
await kit.setFeeCurrency(CeloContract.StableToken)
let totalB... |
from django.db.models import Max
from websocket_controller.message_utils import SUCCESS_MESSAGE, require_message_content
from game_map.models import Structure, Chunk
from player_manager.models import Player, ActivePlayer
from guild_manager.models import Guild
from game_map.utils import notify_dynamic_map_structure_cha... |
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import options as opt
import os
import time
def init_model(model):
for module in model.modules():
if isinstance(module, nn.Conv2d):
nn.init.kaiming_normal_(module.... |
from typing import Any, Optional, Sequence, List
import pandas as pd
from ray.util.data import MLDataset as MLDatasetType
from xgboost_ray.data_sources.data_source import DataSource, RayFileType
class MLDataset(DataSource):
"""Read from distributed Ray MLDataset.
The Ray MLDataset is a distributed dataset b... |
var searchData=
[
['flash_239',['Flash',['../classfemto_1_1input_1_1Button.html#aeed0f29abe8a8235be9dbf3c40309b03',1,'femto::input::Button']]],
['font_240',['font',['../classfemto_1_1mode_1_1ScreenMode.html#abe478e07ed7f03fe634293bd65ed785a',1,'femto::mode::ScreenMode']]]
];
|
import http from "../http-common";
import axios from "axios";
let accessToken = localStorage.getItem("user_token");
class BannerDataService {
getAll(page = 1) {
return http.get(`/banner?page=${page}`);
}
get(id) {
return http.get(`http://127.0.0.1:8000/api/banner/${id}`);
}
store(da... |
import Vue from 'vue'
import Router from 'vue-router'
// in development-env not use lazy-loading, because lazy-loading too many pages will cause webpack hot update too slow. so only in production use lazy-loading;
// detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading
Vue.use(Router)
/* Layout... |
// @flow
import sample from 'lodash.sample';
import React, { Component } from 'react';
import AtlassianIcon from '../glyph/atlassian';
import ArrowUpIcon from '../glyph/arrow-up';
import ArrowDownIcon from '../glyph/arrow-down';
import ArrowLeftIcon from '../glyph/arrow-left';
import ArrowRightIcon from '../glyph/arro... |
document.getElementById('mode').addEventListener('click', () => {
document.body.classList.toggle('dark');
document.body.classList.toggle('light');
localStorage.setItem('theme', document.body.classList.contains('dark') ? 'dark' : 'light');
});
if (localStorage.getItem('theme') === 'dark') {
document.body.clas... |
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v23.2.1
* @link http://www.ag-grid.com/
* @license MIT
*/
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
... |
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("element-ui/lib/button"),require("element-ui/lib/tooltip"),require("element-ui/lib/table-column"),require("element-ui/lib/table"));else if("function"==typeof define&&define.amd)define(["element-ui/lib/button","element-ui/lib/to... |
from __future__ import print_function
import argparse
from datetime import datetime
import os
import sys
import time
import scipy.misc
import scipy.io as sio
import cv2
from glob import glob
os.environ["CUDA_VISIBLE_DEVICES"]="0"
import tensorflow as tf
import numpy as np
from PIL import Image
from utils import *
N_C... |
import firebase from '@firebase/app-compat';
import { httpsCallable, connectFunctionsEmulator } from '@firebase/functions';
import { FirebaseError } from '@firebase/util';
import { Component } from '@firebase/component';
const name = "@firebase/functions-compat";
const version = "0.1.10";
/**
* @license
* Copyright... |
const config = require('./src/config');
module.exports = {
siteMetadata: {
title: config.siteTitle,
siteUrl: config.siteUrl,
description: config.siteDescription,
},
plugins: [
`gatsby-plugin-react-helmet`,
`gatsby-plugin-styled-components`,
`gatsby-plugin-sharp`,
`gatsby-transformer-s... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1'
os.environ["CUDA_VISIBLE_DEVICES"] = "4"
import tensorflow as tf
import numpy as np
import argparse
import facenet
import lfw
import sys
from tensorflow.pytho... |
# pip install neoradio2
import neoradio2
import time
BANK_LED1 = 0x10
BANK_LED2 = 0x20
BANK_LED3 = 0x40
BANK_LED4 = 0x80
BANK_DIO1 = 0x01
BANK_DIO2 = 0x02
BANK_DIO3 = 0x04
BANK_DIO4 = 0x08
def enable_device_io(device, io_mask, enable_mask=0xFF):
# The second device bank 1 in the "chain" controls all the IO
... |
/**
* Created by ly on 2016/3/30.
*/
var underscore = require("underscore");
var path = require("path"),
fs = require('fs'),
request = require(path.join(process.cwd(), "server/common/util/request")),
signUrl = require(path.join(process.cwd(), "server/common/util/signurl"));
/**
* 修改密码
* @param next
*... |
def duplicate_encode(word):
result=""
word=word.lower()
#case insensitive
for char in word:
if word.count(char)>1:
result+=")"
else:
result+="("
return result |
# Copyright 2022 Google LLC. 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 o... |
"use strict";
/* Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved.
*
* This software is licensed under the Apache License, Version 2.0 (the
* "License") as published by the Apache Software Foundation.
*
* You may not use this file except in compliance with the License. You may
* obtain a c... |
"""Example module to contain methods, functions and variables for reuse.
This file gets loaded as a module (sometimes also called a library) when
you call `import mymod` in your scripts.
"""
import codestudio
class Zombie(codestudio.Artist):
"""An Artist with a propensity for brains and drawing squares.
Wh... |
'use strict'
const mapAnyway = require('./mapAnyway')
function filterAnywayObjectPromise(subjects, promiseFunction) {
return mapAnyway(subjects, promiseFunction)
.then(res => {
const keys = Object.keys(subjects)
const r = {results: {}, errors: res.errors}
for(let i=0; i < keys.length; i++) {
... |
/*
creatTime: 2014.6.17,
author: xh_lsj,
module: 互动嵌入原生JS实现JSONP,
v-1.02: 2015.3.26 辩论、投票两个模块放一起
v-1.03: 2015.4.23 解决冲突问题,简化代码
v-1.04: 2015.6.1 添加调查模块
v-1.05: 2015.8.6 添加话题、问答两个模块
*/
function includeDebate(opt){
var _t = this;
opt = opt?opt:{};
if(!opt.container)
{
return false;
}
_t._conbox = document.g... |
# QuantWorks
#
# Copyright 2019 Tyler M Kontra
# Copyright 2011-2018 Gabriel Martin Becedillas Ruiz
#
# 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/LICEN... |
/*
* @author Ryan Johnson <http://syntacticx.com/>
* @copyright 2008 PersonalGrid Corporation <http://personalgrid.com/>
* @package LivePipe UI
* @license MIT
* @url http://livepipe.net/control/contextmenu
* @require prototype.js, livepipe.js
*/
/*global window, document, Prototype, Class, Event, $, $A, $R, Con... |
'use strict';
const logger = require('../src/middleware/logger.js');
// spy on calling the console log or not
describe('Logger middleware', ()=> {
let consoleSpy;
let req = {};
let res = {};
let next = jest.fn();
beforeEach(()=> {
consoleSpy = jest.spyOn(console, 'log').mockImplementation();
});
... |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017-2018 The Raptoreum Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test raptoreumd with different proxy configurat... |
const path = require('path');
// setup webpack using the ts-loader
module.exports = [
{
name: 'lib',
devtool: "eval-source-map", // just source-map is slower, but nicer
entry: "./src/lib.ts",
mode: 'development',
module: {
rules: [
{
test: /\.ts$/,
... |
'use strict';
// Create an instance
var wavesurfer;
// Init & load
document.addEventListener('DOMContentLoaded', function () {
var playButton = document.querySelector('#playBtn'),
toggleMuteButton = document.querySelector('#toggleMuteBtn'),
setMuteOnButton = document.querySelector('#setMuteOnBtn')... |
//Importing Line class from the vue-chartjs wrapper
import {Line} from 'vue-chartjs'
//Exporting this so it can be used in other components
export default {
// extend: Line,
extends: Line,
data () {
return {
label: [],
rows: []
}
},
mounted () {
axios.get(... |
// Generated by ReScript, PLEASE EDIT WITH CARE
import * as React from "react";
var themeSwitchContext = React.createContext(function (param) {
});
var provider = themeSwitchContext.Provider;
function ThemeSwitchProvider(Props) {
var value = Props.value;
var children = Props.children;
return React.... |
/*! jQuery UI - v1.11.4 - 2015-03-13
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed MIT */
(function(t){"function"==typeof define&&define.amd?define(["../datepicker"],t):t(jQuery.datepicker)})(function(t){return t.regional.fa={closeText:"بستن",prevText:"<قبلی",nextText:"بعد... |
app.views.StreamObject = app.views.Base.extend({
initialize: function(options) {
this.setupRenderEvents();
},
postRenderTemplate : function() {
// collapse long posts
this.$(".collapsible").expander({
slicePoint: 400,
widow: 12,
expandPrefix: "",
expandText: Diaspora.I18n.t("s... |
# qubit number=3
# total number=15
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collectio... |