text stringlengths 3 1.05M |
|---|
'use strict';
var aFrom = require('es5-ext/array/from')
, source = require('./__playground');
module.exports = function (t, a) {
var testType, testObj;
testType = function (Type) {
a.h2("Constructor");
a(Type.regularType, 'bar', "Value");
a(Type.getOwnDescriptor('regularType').type, source.String, "Type")... |
''' Else Statements
Code that executes if contitions checked evaluates to False.
if(Condition)
''' |
'''
Created on Feb 20, 2016
@author: Rahul Tanwani
'''
from __future__ import absolute_import, unicode_literals
from abc import ABCMeta
from concurrent.futures._base import Executor as BaseExecutor, Future
from concurrent.futures.process import ProcessPoolExecutor
from concurrent.futures.thread import ThreadPoolExec... |
#!/usr/bin/python
#encoding:utf-8
import re
import urllib
import urllib2
import requests
import cookielib
from bs4 import BeautifulSoup
class CSDN(object):
"""
csdn网站抓取工具
"""
def __init__(self, username, password):
self.username = username
self.password = password
self.login_ur... |
# Copyright (c) 2014-2015 Bruno Daniel <bruno.daniel@blue-yonder.com>
# Copyright (c) 2015-2016, 2018, 2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2016 Ashley Whetter <ashley@awhetter.co.uk>
# Copyright (c) 2020 hippo91 <guillaume.peillex@gmail.com>
# Licensed under the GPL: https://www.gnu.org/licenses/... |
# -*- coding: utf-8 -*-
"""
Parse, stream, create, sign and verify Bitcoin transactions as Tx structures.
The MIT License (MIT)
Copyright (c) 2013 by Richard Kiss
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to dea... |
from colossalai.amp import AMP_TYPE
# ViT Base
BATCH_SIZE = 128
DROP_RATE = 0.1
NUM_EPOCHS = 2
fp16 = dict(
mode=AMP_TYPE.NAIVE,
)
clip_grad_norm = 1.0
|
/*
This is a list of all the capsizumized zlib interfaces.
Every one of the capsicumized functions will have a define.
This list is taken from zlib.h, in this same directory.
All this defines represent the commands passed to the real
zlib listening through a program, and it will recognize them.
Also, the define... |
#!/usr/bin/env python
u"""
bilinear_interp.py (03/2021)
Bilinear interpolation of input data to output coordinates
CALLING SEQUENCE:
data = bilinear_interp(ilon,ilat,idata,lon,lat)
INPUTS:
ilon: longitude of tidal model
ilat: latitude of tidal model
idata: tide model data
lat: output latitude
... |
import AHandler from '../../../Structures/Event/AHandler';
class ShardPreReadyHandler extends AHandler {
handle() {
return null;
}
}
export default ShardPreReadyHandler;
|
import React, { Component } from 'react'
import FaHome from 'react-icons/md/arrow-back'
import { Motion, spring } from 'react-motion'
import Button from 'components/Button'
const springConfig = { stiffness: 290 }
class BackButton extends Component {
state = {
isOver: false,
}
handleMouseEnter = () => this... |
from django.db import models
# Create your models here.
class Transaction(models.Model):
user = models.ForeignKey('users.Account', on_delete=models.CASCADE)
transaction_id = models.CharField(max_length=100)
method = models.CharField(max_length=100)
amount = models.CharField(max_length=100)
status =... |
"""
pygame-menu
https://github.com/ppizarror/pygame-menu
TEST WIDGET SELECTION.
Test widget selection effects.
License:
-------------------------------------------------------------------------------
The MIT License (MIT)
Copyright 2017-2021 Pablo Pizarro R. @ppizarror
Permission is hereby granted, free of charge, t... |
import sentencepiece as spm
import os
from collections import defaultdict
from math import sqrt
import numpy as np
from tqdm import tqdm
from math import log2 as log
from translation.utils import Opt
def preprocessCountDictionary(counts):
sum1 = sum(counts.values())
output = np.array([counts[i] / sum1 for i i... |
# Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... |
import React, { useState } from 'react';
import _ from 'lodash';
import { Checkbox, Content, Container, Dropdown, Icon, Input, InputGroup, Grid, Row, Col, Panel, Table } from 'rsuite';
import { allEpCategories } from '../data/constants';
import ItemTooltip from './item_tooltip';
import { filterByItemName, filter1HOnly,... |
const Shard = require('./Shard');
class WebSocketManager {
constructor(client) {
this.client = client;
/**
* A map of active server shards.
* @type {Map<string, Shard>}
*/
this.shards = new Map();
this.totalShards = 0;
this.readyAt = 0;
}
... |
define(['df', 'df-lodash', 'Df_Checkout/data'], function(df, _, dfc) {'use strict'; return(
function(plan, rateToCurrent) {return {
amount: df.c(function() {return Math.round(
dfc.grandTotal() * (1 + plan.rate / 100) + plan.fee * rateToCurrent * plan.numPayments
);}),
amountS: function() {return dfc.formatMo... |
/*
* This source code is public domain.
*
* Authors: Olivier Lapicque <olivierl@jps.net>
*/
#include "libmodplug.h"
#ifdef SNDFX_C
static const BYTE ImpulseTrackerPortaVolCmd[16] =
{
0x00, 0x01, 0x04, 0x08, 0x10, 0x20, 0x40, 0x60,
0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
};
// Period table for Protracker... |
/*
* iSCSI transport class definitions
*
* Copyright (C) IBM Corporation, 2004
* Copyright (C) Mike Christie, 2004 - 2005
* Copyright (C) Dmitry Yusupov, 2004 - 2005
* Copyright (C) Alex Aizman, 2004 - 2005
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU... |
from __future__ import print_function
import numpy as np
import random
from tqdm import tqdm
import os
#import cPickle as cp
#import _pickle as cp # python3 compatability
import networkx as nx
import pdb
import argparse
cmd_opt = argparse.ArgumentParser(description='Argparser for graph_classification')
cmd_opt.add_ar... |
# coding=utf-8
# 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 ... |
/*
* BMKLocationViewDisplayParam.h
* BMapKit
*
* Copyright 2013 Baidu Inc. All rights reserved.
*
*/
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
///此类表示定位图层自定义样式参数
@interface BMKLocationViewDisplayParam : NSObject
{
float _locationViewOffsetX; // 定位图标偏移量(经度)
float _locationViewOffset... |
var Helix_Shopify_Product_Image =
[
[ "DIR", "Helix_Shopify_Product_Image.html#c482d92", null ],
[ "TYPE", "Helix_Shopify_Product_Image.html#0cb7892", null ],
[ "_container", "Helix_Shopify_Product_Image.html#9f43825", null ],
[ "_metafieldType", "Helix_Shopify_Product_Image.html#6c90164", null ],
[... |
// Copyright 2017 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.
/**
* @fileoverview
* 'cr-camera' is a Polymer element used to take a picture from the
* user webcam to use as a Chrome OS profile picture.
*/
(functi... |
const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const productionEnvPlugin = new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
},
});
const PATHS = {
b... |
"""
A two-dimensional vector class
>>> v1 = Vector2d(3, 4)
>>> print(v1.x, v1.y)
3.0 4.0
>>> x, y = v1
>>> x, y
(3.0, 4.0)
>>> v1
Vector2d(3.0, 4.0)
>>> v1_clone = eval(repr(v1))
>>> v1 == v1_clone
True
>>> print(v1)
(3.0, 4.0)
>>> octets = bytes(v1)
>>> octe... |
/*
*
* MIT License
*
* Copyright (c) 2020 Mirgor
*
* 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... |
$(document).ready(function() {
//Setting up the Wysibb Editor.
$('#editor').wysibb({
buttons : 'bold,italic,underline,strike,|,fontcolor,fontsize,fontfamily,|,justifyleft,justifycenter,justifyright,|,bullist,|,img,link,|,code,quote',
tabInsert: false
});
//The syntex highlighting in <pr... |
import socket
import json
import threading
from gui import *
gui = GUI()
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
def main():
client.connect(('localhost', 8888))
readIncomingThread = threading.Thread(target=read_incoming)
readIncomingThread.start()
gui.pack()
gui.inputField.bi... |
graph = {
'f': ['g', 'i'],
'g': ['h'],
'h': [],
'i': ['g', 'k'],
'j': ['i'],
'k': []
}
def has_path(graph, start, end):
queue = [start]
while len(queue) > 0:
current = queue[0]
queue.pop(0)
if current == end:
return True
for adj in graph[curr... |
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='stix-pattern-translator... |
var structovs__cmdl__context =
[
[ "argc", "structovs__cmdl__context.html#aaa77261fe624d9665f93e259c7f4cf25", null ],
[ "argv", "structovs__cmdl__context.html#aadc790bc240e17aff1c90ab9a5a113bc", null ],
[ "pvt", "structovs__cmdl__context.html#a2a8b690780113b476ff67ffd7b38ba35", null ]
]; |
const { resolve } = require('path');
const test = require('tape');
const { unlink, write } = require('../../');
const dir = resolve(process.cwd(), './test/data/');
const filepath1 = resolve(dir, './unlink.txt');
test('setup unlink', (t) => {
write(filepath1, 'file content\n')
.then(() => t.end())
.catch(t.e... |
'use strict';
// ---------------------------------------------------------------------------
const Exchange = require ('./base/Exchange');
const { ExchangeError, AuthenticationError, InsufficientFunds, ExchangeNotAvailable, InvalidOrder, BadRequest, OrderNotFound, NotSupported } = require ('./base/errors');
// ---... |
"""
Build a dummy index and run tests on it.
"""
import os
import shutil
import tempfile
from subprocess import check_call
import pytest
import captions
import captions.decode as decode
from lib.common import get_docs_and_lexicon
TMP_DIR = None
TEST_SUBS_SUBDIR = 'subs'
TEST_INDEX_SUBDIR = 'index'
TEST_DATA_PATH = ... |
var config = require('../../config');
var nock = require('nock');
var rewire = require('rewire');
var sinon = require('sinon');
var test = require('tape');
var events = rewire('../../lib/events');
// do not allow real http requests
nock.disableNetConnect();
test('events: error is returned if failed to get user detai... |
def main():
# input
N = int(input())
Ts = [*map(int, input().split())]
M = int(input())
PXs = [[*map(int, input().split())] for _ in range(M)]
# compute
# output
for P, X in PXs:
tmp_Ts = list(Ts)
tmp_Ts[P-1] = X
print(sum(tmp_Ts))
if __name__ == '__main__':
... |
var gulp = require("gulp");
var pkg = require("./package.json");
var uglify = require("gulp-uglify");
var minifycss = require('gulp-minify-css');
var del = require('del');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var header = require('gulp-header');
//var banner = ['/**',
// ... |
import React from 'react';
const GridItemImageView = ({imageFolder, name, fileType}) => {
let imageName = name.replace(/ /g, "-").replace(/'/g,"").toLowerCase();
fileType = fileType || 'png';
return (
<td>
<img alt={imageName} className="resource-icon" src={`${imageFolder}/${imageName}.${fileType}`}... |
'use strict';
const express = require('express');
const router = express.Router();
const log = require('../../libs/log.js')(module);
const copy = require('../../models/project/copy.js').copy;
router.post('/', function(req, res, next) {
const id = req.body.projectId;
copy(id, function(err) {
if (err) {
r... |
/*eslint no-unused-vars: "warn"*/
const esb = require('elastic-builder');
const { RESOURCES } = require('../../constants');
const { resolveSchema } = require('../../node-fhir-server');
const { search: querySearch, searchReferenecePromise, searchId, create, _delete, update} = require('../../utils/es.helper.functions.uti... |
"""Class to perform over-sampling using SMOTE."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# Fernando Nogueira
# Christos Aridas
# Dzianis Dudnik
# License: MIT
import math
from collections import Counter
import numpy as np
from scipy import sparse
from sklearn.base import ... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
(function () {
if (navigator.userAgent.match(/(iPad|iPhone|iPod).*?moschat_ios/g)) {
/**
* YYApiCore
*/
YYApiCore = {
__GLOBAL_FUNC_INDEX__: 0,
invokeClientMethod: function(module, name, parameters, callback) {
var url = 'yyapi://' + module + '/' + name + '?p=' + encodeURIComponent(JSON.stringify... |
# -*- coding: utf-8 -*-
import logging
from CommonLibrary.CommonConfiguration import result_path
class LogUtility(object):
def __init__(self):
self.logger = logging.getLogger()
self.logger.setLevel(logging.DEBUG)
def create_logger_file(self, filename):
try:
full_log_nam... |
/** @license MUI v5.0.0-alpha.65
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
val... |
def insertionSort(myArray):
# take second element and store it in a variable
for step in range(1, len(myArray)):
key = myArray[step]
j = step - 1
# Compare variable with each element on the left of it until an element smaller than it is found
# For descending order, chang... |
# coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class QataskRetry30timeout60taskRef(object):
"""
NO... |
// Copyright (c) 2013 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 NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_
#define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_
#include <map>
#include <string>
#include "base/basictyp... |
import pytest
def test_gene_upgrade_remove_go_annotations(
upgrader,
gene_1,
):
new_gene = upgrader.upgrade(
'gene', gene_1, current_version='1', target_version='2'
)
assert new_gene['schema_version'] == '2'
assert 'go_annotations' not in new_gene
|
from typing import Optional
from parchmint.params import Params
class Layer:
def __init__(self, json_data=None) -> None:
"""Creates a new instance Layer
Args:
json (dict, optional): json dict after json.loads(). Defaults to None.
"""
self._id: Optional[str] = None
... |
"""
License: Apache-2.0
Author: Suofei Zhang | Hang Yu
E-mail: zhangsuofei at njupt.edu.cn | hangyu5 at illinois.edu
"""
import tensorflow as tf
import tensorflow.contrib.slim as slim
from config import cfg, get_dataset_size_train, get_num_classes, get_create_inputs
import time
import numpy as np
import sys
import os
... |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class FeedItem(scrapy.Item):
# required
title = scrapy.Field()
content = scrapy.Field()
trims = scrapy.Field()
url = scrapy.Field()... |
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 Dan Halbert for Adafruit Industries
* Copyright (c) 2018 Artur Pacholec
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated ... |
/*
* Copyright (c) 2000-2018 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file exc... |
# -*- coding: utf-8 -*-
from screws.freeze.main import FrozenOnly
from tools.linear_algebra.elementwise_cache.objects.sparse_matrix.main import EWC_SparseMatrix
class CSCG_Trace_Form_Coboundary_BASE(FrozenOnly):
""""""
def __init__(self, tf):
self._tf_ = tf
self._T_ = None
self.___PR... |
#ifndef CHARPANEL_H
#define CHARPANEL_H
#include <QPushButton>
#include "cchar.h"
#include "button.h"
class MainWindow;
class CharPanel:public QWidget
{
Q_OBJECT
public:
CharPanel(MainWindow *,QFont &);
void load(const std::vector<wchar_t>& table,size_t page);
void clear();
QPoint center();
private:... |
import assign from "lodash/assign";
import clone from "lodash/clone";
import concat from "lodash/concat";
import delay from "lodash/delay";
import debounce from "lodash/debounce";
import map from "lodash/map";
import times from "lodash/times";
import transform from "lodash/transform";
import isArray from "lodash/isArra... |
let App = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
order_id: null,
order: {},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.data.order_id = options.order_id;
this.getOrderDetail(options.order_id);
},
/**
* 获取订单详情
*/
getOrderDetail: function (order_id... |
import inspect
from json import loads as json_loads
from json import JSONDecodeError
from collections import namedtuple
from functools import partial
from pydantic import ValidationError
from .base import BasePlugin, Context
from .page import PAGES
METHODS = {'get', 'post', 'put', 'patch', 'delete'}
Route = namedtup... |
import os
from datetime import timedelta
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'hhz7l-ltdismtf@bzyz+rple7*s*w$jak%whj@(@u0eok^f9k4'
DEBUG = True
ALLOWED_HOSTS = []
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttype... |
import os
# enables comments and blank lines in plan files
def loadScript ( path ):
# read query plan
with open ( path, "r") as planFile:
script = planFile.read()
script = os.linesep.join([s for s in script.splitlines() if s and s != "\n" ])
script = os.linesep.join([s for s in script.s... |
var fs = require('fs');
var pool = require('../../common/commonFunction').pool;
const path = require('path');
var _ = require('underscore');
module.exports = function (req, res) {
console.log("m in add product");
var data1 = [];
const path = require('path');
fs.readFile('data.json', 'utf8', function (err, data) {
... |
#!/usr/bin/python
# vim: expandtab:tabstop=4:shiftwidth=4
''' sysconfig_fact module
The purpose of this module is to read the contents of an /etc/sysconfig file
and set Ansible facts for each value.
'''
from StringIO import StringIO
import ConfigParser
def main():
''' Main function of this module.
... |
from conans import python_requires
import os
common = python_requires('llvm-common/0.0.2@orbitdeps/stable')
class LLVMScalarOpts(common.LLVMModulePackage):
version = common.LLVMModulePackage.version
name = 'llvm_scalar_opts'
llvm_component = 'llvm'
llvm_module = 'ScalarOpts'
llvm_requires = ['llvm... |
import WebFontLoaderPlugin from '../../plugins/webfontloader-plugin.js';
var preload = function () {
this.add.text(100, 0, 'default font', {
fontSize: '60px'
});
this.add.text(100, 100, 'preload stage ', {
fontFamily: 'Bangers',
fontSize: '60px'
});
var config = {
... |
import React from "react";
import ParallaxComponent from "../components/parallaxComponent/ParallaxComponent";
import Layout from "../components/layoutIndex/layoutIndex";
import Service from "../components/cardService/CardService";
import ServiceIcon from "../components/serviceIcon/ServiceIcon";
import RecentWork from "... |
import {Point} from "./../base";
import {toRadians} from "./../helpers";
import Sun from "./Sun";
import Planet from "./Planet";
import Orbit from "./Orbit";
import Star from "./Star";
class SolarSystem {
/** @var {Sun} */
sun = null;
/** @var {Planet[]} */
planets = [];
/** @var {Star[]} */
st... |
function fib(arr, n) {
if (!n){
return;
}
console.log(arr);
var c = arr[1];
arr[1] = arr[0] + arr[1];
arr[0] = c;
var temp = [1, 2, 3];
for (var v of temp) {
console.log(v + 4);
}
return fib(arr, n-1);
}
fib([0, 1], 8); |
/* Generated by RuntimeBrowser
Image: /System/Library/PrivateFrameworks/CalendarDatabase.framework/CalendarDatabase
*/
@interface EKPersistentChangeStoreRowInfo : NSObject {
NSString * _clientIdentifier;
int _consumedSequenceNumber;
}
@property (nonatomic, retain) NSString *clientIdentifier;
@property (n... |
import React, { useEffect, useState } from "react";
import {
TouchableOpacity,
StyleSheet,
TextInput,
View,
Image,
Dimensions,
} from "react-native";
import { Input, Button, Text, useTheme } from "react-native-elements";
import { BButton } from "../../components/index";
import { AntDesign, Ionicons, Materia... |
# -*- coding: utf-8 -*-
#
# Copyright (C) tkornuta, IBM Corporation 2019
#
# 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... |
"use strict"
exports.__esModule = true;
exports.AwardIconConfig = {
name: 'AwardIcon',
height: 512,
width: 384,
svgPath: 'M97.12 362.63c-8.69-8.69-4.16-6.24-25.12-11.85-9.51-2.55-17.87-7.45-25.43-13.32L1.2 448.7c-4.39 10.77 3.81 22.47 15.43 22.03l52.69-2.01L105.56 507c8 8.44 22.04 5.81 26.43-4.96l52.05-127.62c-... |
// EVENTS
$('#message').on('keyup', function(event) {
if(event.charCode == 13) {
submitMessage();
}
});
$('#send').on('click', submitMessage);
// FUNCTIONS
function submitMessage() {
var $input = $('#message');
var message = $input.val();
if(!message == "") {
socket.emit('chat message', message); // emits a ... |
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const ReactComponent = props => (react_1.default.crea... |
import argparse
import datasets
from transformers import BertTokenizer
from bs4 import BeautifulSoup
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--dataset', type=str, required=True)
parser.add_argument('--tokenizer', type=str, required=True)
return parser.parse_... |
/* Work queue helper functions
*
* Copyright (c) 2018 Joachim Nilsson <troglobit@gmail.com>
*
* 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 lim... |
//>>built
define(["dojo","dijit","dojox"],function(f,z,t){f.provide("dojox.lang.docs");(function(){function u(d){console.log("Warning, the API docs must be available at ../util/docscripts/api.json or ../util/docscripts/api/*.json in order for dojox.lang.docs to supply schema information, but it could not be loaded: "+d... |
from flask import Flask, request
from flask.templating import render_template
from flask.helpers import make_response
from sympy import symbols,integrate
from sympy.parsing.sympy_parser import (parse_expr)
from flaskwebgui import FlaskUI
app = Flask(__name__)
ui = FlaskUI(app)
@app.route('/', methods=['POST', 'GET'])... |
import pdf_to_json as p2j
import json
url = "file:data/multilingual/Latn.SUN/Sans_8/udhr_Latn.SUN_Sans_8.pdf"
lConverter = p2j.pdf_to_json.pdf_to_json_converter()
lConverter.mImageHashOnly = True
lDict = lConverter.convert(url)
print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
|
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import torch
from torch import nn
from torch.autograd.function import Function
import logging
import pickle
import json
from detectron2.layers import ShapeSpec, SELayer
from detectron2.structures import Boxes, Instances, pairwise_iou
from detectron... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _iceCap = require('ice-cap');
var _iceCap2 = _interopRequireDefault(_iceCap);
var _DocBuilder = require('./DocBuilder.js');
var _DocBuilder2 = _interopRequireDefault(_DocBuilder);
function _interopRequireDefault(obj) { return obj &... |
/**
* Auto-generated action file for "U.S. EPA Enforcement and Compliance History Online (ECHO) - Detailed Facility Report (DFR)" API.
*
* Generated at: 2019-05-07T14:40:23.865Z
* Mass generator version: 1.1.0
*
* flowground :- Telekom iPaaS / epa-gov-dfr-connector
* Copyright © 2019, Deutsche Telekom AG
* cont... |
var request = require('request');
var jsonfile = require('jsonfile');
exports.swagger = true;
exports.login = true;
exports.desc = "Add a user";
exports.run = function(config, info) {
var email = info.args[1];
console.log("Granting " + email.yellow + " push access to " + info.swagger['x-api-id'].yellow + "!");
... |
'''
HTTP handeler to serve general endpoints request, specifically
http://myserver:9004/endpoints
For how individual endpoint requests are served look
at endpoint_handler.py
'''
import json
import logging
from tabpy.tabpy_server.common.util import format_exception
from tabpy.tabpy_server.handlers import ManagementHan... |
/*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkTLList_DEFINED
#define SkTLList_DEFINED
#include "include/core/SkTypes.h"
#include "include/private/SkMalloc.h"
#include "include/private/SkTemplates.h"
#include "s... |
//-----------------------------------------------------------------------
// Copyright 2016 Sitecore Corporation A/S
// 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... |
import React, { memo, useCallback, useMemo, useState, useEffect } from 'react';
import get from 'lodash/get';
import isEqual from 'react-fast-compare';
import PropTypes from 'prop-types';
import { Stack } from '@strapi/design-system/Stack';
import { Box } from '@strapi/design-system/Box';
import { NotAllowedInput, useN... |
const config = {
development: {
PORT: 5000,
DB_CONNECTION_URL: "mongodb://localhost/video_tutorials",
JWT_SECRET: "keyboard cats"
},
production: {
PORT: 80,
DB_CONNECTION_URL: "mongodb://localhost/video_tutorials",
JWT_SECRET: "keyboard cats"
}
}
module.exports = config[process.env.NODE... |
function*g(){ var yield; } |
# 2020.07.21
# Problem Statement:
# https://leetcode.com/problems/letter-combinations-of-a-phone-number/
class Solution:
# initialize global answer to return
answer = []
def letterCombinations(self, digits: str) -> List[str]:
# base case
if len(digits) == 0:
temp = So... |
import numpy as np
def test_broadcast_arguments():
from pytest import raises
from skypy.utils import broadcast_arguments
@broadcast_arguments('a', 'b')
def assert_same_shape(a, b):
assert a.shape == b.shape
a = [1, 2, 3]
b = [[4], [5], [6]]
assert_same_shape(a, b)
a = [[1... |
'use strict';
angular.module('app.controllers.header', [])
.controller( 'HeaderCtrl', function($scope, _, Settings) {
$scope.settings = Settings.UI.header;
});
|
import lldb
from lldbsuite.test.decorators import *
import lldbsuite.test.lldbtest as lldbtest
import lldbsuite.test.lldbutil as lldbutil
import unittest2
class TestSwiftPrivateDiscriminator(lldbtest.TestBase):
NO_DEBUG_INFO_TESTCASE = True
mydir = lldbtest.TestBase.compute_mydir(__file__)
@swiftTest
... |
"""Helper general purpose functions"""
import glob
import importlib
import json
import os
import re
import traceback
import types
from datetime import datetime
from distutils.version import StrictVersion
def get_timestamp():
time_format = "%Y.%m.%d.%H.%M.%S.%f"
timestamp = datetime.today().strftime(time_forma... |
from datetime import timedelta
import logging
from django.contrib.auth.models import User
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext
from django.utils.timesince import timesince
from activeusers import utils
from activeusers.utils import string_with_titl... |
import React, { useState } from "react";
import {
Button,
Layout,
Row,
Col,
Typography,
Card,
Input,
Divider,
Carousel,
Space,
} from "antd";
import { LeftSquareOutlined } from "@ant-design/icons";
const { Search } = Input;
const RightCardPages = (props) => {
const { title, link } = props;
const... |
from __future__ import print_function
from pprint import pprint
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
# parameters
m = 10
k = 4
o = 2
p = 2
verbose = True
p_indicator = np.ones(m) * p
position = 0
capacity = 0
array = np.array([]).reshape(0, m)
# while(position < m):
# Lay the first s... |