text
stringlengths
3
1.05M
// Copyright (c) 2011-2016 The Bitcoin Core developers // Copyright (c) 2017-2019 The Sato Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef SATO_QT_OPTIONSMODEL_H #define SATO_QT_OPTIONSMODEL_H #include "...
'use strict' import { spawn } from 'child_process' import Brain from '@/core/brain' describe('brain', () => { describe('constructor()', () => { test('creates a new instance of Brain', () => { const brain = new Brain({ emit: jest.fn() }, 'en') expect(brain).toBeInstanceOf(Brain) }) }) desc...
// // GITPackFileVersion2.h // CocoaGit // // Created by Geoffrey Garside on 04/11/2008. // Copyright 2008 ManicPanda.com. All rights reserved. // #import "GITPackFile.h" @class GITPackIndex; @interface GITPackFileVersion2 : GITPackFile { NSString * path; NSData * data; GITPackIndex * index; NSU...
import("etherpad.log"); import("plugins.realTimeRecentChanges.hooks"); import("plugins.realTimeRecentChanges.static.js.main"); function realTimeRecentChangesInit() { this.hooks = ['handlePath', 'docbarItemsSearch']; this.client = new main.realTimeRecentChangesInit(); this.description = 'Real-Time Recent Changes mod...
import pydoc import textwrap import sys import cStringIO # window has to be a global so that the main bpython.py can load it and # alter its state and share it with the interpreter being used for the # actual user input, I couldn't think of another way of doing this. window = None def _help(obj): """Wrapper for ...
/* === Complete Variable and Function Definitions === */ const customName = document.getElementById('customName') const randomize = document.querySelector('.randomize') const story = document.querySelector('.story') function randomValueFromArray(array) { const random = Math.floor(Math.random() * array.length) ret...
import os import tempfile from django.conf import settings CUSTOM_MODULES = { 'django.db.backends.mysql': 'backupdb.dbbackends.mysql.MysqlDump', } # Custom Settings # 2.5MB - 2621440 # 5MB - 5242880 # 10MB - 10485760 # 20MB - 20971520 # 50MB - 5242880 # 100MB - 104857600 # 250MB - 214958080 # 500MB - 429916160 ...
from django.core.exceptions import ImproperlyConfigured import pytest from tests.factories import AttachmentFactory, AttachmentFileTypeFactory from unicef_attachments import utils from unicef_attachments.models import AttachmentFlat, FileType from unicef_attachments.permissions import AttachmentPermissions from demo...
// Copyright (c) 2012 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. // ChromotingClient is the controller for the Client implementation. #ifndef REMOTING_CLIENT_CHROMOTING_CLIENT_H_ #define REMOTING_CLIENT_CHROMOTING_...
# MIT LICENSE # # Copyright 1997 - 2020 by IXIA Keysight # # 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 without limitation # the rights to use, copy, modify,...
import discord class Color(discord.Color): """ Colors that aren't part of standard lib colors """ def __init__(self, _hex): super().__init__(_hex) @classmethod def light_pink(cls): return cls(0xFFB6C1)
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_BASE_BITOPS_SCHED_H_ #define __ASM_GENERIC_BASE_BITOPS_SCHED_H_ #include <base/compiler.h> /* unlikely() */ #include <asm/base/types.h> /* * Every architecture must define this function. It's the fastest * way of searching a 100-bit bitmap. It's guarant...
import compiler from './compiler.js' import helpers from './helpers' /** * Build a word frequency map from a source text. */ test('Builds word frequency map (match, project)', async () => { // Set up loader options. const options = { regex: /\b\w+\b/gi, // Match gets called for every match (must return a...
import Transport from './Transport'; import TransportError from '../errors/TransportError'; export default class JQueryTransport extends Transport { /** * A {@link Transport} implementation for [jQuery]{@link https://jquery.com/}.<br /> * This class supposes that the `jQuery` global object is available. * ...
import tkinter import change_password_window import login_register_window import message_window import change_password_window_actions import login_register_window_actions import message_window_actions class MessengerWindowActions: def __init__(self, model, view): self.__model = model self.__view =...
# Copyright 2018-2020 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or...
#include<stdio.h> void main () { char *p = "hello Vishwas"; printf("String p: %s\n",p); char *q; printf("copying the content of p into q...\n"); q = p; printf("String q: %s\n",q); }
const { createDecorateReactTopJSXVisitor, default: createDecorateReactVisitor } = require('../../../src') const nps = require('path') module.exports = (babel) => { return { visitor: { Program(path) { const run1 = createDecorateReactVisitor({ prefix: 'decorate', decorateLibPath: ...
/** File: candy.js * Candy - Chats are not dead yet. * * Legal: See the LICENSE file at the top-level directory of this distribution and at https://github.com/candy-chat/candy/blob/master/LICENSE */ "use strict"; /* global jQuery */ /** Class: Candy * Candy base class for initalizing the view and the core * * P...
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-custom-index~pages-index-index"],{"0051":function(t,e,n){"use strict";var i=n("956f"),a=n.n(i);a.a},"018f":function(t,e,n){var i=n("3842");"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("4f06").default;a("407eb178",i,!0,{sou...
import json import shutil import tempfile import unittest from pyhocon import ConfigFactory # noqa: F401 from typing import Any, List # noqa: F401 from databuilder import Scoped from databuilder.loader.file_system_elasticsearch_json_loader import FSElasticsearchJSONLoader from databuilder.models.table_elasticsearch...
from omymodels import create_models def test_unique_and_normal_index(): ddl = """ drop table if exists schema_name.approver_history ; CREATE table schema_name.approver_history ( runid decimal(21) not null ,job_id decimal(21) not null ,id va...
import bcrypt from 'bcrypt'; import jwtSign from './token-service'; const { TOKEN_BODY_NAME } = process.env; const TOKEN_COOKIE_NAME = process.env.TOKEN_COOKIE_NAME || 'NOT-XSRF-TOKEN'; const usersArray = []; const getUserByUsername = (username, users) => { let user; for (let i = 0; i < users.length; i += 1) { ...
""" Django settings for app project. Generated by 'django-admin startproject' using Django 3.1.2. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ import os from pa...
var class_vulkan_render_pipeline_push_constants_layout_builder_1_1_vulkan_render_pipeline_push_constants_layout_builder_impl = [ [ "VulkanRenderPipelinePushConstantsLayoutBuilderImpl", "class_vulkan_render_pipeline_push_constants_layout_builder_1_1_vulkan_render_pipeline_push_constants_layout_builder_impl.html#aa64...
// Fibonacci sequence function fabonacci(n) { if (n === 0) { return 0; } if (n === 1) { return 1; } return fabonacci(n - 1) + fabonacci(n - 2); } onmessage = function (val) { switch (val.data) { case 'start': let result = fabonacci(42); postMessa...
# This program says hello and asks for my name. print('Hello world!') print('What is your name?') # ask for their name myName = input() print('It is good to meet you, ' + myName) print('The length of your name is:') print(len(myName)) print('What is your age?') # ask for their age myAge = input() print('You will be ' ...
config = { "interfaces": { "google.ads.googleads.v0.services.RecommendationService": { "retry_codes": { "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], "non_idempotent": [] }, "retry_params": { "default": { ...
import Phaser from 'phaser'; class GameScene extends Phaser.Scene { constructor() { super({ key: 'GameScene' }); } init() { this.loaded = false; this.score = 0; this.ended = 0; this.highScore = localStorage.getItem('highScore'); this.events.once('start-game', ({ url, speed, endGame }) => ...
import argparse from functools import partial, update_wrapper from gdmixworkflow.common.constants import SINGLE_NODE, DISTRIBUTED from gdmixworkflow.distributed_workflow import gdmix_distributed_workflow from gdmixworkflow.single_node_workflow import run_gdmix_single_node import os import sys def str2bool(v): """...
import { withPluginApi } from "discourse/lib/plugin-api"; import { iconHTML } from "discourse-common/lib/icon-library"; function customBool(field) { if (field) { return Array.isArray(field) ? field.some(x => x === "t") : field === "t"; } return false; } export default { name: "add-holiday-flair", initia...
# -*- coding: utf-8 -*- from Datenbank import Zeitungsdatenbank print u"Modul chronam geladen" print u"Initialisieren Sie bitte die Datenbank über Variable = chronam.Chronam()" class Chronam(Zeitungsdatenbank): #Für 'https://chroniclingamerica.loc.gov': daten_init = { 'Datenbank_Url' : 'https://chronicl...
// Copyright (c) 2011-2013 The Bitcoin developers // Copyright (c) 2017-2019 The TARIAN developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_ADDRESSBOOKPAGE_H #define BITCOIN_QT_ADDRESSBOOKPAGE_H #i...
import csbuilder from hks_pylib.done import Done from csbuilder.scheme.scheme import Scheme from csbuilder.scheme.result import SchemeResult from csbuilder.cspacket.cspacket import CSPacket from _simulator.manager.token import Token from _simulator.manager.storage import Storage from _simulator.protocol.definition i...
from pythonforandroid.recipe import PythonRecipe class IdnaRecipe(PythonRecipe): name = 'idna' version = '2.6' url = 'https://github.com/kjd/idna/archive/v{version}.tar.gz' depends = [('python2', 'python3crystax'), 'setuptools'] call_hostpython_via_targetpython = False recipe = IdnaRecipe()
import angr import logging print "WARNING: THIS EXAMPLE IS BROKEN RIGHT NOW" def main(): p = angr.Project("r200", auto_load_libs=False) sm = p.factory.simulation_manager() # merge all states every time we hit the bottom of the outer loop sm.use_technique(angr.exploration_techniques.ManualMergepoint(0...
#include <no_macros.h> /* Component types */ typedef struct { double x, y; } Position, Velocity; /* Implement a simple move system */ void Move(ecs_iter_t *it) { /* Get the two columns from the system signature */ Position *p = ecs_term_w_size(it, sizeof(Position), 1); Velocity *v = ecs_term_w_size(it...
// blnk.c // 2019-02-20 Markku-Juhani O. Saarinen <mjos@pqshield.com> // Copyright (C) 2019, PQShield Ltd. Please see LICENSE. // The BLNK2 "core" state manipulation functions. #include "blnk.h" // Initialize with given rate and number of rounds void blnk_clr(blnk_t *ctx, size_t rate, uint8_t rounds) { si...
import React from 'react'; import { assert } from 'chai'; import { createMount, findOutermostIntrinsic, getClasses } from '@material-ui/core/test-utils'; import Slide from '../Slide'; import createMuiTheme from '../styles/createMuiTheme'; import Paper from '../Paper'; import Modal from '../Modal'; import Drawer, { getA...
// == Import npm import React from 'react'; import PropTypes from 'prop-types'; // == Import import './styles.scss'; // == Composant const Result = ({ currency, value }) => ( <div className="result"> <p className="result__number">{value.toFixed(2)}</p> <p className="result__currency">{currency}</p> </div>...
import bpy from datetime import datetime from os import path from subprocess import call, check_output from time import time import meta def export_still(options): export_directory = bpy.path.abspath("//") image_directory = path.join(export_directory, "rendered_frames") ffmpeg_input_options = [ ...
# -*- coding: utf-8 -*- # # sphinxcontrib-rubydomain-acceptancetest documentation build configuration file, created by # sphinx-quickstart on Sun Apr 25 13:27:18 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in th...
const Discord = require('discord.js'); const ms = require('ms'); exports.run = (client, msg, args, lang) => { const reason = args.slice(2).join(' '); const time = args.slice(1, 2).join(' '); let user = msg.mentions.users.first(); const membermention = msg.mentions.members.first(); const botconfs = client.botconfs....
#ifndef GUIUtils_Included #define GUIUtils_Included #include "TemporaryComponent.h" #include "Font.h" #include "gobjects.h" #include "ginteractors.h" #include "gwindow.h" #include <string> #include <vector> #include <tuple> #include <memory> #include <functional> /* Line breaking mode. You can select between breaking...
"""Parse a page and add a Link header to the request, which CloudFlare can use to push static media to an HTTP/2 client.""" from django.conf import settings from django.contrib.staticfiles import storage from django.contrib.staticfiles.templatetags import staticfiles from django.core.files.storage import get_storage_c...
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP865.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
/** * @file ipv4_acl.h * * @brief definitions related to IPv4 access control list handling * */ #ifndef PTPD_IPV4_ACL_H_ #define PTPD_IPV4_ACL_H_ #define IN_RANGE(num, min,max) \ (num >= min && num <= max) enum { ACL_PERMIT_DENY, ACL_DENY_PERMIT }; typedef struct { uint32_t network; uint32_t bitmask; ...
/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +---------...
/** * Constructs a ULID generator closure that emits universally unique, * monotonic values. * * let generator = ULID(); * let ulid0 = generator(); * let ulid1 = generator(); * assert(ulid0 < ulid1); */ function ULID() { const BASE32 = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A',...
""" WSGI config for qts_app 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/3.1/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTI...
mycallback( {"CONTRIBUTOR OCCUPATION": "Administrative Staff Secretary", "CONTRIBUTION AMOUNT (F3L Bundled)": "5.00", "ELECTION CODE": "", "MEMO CODE": "", "CONTRIBUTOR EMPLOYER": "INT'L ASSOCIATION OF MACHINISTS", "DONOR CANDIDATE STATE": "", "CONTRIBUTOR STREET 1": "38140 PLEASANT VIEW DRIVE", "CONTRIBUTOR MIDDLE NAM...
module.exports = { mode: 'jit', /*purge: [],*/ purge: ['./src/pages/**/*.{js,ts,jsx,tsx}', './src/components/!**/!*.{js,ts,jsx,tsx}'], darkMode: false, // or 'media' or 'class' theme: { extend: {}, }, variants: { extend: {}, }, plugins: [], }
(function(window) { // 防止污染全局变量 var zepto = {}; function Z (dom, selector) { // 构造函数 var i, len = dom? dom.length : 0; for (i = 0; i < len; i++) { // 初始化时候挂载到每个实例上 this[i] = dom[i]; } this.length = len; this.selector = selector || ''; } z...
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _package = { version: '3.23.3' }; var _default = _package.version; exports["default"] = _default; //# sourceMappingURL=index.js.map
var Discord = require('discord.js'); var auth = require('../.secure/auth.json'); const prefix = '.'; const calcDust = (level, special, isNew) => { var baseOwned = 100; var baseUnowned = 20000; var baseOwnedSpecial = 20000; var baseUnownedSpecial = 1000000; var modifiers = { good : 1, ...
from __future__ import unicode_literals from moto.core.responses import BaseResponse from moto.ec2.models import ec2_backends from .models import rds2_backends import json import re class RDS2Response(BaseResponse): @property def backend(self): return rds2_backends[self.region] def _get_db_kwar...
module.exports = { entry: "./src/js/index.js", node: { fs: "empty", net: "empty" }, output: { path: __dirname, filename: "bundle.js" } }
/** * @license * Copyright 2019 Google LLC. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * Code distributed by Google as part of this project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ import ...
// // PhoneFactory.h // FactoryMethodPattern // // Created by chenqg on 2019/10/30. // Copyright © 2019 chenqg. All rights reserved. // #import <Foundation/Foundation.h> #import "Phone.h" NS_ASSUME_NONNULL_BEGIN @interface PhoneFactory : NSObject + (Phone *)createPhone; @end NS_ASSUME_NONNULL_END
import asyncio async def app(scope, receive, send): assert scope['type'] == 'http' data = [b'Welcome to Django',b'3.0'] await send({ 'type':'http.response.start', 'status':200, 'headers':[ [b'content-type',b'text/html'] ], }) for chunk in data: await send({ ...
#!/usr/bin/env node var fis = module.exports = require('fis3'); //先把rake加到插件查找中 fis.require.prefixes.unshift('rake'); fis.require.prefixes.unshift('kys'); fis.cli.name = 'kys'; fis.cli.info = require('./package.json'); //文件过滤设置 fis.set('project.ignore', ['node_modules/!**', 'output/!**', 'fis-conf.js']); /...
$(function () { $('#container').highcharts('StockChart', { rangeSelector: { enabled: false }, navigator: { enabled: false }, scrollbar: { enabled: false }, title: { text: "Marker overflow" }, ...
""" Ory APIs Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. # noqa: E501 The version of the OpenAPI document: v0.0.1-alpha.9 Contact: support@ory.sh Generated by: http...
#!/usr/bin/python from flask import Flask, request, json, Response app = Flask(__name__) @app.route('/', methods=['POST']) def handlePost(): if 'application/json' in request.headers.get('Content-Type'): raw = json.dumps(request.json) print(raw) with open('./log.txt', 'a+') as log: ...
/* * Copyright (c) 2008-2015 Travis Geiselbrecht * * 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 without limitation the rights to use, copy, modify, m...
import unittest import numpy as np import numpy.testing as np_test import pandas as pd from pgmpy.models.BayesianModel import BayesianModel from pgmpy.factors.discrete import TabularCPD from pgmpy.inference.CausalInference import CausalInference class TestCausalGraphMethods(unittest.TestCase): def setUp(self): ...
import pprint from abc import ABC class Animal(ABC): def __init__( self, color: str, number_of_legs: int, **kwargs ) -> None: self.color = color self.number_of_legs = number_of_legs if 'species' in kwargs: self.species = kwargs['species'] ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2018 Alibaba Group Holding 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-...
/*************************************************************************** * Copyright (C) by GFZ Potsdam * * * * You can redistribute and/or modify this program under the * * terms o...
'use strict'; /** * Management of a device. Supports quering it for information and changing * the WiFi settings. */ class DeviceManagement { constructor(device) { this.device = device; } /** * Get information about this device. Includes model info, token and * connection information. */ info() { re...
""" The MIT License (MIT) Copyright (c) 2021 Losant IoT, Inc. 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 without limitation the rights to use, copy, modify, me...
(function JVM_net_nexustools_jvm_bridge_JSObjectRef_Controller($JVM, JVM){ $JVM.ClassLoader.defineClass("net/nexustools/jvm/bridge/JSObjectRef$Controller", [], "java/lang/Object", [ { "type": "method", "name": "getRef", "signature": "()Lnet/nexustools/jvm/bridge/JSObjectRef;", "sigparts": { "return":...
"""\ basis_6311pp_1d_1p.dat basis set for use with PyQuante (added by Globulion - from GAUSSIAN09 log file) This program is part of the PyQuante quantum chemistry program suite. Copyright (c) 2004, Richard P. Muller. All Rights Reserved. PyQuante version 1.2 and later is covered by the modified BSD license. Pl...
import tensorflow as tf class StateProcessor(object): """ Processes a raw Atari iamges. Resizes it and converts it to grayscale. # D. Britz Implementation """ def __init__(self): # Build the Tensorflow graph with tf.variable_scope("state_processor"): self.input_state = ...
/* Generated by RuntimeBrowser Image: /System/Library/PrivateFrameworks/VectorKit.framework/Versions/A/VectorKit */ @interface VKPShieldIndex : PBCodable <NSCopying> { NSMutableArray * _entries; NSMutableArray * _textEntries; NSMutableArray * _variantEntries; } @property (nonatomic, readwrite, retain)...
# 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 ...
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2018. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
"""Wrapper for lifecycle/ak, to be installed by poetry""" from os import system from pathlib import Path from sys import argv def main(): """Wrapper around ak bash script""" current_path = Path(__file__) args = " ".join(argv[1:]) system(f"{current_path.parent}/ak {args}") # nosec if __name__ == "__...
# Copyright (c) 2010-2021 Emmanuel Blot <emmanuel.blot@free.fr> # Copyright (c) 2010-2016, Neotion # All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause #pylint: disable-msg=missing-docstring __version__ = '0.53.0' __title__ = 'PyFtdi' __description__ = 'FTDI device driver (pure Python)' __uri__ = 'http://...
define({ "_themeLabel": "Mücevher Kutusu Teması", "_layout_default": "Varsayılan düzen", "_layout_layout1": "Düzen 1", "emptyDocablePanelTip": "Araç eklemek için Araç sekmesinde + düğmesine tıklayın. " });
# Copyright (c) 2019 VMware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
/** * @file 平移变换 * @author mengke01(kekee000@gmail.com) */ define( function (require) { var lang = require('common/lang'); var pathAdjust = require('graphics/pathAdjust'); /** * 移动对象 * * @param {Object} camera 镜头对象 * @param {boolean} fixX 固定X ...
import React from "react"; import * as api from "../../api"; class NewTweet extends React.Component { state = { text: "" }; handleInputChange = event => { const target = event.target; const value = target.type === "checkbox" ? target.checked : target.value; const name = target.name; this.set...
import fileinput lines = list(l for l in fileinput.input()) def mark(grid, n): s = 0 for i in range(5): for j in range(5): if grid[i][j] == n: grid[i][j] = -1 if grid[i][j] != -1: s += grid[i][j] for i in range(5): if grid[i].count(-...
"use strict"; exports.__esModule = true; /** * Checks if value is inside the range. */ function inRange(val, min, max, threshold) { if (threshold === void 0) { threshold = 0; } return val + threshold >= min && val - threshold <= max; } exports["default"] = inRange;
from ..core import Solution from ..core import Experiment import numpy as np class DynamicSolver(Experiment): def __init__(self, instance, solution=None): self.log = "" if solution is None: solution = Solution({"include": []}) super().__init__(instance, solution) self.l...
/** * @description MeshCentral web server * @author Ylian Saint-Hilaire * @copyright Intel Corporation 2018-2020 * @license Apache-2.0 * @version v0.0.1 */ /*jslint node: true */ /*jshint node: true */ /*jshint strict:false */ /*jshint -W097 */ /*jshint esversion: 6 */ 'use strict'; /* class SerialTunnel extends requ...
""" Standard container-class for easy multiple-inheritance. Try to inherit from the ndarray instead of using this class as this is not complete. """ from __future__ import division, absolute_import, print_function from numpy.core import ( array, asarray, absolute, add, subtract, multiply, divide, remainder, p...
"use strict"; process.stdin.resume(); process.stdin.setEncoding("utf-8"); let inputString = ""; let currentLine = 0; process.stdin.on("data", inputStdin => { inputString += inputStdin; }); process.stdin.on("end", _ => { inputString = inputString .replace(/\s*$/, "") .split("\n") .map(str => str.repl...
""" Genomic SNP endpoint. This endpoint is specific for querying SNPs, hence the parameters accepted by the request differ from the ones in the basic query endpoint. .. note:: See ``schemas/genomic_snp.json`` for checking the parameters accepted in this endpoint. """ import ast import logging from .exceptions impo...
# Copyright 2019 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 agreed to in writing, ...
import numpy as np import os distmat_paths = [ './logs/stage2/resnext101a_384/v1/dist_mat.npy', './logs/stage2/resnext101a_384/v2/dist_mat.npy', './logs/stage2/101a_384/v1/dist_mat.npy', './logs/stage2/101a_384/v2/dist_mat.npy', './logs/stage2/101a_384_recrop/v1/dist_mat.npy',...
""" An implementation of JSON Schema for Python The main functionality is provided by the validator classes for each of the supported JSON Schema versions. Most commonly, the :function:`validate` function is the quickest way to simply validate a given instance under a schema, and will create a validator for you. """...
/****************************************************************************** *** The driver code of an example of how to use the INHDF5 API *** *** Copyright (c) 2020 Ioannis Nompelis *** Ioannis Nompelis <nompelis@nobelware.com> *****************************************************************************...
import shutil import unittest import tempfile import pandas as pd from kgtk.cli_entry import cli_entry from kgtk.exceptions import KGTKException class TestKGTKNormalizeNodes(unittest.TestCase): def setUp(self) -> None: self.file_path = 'data/sample_kgtk_nodes.tsv' self.temp_dir = tempfile.mkdtemp(...
from gensim.corpora.dictionary import Dictionary from gensim.models.coherencemodel import CoherenceModel from gensim.matutils import Sparse2Corpus import numpy as np from sklearn.base import BaseEstimator, TransformerMixin from sklearn.exceptions import NotFittedError import torch from torch.optim import Adam from torc...
#coding:utf-8 import threading class Singleton(object): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(cls, "_instance"): with cls._instance_lock: if not hasattr(cls, "_instance"): cls._instance = object.__new__(cls) ...
from enum import Enum class NumeroCarta(Enum): NINGUNO = 0 AS = 1 DOS = 2 TRES = 3 CUATRO = 4 CINCO = 5 SEIS = 6 SIETE = 7 OCHO = 8 NUEVE = 9 DIEZ = 10 JACK = 11 QUEEN = 12 KING = 13 class PintaCarta(Enum): NINGUNO = 0 TREBOL = 1 ...
// DO NOT EDIT! This test has been generated by tools/gentest.py. // OffscreenCanvas test in a worker:2d.fillStyle.parse.hex6 // Description: // Note:<p class="notes"> importScripts("/resources/testharness.js"); importScripts("/2dcontext/resources/canvas-tests.js"); var t = async_test(""); t.step(function() { var of...