text stringlengths 3 1.05M |
|---|
/**
* Copyright 2017 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 React from "react";
const LogoutButton = () => {
const logout = async () => {
const domain = "ambient-coder.us.auth0.com";
const clientId = "your-client-id";
const returnTo = "http://localhost:3000";
const response = await fetch(
`https://${domain}/logout?client_id=${clientId}&returnTo=... |
from random import Random
l = [2, 3, 5, 7, 11]
for x in l:
print(x)
s = "Hallo!"
for c in s:
print(c)
class Wuerfel(object):
def __init__(self):
self.r = Random()
def __iter__(self):
return self
def __next__(self):
return self.r.randint(1, 6)
#w = Wu... |
from neuralnetwork import *
if __name__ == '__main__':
X = numpy.array([
[0, 0],
[0, 1],
[1, 0],
[1, 1],
])
T = numpy.array([
[0], [1], [1], [0],
])
N = X.shape[0]
input_size = X.shape[1]
hidden_size = 2
output_size = 2
epsilon = 0.1
... |
/*
* Use of this source code is governed by an Apache license that can be
* found in the LICENSE file.
*/
/**
* Class handling server discussion with client
* @param {[type]} rtcServer [description]
*/
function GameServer(rtcServer){
var that = this;
this.rtcServer = rtcServer;
//Master gamestate
this.gameStat... |
// -------------------------------------------------------------------------
// @FileName : NFMailPlugin.h
// @Author : LvSheng.Huang
// @Date : 2016-12-18
// @Module : NFMailPlugin
//
// -------------------------------------------------------------------------
... |
#include "hashfunc.h"
/*
** FNV-1a
** https://en.wikipedia.org/wiki/Fowler–Noll–Vo_hash_function
*/
uint32_t fnv1a(const char* data, int len){
static const uint32_t PRIME = 16777619;
static const uint32_t OFFSET = 2166136261;
int i;
uint32_t result = OFFSET;
for(i=len-1; i>=0; i--){
result ^= data[i];
result ... |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 SINA 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 copy of the License at
#
# ... |
/*
* Kendo UI Web v2014.1.318 (http://kendoui.com)
* Copyright 2014 Telerik AD. All rights reserved.
*
* Kendo UI Web commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-web
* If you do not own a commercial license, this file shall be governed by the
* GNU General Public ... |
#ifndef FUNCOES_H_INCLUDED
#define FUNCOES_H_INCLUDED
#include <iostream>
#include <cmath>
using namespace std;
float norma(float *v);
float dot(float *v1, float *v2);
float angulo_vetores(float *v1, float *v2);
float distancia(float *v1, float *v2);
float distancia_point_line(float *p0, float *p1, float *p2);
floa... |
/*! AdminLTE app.js
* ================
* Main JS application file for AdminLTE v2. This file
* should be included in all pages. It controls some layout
* options and implements exclusive AdminLTE plugins.
*
* @Author Almsaeed Studio
* @Support <http://www.almsaeedstudio.com>
* @Email <support@almsaee... |
export default require('./vi/home.json') |
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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, merge, publish... |
'''Utility used for transforming a list of extracted data for use in tests'''
import copy
def extract_in_data(extracted_data, **kwargs_extra_data):
extracted_request_data = []
for ddx, data in enumerate(extracted_data):
output_extract = {'data': copy.deepcopy(data)}
for key in kwargs_extra_dat... |
import sys
import numpy as np
from typing import *
import scipy.linalg as sla
import scipy.sparse as sparse
import jax.numpy.linalg as nla
import matplotlib.pyplot as mplt
import scipy.sparse.linalg as ssl
from sklearn.utils import shuffle
from sklearn.cluster import KMeans
from scipy.sparse.csr import csr_matrix
from ... |
/*
* Lets the user navigate laterally through a sequence of child elements.
*
* basic-carousel is an implementation of the carousel user interface pattern,
* commonly used for navigating between images, pages, and other elements.
* This pattern presents the user with a linear sequence of elements, only one of
* w... |
"""Test subsampling utilities."""
import pytest
from backpack.extensions import BatchGrad
from vivit.extensions import SqrtGGNExact
from vivit.utils.subsampling import (
merge_extensions,
merge_multiple_subsamplings,
merge_subsamplings,
sample_output_mapping,
)
def test_sample_output_mapping():
"... |
"""
Django settings for the_beat_live_28569 project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
... |
var request = require('request');
var containers_actions = {
get_available_port: function(exitCode){
var send = {};
request.get({
url: 'http://localhost:5000/containers/availablePort',
}, function(error, response, body){
if(error){
... |
# 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 ... |
'use strict';
const getDocsUrl = require('./utils/get-docs-url');
const isMathPow = node => {
const {callee} = node;
return (
callee.type === 'MemberExpression' &&
callee.object.type === 'Identifier' &&
callee.object.name === 'Math' &&
callee.property.type === 'Identifier' &&
callee.property.name === 'pow'... |
//
// ESPTouchTask.h
// EspTouchDemo
//
// Created by 白 桦 on 4/14/15.
// Copyright (c) 2015 白 桦. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ESPTouchResult.h"
#import "ESPTouchDelegate.h"
#define DEBUG_ON YES
@interface ESPTouchTask : NSObject
@property (atomic,assign) BOOL isCancelled;... |
"""
They copy() method returns a shallow copy of the dictionary.
dict.copy():
copy() method doesn't take any parameters.
"""
original = {1: 'one', 2: 'two'}
new = original.copy()
print('Original: ', original)
print('New: ', new)
# difference between 'copy' and '='
# copy
original = {1: 'one', 2:... |
import unittest
from test import support
import gc
import weakref
import operator
import copy
import pickle
from random import randrange, shuffle
import warnings
import collections
import collections.abc
import itertools
class PassThru(Exception):
pass
def check_pass_thru():
raise PassThru
yield 1
class ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-19 20:09
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('suite', '0002_auto_20170219_0729'),
]
operations = [
migrations.AlterField(... |
# -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import os
impo... |
#pragma once
#include "../utils/Arduboy2Ext.h"
#include "../Utils/Enums.h"
#include "../map/Coordinates.h"
class Key {
public:
Key();
// Properties ..
uint8_t getPosition();
int8_t getXPosition();
int8_t getYPosition(uint8_t yOffset);
uint8_t getImage();
... |
class Base{
constructor(x,y,w,h) {
var options = {
isStatic:true
}
this.w = w
this.h = h
this.body = Bodies.rectangle(x,y,this.w,this.h,options)
World.add(world,this.body)
}
display() {
var pos = this.body.position
push()
... |
'use strict';
angular.module('mean-factory-interceptor',[])
.factory('httpInterceptor', ['$q','$location',function ($q,$location) {
return {
'response': function(response) {
if (response.status === 401) {
$location.path('/login');
... |
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var prefix = 'fas';
var iconName = 'calculator';
var width = 448;
var height = 512;
var ligatures = [];
var unicode = 'f1ec';
var svgPathData = 'M400 0H48C22.4 0 0 22.4 0 48v416c0 25.6 22.4 48 48 48h352c25.6 0 48-22.4 48-48V48c0-25.6-2... |
var gulp = require('gulp');
var minify = require('gulp-minify');
var uglify = require('gulp-uglify');
var watch = require('gulp-watch');
gulp.task('css', function() {
return gulp.src('./src/**/*.css')
.pipe(minify())
.pipe(gulp.dest('./dist/'));
});
gulp.task('js', function() {
return gulp.src('./src/**/*... |
int removeDuplicates(int* nums, int numsSize) {
int i, j;
if (numsSize <= 2) {
return numsSize;
}
for (i = 2, j = 2; i != numsSize; i++) {
if (nums[i] == nums[j - 1] && nums[i] == nums[j - 2]) {
} else {
if (j != i) {
nums[j] = nums[i];
}
... |
import os
import string
import re
import wave
import shutil
from audioset_download_tool import AudioSetDownloader
from cli_manager import CLIManager
from pydub import AudioSegment
import pydub.playback
class Logger():
def __init__(self, audioset_dl: AudioSetDownloader):
self.audioset_dl = audioset_dl
... |
from __future__ import absolute_import
from __future__ import print_function
import sys
import os
# the next line can be removed after installation
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))))
from veriloggen import *
import ve... |
"""
Copyright 2017-2018 Fizyr (https://fizyr.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 by applicable law or agreed to in w... |
import sys, os
sys.path.append(os.path.realpath(os.path.dirname(__file__)+"/.."))
from wallet import WalletWidget
from PySide2.QtWidgets import QInputDialog
from PySide2 import QtCore
def test_token(qtbot, monkeypatch):
wallet = WalletWidget()
qtbot.addWidget(wallet)
old_tokens_amount = wallet.token_wid... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core, dyndep
from hypothesis import given
import caffe2.python.hypothesis_test_util as hu
import hypothesis.strategies as st
import n... |
# -*- coding: utf-8 -*-
"""
pygments.styles.stata_dark
~~~~~~~~~~~~~~~~~~~~~~~~~~
Dark style inspired by Stata's do-file editor. Note this is not
meant to be a complete style, just for Stata's file formats.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see ... |
/*
* JavaScript - Input
*
*/
$().ready( function() {
if ($.tools != null) {
var $tab = $("#tab");
var $title = $("#inputForm :input[title], #inputForm label[title]");
// Tab效果
$tab.tabs("table.tabContent, div.tabContent", {
tabs: "input"
});
// 表单提示
$title.tooltip({
position: "bottom ri... |
const name = 'Baron David Ward'
const dates = '14th May 1961 - 11th May 2021'
export default {
publicRuntimeConfig: {
name: name,
dates: dates
},
// Target (https://go.nuxtjs.dev/config-target)
target: 'static',
// Global page headers (https://go.nuxtjs.dev/config-head)
head: {
htmlAttrs: {
... |
import pygame as pg
pg.init()
a = pg.font.Font('freesansbold.ttf', 32)
s = pg.Surface((100, 100))
s.fill((255, 255, 255))
s.blit(a.render('hello', True, (0, 0, 0)), (0, 0))
pg.image.save(s, 'C:\\Users\\michael\\desktop\\s.png') |
// pages/detail/detail.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
data: app.pageData.detailPage.data
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监... |
/*
*
* Layouts actions
*
*/
import { DEFAULT_ACTION } from './constants';
export function defaultAction() {
return {
type: DEFAULT_ACTION,
};
}
|
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2020, OMRON SINIC X
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must... |
function f() {
return 9;
}
|
module.exports = {"default": require("core-js/library/fn/symbol/for"), __esModule: true}; |
import expect from 'expect'
import expectJsx from 'expect-jsx'
import noop from 'lodash.noop'
import Checkbox from '@material-ui/core/Checkbox'
import React from 'react'
import ReduxFormMaterialUICheckbox from '../Checkbox'
expect.extend(expectJsx)
describe('Checkbox', () => {
it('has a display name', () => {
e... |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# 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 Licen... |
from flask_restful import reqparse
from flask_wtf import FlaskForm
from wtforms import BooleanField, PasswordField, StringField, SubmitField, TextAreaField, validators
from wtforms.validators import DataRequired, Length
class LoginForm(FlaskForm):
username = StringField('Username',
vali... |
/*
* Copyright (c) 2015-2017, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the f... |
class FunctionHelper {
constructor() {
this.regex = /^_exp:(.*)/;
}
/**
* Returns whether or not the given string is a text expression
* @param textExpression
*/
isTextExpression(textExpression) {
return typeof textExpression === 'string' && this.regex.test(textExpressio... |
(self.webpackChunkreact_template=self.webpackChunkreact_template||[]).push([[143],{61635:(t,r,o)=>{"use strict";o.d(r,{Z:()=>m});var a=o(67294),c=o(74865),i=o.n(c),u=o(68356),l=o.n(u);i().configure({showSpinner:!1});var p=function LazyLoad(){return a.useEffect((function(){return i().start(),function(){i().done()}})),a.... |
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.contentfulManagement=t():e.contentfulManagement=t()}(window,(function(){var e=String.prototype,t=Math.floor;return function(e){function t(r){if(n[r])ret... |
"""
This project lets you try out Tkinter/Ttk and practice it!
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
Mark Hays, Amanda Stouder, Aaron Wilkin, their colleagues,
and Sam Hedrick.
""" # DONE: 1. PUT YOUR NAME IN THE ABOVE LINE.
import tkinter
from tkinter import ttk
def ... |
(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{"7cmm":function(t,e,s){"use strict";s.r(e);var A=s("KHd+"),i={metaInfo:{title:"Europe",meta:[{name:"description",content:"A to Z guide of what plays, that are showing at London theatres. Due to coronavirus London theatres are curently closed, new exciting shows c... |
import csv
import os
import sys
import pandas as pd
from collections import OrderedDict
from bokeh.io import show, output_file
from bokeh.plotting import figure
from bokeh.models import HoverTool, CDSView, IndexFilter, ColumnDataSource
from bokeh.transform import factor_cmap
def read_csv(path):
with open(path, 'r... |
from django.apps import AppConfig
class CuentaConfig(AppConfig):
name = 'cuenta'
|
const caniuse = require('caniuse-api')
const db = require('caniuse-db/data.json')
const fs = require('fs')
const browserslist = require('browserslist')
const featuresMap = require('./featuresMap')
const browserPrefixMap = require('./browserPrefixMap')
const generateFile = (scope, output) => {
caniuse.setBrowserScope... |
exports.urlSafe = function(string) {
const url = string.replace(/[^a-z0-9_\-]/gi, '-').replace(/-{2,}/g, '-').replace(/^\-|\-$/, '').toLowerCase();
return url;
}; |
"""Test for old ternary constructs"""
from UNINFERABLE import condition, true_value, false_value, some_callable # pylint: disable=import-error
SOME_VALUE1 = true_value if condition else false_value
SOME_VALUE2 = condition and true_value or false_value # [consider-using-ternary]
SOME_VALUE3 = condition
def func1():
... |
import Vue from 'vue'
import { on } from './dom.js'
const nodeList = []
const ctx = '@@clickoutsideContext'
!Vue.prototype.$isServer && on(document, 'click', e => {
nodeList.forEach(node => node[ctx].documentHandler(e))
})
/**
* v-clickoutside
* @desc 点击元素外面才会触发的事件
* @example
* ```vue
* <div v-element-clickout... |
from django.apps import AppConfig
class MapsConfig(AppConfig):
name = "fight_covid19.maps"
|
/*******************************************************************************************
*
* raylib [shaders] example - Sieve of Eratosthenes
*
* Sieve of Eratosthenes, the earliest known (ancient Greek) prime number sieve.
*
* "Sift the twos and sift the threes,
* The Sieve of Eratosthenes.
* When the ... |
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.5.4.15_A2_T8;
* @section: 15.5.4.15;
* @assertion: String.prototype.substring (start, end) returns a string value(not object);
* @description: start is tested_string.leng... |
from django import forms
from django.forms.widgets import HiddenInput
from django.core.exceptions import ValidationError
from django.core.validators import RegexValidator, BaseValidator
from models import Layout
class UnicodeField(forms.CharField):
def __init__(self, blank=True, *args, **kwargs):
super(Un... |
from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
from tastypie.api import Api
from .api import ImageResource, ThumbnailResource, PinResource, UserResource
from .feeds import LatestPins, LatestUserPins, LatestTagPins
from .views import CreateImage
from .models import LI... |
# -*- coding: utf-8 -*-
###
# (C) Copyright [2019] Hewlett Packard Enterprise Development LP
#
# 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
#... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 10
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class SettingsAclsAclPolicySett... |
import { Meteor } from 'meteor/meteor'
import {
Rooms,
Subscriptions,
Messages,
Uploads,
Integrations,
Users,
} from '../../models'
import { streamerJitsiCall, streamName } from '../lib/streamer'
//import {createMeetURL} from './../lib/createMeet'
//import {generateMeetURL} from './methods/jitsiGenerateToken'
st... |
import React, { useState, useEffect, useContext } from "react";
import HomeComapanySearchFilter from "./HomeComapanySearchFilter";
import { getAllKeywords } from "../API/Api";
import UserContext from "Context/UserContext";
import HomePageEmployementJobProjectResultCard from "Components/HomePageEmployementJobProjectResu... |
'use strict'
const { parseArgs } = require('./utils')
module.exports = ({ ipld, preload }) => {
return async function get (cid, path, options) {
[cid, path, options] = parseArgs(cid, path, options)
if (options.preload !== false) {
preload(cid)
}
if (path == null || path === '/') {
cons... |
/*=========================================================================
*
* Copyright NumFOCUS
*
* 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... |
'use strict';
const txtLog = () => document.getElementById('txtLog');
/**
* Implementation has been changed to utilize flex-layout to reverse the log direction.
* @param {string} aText
*/
function addLogText(aText) {
let d = document.createElement('div');
d.innerHTML = aText;
txtLog().appendChild(d);
}
functi... |
/*
* Implementation of the Microsoft Installer (msi.dll)
*
* Copyright 2002 Mike McCormack for CodeWeavers
*
* This 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
* version 2.1 o... |
define(
"dojo/cldr/nls/cs/roc", //begin v1.x content
{
"field-second": "Sekunda",
"field-year-relative+-1": "Minulý rok",
"field-week": "Týden",
"field-month-relative+-1": "Minulý měsíc",
"field-day-relative+-1": "Včera",
"field-day-relative+-2": "Předevčírem",
"field-year": "Rok",
"field-week-relative+0": "Ten... |
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
*
* Gearmand client and server library.
*
* Copyright (C) 2011-2013 Data Differential, http://datadifferential.com/
* Copyright (C) 2008 Brian Aker, Eric Day
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* ... |
import {createStore, combineReducers, applyMiddleware} from 'redux'
import createLogger from 'redux-logger'
import thunkMiddleware from 'redux-thunk'
import {composeWithDevTools} from 'redux-devtools-extension'
import {food} from './food'
import {recipe} from './recipe'
const reducer = combineReducers({food, recipe})
... |
import Vue from 'vue'
import VueGithubActivity from 'vue-github-activity'
Vue.use(VueGithubActivity) |
/*
* Copyright (C) 2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions a... |
/**
* bootbox.js 5.2.0
*
* http://bootboxjs.com/license.txt
*/
!function(t,e){'use strict';'function'==typeof define&&define.amd?define(['jquery'],e):'object'==typeof exports?module.exports=e(require('jquery')):t.bootbox=e(t.jQuery)}(this,function e(p,u){'use strict';var r,n,i,l;Object.keys||(Object.keys=(r=Object.... |
"""Module to test metarl.torch._functions."""
import numpy as np
import pytest
import torch
import torch.nn.functional as F
from metarl.torch import compute_advantages, pad_to_last
from metarl.torch import dict_np_to_torch, global_device
from metarl.torch import product_of_gaussians, set_gpu_mode, torch_to_np
import ... |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
from collections import Counter
import re,string
def add_text_to_vocab(w,vocab):
list = [words for words in w.split(' ')]
token_list =[]
for i in range(len(list)):
#load file
#tokens = clean_doc(list[i])
#token_list.append(tokens)
vocab.update(list)
return t... |
from functools import reduce
import copy
import itertools as it
import operator as op
import os
import random
import sys
from colour import Color
import numpy as np
from ..constants import *
from ..config import config
from ..container.container import Container
from ..utils.color import color_gradient
from ..utils.c... |
/* eslint-disable class-methods-use-this, camelcase, no-param-reassign, max-classes-per-file */
import { dedupeMixin, SlotMixin } from '@lion/core';
import { localize } from '@lion/localize';
import { ResultValidator } from './ResultValidator.js';
import { Unparseable } from './Unparseable.js';
import { AsyncQueue } f... |
import pytest
def user_flows_handler(event, context):
environment = event['environment']
return pytest.main([
"-p", "no:cacheprovider",
"-s", "--verbose",
"--environment", environment,
"./test_retrieve_everything.py"
])
|
// Copyright (c) 2019-2020 The Beans Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BEANS_UTIL_ASMAP_H
#define BEANS_UTIL_ASMAP_H
#include <stdint.h>
#include <vector>
uint32_t Interpret(const std::vec... |
import test from 'ava'
import sinon from 'sinon'
import Analytics from '../src'
test.beforeEach((t) => {
t.context.sandbox = sinon.createSandbox()
})
test.cb('Plugins should have correct config in methods', (t) => {
let valueOne
let valueTwo
const analytics = Analytics({
app: 'appname',
version: 100,
... |
import axios from "axios";
const adminGet = async (id) => {
const token = localStorage.getItem('jwt_token');
const url = "/api/auth/admin/get";
const body = {
id: id,
};
const headers = {
"Authorization": "Bearer " + token
}
const response = await axios({
method: '... |
const express = require('express');
const aplicacion = express();
const mysql = require('mysql');
const bodyParser = require('body-parser');
const constantes = require('constants');
var pool = mysql.createPool({
connectionLimit: 20,
host: 'localhost',
user: 'root',
password: '****',
da... |
/****************************************************************
* AUTHOR: Brett Kettering
* DATE: July 26, 2005
* LAST MODIFIED: July 26, 2005
*
* LOS ALAMOS NATIONAL LABORATORY
* An Affirmative Action/Equal Opportunity Employer
*
* Copyright (c) 2005
* the Regents of the University of California.
*... |
# -*- coding: UTF-8 -*-
# import pprint
from clarifai.rest import ClarifaiApp
import settings
def is_cat(file_name):
""" Add ClarifaiApp call for image_classification"""
is_cat = False
app = ClarifaiApp(api_key=settings.CLARIFAI_API_KEY)
model = app.public_models.general_model
response = model.pre... |
# Copyright (c) 2017-2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# fmt: off
# isort: skip_file
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
imp... |
"""Support for monitoring energy usage using the DTE energy bridge."""
import logging
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
ICON = 'mdi:flash'
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Setup the DTE energy bridge sensor."""
ip_add... |
/*!
* OpenUI5
* (c) Copyright 2009-2020 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
sap.ui.define(['sap/ui/core/Renderer','sap/m/PlanningCalendarRenderer'],function(R,P){"use strict";var a=R.extend(P);a.addAdditionalClasses=function(r){r.class("sapMPlan... |
from datetime import datetime
from glob import glob
from argparse import ArgumentParser
import requests
import os
import logging
import subprocess
logging.basicConfig(level=logging.INFO, format='%(message)s', handlers=[logging.FileHandler('synchronize.log'), logging.StreamHandler()])
'''
pc.synchronize.vcfs.py
Oct... |
import re
from collections import namedtuple
from itertools import dropwhile
from .base import BaseVersion
from .exceptions import InvalidVersion
from .utils import Infinity
_Version = namedtuple("_Version", ["epoch", "release", "dev", "pre", "post", "local"])
VERSION_PATTERN = re.compile(
"""
^
v?
... |
define(['datetime'], function (datetime) {
function getDisplayName(item, displayAsSpecial, includeParentInfo) {
if (!item) {
throw new Error("null item passed into getPosterViewDisplayName");
}
var name = item.EpisodeTitle || item.Name || '';
if (item.Type == "TvChann... |
from enum import Enum
import numpy as np
class State:
"""状態(位置)を定義するクラス
原点は左上
正の向き
-->
↓
"""
def __init__(self, row=-1, column=-1):
self.row = row
self.column = column
def __repr__(self):
return "<State: [{}, {}]>".format(self.row, self.column)
... |
#ifndef _CAMERA5DOF
#define _CAMERA5DOF
#include "Camera.h"
// Camera with 5 degrees of freedom, 3 translational (X, Y, Z) and two rotational (yaw, pitch)
class Camera5DoF : public Camera {
float pitch = 0.0f;
public:
Camera5DoF(SDL_Window *window);
void move(float x, float y, float z) override;
void rotate(... |