text stringlengths 3 1.05M |
|---|
from functools import wraps
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models as django_models
from django.db import transaction
from dj... |
import os
import sys
import subprocess
import traceback
try:
sys.path.append(snakemake.config['args']['mcc_path'])
import scripts.mccutils as mccutils
except Exception as e:
track = traceback.format_exc()
print(track, file=sys.stderr)
print("ERROR...unable to locate required external scripts at: "+s... |
from allenact_plugins.ithor_plugin.ithor_sensors import GoalObjectTypeThorSensor
from allenact_plugins.robothor_plugin.robothor_sensors import DepthSensorThor
from projects.objectnav_baselines.experiments.ithor.objectnav_ithor_base import (
ObjectNaviThorBaseConfig,
)
from projects.objectnav_baselines.experiments.o... |
/*global describe,beforeEach,it,expect */
var SandboxedModule = require('sandboxed-module');
var Command = require("commander").Command;
describe("spec template", function () {
var testCommand;
var Template;
beforeEach(function() {
Template = SandboxedModule.require('../../templates/spec', {
... |
import * as Curry from "../../../../../../../../../../../../node_modules/bs-platform/lib/es6/curry.js";
import * as AppStore$WonderEditor from "../../../../../../../../ui/store/AppStore.js";
import * as EventHandler$WonderEditor from "../../../../../../../../ui/eventHandler/EventHandler.js";
import * as EmptyEventHan... |
export default function CapsLock(props) {
const textoInserido = props.texto
const textoEmCapsLock = textoInserido.toUpperCase()
const childrenInserido = props.children
const childrenEmCapsLock = childrenInserido.toUpperCase()
return (
<div>
<div>{textoEmCapsLock} - {childrenEmCapsLock}</div>
<... |
"""
WSGI config for notebook project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION``... |
import json
from util.config import APIDOC_DESCRIPTION_STORE_PATH, JAVADOC_GLOBAL_NAME, INITIAL_API_DOMAIN_TERM_MAP_STORE_PATH, API_DOMAIN_TERM_STORE_PATH, FUSED_API_DOMAIN_TERM_MAP_STORE_PATH, FUSED_DOMAIN_TERM_API_MAP_STORE_PATH, FUSED_DOMAIN_TERM_STORE_PATH
def generate_fused_api_term_map(doc_name: str = JAVADOC_... |
alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z','a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
number=['1','2','3']
from cipher_art import l... |
import numpy as np
import collections
from types import SimpleNamespace
from typing import Tuple
from affine import Affine
# This is numeric code, short names make sense in this context, so disabling
# "invalid name" checks for the whole file
# pylint: disable=invalid-name
class WindowFromSlice(object):
""" Tran... |
"""
Django settings for polyclinic project.
Generated by 'django-admin startproject' using Django 1.8.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build p... |
sap.ui.define(["sap/ui/core/UIComponent", "sap/ui/core/ComponentSupport"], function(UIComponent) {
"use strict";
return UIComponent.extend("els.org.pratideen.Component", {
metadata: {
manifest: "json"
},
init: function() {
debugger;
// call the base component's init function and create the App view
... |
"""
check for common build errors
"""
import json
import os
import sys
_this_dir = os.path.dirname(__file__)
_parent = os.path.realpath(os.path.join(_this_dir, '..'))
def check_messages():
_messages = os.path.realpath(os.path.join(_parent, 'messages.json'))
_messages_dir = os.path.realpath(os.path.join(_pa... |
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.lang['nb']={"undo":{"redo":"Gjør om","undo":"Angre"},"toolbar":{"toolbarCollapse":"Skjul verktøylinje","toolbarExpand":"Vis verktøylinje","toolbarGroups":{"document":"... |
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-97846336"],{"166a":function(t,e,i){},"2f71":function(t,e,i){},"32b1":function(t,e,i){"use strict";var s=i("f0ff"),o=i.n(s);o.a},3408:function(t,e,i){},"3ad0":function(t,e,i){},"5d41":function(t,e,i){var s=i("23e7"),o=i("861d"),n=i("825a"),a=i("5135"),l=i... |
import { TextureLoader, NearestFilter, Vector2 } from "three";
export class RenderTileset {
constructor(tileset, texture, renderer) {
this._tileset = tileset;
this.texture = texture;
this._renderer = renderer;
}
static load(tileset, renderer) {
const resolveTexture = (reso... |
#! /usr/bin/env python
import tensorflow as tf
import numpy as np
import os
import time
import datetime
import data_helpers
from text_cnn import TextCNN
from tensorflow.contrib import learn
# Parameters
# ==================================================
# Data loading params
tf.flags.DEFINE_float("dev_sample_perce... |
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
from pandas import DataFrame
from nnlib.classifiers.cnn_fft_1D import ThreeLayerConvNetFFT1D
from nnlib.load_time_series import load_data
from nnlib.solver import Solver
from nnlib.utils.general_utils import *
class Result(object):
def __init_... |
##
# from https://github.com/jojonki/word2vec-pytorch/blob/master/word2vec.ipynb
# Migrated to > 0.4.0 pytorch
##
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
class CBOW(nn.Module):
def __init__(self, vocab_size, embd_size, contex... |
"""Misc. tests that don't fit anywhere.
XXX: Try our best to reduce tests in this file.
"""
import os
from tempfile import mkdtemp
import mock
import pytest
from pipenv._compat import Path
from pipenv.project import Project
from pipenv.utils import temp_environ
from pipenv.vendor import delegator
@pytest.mark.co... |
// Max van Leeuwen
// ig @max.van.leeuwen
// twitter @maksvanleeuwen
//
// Starts animation on tap
// It uses all default settings,
// e.g. duration = 1s, animation curve = Cubic|InOut
// create new animation instance
var anim = new global.AnimateProperty();
// the function to call on each animation frame, this mov... |
"use strict";
// 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agre... |
import context from '../../context'
import ActiveModel from '../ActiveModel'
import { findById, updateById } from '../../helpers'
const coll = () => context.users
class User extends ActiveModel {
constructor (params = {}) {
super(params)
// These fields have a lot of overlap and it's a bit unclear what is n... |
# # game_test.py
# from game import determine_winner
# def test_determination_of_the_winner():
# assert determine_winner("rock", "rock") == None # represents a tie
# assert determine_winner("rock", "paper") == "paper"
# assert determine_winner("rock", "scissors") == "rock"
# assert determine_winner("... |
function convert_uuencode(str) {
// discuss at: http://phpjs.org/functions/convert_uuencode/
// original by: Ole Vrijenhoek
// bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// bugfixed by: Brett Zamir (http://brett-zamir.me)
// reimplemented by: Ole Vrijenhoek
// ... |
#*******************************************************************************
# Copyright 2014-2020 Intel Corporation
# All Rights Reserved.
#
# This software is licensed under the Apache License, Version 2.0 (the
# "License"), the following terms apply:
#
# You may not use this file except in compliance with the Li... |
#!/usr/bin/python
# Classification (U)
"""Program: gtidset_init.py
Description: Unit testing of GTIDSet.__init__ in mysql_class.py.
Usage:
test/unit/mysql_class/gtidset_init.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import sys
import os
if sys.version_info < (2, 7):
... |
from tensorflow.python.keras import activations
from tensorflow.python.keras.utils import tf_utils
import tensorflow as tf
import numpy as np
import numpy as np
import time
import argparse
class subLSTMCell(tf.keras.layers.Layer):
"""Cell class for the subLSTM layer.
Arguments:
units: Positive integer, dime... |
import os
import os.path as osp
import shutil
import sys
from tempfile import mkdtemp
import pytest
sys.path.insert(
0, osp.abspath(osp.join(osp.dirname(osp.abspath(__file__)), "..", ".."))
)
from disk import Disk
class TestDiskConstructor(object):
def setup_method(self):
self.tmpdir = mkdtemp()
... |
from .job import Job
class SimgrExploreJob(Job):
def __init__(self, simgr, find=None, avoid=None, step_callback=None, until_callback=None, callback=None):
super().__init__('Simulation manager exploring')
self._simgr = simgr
self._find = find
self._avoid = avoid
self._callb... |
import * as instructionSets from '@/scripts/si/instructionSets'
test('Instruction Sets', () => {
const port = { write: jest.fn() }
instructionSets.beep(port)
expect(port.write).toHaveBeenLastCalledWith(Buffer.from([0xff, 0x06]))
instructionSets.card5.getData(port)
expect(port.write).toHaveBeenLastCalledWith(... |
import React, {Fragment} from "react";
import { useLazyQuery } from "@apollo/client";
import { SEARCH } from "../graphQL functions";
import Back from "../Components/Back";
import SearchIcon from "../Components/Search";
import Close from "../Components/Close";
import SearchData from "./searchData";
import SearchBox from... |
"""Implementation of PPO Algorithm."""
from rllib.algorithms.ppo import PPO
from rllib.util.early_stopping import EarlyStopping
from rllib.util.neural_networks.utilities import stop_learning
from rllib.value_function import NNValueFunction
from .actor_critic_agent import ActorCriticAgent
class PPOAgent(ActorCriticAg... |
import json
import pytest
from bocadillo import API, Media
from bocadillo.media import UnsupportedMediaType
def test_defaults_to_json(api: API):
data = {"message": "hello"}
@api.route("/")
async def index(req, res):
res.media = data
response = api.client.get("/")
assert response.status... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = hashCode;
// http://erlycoder.com/49/javascript-hash-functions-to-convert-string-into-integer-hash-
function hashCode(s) {
var str = String(s);
var hash = 0;
var char;
if (str.trim().length === 0) return hash;
... |
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require... |
module.exports = function(grunt) {
grunt.registerTask('deploy', [
'deployOnlyOnStagingOrProd',
'build',
'buildDemo',
'gzip',
'shell:deployS3-docs',
'shell:deployS3-lib',
'shell:deployS3-demo'
]);
grunt.registerTask('deploy-demo', [
'buildDemo',
'shell:deployS3-demo'
]);
... |
export const tpHours = [
{ key: '00', name: '00' },
{ key: '01', name: '01' },
{ key: '02', name: '02' },
{ key: '03', name: '03' },
{ key: '04', name: '04' },
{ key: '05', name: '05' },
{ key: '06', name: '06' },
{ key: '07', name: '07' },
{ key: '08', name: '08' },
{ key: '09',... |
#!/usr/bin/env python3
#
# Copyright (c) 2016, Neil Booth
#
# All rights reserved.
#
# See the file "LICENCE" for information about the copyright
# and warranty status of this software.
'''Script to send RPC commands to a running ElectrumX server.'''
import argparse
import asyncio
import json
from functools import p... |
# pylint: skip-file
# flake8: noqa
# pylint: skip-file
# pylint: disable=wrong-import-position,wrong-import-order
import base64
# pylint: disable=too-many-arguments
class OCSecret(OpenShiftCLI):
''' Class to wrap the oc command line tools
'''
def __init__(self,
namespace,
... |
import React from "react";
import { NavLink, withRouter } from "react-router-dom";
const Navigation = ({ history }) => {
const signOut = () => {
localStorage.removeItem('token');
history.push('/login');
};
return (
<div className="App">
<nav className="nav">
<di... |
//
// SwiftFP.h
// SwiftFP
//
// Created by Hai Pham on 14/3/18.
// Copyright © 2018 Hai Pham. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for SwiftFP.
FOUNDATION_EXPORT double SwiftFPVersionNumber;
//! Project version string for SwiftFP.
FOUNDATION_EXPORT const unsigned char Swift... |
//=================================================================================================
/*!
// \file blaze/math/constraints/MatGenExpr.h
// \brief Constraint on the data type
//
// Copyright (C) 2012-2020 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistr... |
NEWSCHEMA('Users/Groups', function(schema) {
schema.define('id', 'String(50)');
schema.define('name', 'String(50)');
schema.define('note', 'String(200)');
schema.define('apps', '[Object]'); // [{ id: UID, roles: [] }]
schema.setQuery(function($) {
if ($.controller && FUNC.notadmin($))
return;
var arr = ... |
class GtrendsRepository {
constructor() {
this.resultsOut=[];
this.i=0;
}
//loading data
async loadDataFromJsonFiles()
{
const fs = require('fs-extra')
const data = await fs.readFile('data/inputs.json')
const inputs = JSON.parse(data)
return inputs;
... |
"""
io utilities
"""
#-----------------------------------------------------------------------------
# Copyright (c) ytree development team. All rights reserved.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#------------... |
# coding: utf8
from __future__ import unicode_literals
ADJECTIVES = set("""
n-διάστατος µεταφυτρωτικός άβαθος άβαλτος άβαρος άβατος άβαφος άβγαλτος άβιος
άβλαπτος άβλεπτος άβολος άβουλος άβραστος άβρεχτος άβροχος άβυθος άγαμος
άγγιχτος άγδαρτος άγδυτος άγευστος άγιος άγλυκος άγλωσσος άγναθος άγναντος
άγνεστος... |
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import "ALTask.h"
#import "ALConnectionManagerDelegate-Protocol.h"
@class ALPostbackHTTPRequest, NSString;
@protocol ALPostbackDeleg... |
/**
* Configure your Gatsby site with this file.
*
* See: https://www.gatsbyjs.org/docs/gatsby-config/
*/
require("dotenv").config();
const useStrapi = process.env.GATSBY_USE_STRAPI;
description_string =
"Learn everything you need to know to use the @coursemaker/gatsby-theme-coursemaker \n" +
"Including how to... |
import datetime
from decimal import Decimal
from json import JSONDecodeError
from unittest.mock import Mock, patch
import pytest
from django.core.exceptions import ValidationError
from django.test import override_settings
from prices import Money, TaxedMoney
from requests import RequestException
from ....checkout.fet... |
"""
This file offers the methods to automatically retrieve the graph Nocardia higoensis.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein ass... |
import React, { Component } from 'react';
import { Link, withRouter } from 'react-router-dom';
import { withFirebase } from '../../components/Firebase';
import { Input, Button } from '../../components';
import * as ROUTES from '../../constants/routes';
const PasswordForgetPage = () => (
<div>
<h1>PasswordForget<... |
"""
Training Transformer models using Pipeline Parallelism
======================================================
**Author**: `Pritam Damania <https://github.com/pritamdamania87>`_
This tutorial demonstrates how to train a large Transformer model across
multiple GPUs using pipeline parallelism. This tutorial is an ex... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... |
export default function buildUpdateSubjectsController({ updateSubjects }) {
return async function updateSubjectsController(httpRequest) {
try {
const subjectInfo = httpRequest.body;
const { userToken } = httpRequest;
await updateSubjects({
...subjectInfo,
userToken,
});
... |
/*
Simple DirectMedia Layer
Copyright (C) 1997-2015 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this ... |
import { getNPMConfig } from '@tech_query/node-toolkit';
import Browser from './Browser';
const stack = [ ];
/**
* Puppeteer API
*/
export default class Puppeteer {
/**
* @return {String} A path where Puppeteer expects to find installed Firefox
*/
static executablePath() { return getNPMConfig... |
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
app: path.resolve(process.cwd(),'./client/index.js'),
},
resolve: {
extensions: ['.js', '.jsx'],
},
module: {
rules: [
{ test: /\.jsx?$/, l... |
/*
* Copyright (C) 2019 Open Source Robotics Foundation
*
* 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 appl... |
// Copyright (c) 2017 The GRINC developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_BIP38_H
#define BITCOIN_BIP38_H
#include "pubkey.h"
#include "uint256.h"
#include <string>
/** 39 bytes - 78 characte... |
// This array contains the coordinates for all bus stops between MIT and Harvard
const busStops = [
[-71.093729, 42.359244],
[-71.094915, 42.360175],
[-71.0958, 42.360698],
[-71.099558, 42.362953],
[-71.103476, 42.365248],
[-71.106067, 42.366806],
[-71.108717, 42.368355],
[-71.1... |
const { logParams, getCmdParams } = require("./utils/cmd");
const { genRandomUser } = require("./utils/genTools");
const {
createNewUser: createNewUserController
} = require("../../api/user").userControllers;
const {
createNewAccount: createNewAccountController
} = require("../../api/account").accountController... |
/**************************************************************************
* AW5306_Drv.h
*
* AW5306 Driver code version 1.0
*
* Create Date : 2012/06/25
*
* Modify Date :
*
* Create by : wuhaijun
*
**************************************************************************/
#ifndef AW5306_DRV_H
#define A... |
'''
Copyright (c) 2021, Štěpán Beneš
Basic Convolutional Autoencoder, few layers deeper than the initial one
'''
import numpy as np
from Models.Autoencoders.BaseModel import BaseModel
from keras.layers import Input, Reshape, Dense, Flatten
from keras.layers import Activation, Conv2D, MaxPooling2D, UpSampling2D, PReL... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = makeNewBuild;
var graphql = _interopRequireWildcard(require("graphql"));
var _graphqlParseResolveInfo = require("graphql-parse-resolve-info");
var _debug = _interopRequireDefault(require("debug"));
var _pluralize = _in... |
/*
Aman-nexus
Goals:
* Full coin infrastructure test mock
* Gateway between middle earth and aman RPC, mixing of coins
* audibility
*/
require('dotenv').config();
const log = require('@arbiter/dumb-lumberjack')
const TAG = " | app | "
const nexus = require("./mo... |
import { cilTrash } from "@coreui/icons";
import CIcon from "@coreui/icons-react";
import {
CAlert,
CCard,
CCardBody,
CCardHeader,
CForm,
CFormGroup,
CInput,
CButton,
CBadge,
} from "@coreui/react";
import React, { useContext, useEffect, useState } from "react";
import getFileBerkasKp from "src/contex... |
from django.shortcuts import render, render_to_response, get_object_or_404
from django.views.generic.detail import View
from django.views.generic.edit import FormView
from django.conf import settings
from comparedata.forms import JobForm
from comparedata.models import Job, Org, Object, ObjectField, UnmatchedRecord
from... |
# 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
from... |
#! /usr/bin/env python3
import logging
from typing import cast
from core.app import App
from player_ui import PlayerUI
logger = logging.getLogger('player')
class PlayerApp(App):
def setup(self):
self.ui = PlayerUI(self)
self.injector.provide(PlayerUI, lambda: self.ui)
@classmethod
def ... |
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Architecture import *
from Autodesk.Revit.DB.Analysis import *
from Autodesk.Revit.DB.Plumbing import *
from Autodesk.Revit.Exceptions import *
from Autodesk.Revit.UI import TaskDialog
from Autodesk.Revit.UI import TaskDialogCommonButtons
from Autodesk.Revit.UI im... |
/*
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
var babylon... |
import pytest
import tensorflow as tf
import numpy as np
from numpy.testing import assert_array_equal
from model.encdec import BasicEncoder, BasicDecoder, BasicEncoderDecoder, GraphEncoder, GraphDecoder, GraphEncoderDecoder
from model.word_embedder import WordEmbedder
class TestEncoderDecoder(object):
rnn_size = 3... |
# 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
# distributed under t... |
/*
This file parses the json from:
https://raw.githubusercontent.com/benetech/math-speech-rule-editor/master/examples/rules.json
https://github.com/benetech/math-speech-rule-editor/blob/master/lib/mathspeak.json
And does part of what is needed to then dynamically generate a .js file like this one:
https://github.com/z... |
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.10/esri/copyright.txt for details.
//>>built
define({widgetLabel:"Tra\u0165",startTracking:"Spustit sledov\u00e1n\u00ed m\u00e9 polohy",stopTracking:"Zastavit sledov\u00e1n\u00ed m\u00e9 polohy"}); |
import Vue from 'vue'
Vue.use({
install(Vue) {
const $window = Vue.observable({
width: 0,
height: 0,
isMobile: true
})
let queue = null
const wait = 100
const getWindowSize = () => {
clearTimeout(queue)
queue = setTimeout(function() {
const width = document... |
import React, { PropTypes, Component } from 'react';
import { connect } from 'react-redux';
import * as actions from './../actions';
import * as storage from './../persistence/storage';
import Loader from 'halogen/ClipLoader';
import Comment from './Comment';
import Post from './Post';
class Comments extends Component... |
from typing import Optional
from flask_wtf import FlaskForm
from wtforms import StringField, SelectField, SubmitField
from wtforms.validators import DataRequired, Length, Email
from servicex.models import UserModel
class ProfileForm(FlaskForm):
name = StringField('Full Name', validators=[DataRequired(), Length(... |
var min=document.getElementById('min').innerHTML;
min=parseInt(min);
var conv=document.getElementById('conv').innerHTML;
conv=parseInt(conv);
var sup=document.getElementById('sup').innerHTML;
sup=parseInt(sup);
var partidos=conv+sup;
document.getElementById('min_par').innerHTML=min/partidos;
var gol=document.getEleme... |
#users/admin.py
import sys
sys.path.insert(0,'..')
import questions_and_answers
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
import pprint
from .forms import CustomUserCreation, CustomUserChange
from .models import CustomUser
from slam.questions_and_answers import fields as f
tpl ... |
# -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
import { render, screen } from '@testing-library/react';
import Footer from './index';
test('renders correctly', () => {
render(<Footer />);
const footer = screen.getAllByTestId('footer');
expect(screen.getByTestId('footer_left')).toHaveTextContent('EasyBanking POC web app');
expect(screen.getByTestId('footer_... |
window.setTimeout(function () {
document.location.href = "/game";
}, 4000);
|
# Set Example
myset = {"Joseph", "Adaobi", "Kamara", "Ugochi"}
# Loop through set
for i in myset:
print(i)
#checking wheter 2 exists in myset
print(2 in myset)
#adding new element
myset.add(99)
print(myset)
|
/*!
* CanJS - 2.3.23
* http://canjs.com/
* Copyright (c) 2016 Bitovi
* Fri, 08 Apr 2016 17:58:15 GMT
* Licensed MIT
*/
/*can@2.3.23#compute/get_value_and_bind*/
steal('can/util', function (can) {
function ObservedInfo(func, context, compute) {
this.newObserved = {};
this.oldObserved = null;
... |
from core import scratch
from core.scratchpy.parser import SPModuleParser
from core.scratchpy.compiler2 import SPModuleCompiler
parser = SPModuleParser()
with open("vm.sp") as fl:
text = fl.read()
module = parser.parseText(text)
#print(module.functionBlocks[0].body)
#print(module.functionBlocks[1].body)
compiler =... |
import React from 'react';
import ReactDom from 'react-dom';
import './index.css'
const root = document.getElementById('root');
function Square(props) {
return (
<button className="square" onClick={props.onClick} >
{props.value}
</button>
)
}
class Board extends React.Compo... |
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, Undefined, config
from typing import Optional, TYPE_CHECKING
from uuid import UUID
import os
import hashlib
@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclass
class PesertaDidik:
registrasi_id: UUID
peserta_didik_id: UUI... |
import { storiesOf } from '@storybook/vue'
import RplAnchorLinks from './index.vue'
import {
withKnobs,
text,
object
} from '@storybook/addon-knobs/vue'
storiesOf('Molecules/AnchorLinks', module)
.addDecorator(withKnobs)
.add('Anchor Links', () => ({
components: { RplAnchorLinks },
template: `<rpl-a... |
$(function() {
var timeid = query = null;
var controlLink = $('#control');
var errmsg = $('<p class="errmsg">'+Database.errmsg+'</p>')
.insertBefore(controlLink)
.hide();
var loading = $('<img class="loading" alt="[loading]" src="'+ Database.load_icon +'" />')
.insertAfter(controlLink)
.hide();
function ... |
N, K = map(int, input().split())
X = list(map(int, input().split()))
ans = 1e10
for i in range(N - K + 1):
left = X[i]
right = X[i + K - 1]
ans = min(ans, min(abs(left), abs(right)) + abs(left - right))
print(ans)
|
import React from "react";
export default function Euro() {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
>
<path d="M15 18.5c-2.51 0-4.68-1.42-5.76-3.5H15v-2H8.58c-.05-.33-.08-.66-.08-1s.03-.67.08-1H15V9H9.24C10.32 6.92 12.5 5.5 15 ... |
deepmacDetailCallback("0008c5000000/24",[{"d":"2001-12-23","t":"add","a":"306, Wooyoung Techno Center, 273-15,\nSungsu2ga-3dong, Sungdong-ku,\nSeoul 133-831\n","c":"KOREA, DEMOCRATIC PEOPLE'S REPUBLI","o":"Liontech Co., Ltd.","s":"wireshark.org"},{"d":"2004-06-05","t":"change","a":"306, Wooyoung Techno Center, 273-15,... |
import React, {Component} from 'react';
import {
Text,
View,
TouchableOpacity,
StyleSheet,
Alert,
Platform,
Dimensions,
TextInput,
Picker,
ScrollView,
ListView,
Image
} from 'react-native';
import { Card, CardSection, Input, Button2, InfoBox, InfoBox2, TitleBox } from './common';
import ActionBu... |
domain_name = os.environ.get("DOMAIN_NAME", "wldomain")
domain_path = '/apps/oracle/%s' % domain_name
db_user_chipsDS = os.environ.get("DB_USER_CHIPSDS", 'db_user_chipsds_missing')
db_password_chipsDS = os.environ.get("DB_PASSWORD_CHIPSDS", 'db_password_chipsds_missing')
db_url_chipsDS = os.environ.get("DB_URL_CH... |
"""Defines common errors raised from function binding."""
class NoPoolSetError(Exception):
"""Raised when there is no pool set for a function binder before a sql operation is called."""
pass
class PoolAlreadySetError(Exception):
"""Raised when a pool is set twice on a binder."""
pass
class Bindi... |
/**
* @license NgRx 6.1.0
* (c) 2015-2018 Brandon Roberts, Mike Ryan, Rob Wormald, Victor Savkin
* License: MIT
*/
import { Inject, InjectionToken, NgModule } from '@angular/core';
import { NavigationCancel, NavigationError, NavigationEnd, Router, RoutesRecognized } from '@angular/router';
import { select, Store } ... |
// @flow
import babelConfig from '../lib/utils/babel-config'
//TODO add mock for 'path'
test("work babelConfig with npm run develop", () => {
return expect(babelConfig('./.babelrc', 'develop').presets[0]).toContain("react-hmre")
})
test("work babelConfig with npm run build", () => {
return expect(babelConfig... |
const { ethers } = require("hardhat");
async function main() {
const [deployer] = await ethers.getSigners();
console.log("Deploying contracts with the account:", deployer.address);
console.log("Account balance:", (await deployer.getBalance()).toString());
const Token = await ethers.getContract... |