text stringlengths 3 1.05M |
|---|
import torch
import torch.nn as nn
import torch.nn.functional as F
class RCNN(nn.Module):
"""
Recurrent Convolutional Neural Networks for Text Classification (2015)
"""
def __init__(self, vocab_size,filter_size, embedding_dim, hidden_size, hidden_size_linear, class_num, dropout,padding_idx):
... |
"""Unique email codes
Revision ID: e6937aa2f743
Revises: da961d77314e
Create Date: 2017-05-07 14:41:04.134656
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e6937aa2f743'
down_revision = 'da961d77314e'
branch_labels = None
depends_on = None
def upgrade():
... |
# Copyright (c) 2022 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 ap... |
const path = require('path');
const Koa = require('koa');
const logger = require('koa-logger');
const router = require('koa-router')();
const bodyParser = require('koa-bodyparser');
const webpack = require('webpack');
const config = require('./webpack.config.dev');
const webpackMiddleware = require('koa-webpack');
con... |
const fs = require('fs');
const path = require('path');
const archiver = require('archiver');
/**
* Current ziptool's version.
* @const {string}
*/
const VERSION = require('../package.json').version;
/**
* Create a zip archive from one or multiple files.
* @param {string|Array<string>} src - The pathname(s) of t... |
# Copyright (C) 2009 by Eric Talevich (eric.talevich@gmail.com)
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
"""Classes corres... |
'use strict';
const PropTypes = require('prop-types');
const isEqualShallow = require('is-equal-shallow');
const VNode = require('./vnode');
const isClassComponent = component => component.isComponent;
const checkPropTypes = (component, props) => {
if (process.env.NODE_ENV !== 'production' && typeof component.propT... |
/*
* Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
* BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
*
* License for BK-BASE 蓝鲸基础平台:
* ----------------------------------------------------... |
# Copyright (c) 2011 Jeff Garzik
#
# Previous copyright, from python-jsonrpc/jsonrpc/proxy.py:
#
# Copyright (c) 2007 Jan-Klaas Kollhof
#
# This file is part of jsonrpc.
#
# jsonrpc is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# th... |
'use strict';
/* jshint node: true, mocha: true */
/* global suiteSetup */
var assert = require('chai').assert;
var path = require('path');
var fs = require('fs');
var helper = require('helper');
var AdmZip = require('adm-zip');
var jsdom = require('jsdom').jsdom;
function checkLayoutsJSON(zipPath, expectedArr) {
... |
/*
* Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com)
*
* 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 b... |
import { run } from '@ember/runloop';
import Test from 'ember-test';
/* === Integration Test Helpers === */
/**
* Fires `success` action for an instance of a copy-button component
* @function triggerSuccess
* @param {Object} context - integration test’s this context
* @param {String|Element} selector - selector o... |
//Base component https://material-ui.com/api/button/
import React from "react";
import PropTypes from "prop-types";
import { withStyles } from "@material-ui/core/styles";
import Button from "@material-ui/core/Button";
import classNames from "classnames";
import servedImage from "../../helpers/imagePathHelper";
import ... |
import { Color, DataTexture, LinearFilter, RGBAFormat } from 'three'
import { defineWorkerModule, terminateWorker, ThenableWorkerModule, Thenable } from 'troika-worker-utils'
import { createSDFGenerator } from './worker/SDFGenerator.js'
import { createTypesetter } from './worker/Typesetter.js'
import { createGlyphS... |
/*!
* Datepicker for Bootstrap v1.8.0 (https://github.com/uxsolutions/bootstrap-datepicker)
*
* Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/
(function(factory){
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else if (typeof... |
/*
This file is part of Ext JS 4
Copyright (c) 2011 Sencha Inc
Contact: http://www.sencha.com/contact
Commercial Usage
Licensees holding valid commercial licenses may use this file in accordance with the Commercial Software License Agreement provided with the Software or, alternatively, in accordance with the term... |
#!/usr/bin/env python
# ECLAIR/src/ECLAIR/Statistical_performance/Gaussian_KDE_HDF5.py;
# Author: Gregory Giecold for the GC Yuan Lab
# Affiliation: Harvard University
# Contact: g.giecold@gmail.com; ggiecold@jimmy.harvard.edu
"""ECLAIR is a package for the robust and scalable
inference of cell lineages from gene... |
# -*- coding: UTF-8 -*-
"""
Model tests for Microformats
Author: Nicholas H.Tollervey
"""
# python
import datetime
# django
from django.test.client import Client
from django.test import TestCase
from django.contrib.auth.models import User
# project
from microformats.models import *
class ModelTestCase(TestCase):
... |
"use strict";
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
_Object$defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _Array... |
// tankokai.com/mt | Demo - Cards Profile Card Title Subtitle | v0.0.0
var Nav1 =
m("header.bg-black-90.w-100.ph3.pv3.pv4-ns.ph4-m.ph5-l",
m("nav.f6.fw6.ttu.tracked", [
m("a.link.dim.white.dib.h2.w2.br-100.mr3.[href='https://tankokai.com/mt/']",
m("svg[data-icon='facebook'][viewBox='0 0 32 32']", { style... |
/**
* Shopware 5
* Copyright (c) shopware AG
*
* According to our dual licensing model, this program can be used either
* under the terms of the GNU Affero General Public License, version 3,
* or under a proprietary license.
*
* The texts of the GNU Affero General Public License with an additional
* permission... |
from __future__ import print_function, division
from sympy.concrete.expr_with_limits import AddWithLimits
from sympy.core.add import Add
from sympy.core.basic import Basic, C
from sympy.core.compatibility import is_sequence, xrange
from sympy.core.containers import Tuple
from sympy.core.expr import Expr
from sympy.cor... |
module.exports={A:{A:{"2":"J E F G A B kB"},B:{"2":"C K L D M N O","194":"P Q T U V W","260":"X Y Z a b c R d H e"},C:{"2":"0 1 2 3 4 5 6 7 8 9 lB dB I f J E F G A B C K L D M N O g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB eB KB fB LB MB S NB OB PB QB RB SB TB UB VB WB XB YB ZB aB P Q T mB U ... |
var __extends=this&&this.__extends||function(){var e=function(r,t){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)if(r.hasOwnProperty(t))e[t]=r[t]};return e(r,t)};return function(r,t){e(r,t);function n(){this.constructor=r}r.prototype=t===null?Object.... |
export const mortart = "#555555";
export const nero = "#222222";
export const veryLightGrey = "#CCCCCC"; |
deepmacDetailCallback("0010d5000000/24",[{"d":"1998-04-22","t":"add","a":"URB. EL CEBADAL\nC/DR. JUAN DGUEZ.PEREZ, 39-2\n35008 LAS PALMAS G.C.\n","c":"SPAIN","o":"IMASDE CANARIAS, S.A."},{"d":"2001-10-24","t":"change","a":"URB. EL CEBADAL\nC/DR. JUAN DGUEZ.PEREZ, 39-2 35008 LAS P\n\n","c":"SPAIN","o":"IMASDE CANARIAS, ... |
var toObject = require('./toObject');
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new function.
*/
function baseProperty(key) {
return function(object) {
return object == n... |
import cv2
import numpy as np
import matplotlib.pyplot as plt
image = cv2.imread('Dhoni.jpg')
image = cv2.cvtColor(image , cv2.COLOR_BGR2RGB)
gray = cv2.cvtColor(image , cv2.COLOR_BGR2GRAY)
eye_cascade = cv2.CascadeClassifier("haarcascade_eye.xml")
eyes = eye_cascade.detectMultiScale(gray)
filter = cv2.cvtColor(cv2.imr... |
import { __makeTemplateObject, __rest } from "tslib";
import styled, { css } from 'styled-components';
import { themed } from '@atlaskit/theme/components';
import * as colors from '@atlaskit/theme/colors';
var disabledColor = themed({ light: colors.N80, dark: colors.N80 });
export var Label = styled.label(templateObjec... |
function StatusModel(data) {
this.type = data ? data.Type : "";
this.data = new DataModel(data ? data.Data : null);
} |
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {ActionTypes} from 'utils/constants.jsx';
export function incrementWsErrorCount() {
return async (dispatch) => {
dispatch({
type: ActionTypes.INCREMENT_WS_ERROR_COUNT,
... |
var Draft75 = require("../../../lib/websocket/driver/draft75"),
test = require('jstest').Test
test.describe("Draft75", function() { with(this) {
define("request", function() {
return this._request = this._request || {
headers: {
"connection": "Upgrade",
"upgrade": "WebSocket",
... |
import slugify from "slugify";
/**
* Get a random number function
* @param {float} min - min number to return
* @param {float} max - max number to return
* @param {boolean} floor - floor the value (default false)
*/
const rand = (min = 0, max = 1, floor = false) => {
const rand = Math.random() * (max - min) + m... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutControlStatements(Koan):
def test_if_then_else_statements(self):
if True:
result = 'true value'
else:
result = 'false value'
self.assertEqual('true value', result)
def test_if_t... |
class AWSError(Exception):
pass |
from django.db import connection
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""Refreshes the materialized view"""
def handle(self, *args, **options):
self.stdout.write('Materialized view refreshing...')
with connection.cursor() as cursor:
cursor... |
// @tags: [
// requires_non_retryable_writes,
// ]
// Test precision of NumberLong values with v1 index code SERVER-3717
t = db.jstests_numberlong2;
t.drop();
t.createIndex({x: 1});
function chk(longNum) {
t.remove({});
t.save({x: longNum});
assert.eq(longNum, t.find().hint({x: 1}).next().x);
asse... |
"""
vn.py - By Traders, For Traders.
The vn.py project is an open-source quantitative trading framework
that is developed by traders, for traders.
The project is mainly written in Python and uses C++ for low-layer
and performance sensitive infrastructure.
Using the vn.py project, institutional investors and professi... |
import get from 'lodash/get';
import graphql, { buildSqonForIds, getErrorMessageFromResponse } from 'services/arranger';
import participantQuery from './participantEntityQuery';
export const fetchParticipantWithId = async (api, participantId) => {
const sqon = buildSqonForIds([participantId]);
return graphql(api)(... |
"""testcases for testing the item module"""
import unittest
import swampymud.item as item
import swampymud.inventory as inv
import swampymud.character as char
class TestItemMetas(unittest.TestCase):
"""testcase for the basic guarantees of the item metaclasses"""
# a bunch of classes and instantiating for test... |
/* Hebrew initialisation for the UI Datepicker extension. */
/* Written by Amir Hardon (ahardon at gmail dot com). */
jQuery(function($){
$.datepicker.regional['he'] = {
clearText: 'נקה', clearStatus: '',
closeText: 'סגור', closeStatus: '',
prevText: '<הקודם', prevStatus: '',
prevBigText: '<&... |
var searchData=
[
['dot',['dot',['../classtgfx_1_1vec2.html#a47296f03e333812866b0334f778779a1',1,'tgfx::vec2']]],
['draw',['draw',['../classtgfx_1_1context.html#a8276dc892a78404a9ee6e4270e8a1eac',1,'tgfx::context::draw()'],['../classtgfx_1_1drawable.html#afe1f4a435a5ec4e7c7f238d32fa5ed06',1,'tgfx::drawable::draw()'... |
// @flow
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import { setCommunicatorInstance } from '../../../../common';
import { getCityStatistics } from '../city_statistics_actions';
const TEST_CITY_ID = 4;
co... |
// import produce from 'immer';
import homeReducer, { initialState } from '../home.reducer';
import {
GET_RECORD_DATA,
GET_RECORD_DATA_SUCCESS,
GET_RECORD_DATA_ERROR,
UPDATE_INCOME_RECORD,
UPDATE_EXPENSE_RECORD,
REMOVE_INCOME_RECORD,
REMOVE_EXPENSE_RECORD,
ADD_INCOME_RECORD,
ADD_EXPENSE_RECORD,
} from... |
(window.webpackJsonp=window.webpackJsonp||[]).push([[88],{3800:function(t,e,r){"use strict";r.r(e),r.d(e,"icon",(function(){return l}));r(9),r(8),r(2);var n=r(0);function a(){return(a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,... |
import { Link } from "react-router";
import prettycron from "prettycron";
import PropTypes from "prop-types";
import React from "react";
import { Tooltip } from "reactjs-components";
import Job from "#SRC/js/structs/Job";
import JobTree from "#SRC/js/structs/JobTree";
import TaskStates from "#PLUGINS/services/src/js/c... |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import TaskFilters from '../../components/task-filters';
import { withRouter } from 'react-router-dom';
import { authActions } from '../../../auth';
import { connect } from 'react-redux';
import { userInterfaceActions } from '../../../user-in... |
import _ from 'lodash';
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import Post from './Post';
import { withRouter } from 'react-router';
export class Posts extends Component {
state = {
sortBy: 'voteScore'
}
renderPosts() {
if (_.keys(this.props.posts).length === 0) {
... |
const path = require('path');
const argv = require('yargs').argv;
const packageJson = require('./package.json');
const webpack = require('webpack');
const TerserJSPlugin = require('terser-webpack-plugin');
const WrapperPlugin = require('wrapper-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-pl... |
import ApiClient from './ApiClient'
import { USER_GET, USER_INFO, USER_LIST, USER_EDIT, USER_RESET_PWD } from '../constants/api'
export function get(params: Object) {
return ApiClient.get(USER_GET, params, { needAuth: true })
}
export function info(params: Object) {
return ApiClient.get(USER_INFO, params)
}
... |
# Copyright (c) Facebook, Inc. and its affiliates.
# 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.
from torch.testing._internal.common_utils import TestCase, run_tests, is_iterable_of_tensors
import torch
import ... |
import os
class Config:
SQLALCHEMY_TRACK_MODIFICATIONS=True
MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USE_SSL = False
MAIL_USERNAME = os.environ.get("MAIL_USERNAME")
MAIL_PASSWORD = os.environ.get("MAIL_PASSWORD")
UPLOADED_PHOTOS_DEST ='app/static... |
$(function () {
'use strict';
window.nuget.configureExpander(
"package-owners",
"ChevronRight",
"Current Owners",
"ChevronDown",
"Current Owners");
window.nuget.configureExpander(
"add-owner",
"ChevronRight",
"Add Owner",
"ChevronDow... |
"""Support for Tahoma switches."""
import logging
from homeassistant.components.switch import SwitchDevice
from homeassistant.const import STATE_OFF, STATE_ON
from . import DOMAIN as TAHOMA_DOMAIN, TahomaDevice
_LOGGER = logging.getLogger(__name__)
ATTR_RSSI_LEVEL = "rssi_level"
def setup_platform(hass, config, a... |
import React, { useState, useEffect, useRef } from "react";
function TodoForm(props) {
const [input, setInput] = useState("");
const inputRef = useRef(null);
useEffect(() => {
inputRef.current.focus();
});
const handleChange = (e) => {
setInput(e.target.value);
};
const handleSubmit = (e) => ... |
// demo data
var data = {
name: 'My Tree',
children: [
{ name: 'hello' },
{ name: 'wat' },
{
name: 'child folder',
children: [
{
name: 'child folder',
children: [
{ name: 'hello' },
{ name: 'wat' }
]
},
{ name: 'he... |
'use strict';
const _ = require('lodash');
class Model {
constructor(data) {
_.assign(this, data);
}
static fromEvent(alexaEvent) {
return new this(alexaEvent.session.attributes.modelData);
}
serialize() {
return this;
}
general(){
let response;
switch ... |
import React, {useState} from 'react';
import Alert from '@site/src/components/Alert';
import DownloadDiagram from '@site/src/components/DownloadDiagram';
import Jump from '@site/src/components/Jump';
import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import Select from 'react-select';
import SVG... |
/**
* Generate a simple random Number between 0 and less than its parameter
* @number {int} maxNumber
* return {int} randomNumberGenerated
*/
function generateSimpleRandomNumber(number){
var randomNumber = Math.floor(Math.random() * number);
console.log(randomNumber);
return randomNumber;
... |
particlesJS.load('particles-js', 'particlesjs-config.json', function() {
console.log('callback - particles.js config loaded');
}); |
// gameZoneClient.js
//
// Created by Rebecca Stankus on 08/19/2018.
// Copyright 2018 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
(function() {
var HALF_MULTIPLIER = 0.5;
var TRIVIA... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from core import models
def sample_user(email='mmolledo@gmail.com', password='mmolledo'):
return get_user_model().objects.create_user(email, password)
class ModelTests(TestCase):
def test_create_user_with_email_successful(self... |
const rookout = require('rookout/lambda');
async function handler(event, context) {
console.log("EVENT: \n" + JSON.stringify(event, null, 2))
return context.logStreamName}
exports.handler = rookout.wrap(handler);
|
import argparse
import os
import warnings
import mmcv
import torch
from mmcv import Config, DictAction
from mmcv.cnn import fuse_conv_bn
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import (get_dist_info, init_dist, load_checkpoint,
wrap_fp16_model)
fro... |
import datetime
import random
import string
from django.contrib.auth.models import Group
from django.test import TestCase
from institution.models import Institution
from institution.tests.test_models import InstitutionTests
from project.forms import ProjectCreationForm
from project.forms import ProjectUserMembershipC... |
module.exports = {
Bucketer: require('./data/Bucketer.js'),
Feed: require('./data/Feed.js'),
Hasher: require('./data/Hasher.js'),
List: require('./data/List.js'),
Linear: require('./data/Linear.js'),
Loader: require('./data/Loader.js'),
Manager: require('./data/Manager.js'),
Normalizer: require('./data/Normaliz... |
/**
* Redux is by Dan Abramov; I'm using it under the MIT license, reproduced below.
*
* The MIT License (MIT)
*
* Copyright (c) 2015-present Dan Abramov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to ... |
'''
Atomix project, cmds.py, (TODO: summary)
Copyright (c) 2015 Stanford University
Released under the Apache License v2.0. See the LICENSE file for details.
Author(s): Manu Bansal
'''
import sys
import imp
import time
jsutil = imp.load_source('jsutil','jsutil.py')
def cmd_help(jsproc, options, args):
selfmodule = ... |
import React from "react";
import { mount } from "enzyme";
import toDiffableHtml from "diffable-html";
import { AlertStore } from "Stores/AlertStore";
import { Settings } from "Stores/Settings";
import { ThemeContext } from "Components/Theme";
import {
ReactSelectColors,
ReactSelectStyles
} from "Components/Them... |
/**
* Copyright 2016 The AMP HTML 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 require... |
//Import modules
const express = require('express');
const session = require('express-session');
const morgan = require('morgan');
const path = require('path');
const db = require('./utils/db');
const MongoStore = require('connect-mongo')(session);
const passport = require('passport');
//Add middleware to app:
const a... |
const form = document.querySelector(".todo-form");
const input = document.querySelector(".todo-input");
let toDos = [];
let dragged;
function persistToDos() {
const stringToDo = JSON.stringify(toDos);
window.localStorage.setItem("toDos", stringToDo); // eslint-disable-line no-unused-vars
}
function saveToDo(inde... |
import React from 'react';
const VideoDetail = ({ video }) => {
if(!video) {
return <div>Loading...</div>;
}
const videoId = video.id.videoId;
const url = `https://www.youtube.com/embed/${videoId}`;
return (
<div className="video-detail col-md-8">
<div className="embed-responsive embed-respon... |
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'showblocks', 'en', {
toolbar: 'Show Blocks'
} );
|
// Base16 Mellow Purple
// Scheme: gidsi
var color_scheme = {
'base00': '#1e0528',
'base01': '#1A092D',
'base02': '#331354',
'base03': '#320f55',
'base04': '#873582',
'base05': '#ffeeff',
'base06': '#ffeeff',
'base07': '#f8c0ff',
'base08': '#00d9e... |
import numpy as np
# import pandas as pd
# import matplotlib.pyplot as plt
def func_transformer(func):
prefered_function_format = """
def demo_func(x):
x1, x2, x3 = x[:, 0], x[:, 1], x[:, 2]
return x1 ** 2 + (x2 - 0.05) ** 2 + x3 ** 2
"""
is_vector = getattr(func, "is_vector", False... |
// modules
import {AppContainer} from 'react-hot-loader';
import React from 'react';
import ReactDOM from 'react-dom';
import {Provider} from 'react-redux';
import {syncHistoryWithStore} from 'react-router-redux';
import {browserHistory} from 'react-router';
// api
import FirebaseApi from './api/firebase';
// actions... |
import numpy as np
import tensorflow as tf
from keras.layers.advanced_activations import PReLU
from models.layers.summarization import create_var_summaries
# ----------------------------------------------------------------------------
def conv1d(x, n_filters, n_size, stride=1, nl='relu', name='conv1d'):
n_batch, ... |
const HelloBlockchain = artifacts.require("HelloBlockchain");
contract('HelloBlockchain', (accounts) => {
it('testing ResponseMessage of HelloBlockchain', async () => {
const HelloBlockchainInstance = await HelloBlockchain.deployed();
var returnValue1;
returnValue1 = await HelloBlockchainIn... |
"use strict";
var request = require("request");
var http = require("http");
var querystring = require("querystring");
// If caller has installed googleapis, we do some sanity checking to make sure it's a version we know.
try {
if (process.env.NODE_ENV !== "production") {
var semver = require("semver");
var ... |
import os
import re
import logging
import binascii
import hashlib
import json
import datetime
import decimal
from repoze.lru import lru_cache
from pycoin import encoding
from counterblock.lib import config, util
D = decimal.Decimal
decimal.getcontext().prec = 8
logger = logging.getLogger(__name__)
def round_out(nu... |
class hudControl {
constructor(bm, x, y){
this.bm = bm;
this._x = x;
this._y = y;
this.lineWidth = this.bm.lineWidth;
this.globalLineWidth = this.bm.lineWidth;
this._fontSize = 12;
}
set lineWidth(lineWidth){
this.localLineWidth = lineWidth;
}
... |
from unittest.mock import patch
from allauth.exceptions import ImmediateHttpResponse
from allauth.socialaccount.models import SocialAccount, SocialLogin
from django.contrib.auth.models import User
from django.contrib.messages.storage.base import BaseStorage
from django.http import HttpRequest
from django.test import T... |
#!/usr/bin/env node
const fs = require('fs')
const getStdin = require('get-stdin')
const figureParser = require('it-figures/bin/parser').default
const path = require('path')
const yamlFront = require('yaml-front-matter')
getStdin().then(content => {
const frontMatter = yamlFront.loadFront(content)
let figures = (... |
'use strict'
const http = require("http")
const fs = require("fs")
const queryString = require("querystring")
http.createServer(function (req, res) {
if (req.method == "GET") {
res.writeHead(200, {
"Content-Type": "text/html"
})
fs.createReadStream(__dirname + "/index.html").p... |
import PropTypes from "prop-types";
import {
renderLogoITEandPartner,
renderFullCertAwardText,
renderTwoNiecSignatures,
renderITEFooter
} from "../common/certificate";
const Template = ({ certificate }) => (
<div>
<div
className="container"
style={{ border: 5, borderColor: "#AAA", borderStyle... |
import _ from 'lodash';
import { toast } from 'react-toastify';
import {
FAILED_TO_FETCH_MESSAGE_RAW,
FAILED_TO_FETCH_MESSAGE_PRETTY,
UNEXPECTED_ERROR_MESSAGE,
} from '../constants/messages';
const showErrorToast = payload => {
let message = UNEXPECTED_ERROR_MESSAGE;
if (_.isString(payload)) {
message = ... |
/*
Copyright 2013 Daniel Wirtz <dcode@dcode.io>
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... |
import React from 'react';
import { storiesOf } from '@storybook/react';
import { Icon } from '../../src';
import info from './info.md';
storiesOf('Icon', module)
.addParameters({
component: Icon,
notes: {
markdown: info
}
})
.add('default', () => <Icon name="leaf" />)
.add('colored', () => <... |
/**
* HTTP Cloud Function.
* This function is exported by index.js, and is executed when
* you make an HTTP request to the deployed function's endpoint.
*
* @param {Object} req Cloud Function request context.
* @param {Object} res Cloud Function response context.
*/
exports = module.exports = (req, res) => {
r... |
import { TaskManager, Constants, Logger, PlatformManager } from 'rnv';
import { SDKXcode } from '../sdks';
const { logErrorPlatform } = PlatformManager;
const { logTask } = Logger;
const {
IOS,
MACOS,
ANDROID,
ANDROID_TV,
FIRE_TV,
ANDROID_WEAR,
TASK_BUILD, TASK_EXPORT,
PARAMS
} = Consta... |
'use strict';
process.env.NODE_ENV = 'test';
const path = require('path');
const config = require('../../../../../config');
const server = require(config.app.path);
const models = require(path.join(config.app.path, 'models'));
const User = models.user
const chai = require('chai');
const expect = chai.expect;
const ch... |
"""
AMR kD-Tree Framework
"""
from __future__ import print_function
from __future__ import absolute_import
#-----------------------------------------------------------------------------
# Copyright (c) 2013, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in ... |
ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
exports.isDark = true;
exports.cssClass = "ace-monokai";
exports.cssText = ".ace-monokai .ace_gutter {\
background: #2F3129;\
color: #8F908A\
}\
.ace-monokai .ace_print-margin {\
width: 1px;\
background: #... |
Ext.define('Ext.layout.container.SegmentedButton', {
extend: 'Ext.layout.container.Container',
alias: 'layout.segmentedbutton',
needsItemSize: false,
setsItemSize: false,
_btnRowCls: Ext.baseCSSPrefix + 'segmented-button-row',
getRenderTree: function() {
var me = this,
res... |
var struct__OVS__DEVICE__EXTENSION =
[
[ "numberOpenInstance", "struct__OVS__DEVICE__EXTENSION.html#a1dee822846a6e3073e1f1618d246465a", null ],
[ "pidCount", "struct__OVS__DEVICE__EXTENSION.html#affaf52cb10b0df1756aa72ac3b352549", null ]
]; |
import React, { Component } from "react";
import PropTypes from "prop-types";
// TODO: Search needs to have a magnifying glass icon
// Acceptance criteria "c. Ability to view the results of the search on key up" assume this means key up of enter key? Check with PO/Designer
// TODO For key-up search, be aware of rate ... |
import _ from 'lodash'
import express from 'express'
import User from '../../../models/user'
import Notification from '../../../models/notification'
const router = express.Router()
router.get('/', async (req, res) => {
let user = await User.getUserById(req.user.id)
if (_.isEmpty(user)) {
return res.status(404... |
'use strict'
const Sequelize = require('sequelize')
const DataTypes = Sequelize.DataTypes
module.exports = function (app) {
const sequelizeClient = app.get('sequelizeClient')
const Burgs = sequelizeClient.define('burgs', {
id: {
type: DataTypes.BIGINT,
autoIncrement: true,
primaryKey: true
... |
let Discord = require("discord.js");
module.exports.gban = (message, client) => {
let embed = new Discord.MessageEmbed();
embed.setTitle(`Globalban`);
embed.setDescription(`You can't use this bot.\nYou can appeal here https://discord.gg/NEGmf5A`);
embed.setColor("#FF0000");
if (client.config.settin... |