text stringlengths 3 1.05M |
|---|
import { debug } from '@ember/debug';
import Route from '@ember/routing/route';
export default Route.extend({
model: function() {
return {
value: [20, 80]
};
},
actions: {
sliderChanged: function(value) {
this.set("model.value", value);
debug("Slider value changed to %@".fmt(value)... |
#!/usr/bin/env python
r"""
Front-facing script to find drifting, narrowband events in a set of generalized
cadences of ON-OFF radio SETI observations.
The main function contained in this file is :func:`find_event_pipeline` calls
find_events from find_events.py to read a list of turboSETI .dat files.
It then finds eve... |
from dataclasses import dataclass
from typing import Optional, List
from unittest import TestCase
from panamap import Mapper, MissingMappingException, FieldMappingException
@dataclass
class A:
a_value: str
common_value: int
@dataclass
class B:
b_value: str
common_value: int
@dataclass
class Neste... |
//
// CodeView.h
// 验证码View - 六个框框
//
// Created by 贾远潮 on 2017/12/20.
//
#import <UIKit/UIKit.h>
@interface CodeView : UIView
- (__kindof CodeView *)initWithFrame:(CGRect)frame
maxNumber:(NSInteger)maxNumber;
/**
点击了下一步的回调,回调中两个参数第一个为手机号码 第二个为验证码
*/
@property (nonatomic, copy) vo... |
from scalene.scalene_arguments import ScaleneArguments
from scalene.scalene_version import scalene_version
from typing import (
Any,
List,
NoReturn,
Optional,
Tuple,
)
from textwrap import dedent
import argparse
import contextlib
import sys
class RichArgParser(argparse.ArgumentParser):
def __... |
#Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.
#You may assume that the array is non-empty and the majority element always exist in the array.
#solution 1
from collections import Counter
class Solution:
def majorityElement(self, nums... |
/*
* Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree.
*/
/* eslint-env node */
'use strict';
describe('establishes a connection', () => {
let pc1;
l... |
/*
Copyright (c) 2018-2019 Xavier Leclercq and the wxCharts contributors.
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 ... |
#!/usr/bin/env python3
import cv2
import sys
import numpy as np
import imutils
from skimage.filters import threshold_local
def vid_to_frames(filename, write=False):
vidcap = cv2.VideoCapture(filename)
success, image = vidcap.read()
count = 0
images = []
while success:
if write:
... |
var callbackArguments = [];
var argument1 = function (item) {
callbackArguments.push(arguments)
return item['cols'];
};
var argument2 = "";
var argument3 = [627,714,618,460,25,157,157];
var argument4 = function (currentKind) {
callbackArguments.push(arguments)
return kind === currentKind ? true : fa... |
import unittest
import numpy as np
from data import TextData
from inits import Xavier, Zeros
from crnn import CharRNN
from util import generate_text
class TestTextGeneration(unittest.TestCase):
@classmethod
def setUp(cls):
cls.goblet = TextData('data/goblet_book.txt')
cls.rnn = CharRNN(
... |
const express = require('express')
const app = express()
/*Syntax
res.set(field [, value])
*/
/*Definition
Sets the response’s HTTP header field to value.
To set multiple fields at once, pass an object as the parameter.
*/
app.get('/', (req, res) => {
res.set('Content-Type', 'text/plain');
res.set({
'Conte... |
import React, {useReducer, useMemo} from 'react';
import {Text, View, Image, StyleSheet, TouchableOpacity} from 'react-native';
import Estrelas from '../../../componentes/Estrelas';
const distanciaEmMetros = distancia => {
return `${distancia}m`;
};
export default function Produtor({nome, imagem, distancia, estrel... |
#!/usr/bin/env python3
import numpy as np
def activation(w, x):
return sum(w * x for w, x in zip(w, x)) > 0
def predict(weight):
return 1
def func(examples, start_weight=(0, 0, 0)):
w = np.array(start_weight)
perfect = False
while not perfect:
perfect = True
for example in exa... |
# -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
from ingenico.connect.sdk.data_object import DataObject
from ingenico.connect.sdk.domain.definitions.amount_of_money import AmountOfMoney
from ingenico.connect.sdk.domai... |
import logging
logger = logging.getLogger('Rogue-EVE')
class ObjectPool(object):
def __init__(self):
self.id_counter = 0
self.object_poll = {}
self.player = None
def __str__(self):
return repr(self)
def _identify_object(self):
"""Returns the actual value of the ... |
#!/usr/bin/env python3
#
# Copyright (c) 2021 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
"""
Process ELF file to generate placeholders for kobject
hash table and lookup functions produced by gperf,
since their sizes depend on how many kobjects have
been declared. The output header files will be used
dur... |
import '../../style/index.css';
import './index.css'; // style dependencies
// deps-lint-skip: grid
import '../../progress/style/css'; |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 26 15:40:07 2018
@author: Christian Bender
@license: MIT-license
This file contains the test-suite for the linear algebra library.
"""
import unittest
from lib import Matrix, Vector, axpy, squareZeroMatrix, unitBasisVector, zeroVector
class Test(unittest.TestCase):
... |
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# ---------------------------------------------------------------------... |
import axios from 'axios'
import { MessageBox, Message } from 'element-ui'
import store from '@/store'
import { getToken } from '@/utils/auth'
// create an axios instance
const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
// withCredentials: true, // send cookies ... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toHexString = exports.fromHexString = void 0;
var fromHexString = function (hexString) {
return new Uint8Array(hexString.match(/.{1,2}/g).map(function (byte) { return parseInt(byte, 16); }));
};
exports.fromHexString = fromHexStrin... |
// Require and assign the photo model.
const photoModel = require('../database/schemas/photoSchema')
// Photo gallery
// searches model for all and if no error, getPhotos will return the images
const getPhotos = async (req, res) => {
//finds all photo objecst from the database
const photos = await photoModel.find()
... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/type.proto
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as ... |
import setuptools
from setuptools import find_packages
setuptools.setup(
name="censys_maltego",
version="1.1.0",
author="Art Sturdevant",
author_email="support@censys.io",
description="This package provides an interface into Censys from Maltego.",
install_requires=['censys', 'maltego-trx'],
... |
# https://www.codewars.com/kata/56d93f249c844788bc000002/train/python
'''
Instructions:
No Story
No Description
Only by Thinking and Testing
Look at result of testcase, guess the code!
'''
def testit(s):
return ' '.join([i[:-1]+i[-1].upper() for i in s.split()])
|
/* eslint no-param-reassign: "off" */
import React from 'react';
import _ from 'lodash';
import defaultConfig from './config';
export default {
defaults: {
dialog: defaultConfig
},
load: function(lore) {
const {
domElementId,
buildDialogContainer,
renderDialogToDom
} = lore.confi... |
/*
* LPC utility code
* Copyright (c) 2006 Justin Ruggles <justin.ruggles@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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
* versio... |
import doctest
import os
from music21 import note
from decitala.hm import molt
from decitala.database.db import Transcription, Species
def test_doctests():
assert doctest.testmod(molt, raise_on_error=True)
def test_molt_query_str_and_int():
exstr = ["C#", "D", "G#", "E", "G", "F", "C#"]
str_queries = molt.MOLT_q... |
$(function () {
'use strict';
var sut;
var sutChaining;
var lyricsPanelSpy;
var strategyStub;
var persistFindByStub;
var persistPersistStub;
var $lyricsPanel = $('#lyrics-panel');
var artist = 'artist';
var title = 'title';
var lyric = 'lyric';
var thisPersist;
v... |
const Discord = require('discord.js');
const client = new Discord.Client();
exports.run = (client, message, args) => {
if (!message.guild) {
const ozelmesajuyari = new Discord.RichEmbed()
.setColor(0xFF0000)
.setTimestamp()
.setAuthor(message.author.username, message.author.avatarURL)
.addField(':warning:... |
# Desenvolva um programa que leia o primeiro termo e a razão de uma PA. No final, mostre os 10 primeiros termos dessa progressão.
pt = int(input('Diga qual é o primeiro termo: '))
razão = int(input('Diga a razão: '))
décimo = pt + (10 - 1) * razão
for a in range(pt, razão + décimo, razão):
print(a, end=' ')
print(... |
import React from "react";
import { MDBCarouselItem, MDBIcon } from "mdb-react-ui-kit";
const ReviewCarousel = ({ tour, index }) => {
return (
<MDBCarouselItem itemId={index}>
<div className="testimonial">
<div className="avatar mx-auto ">
<img
src={
tour.user ? ... |
#ifndef VS_SCRIPT_PROCESSOR_DIALOG_H_INCLUDED
#define VS_SCRIPT_PROCESSOR_DIALOG_H_INCLUDED
#include "../../../common-src/vapoursynth/vs_script_processor_structures.h"
#include "../script_status_bar_widget/script_status_bar_widget.h"
#include <QDialog>
#include <QPixmap>
#include <list>
class QCloseEvent;
class QSta... |
import attr
from falcon_auth.backends import AuthBackend
from ebl.bibliography.application.bibliography import Bibliography
from ebl.bibliography.application.bibliography_repository import BibliographyRepository
from ebl.changelog import Changelog
from ebl.corpus.infrastructure.mongo_text_repository import MongoTextRe... |
import React, { Component } from 'react';
// import { Link } from 'react-router-dom';
import axios from 'axios';
import { faCog, faHome, faSearch,faTrashAlt } from '@fortawesome/free-solid-svg-icons';
import { Col, Row, Form, Button, ButtonGroup, Breadcrumb, InputGroup, Dropdown } from '@themesberg/react-bootstrap';
... |
import styled from 'styled-components';
import UnstiledLink from '../Link';
export const Container = styled.header`
width: 100%;
display: flex;
align-items: center;
justify-content: stretch;
padding: 0px 40px;
background: ${({ theme }) => theme.colors.primary};
nav {
width: 100%;
ul {
display: flex;
... |
# -*- coding: utf-8 -*-
##########################################################################
# Copyright 2013-2017 Aerospike, Inc.
#
# 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
#
# ... |
/*---
{
"custom": true
}
---*/
/*===
ERROR, contains "end of input": true
ERROR, contains "end of input": true
ERROR, contains "end of input": false
ERROR, contains "end of input": true
ERROR, contains "end of input": true
ERROR, contains "end of input": true
ERROR, contains "end of input": true
ERROR, contains "e... |
function AddMixingChartDetail() {
try {
var supBalNo,DummyBaleNo,lotno, IssueWt, millWt,CiDetailId,CiId, ItemId, ItemName, txt_Rate, UomId;
var MixingChartDetailId=0;
supBalNo = document.getElementById("txt_SupplierBaleNo").value;
DummyBaleNo = document.getElementById("txt_DummyBaleN... |
"""Collect data for comparison of MHE and EKF with different number of anchors
This script simulates the performance of MHE and EKF on the trajectories
in the data/publication_run folder. For each file, the number of anchors
is varied between 1-8 for TWR and 2-8 for TDOA. Every number of anchor
is tested in 10 runs ... |
import { Component } from "react";
import Message from './Message';
class Footer extends Component {
constructor(props){
super(props)
this.state = {
showFooter: true
}
}
componentDidMount(){
setTimeout(() => {
this.setState({showFooter: false})
... |
#include <std.h>
inherit ROOM;
void create()
{
:: create();
set_property ("light", 2);
set_property("indoors", 0);
set_short ("The Knightly Inn, a room");
set_long ("%^ORANGE%^All the rooms are the same, very utilitarion in style. A <bed>, <table>, <chair> and clothes <press> form the furniture. There are some <flow... |
import shlex
from azul import (
config,
)
from azul.deployment import (
emit_tf,
)
emit_tf({
"resource": [
{
"google_service_account": {
"azul": {
"project": "${local.google_project}",
"account_id": config.google_service_account,
... |
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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
*
* h... |
export default class Snake {
constructor (x1, y1, x2, y2, options = {}) {
this.entity = 'Snake';
this.startingPosition = [x1, y1, x2, y2];
this.headColor = options.headColor || '#ec2626';
this.color = options.color || '#52ee38';
this.segments = [];
this.direction = null;
this.createSegmen... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.0.0.11832 on 2017-03-22.
# 2017, SMART Health IT.
import io
import json
import os
import unittest
from . import operationoutcome
class OperationOutcomeTests(unittest.TestCase):
def instantiate_from(self, filename):
datadir = os.e... |
export const SET_ALERT = "SET_ALERT";
export const REMOVE_ALERT = "REMOVE_ALERT";
export const REGISTER_SUCCESS = "REGISTER_SUCCESS";
export const REGISTER_FAIL = "REGISTER_FAIL";
export const USER_LOADED = "USER_LOADED";
export const AUTH_ERROR = "AUTH_ERROR";
export const LOGIN_SUCCESS = "LOGIN_SUCCESS";
export const... |
# Copyright (c) 2019-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import functools
import logging
import multiprocessing
import os
import signal
import sys
from multiprocessing import Event
from pathlib import Pat... |
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import React from 'react'
import ReactDOM from 'react-dom'
import '@testing-library/jest-dom/extend-expect'
// Tes... |
/*
* Copyright (c) 2020 Peter Johanson <peter@peterjohanson.com>
*
* SPDX-License-Identifier: MIT
*/
#define DT_DRV_COMPAT zmk_split_listener
#include <device.h>
#include <power/reboot.h>
#include <logging/log.h>
#include <zmk/split/bluetooth/service.h>
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
#include <... |
import React, { useState } from "react";
import "./headerStyle.css";
import HomePageContent from "../Components/homepagecontent";
import AboutUs from "../Components/aboutus";
import Footer from "../Components/footer";
import medIcon from "../images/icon.png";
import searchIcon from "../images/searchIcon.png";
import { ... |
'use strict';
const cheerio = require('cheerio');
const Scraper = require('./se_scraper');
class GoogleScraper extends Scraper {
constructor(...args) {
super(...args);
}
async parse_async(html) {
const results = await this.page.evaluate(() => {
let _text = (el, s) => {
... |
#ifndef SCD30_MODBUS_H
#define SCD30_MODBUS_H
#include <Arduino.h>
// SCD30 default modbus baudrate
#define SCD30_MODBUSBAUDRATE_DEFAULT 19200
// SCD30 default modbus address
#define SCD30_MODBUSADDR_DEFAULT 0x61
// Main data register
#define SCD30_CMD_READ_MEASUREMENT 0x0028
// Command to start continuous measurem... |
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/axios/index.js":
/*!*************************************!*\
!*** ./node_modules/axios/index.js ***!
\*************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
module... |
Oskari.registerLocalization({
"lang": "nl",
"key": "Printout",
"value": {
"title": "Print kaartbeeld",
"flyouttitle": "Print kaartbeeld",
"desc": "",
"btnTooltip": "Print",
"BasicView": {
"title": "Print kaartbeeld",
"name": {
... |
"""
Programmer: Chris Tralie, 12/2016 (ctralie@alumni.princeton.edu)
Purpose: To implement similarity network fusion approach described in
[1] Wang, Bo, et al. "Unsupervised metric fusion by cross diffusion."
Computer Vision and Pattern Recognition (CVPR), 2012 IEEE Conference
on. IEEE, 2012.
[2] Wang, Bo, et a... |
'use strict';
var path = require('path')
, chai = require('chai')
, expect = chai.expect
, helper = require(path.join(__dirname, 'lib', 'agent_helper'))
, Context = require(path.join(__dirname, '..', 'lib', 'context'))
, Tracer = require(path.join(__dirname, '..', 'lib', 'transaction', 'tracer'))
... |
/*
* This module is used to copy security markings from packets
* to connections, and restore security markings from connections
* back to packets. This would normally be performed in conjunction
* with the SECMARK target and state match.
*
* Based somewhat on CONNMARK:
* Copyright (C) 2002,2004 MARA Systems ... |
import os
import sys
sys.path.insert(1, os.path.dirname(os.path.realpath(__file__)))
|
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
from prlworkflows.sqs import SQS, enumerate_sqs
from prlworkflows.sqs_db import SQSDatabase, get_structures_from_database
|
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(React.createElement("path", {
d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm4.2 14.2L11 13V7h1.5v5.2l4.5 2.7-.8 1.3z"
}), 'WatchLater'); |
from zenithml.preprocess.analyze.bq_analyzer import (
BQAnalyzer,
BucketizedBQAnalyzer,
StandardScalerBQAnalyzer,
LogScalerBQAnalyzer,
CategoricalBQAnalyzer,
WeightedCategoricalBQAnalyzer,
)
from zenithml.preprocess.analyze.pandas_analyzer import (
PandasAnalyzer,
NumericalPandasAnalyzer... |
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from settings import MYSQL_USER, MYSQL_PASSWORD, MYSQL_HOST, MYSQL_PORT, MYSQL_DB
SQLALCHEMY_DATABASE_URL: str = f"mysql+pymysql://{MYSQL_USER}:{MYSQL_PASSWORD}@{MYSQL_HOST}:{MYSQL_PORT... |
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double Pods_app18VersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_app18VersionString[];
|
var horizontalBlockHelpers, throttledResize, typeHelpers;
UI.registerHelper('selectedIf', function(val) {
return val ? 'selected' : '';
});
Session.set("separation", 20);
window.windowSizeDep = new Tracker.Dependency();
Meteor.startup(function(){
Tracker.autorun(function(){
windowSizeDep.depend();
va... |
#!/usr/bin/python3
from tornado import web, gen
from tornado.concurrent import run_on_executor
from concurrent.futures import ThreadPoolExecutor
from probe import run
import traceback
import uuid
import os
THUMBNAIL_CACHE=int(os.environ["THUMBNAIL_CACHE"])
class Thumbnail(object):
def __init__(self):
sel... |
"""
controllers.py
Login module controllers.
"""
from flask import Blueprint, render_template, redirect, request, abort, url_for, session, current_app
from flask_login import login_user, LoginManager, login_required, logout_user
from app.mod_auth.models import MyAdventure
from app.mod_user.models import User
from .fo... |
/* ===========================================================================
* uz80as, an assembler for the Zilog Z80 and several other microprocessors.
*
* Expression parsing.
* ===========================================================================
*/
#include <config.h>
#include "expr.h"
#include "utils.... |
from .core import (
int2bytes,
bytes2int,
require_version,
Version,
Tlv,
AID,
BadResponseError,
)
from .core.smartcard import SmartCardConnection, SmartCardProtocol
from urllib.parse import unquote, urlparse, parse_qs
from functools import total_ordering
from enum import IntEnum, unique
fro... |
from robot.api.parsing import DefaultTags, ForceTags, ModelTransformer, Tags, Token
from robotidy.disablers import skip_section_if_disabled
from robotidy.exceptions import InvalidParameterValueError
class NormalizeTags(ModelTransformer):
"""
Normalize tag names by normalizing case and removing duplicates.
... |
# -*- coding: UTF-8 -*-
# ZDF Mediathek by AliAbdul
from __future__ import print_function
from Components.ActionMap import HelpableActionMap
from Components.AVSwitch import AVSwitch
from Components.Label import Label
from Components.Sources.List import List
from Components.MenuList import MenuList
from Components.Multi... |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Legendgrouptitle(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "densitymapbox"
_path_str = "densitymapbox.legendgrouptitle"
_valid_props = {"font"... |
var completionSpec = {
name: "endpoints",
description: "Create, enable and manage API services.",
subcommands: [
{
name: "configs",
description: "View configurations for various services.",
subcommands: [
{
name: "describe",
description:
"Describes the... |
"""cyme.bin.cyme"""
from __future__ import absolute_import
from .base import app
@app()
def cyme(env, argv):
from cyme.management.commands import cyme
cyme.Command(env=env).run_from_argv([argv[0], 'cyme'] + argv[1:])
if __name__ == '__main__':
cyme()
|
import pytest
from nglui import EasyViewer
import pandas as pd
import numpy as np
import json
@pytest.fixture(scope="session")
def viewer():
return EasyViewer()
@pytest.fixture(scope="session")
def img_path():
return "precomputed://gs://pathtoimagery"
@pytest.fixture(scope="session")
def seg_path_precompu... |
import warnings
from typing import MutableSequence, Optional
from starfish.core.morphology.binary_mask import BinaryMaskCollection, MaskData
from ._base import FilterAlgorithm
class AreaFilter(FilterAlgorithm):
"""
Create a BinaryMaskCollection using only the masks that meet the minimum and maximum area
... |
# tools related to mesuring stuff
import os, sys
import math
import json
import operator
import torch
import numpy as np
import matplotlib.pyplot as plt
from codae.tool import get_mask_transformation
"""
compute rmse between x and y
(can be two scalars, two vectors, or two arrays)
input
x
... |
def Bees(thoughts, eyes, eye, tongue):
return f"""
{thoughts}
{thoughts}
^^ .-=-=-=-. ^^
^^ (\`-=-=-=-=-\`) ^^
(\`-=-=-=-=-=-=-\`) ^^ ^^
^^ (\`-=-=-=-=-=-=-=-\`) ^^ ^^
( \`-=-=-=-(@)-=-=-\` ) ^^
... |
class Boat{
constructor(x,y,width,height,boatPos){
var options = {
isStatic : true
}
this.width = width;
this.height = height;
this.boatPosition = boatPos;
this.image = loadImage("./assets/boat.png");
this.body = Bodies.rectangle(x,y,... |
from django.shortcuts import render
from django.conf import settings
import sqlalchemy
import pandas as pd
import numpy as np
# Create your views here.
def index(request):
# Access database via sqlalchemy
db_path = "./exercise01.sqlite"
dbEngine = sqlalchemy.create_engine("sqlite:///" + db_path)
# Im... |
load("bf4b12814bc95f34eeb130127d8438ab.js");
load("93fae755edd261212639eed30afa2ca4.js");
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 15.4.4.21-9-c-ii-4-s
description: >
Array.prototype.reduce - undefined passed... |
import React, { createContext, useContext } from 'react'
export const ApiContext = createContext()
export const ApiProvider = ({
url = '',
config = {},
resolveHook = res => Promise.resolve(res),
rejectHook = res => Promise.reject(res),
children
}) => {
function proxy (endpoint, queryConfig, params) {
... |
/*
* wpa_supplicant - Event notifications
* Copyright (c) 2009-2010, Jouni Malinen <j@w1.fi>
*
* This software may be distributed under the terms of the BSD license.
* See README for more details.
*/
#ifndef NOTIFY_H
#define NOTIFY_H
#include "p2p/p2p.h"
struct wps_credential;
struct wps_event_m2d;
struct wps_... |
#
# 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... |
import requests
from .image import Image
from .exceptions import EndpointNotFound
CANVAS = "https://some-random-api.ml/canvas/"
class CanvasClient:
"""Represents a client for canvas related endpoints\n
`CanvasClient.pixelate(image_url: str , key: str = None)` - Pixelate an image
"""
def __init__(se... |
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define(["require", "exports", "@angular/core", "./index"]... |
/*********************************************************
* *
* Developed by CJC Automatisering. *
* MIT License, copyright (c) 2014 MediaLab Amsterdam *
* *
************************... |
/**
* Bitbucket API
* Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework.
*
* The version of the OpenAPI document: 2.0
* Contact: support@bitbucket.org
*
* ... |
Oskari.clazz.define('Oskari.statistics.statsgrid.Legend', function (sandbox, locale) {
this.sb = sandbox;
this.locale = locale;
this.log = Oskari.log('Oskari.statistics.statsgrid.Legend');
this.service = this.sb.getService('Oskari.statistics.statsgrid.StatisticsService');
this.__templates = {
... |
from django.shortcuts import render
# Create your views here.
def login(request):
pass
def logout(request):
pass
def home(request):
pass
def profile(request):
pass
def category_view(request):
pass
def tag_view(request):
pass
def archive(request):
pass
def user_doc_view(reques... |
from datetime import datetime
from pandas import DataFrame
import pandas_datareader.data as web
def get_american_stock_dat(stock_of_interest, start_time, now_time):
""" get a dataframe for an american stock of interest """
f_dat = web.DataReader(stock_of_interest, 'google', start_time, now_time)
return f_dat
if _... |
# -*- coding: utf-8 -*-
import uuid
import random
from urllib.parse import urlparse, urlencode, quote
import pytest
import requests
import simplejson as json
import nanoid
class AssertDesc(object):
@classmethod
def status_code(cls, api_res=None):
api_res_dumps = ''
if api_res:
api... |
var gulp = require('gulp'),
sassdoc = require('sassdoc');
// Declare input, output and sourcemaps path
var path = {
input: './scss/**/*.scss'
};
// Declare sassdoc options
var sassdocOptions = {
dest: './docs/'
};
// Gulp Task for Create Documentation
gulp.task('docs', function () {
return gulp
.src(... |
'''
Create a function that looks through an array (first argument) and returns the first element in the array that passes a truth test (second argument).
If no element passes the test, return undefined.
'''
def findElement(arr, func):
for v in arr:
if func(v):
return v
findElement([1, 2... |
(window.webpackJsonp=window.webpackJsonp||[]).push([[126],{4136:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.icon=void 0,n(9);var o=function(e){return e&&e.__esModule?e:{default:e}}(n(0));function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=argume... |
#!/usr/bin/env python
# This script is to help generate any flat yaml files from the ambassador helm chart.
#
# This script takes two arguments:
# 1. A multi-doc yaml file generated from running:
# `helm template ambassador -f [VALUES_FILE.yaml] -n [NAMESPACE] ./charts/emissary-ingress`
# 2. A yaml file list... |
/*
* 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... |
const MongoLib = require('../lib/mongo')
class MoviesService {
constructor() {
this.collection = 'movies';
this.mongoDB = new MongoLib();
}
async getMovies({ tags }) {
const query = tags && { tags: { $in: tags } }
const movies = this.mongoDB.getAll(this.collection, query);
return mo... |