text
stringlengths
3
1.05M
# Generated by Django 3.1.7 on 2021-03-30 23:42 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('ghostpost', '0002_auto_20210330_2341'), ] operations = [ migrations.RemoveField( model_name='rbmodel', name='privatesecret_k...
import logging from collections import Counter from time import time from brownie import chain from joblib import Parallel, delayed import yearn.iearn import yearn.ironbank import yearn.special import yearn.v1.registry import yearn.v2.registry from yearn.exceptions import UnsupportedNetwork from yearn.networks import...
import React, { Component } from 'react'; import { YMLBuilder } from 'common/builder/YMLBuilder'; export default class SchemaBuilder extends Component { static Config() { return { name: 'UIBuilder', }; } render() { return ( <YMLBuilder schema=...
# Copyright (c) 2021 PaddlePaddle 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 appli...
/*! ramp-pcar 29-05-2015 14:06:43 : v. 5.4.0-10 * * RAMP GIS viewer - Elk; Sample of an implementation of RAMP **/ define(["ramp/eventManager","dojo/Deferred","dojo/topic","dojo/text!./templates/filter_wms_meta_Template.json","utils/popupManager","utils/tmplHelper","utils/util"],function(a,b,c,d,e,f,g){"use stric...
// Require Dependencies const express = require('express'); const bodyParser = require('body-parser'); // Init App const app = express(); // BodyParser Middleware // parse application/x-www-form-urlencoded app.use(bodyParser.urlencoded({ extended: true })); // parse application/json app.use(bodyParser.json()); // Re...
from typing import Dict, List from decimal import Decimal from rest_framework.request import Request from polaris import settings from polaris.models import Asset def calculate_fee( fee_params: Dict, *_args: List, request: Request = None, **_kwargs: Dict ) -> Decimal: """ .. _`/fee`: https://github.com/...
from __future__ import absolute_import, print_function import tweepy from tweepy import Stream from tweepy import OAuthHandler from tweepy.streaming import StreamListener import time import json from textblob import TextBlob ckey = 'QtjbyJiJ3NLR2nYuU5SVbaEMF' csecret = 'jDiECspRBGt9SdrieY3BBOtIDXFiFox3zZjAY4i7gCzAjS...
import os import numpy as np from modules.simulation.individual.bess import BESS from modules.simulation.individual.chpp import CHPP from modules.simulation.individual.hwt import HWT from modules.simulation.individual.demand import Demand from modules.simulation.integrated.bess_chpp_hwt import BESS_CHPP_HWT #### # ge...
module.exports = function (grunt) { require('time-grunt')(grunt); var aged = require('aged'); var pkg = grunt.file.readJSON('package.json'); // used for templates var pkgData = { data: { pkg: pkg } }; var plugins = require('matchdep').filterDev('grunt-*'); plugins.forEach(grunt.loadNpmTa...
const express = require('express'); const genres = require('../routes/genres'); const customers = require('../routes/customers'); const movies = require('../routes/movies'); const rentals = require('../routes/rentals'); const users = require('../routes/users'); const auth = require('../routes/auth'); const returns = re...
import * as React from "react"; import { ethers } from "ethers"; import './App.css'; export default function App() { const wave = () => { } return ( <div className="mainContainer"> <div className="dataContainer"> <div className="header"> 👋 Hey there! </div> <...
import express from "express" import { index } from "api/apps/search/routes" import { setUser, authenticated, adminOnly } from "api/apps/users/routes.coffee" const app = (module.exports = express()) app.get("/search", setUser, authenticated, adminOnly, index)
angular.module('kibibitCodeEditor') .directive('kbSearchProject', function() { return { scope: {}, bindToController: { searchTerm: '=ngModel' }, controller: 'searchProjectController', controllerAs: 'searchProjectCtrl', templateUrl: 'app/components/searchProject/searchProjectTemplate.htm...
/* * Copyright (C) 2002-2005 Roman Zippel <zippel@linux-m68k.org> * Copyright (C) 2002-2005 Sam Ravnborg <sam@ravnborg.org> * * Released under the terms of the GNU GPL v2.0. */ #include <stdarg.h> #include <stdlib.h> #include <string.h> #include "lkc.h" /* file already present in list? If not add it */ struct fi...
import{e as a,l as s,i as t,a as e,g as n,c as i}from"./index.4205cc56.js";import{d as l,f as c,r,w as d,t as o,u,o as p,c as m,b as v,B as y,h as f,q as x,C as g,x as k,p as _,a as b}from"./vendor.03637da4.js";const X=x();var $=l({expose:[],props:["startX","startY","size"],setup(s){const{proxy:t}=g();l({FullScreen:a})...
""" Question Source:Leetcode Level: Medium Topic: Stack Solver: Tayyrov Date: 18.03.2022 """ def removeDuplicateLetters(s: str) -> str: last_indices = {char: idx for idx, char in enumerate(s)} stack = [] added = set() for idx, char in enumerate(s): while stack and stack[-1] > c...
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyTreehash(PythonPackage): """Calculates a SHA256 (or, potentially, any other hashlib supp...
from pathlib import Path from io import StringIO from jinja2 import Template from ploomber.tasks.abc import Task from ploomber.tasks.mixins import ClientMixin from ploomber.sources import (SQLScriptSource, SQLQuerySource, FileSource) from ploomber.products import (File, PostgresRelation, SQLiteRelation, ...
import versioneer from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, "README.rst"), encoding="utf-8") as f: long_description = f.read() requires = [ "matplotlib>=2.0.0", "pandas>=0.24", "Cython",...
/* * jit-block.h - Functions for manipulating blocks. * * Copyright (C) 2004 Southern Storm Software, Pty Ltd. * * The libjit library is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, either versi...
#!/usr/bin/env python3 from src.util import * # tag::starOne[] foods = read_file_to_list("input.txt") l = len(foods) dangerous = dict() while True: allergens = dict() for i in range(l): if len(foods[i]["allergens"]) == 1: allg = list(foods[i]["allergens"])[0] if allg not in all...
#coding:utf-8 # # id: functional.procedure.create.02 # title: CREATE PROCEDURE - Input parameters # decription: CREATE PROCEDURE - Input parameters # # Dependencies: # CREATE DATABASE # tracker_id: # min_versions: [] # versions: 2.1 # qmid: fu...
import numpy as np from scipy.integrate import odeint class FirstOrderHold: def __init__(self, m, K, sigma): self.K = K self.m = m self.n_x = m.n_x self.n_u = m.n_u self.A_bar = np.zeros([m.n_x * m.n_x, K - 1]) self.B_bar = np.zeros([m.n_x * m.n_u, K - 1]) ...
/** * @file * JavaScript behaviors for webform custom options. */ (function ($, Drupal) { 'use strict'; Drupal.webformOptionsCustom = Drupal.webformOptionsCustom || {}; // @see http://api.jqueryui.com/tooltip/ Drupal.webformOptionsCustom.jQueryUiTooltip = Drupal.webformOptionsCustom.jQueryUiTooltip || {}...
import { increment, decrement, reset } from './actions/counter' import store from './store' // 打印初始状态 console.log(store.getState()) // 每次 state 更新时,打印日志 // 注意 subscribe() 返回一个函数用来注销监听器 const unsubscribe = store.subscribe(() => console.log(store.getState())) // 发起一系列 action store.dispatch(increment()) store.dispatch...
# -*- coding: utf-8 -*- # mk42 # mk42/apps/core/migrations/0006_auto_20170701_1801.py # Generated by Django 1.11.2 on 2017-07-01 18:01 from __future__ import unicode_literals import uuid from django.db import ( migrations, models, ) import django.db.models.deletion import redactor.fields class Migration(...
// 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. #ifndef BASE_NIX_XDG_UTIL_H_ #define BASE_NIX_XDG_UTIL_H_ // XDG refers to http://en.wikipedia.org/wiki/Freedesktop.org . // This file contains utili...
# Unless explicitly stated otherwise all files in this repository are licensed # under the Apache License Version 2.0. # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2020 Datadog, Inc. import base64 import os import boto3 import logging import re logger = logging.get...
import csi3 print csi3.Project("mkk3") print csi3.Shot("mkk3", "JYW_0200") print csi3.Projects() print csi3.Seqs("TEMP") print csi3.Shots("TEMP", "SS") print csi3.searchwordItems("TEMP", "fx")
module.exports={A:{A:{"2":"J D E F A B oB"},B:{"1":"N O P Q R U V W X Y Z a b c d e f S H","2":"C K L","322":"G M"},C:{"1":"6 8 9 AB BB CB DB FB GB HB IB JB KB fB gB MB NB T OB PB QB SB TB UB VB WB XB YB ZB aB bB P Q R hB U V W X Y Z a b c d e f S H iB","2":"pB eB I g J D E F A B C K L G M N O h i j k l m n o p q r s t...
import sys import os sys.path.append(os.path.abspath('../')) from unittest import TestCase from komand_microsoft_atp.connection.connection import Connection from komand_microsoft_atp.actions.run_antivirus_scan import RunAntivirusScan import json import logging class TestRunAntivirusScan(TestCase): def test_integ...
$(document).ready( function () { var containerDiv = document.getElementById("shootsC"); containerDiv.addEventListener("click", shootHere, false); }); function shootHere(event) { var str = event.target.id; str = str.slice(3, 5); console.log("shooting on cell: "+str); var msg = { type: "sh...
from editor.attributes.player.player_attribute import ( PlayerAttribute, PlayerAttributeTypes, ) class PlayerAttributeSs(PlayerAttribute): @classmethod def att_class_name(cls): return "SS" @classmethod def att_class_type(cls): return PlayerAttributeTypes.Position def get_...
# 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 agreed to in...
import React from "react" import { graphql } from "gatsby" import LandingPageLayout from "../layouts/LandingPageLayout" import HeroSection from "../sections/hero" import ExchangeSection from "../sections/exchanges" import BenefitSection from "../sections/benefit" import FeaturesListSection from "../sections/features-li...
"""Optimization modules This package contains optimization algorithms used to tune image processing parameters. """
import xadmin from .models import Link, SideBar from typeidea.base_admin import BaseOwnerAdmin @xadmin.sites.register(Link) class LinkAdmin(BaseOwnerAdmin): list_display = ('title', 'href', 'status', 'weight', 'created_time') fields = ('title', 'href', 'status', 'weight') def save_model(self, request, o...
from . import converters, pbivcs from . import version __all__ = [ converters, pbivcs, ] __version__ = version.version __title__ = version.project
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ic_app_settings_alt_outline = void 0; var ic_app_settings_alt_outline = { "viewBox": "0 0 24 24", "children": [{ "name": "g", "attribs": {}, "children": [{ "name": "rect", "attribs": { "fill": "no...
/** * Cookie.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ (function() { var each = tinymce.each; /** * This class contains simple cookie manangement functions. * ...
#include <stdio.h> #include <pthread.h> #include <stdlib.h> #include <string.h> #include <signal.h> #include <openssl/md5.h> #include <unistd.h> #include <stdbool.h> /* Program description: * Program is performing dictionary attack on given hashed passwords. It creates 8 threads in total, first thread (consumer) * r...
# Generated by Django 2.1.8 on 2019-07-02 17:44 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='GuestEmail', fields=[ ('id', models.AutoFie...
# Copyright 2020 BULL SAS All rights reserved # from loguru import logger from collections import Counter from logflow.logsparser.Pattern import Pattern from typing import Dict, List, Tuple from loguru import logger # TODO: Test performance of static vs method class Journal: """A journal is a list of logs files. I...
#!/usr/bin/env python # # This file is part of the Emotions project. The complete source code is # available at https://github.com/luigivieira/emotions. # # Copyright (c) 2016-2017, Luiz Carlos Vieira (http://www.luiz.vieira.nom.br) # # MIT License # # Permission is hereby granted, free of charge, to any person obtaini...
const assert = require("assert"); const expect = require("chai").expect; const request = require("supertest"); const validator = require("validator"); const app = require("../../ExpressFunctionApp/app"); describe('GET /api/hello', () => { it('should return 200 status', () => { return request(app) .get('/a...
/* * * Copyright 2016 gRPC 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 agree...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# 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! *** from enum import Enum __all__ = [ 'IpAddressType', 'LoadBalancerType', ] class IpAddressType(str, Enum): IPV4 = "ipv4" ...
function SvgNoFlashRound(props) { return ( <svg xmlns='http://www.w3.org/2000/svg' height='1em' viewBox='0 0 24 24' width='1em' className='svg-icon' {...props}> <path fill='none' d='M0 0h24v24H0z' /> <path d='M3.16 3.16a.996.996 0 10-1.41 1.41l4.6 4.6-.21.23H3.6c-.88 0-1.6.72-1.6 1.6v9.4c0 .8...
#include <JavaScriptCore/RetainPtr.h>
// // VROKnuthPlassFormatter.hpp // ViroRenderer // // Created by Raj Advani on 12/2/16. // Copyright © 2016 Viro Media. All rights reserved. // // 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 t...
# Copyright 2016 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 applica...
/* eslint-disable func-names */ import $ from 'jquery'; import createFlash from '~/flash'; import Api from './api'; import { loadCSSFile } from './lib/utils/css_utils'; import { s__ } from './locale'; import ProjectSelectComboButton from './project_select_combo_button'; const projectSelect = async () => { await loa...
import React from 'react'; import Modal from '../../UI/Modal/Modal'; const confirmDelete = props => { return ( <Modal modalClosed={props.cancelConfirmDelete} show={props.showConfirmDelete}> <div className="panel-group modal-panel"> <div className="panel panel-danger"> <div cla...
import sys import unittest from test import support from test.support import import_helper pwd = import_helper.import_module('pwd') @unittest.skipUnless(hasattr(pwd, 'getpwall'), 'Does not have getpwall()') class PwdTest(unittest.TestCase): def test_values(self): entries = pwd.getpwall() for e i...
/*! pinpoint - v1.5.2 */ !function(){"use strict";angular.module("pinpointApp").filter("iconUrl",function(){return function(a){var b="/images/icons/";if(angular.isString(a)){switch(a){case"UNKNOWN_GROUP":b+="UNKNOWN.png";break;default:b+=a+".png"}return b}return""}})}(),function(){"use strict";angular.module("pinpointA...
# Generated by Django 2.1.3 on 2018-11-15 11:35 from django.db import migrations import s3direct.fields class Migration(migrations.Migration): dependencies = [ ('cms', '0007_auto_20181114_1420'), ] operations = [ migrations.AlterField( model_name='report', name='...
#include <std.h> inherit VOTING; void create(){ object ob; :: create(); set_light(1); set_indoors(1); set_short(" %^BOLD%^%^WHITE%^A voting booth "); set_long( @SEETH %^CYAN%^You enter into a small room, and pull the curtains closed behind you, so as to maintain your privacy. In front of you is a large sign detail...
import math from typing import List from typing import Optional from typing import Tuple from optuna.logging import get_logger from optuna.study import Study from optuna.study import StudyDirection from optuna.trial import FrozenTrial from optuna.trial import TrialState from optuna.visualization.plotly_imports import ...
# -*- coding: utf-8 -*- """ Created on Fri Feb 12 22:05:13 2021 @author: Gary """ import subprocess import shutil import datetime import pandas as pd import numpy as np update_fn = './sources/upload_dates.csv' today_str = '2021-03-12' make_final = True today = datetime.date.today() s= 'jupyter nbconvert --template=...
/* Highcharts JS v8.0.0 (2019-12-10) Exporting module (c) 2010-2019 Torstein Honsi License: www.highcharts.com/license */ (function(c){"object"===typeof module&&module.exports?(c["default"]=c,module.exports=c):"function"===typeof define&&define.amd?define("highcharts/modules/export-data",["highcharts","highchart...
var bcrypt = require('bcryptjs') module.exports = { friendlyName: 'Signup', description: 'Signup to the movie club.', inputs: { firstName: { type: 'string' }, lastName: { type: 'string' }, email: { type: 'string' }, password: { type: 'string' }, confirmPassword: { type: 'string', require...
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path d="M20.84 4.22c-.05-.12-.11-.23-.18-.34-.14-.21-.33-.4-.54-.54-.11-.07-.22-.13-.34-.18-.24-.1-.5-.16-.78-.16h-1V1h-2v2H8V1H6v2H5c-.42 0-.8.13-1.12.34-.21.14-.4.33-.54.54-.07.11-.13.22-.18...
# cython: language_level=3 # distutils: language = c++ # -*- coding: utf-8 -*- # ***************************************************************************** # Copyright (c) 2016-2020, Intel Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are pe...
import { hash } from "./core/hash"; import { compile } from "./core/compile"; import { getSheet } from "./core/get-sheet"; /** * css entry * @param {String} str */ function css(str) { const defs = [].slice.call(arguments, 1); const ctx = this || {}; return hash( str.map ? compile(str, defs, ctx...
from django.contrib import admin from .models import Node from author.models import Author import random import string # Register your models here. class NodeAdmin(admin.ModelAdmin): # Our Node form in the admin panel model = Node list_display = ["server_username", "server_password", "...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import absolute_import import functools import inspect import os import pkg_resources import re import six import types from abc import abstractmethod from io import BytesIO from collections import defaultdict from botocore.config import C...
(function() { let sourceNameIdx = 0; /** * Builder for creating a sequence of actions */ function Actions() { this.sourceTypes = new Map([["key", KeySource], ["pointer", PointerSource], ["general", GeneralSource]]); this.sources = new ...
// Copyright (c) 2014-2019 The PRiVCY Core developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef PRIV_STACKTRACES_H #define PRIV_STACKTRACES_H #include <string> #include <sstream> #include <exception> #include...
/** * JS Linting */ require('mocha-eslint')([ 'assets/js', 'config', 'models', 'routes', 'test', 'app.js' ]);
import json from threading import Thread import numpy as np from acconeer.exptool import configs, utils from acconeer.exptool.clients import SocketClient, UARTClient class Detector(Thread): connection_checked = False def __init__(self, demo_ctrl, name): super().__init__(name=name) self.term...
// Load required packages var mongoose = require('mongoose'); // Define our user schema var UserSchema = new mongoose.Schema({ name: {type: String, required: true}, email: {type: String, required: true, unique: true}, pendingTasks: {type: [String], default: []}, dateCreated: {type: Date, default: Date....
// // ABI39_0_0RNSharedElementContent_h // ABI39_0_0React-native-shared-element // #ifndef ABI39_0_0RNSharedElementContent_h #define ABI39_0_0RNSharedElementContent_h #import <UIKit/UIKit.h> #import "ABI39_0_0RNSharedElementTypes.h" @interface ABI39_0_0RNSharedElementContent : NSObject @property (nonatomic, readon...
# Copyright 2020 QuantumBlack Visual Analytics Limited # # 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 # # THE SOFTWARE IS PROVIDED "AS IS",...
''' Testing tech ''' import pytest import numpy as np from freelunch.base import * from freelunch.util import UnpicklableObjectiveFunction from freelunch.darwin import rand_1 from freelunch.benchmarks import exponential def test_hyp_parse(): opt = optimiser(exponential()) assert(rand_1.__name__ == opt.parse_h...
#!/usr/bin/env python ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR OGDI driver. # Author: Even Rouault <even dot rouault at mines dash paris dot org> # ##############################################...
""" logistics.py A module for a single class LogisticSystem. Refer to LogisticSystem documentation for more information. """ import copy from typing import List from order import Vehicle from order import Order from order import Item class LogisticSystem: """ A class used to represent logistics system. ...
/* * 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/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
import React from 'react'; import Dropzone from 'react-dropzone' import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import * as actions from '../actions/actions'; class Upload extends React.Component { constructor() { super() this.state = {...
import { mapGetters, mapActions } from "vuex"; export default { props: { siteDefaultPanelView: { type: String, required: true, }, }, computed: { ...mapGetters("panels", ["currentPanel", "currentPanelView"]), }, methods: { ...mapActions("panels...
# Copyright 2019 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. # Or at https://developers.google.com/open-source/licenses/bsd from __future__ import absolute_import import os from trainer2 import train_ml_helpers from ...
/* * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>. * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include <asn_system.h> #include <asn_internal.h> #include <asn_bit_data.h> /* * Create a contiguous non-refillable bit data structure. * Can be freed by F...
export function up(queryInterface, Sequelize) { return queryInterface.createTable('shifts', { id: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true, }, mentorId: { type: Sequelize.INTEGER, allowNull: false, references: { model: 'mentors', key: 'id' }, ...
import csv import os from dagster import ( EventMetadataEntry, Field, Materialization, Selector, String, execute_pipeline, input_hydration_config, output_materialization_config, pipeline, seven, solid, usable_as_dagster_type, ) @input_hydration_config(Selector({'csv': ...
''' Created on 24 Feb 2012 @author: Qasim Note: The from_string methods actually require a list, ["string", "string2"], with no newline characters. The to_string methods will actually return a string like "bu7\nbu8u8" A typical DNA string is 'bu7bw9bv1u7u7bu2'. ''' import random from collections import namedtuple ...
r"""Importing this file must **not** initialize CUDA context. test_distributed relies on this assumption to properly run. This means that when this is imported no CUDA calls shall be made, including torch.cuda.device_count(), etc. torch.testing._internal.common_cuda.py can freely initialize CUDA context when imported....
import torch import torch.nn.functional as F from torch import nn, einsum from einops import rearrange, repeat from einops.layers.torch import Rearrange, Reduce # constants ABS_MAX_STEPS = 100 # helper functions def exists(val): return val is not None # classes class PreNorm(nn.Module): def __init__(self...
const service = require("../service"); module.exports = (app) => { app.get("/stats", async (req, res) => { try { const minerCount = await service.client.count(); const requestedCount = await service.pow.requestedCount(); const completedCount = await service.pow.completedCount(); res.json...
const urljoin = require("url-join"); const path = require("path"); const config = require("./data/SiteConfig"); module.exports = { pathPrefix: config.pathPrefix === "" ? "/" : config.pathPrefix, siteMetadata: { siteUrl: urljoin(config.siteUrl, config.pathPrefix), rssMetadata: { site_url: urljoin(conf...
/* * $QNXLicenseC: * Copyright 2007, 2008 QNX Software Systems. * * Licensed under the Apache License, Version 2.0 (the "License"). You * may not reproduce, modify or distribute this software except in * compliance with the License. You may obtain a copy of the License * at: http://www.apache.org/lice...
"use strict"; module.exports = { settings: { "number_of_shards": 2, analysis: { analyzer: { lowercase_only: { type: "custom", char_filter: [], tokenizer: "keyword", filter: ["lowercase"] ...
""" Django settings for app project. Generated by 'django-admin startproject' using Django 3.2.2. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from pathlib imp...
import math import tensorflow as tf from networks.parameter import user_params class QAOutputLayer(tf.layers.Layer): def __init__(self, params:user_params,feature_size:int, is_trainning=True, name:str="QAOutputLayer", dtype=tf.float32): super(QAOutputLayer, self).__init__(is_trainning, name, dtype) ...
from plugin.sync.core.enums import SyncData, SyncMode, SyncMedia from plugin.sync.modes.pull.lists.base import Lists import elapsed import logging log = logging.getLogger(__name__) class LikedLists(Lists): data = [SyncData.Liked] mode = SyncMode.Pull @elapsed.clock def run(self): # Retrieve...
# Copyright [yyyy] [name of copyright owner] # 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.or...
//filter will reemit the data if cb(err,pass) pass is truthy // reduce is more tricky // maybe we want to group the reductions or emit progress updates occasionally // the most basic reduce just emits one 'data' event after it has recieved 'end' var Stream = require('stream').Stream //create an event stream and ap...
// simple data types var myStringVariable = 'Some Name' var myNumberVariable = 200 var myBooleanVariable = true // uncomment one of the following lines and check the console console.log(myStringVariable) console.log(myNumberVariable) // console.log(myBooleanVariable) // the object type, this is an emtpy object var ...
import warning from 'warning' import useBeforeUnload from './useBeforeUnload' function enableBeforeUnload() { warning( false, 'enableBeforeUnload is deprecated, use useBeforeUnload instead' ) return useBeforeUnload.apply(this, arguments) } export default enableBeforeUnload
import datetime from unittest import TestCase from pytz import utc from freezegun import freeze_time from redash.query_runner.mongodb import ( parse_query_json, parse_results, _get_column_by_name, ) from redash.utils import json_dumps, parse_human_time class TestParseQueryJson(TestCase): def test_ig...