text stringlengths 3 1.05M |
|---|
from physDBD import ParamsGauss, DataDesc, ImportHelper
import numpy as np
import os
data_desc = DataDesc(
no_seeds=50,
time_start=0,
time_end=20,
time_interval=0.5,
species=["ca2i","ip3"]
)
data_dir = "playground_data"
vol_exp = 12
no_ip3r = 100
ip3_dir = "ip3_0p100"
vol_dir = "vol_exp_%02d" % v... |
/* See LICENSE file for copyright and license details. */
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pi... |
/*
* Copyright 2017 Google
*
* 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, { createElement, Fragment } from 'react';
import PrismicRichText, { Elements } from 'prismic-richtext';
import { Link as LinkHelper } from 'prismic-helpers';
import { embeds } from './embeds';
const createScript = typeof window !== `undefined` ? require("./embeds").createScript : () => {}
function serial... |
from django.utils.datastructures import MultiValueDictKeyError
from rest_framework.response import Response
from rest_framework.views import APIView
from apis.rescuetime.tasks import import_user_rescuetime_history_via_api
from apis.rescuetime.v1.serializers import RescueTimeAPIRequestSerializer
class UpdateRescueTim... |
import React, { Component } from 'react';
import {
Card,
CardBody,
CardHeader,
Col,
FormGroup,
FormText,
Input,
InputGroup,
InputGroupAddon,
InputGroupText,
Label,
} from 'reactstrap';
class PersonalInfo extends Component {
constructor(props) {
super(props);
this.state = {
... |
//
// main.c
// genetic-snake
//
// Created by Alexander Gonsalves
// 04/17/2021
#include "gsdefs.h"
int main(int argc, const char *argv[])
{
struct timespec start, finish;
double elapsed;
srand(time(NULL));
// get start time
clock_gettime(CLOCK_MONOTONIC, &start);
// start the model --... |
import React, { PropTypes } from 'react';
import purebem from 'purebem';
const block = purebem.of('view-header');
const ViewHeader = React.createClass({
propTypes: {
title: PropTypes.string.isRequired,
// ...
children: PropTypes.node
},
getDefaultProps() {
return {
... |
import os
import sys
import random
import numpy as np
import scipy.io
import scipy.signal
from skimage.transform import resize
import math
import torch
from torch import nn
from torch.utils.data import Dataset, DataLoader
class RamanImageDataset(Dataset):
def __init__(self, image_ids, path, batch_size=2, hr_image_... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# This file is part of the OpenMV project.
#
# Copyright (c) 2013-2021 Ibrahim Abdelkader <iabdalkader@openmv.io>
# Copyright (c) 2013-2021 Kwabena W. Agyeman <kwagyeman@openmv.io>
#
# This work is licensed under the MIT license, see the file LICENSE for details.
#
# This ... |
import streamlit as st
import inspect
import components.noh_plots as noh_figg
import components.sfk_plots as sfk_figg
import components.flr_plots as flr_figg
import components.base as base
import components.google_news as google
def show_with_options(header, func, text=''):
st.header(header)
if (text != ''):
... |
/*=========================================================================
*
* 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... |
import React from "react";
import compose from "recompose/compose";
import {withStyles} from "@material-ui/core";
import {translate} from "react-admin";
import DashboardCard from "./DashboardCard";
import AnnouncementIcon from "@material-ui/icons/Announcement"
import Button from "@material-ui/core/Button/Button";
impor... |
typedef struct ExtraErrorInfo_st
{
int ScenarioLineCnt;
int RetVal;
}
ExtraErrorInfo_t;
extern ExtraErrorInfo_t ExtraErrorInfo;
void termination(int errorLevel);
void error2(char *source, int lineno, char *function);
#define error() \
error2(__FILE__, __LINE__, __FUNCTION__)
#define errorCase(status) \
do { \
i... |
#ifdef _WIN32
#include <windows.h>
#else
#include <arpa/inet.h>
#include <stdint.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "md5.h"
#include "tcp.h"
#include "growl.h"
static const char hex_table[] = "0123456789ABCDEF";
static char*
string_to_hex_alloc(const char* ... |
import asyncio
import contextlib
import pytest
from async_service import background_asyncio_service
from eth import MainnetChain
from eth_utils import decode_hex
from p2p.exceptions import PeerConnectionLost
from trinity.components.builtin.tx_pool.pool import TxPool
from trinity.constants import TO_NETWORKING_BROAD... |
"""
Helpers to test runtimes.
"""
import os
import glob
import pickle
import numpy
import pandas
import warnings
from numpy.testing import assert_array_almost_equal, assert_array_equal
from .utils_backend import load_data_and_model, extract_options, ExpectedAssertionError, OnnxRuntimeAssertionError, compare_outputs
d... |
#ifndef LLVM_TOOLS_LLVM_OBJDUMP_OBJDUMP_OPT_ID_H
#define LLVM_TOOLS_LLVM_OBJDUMP_OBJDUMP_OPT_ID_H
enum ObjdumpOptID {
OBJDUMP_INVALID = 0, // This is not an option ID.
#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
HELPTEXT, METAVAR, VALUES) ... |
module.exports = {
name: "hackban",
group: "moderation",
description: "hackbanDescription",
usage: "hackbanUsage",
requiredPermissions: "banMembers",
argsRequired: true,
async run(client, msg, args, prefix, lang) {
if (!args.length)
return msg.reply(msg.t("commandUsage", prefix, this));
... |
define({
"error": "Eroare",
"tools": {
"bookmarks": {
"label": "Diapozitive",
"goToBookmark": "Accesare"
},
"about": "Despre",
"resize": "Redimensionare",
"expand": "Extindere hartă",
"collapse": "Restrângere hartă",
"measureArea": "Măsurare suprafață",
"measureLine": "Mă... |
_base_ = "../cascade_rcnn/cascade_mask_rcnn_r50_fpn_20e_coco.py"
model = dict(
pretrained="open-mmlab://res2net101_v1d_26w_4s",
backbone=dict(type="Res2Net", depth=101, scales=4, base_width=26),
)
|
from mtp_common.spooling import spoolable
from notification.rules import ENABLED_RULE_CODES, RULES
@spoolable(body_params=['records'])
def create_notification_events(records):
for record in records:
for code in ENABLED_RULE_CODES:
rule = RULES[code]
if rule.applies_to(record) and ... |
/*!
* StackStudio 2.0.0-rc.1 <http://stackstudio.transcendcomputing.com>
* (c) 2012 Transcend Computing <http://www.transcendcomputing.com/>
* Available under ASL2 license <http://www.apache.org/licenses/LICENSE-2.0.html>
*/
/*jshint smarttabs:true */
/*global define:true console:true */
define([
'j... |
// AUTH MODULE
export const LOGIN = 'LOGIN'
export const LOGOUT = 'LOGOUT'
export const REGISTER = 'REGISTER'
export const REMEMBER_PASSWORD = 'REMEMBER_PASSWORD'
export const RESET_PASSWORD = 'RESET_PASSWORD'
// USERS MODULE
export const FETCH_USERS = 'FETCH_USERS'
export const UPDATE_USER = 'UPDATE_USER'
export cons... |
import os
import time
import client.api
import client.models
from mamba import description, before, after, it
from expects import *
from expects.matchers import Matcher
from common import Config, Service
from common.helper import (make_dynamic_results_config,
check_modules_exists,
... |
import sys
sys.path.insert(0, "../../build")
import os
try:
os.mkdir("output")
except OSError:
pass
from JGSL import *
from .SimulationBase import SimulationBase
class FEMSimulationBase(SimulationBase):
def __init__(self, precision, dim, model="FCR"):
super().__init__(precision, dim)
self... |
/********************************************************************
* COPYRIGHT PARROT 2010
********************************************************************
* PARROT - A.R.Drone SDK Windows Client Example
*-----------------------------------------------------------------*/
/*
Warning... |
import yaml
import traceback
import copy
import urllib3
import logging
import coloredlogs
import json
import sys
import pkgutil
from dnacentersdk import DNACenterAPI
from dna_workflows import package_tools
from ise import ERS
# Settings
urllib3.disable_warnings()
logger = logging.getLogger('main')
module_file_path = '... |
# -*- encoding: utf-8 -*-
'''
This module contains a rather simple example on how to develop an interpreter
that translates a CTL formula to an equivalent 𝜇-calculus formula.
Author: X. Gillard
'''
from pyparsers import *
#===============================================================================
# The parser ... |
/*
* Copyright 2007 by IDIAP Research Institute
* http://www.idiap.ch
*
* See the file COPYING for the licence associated with this software.
*/
#ifndef CACHEDPLUGIN_H
#define CACHEDPLUGIN_H
#include <cassert>
#include <vector>
#include "Component.h"
namespace Tracter
{
/**
* This is... |
# coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
#
# 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://ww... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _element = require("./element");
var _icon = _interopRequireDefault(require("./icon"));
var _dropdown_color = _interopRequireDefault(require("./dropdown_color"));
var _dropdown_linetype = _interopRequire... |
class Solution:
def findMin(self, nums: List[int]) -> int:
low = 0
high = len(nums) - 1
while low < high:
mid = (low + high) // 2
if nums[mid] < nums[high]:
high = mid
elif nums[mid] > nums[high]:
low = mid + 1
e... |
"""
UML model support functions.
Functions collected in this module allow to
- create more complex UML model structures
- perform specific searches and manipulations
"""
import itertools
from typing import Iterable, Sequence
from gaphor.UML.uml2 import (
Association,
Class,
Classifier,
Component,
... |
class ParametersRequiredError(Exception):
def __init__(self, message, errors):
super().__init__(message)
self.errors = errors
|
/*!@preserve
* Tempus Dominus Bootstrap4 v5.39.0 (https://tempusdominus.github.io/bootstrap-4/)
* Copyright 2016-2020 Jonathan Peterson and contributors
* Licensed under MIT (https://github.com/tempusdominus/bootstrap-3/blob/master/LICENSE)
*/
if (typeof jQuery === 'undefined') {
throw new Error('Tempus Dominus ... |
import React from 'react'
import { Button } from '@aragon/ui'
function DepositButton({ label, onClick }) {
return (
<Button
mode="strong"
label={label}
onClick={onClick}
css={'margin: 10px 0 10px 10px;'}
/>
)
}
export default DepositButton |
// @flow
import { CONNECTED } from '@polymathnetwork/ui/components/EthNetworkWrapper/actions';
import { setHelpersNetwork } from '@polymathnetwork/ui';
import { CountTransferManager } from '@polymathnetwork/js';
import * as a from '../actions/token';
import { DATA } from '../actions/providers';
import type { Investor... |
# Modified: 2021-08-20
# Description: Implements a validator for BSON object IDs
# (see https://pydantic-docs.helpmanual.io/usage/types/#classes-with-__get_validators__)
from bson import ObjectId
class PydanticObjectID(ObjectId):
"""Defines a Pydantic type validator for BSON object IDs"""
@c... |
// this config file is created by the webpack build process, then required here.
// we need to do this because the web browser can't read files using 'fs',
// resulting in the 'config' package not working,
// and so we need to precalculate the values and import the values here.
import configValues from '../../_build/co... |
const express = require('express')
const nunjucks = require('nunjucks')
const server = express()
const coursesData = require("./data")
server.use(express.static('public'))
server.set('view engine', 'njk')
nunjucks.configure('views', {
express:server
})
server.get('/', function(req, res) {
return res.render... |
const assert = require('assert')
const Mux = require('./Mux')
const asyncIteratorToArray = async x => {
const y = []
for await (const xi of x) y.push(xi)
return y
}
describe('Mux', () => {
describe('new Mux(x Array|Set) -> Mux', () => {
it('x [1, 2, 3]', async () => {
assert.deepEqual(new Mux([1, 2,... |
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8062],{87344:(e,a,t)=>{t.d(a,{T:()=>n});const n={BingMapsLayer:async()=>(await Promise.all([t.e(8778),t.e(6570),t.e(8316),t.e(102),t.e(6968),t.e(3485),t.e(3749)]).then(t.bind(t,2723))).default,BuildingSceneLayer:async()=>(await Promis... |
from __future__ import (
absolute_import, print_function, division, unicode_literals
)
import logging
import re
import sys
from datetime import datetime
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
CURRENT_YEAR = datetime.today().year
LICENSE_BLOB = """Copyright (c) %d Uber Tech... |
#pragma once
#include "base/CryptoNoteBasic.h"
#include "core/Difficulty.h"
namespace CryptoNote {
struct IMinerHandler {
virtual bool handle_block_found(Block& b) = 0;
virtual bool get_block_template(Block& b, const AccountPublicAddress& adr, difficulty_type& diffic, uint32_t& height, const BinaryArray& ex... |
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[20],{
/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Pagination/index.vue?vue&type=script&lang=js&":
/*!************************************************************************************... |
#!/usr/bin/python
# input.py
data = input('Enter value: ')
print('You have entered:', data)
|
# Realiza un pequeño script en Python que lea dos números M y N a través de la consola,
# y que para ellos genere una lista que contenga las primeras M potencias del número N
# Crea dos versiones del mismo script, una utilizando ciclos normales, y la otra utilizando listas comprimidas
# Versión 1
M = int(input("Valor... |
# coding: utf-8
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environmen... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
"""
This module updates the userbot based on chtream revision
"""
from os import remove, execl
import sys
from git im... |
/*
* Viry3D
* Copyright 2014-2019 by Stack - stackos@qq.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 applicabl... |
from checkov.common.models.consts import ANY_VALUE
from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
class AzureBatchAccountUsesKeyVaultEncryption(BaseResourceValueCheck):
def __init__(self):
... |
var gulp = require('gulp');
var less = require('gulp-less');
var browserSync = require('browser-sync').create();
var header = require('gulp-header');
var cleanCSS = require('gulp-clean-css');
var rename = require("gulp-rename");
var uglify = require('gulp-uglify');
var pkg = require('./package.json');
// Set the banne... |
/**
******************************************************************************
* @file comm.h
* @author Jalon
* @date 2016.02.01
* @brief 通讯协议解包封包等相关声明
* @attention Copyright (C) 2016 Inmotion
******************************************************************************
*/
#ifndef __COMM_H__
#d... |
# coding: utf8
"""
CSS Selectors based on XPath
============================
This module supports selecting XML/HTML elements based on CSS selectors.
See the `CSSSelector` class for details.
:copyright: (c) 2007-2012 Ian Bicking and contributors.
See AUTHORS for more details.
... |
/**
* Copyright 2020 The Lovefield Project 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... |
# coding: utf8
""" Test cases """
import pickle
from urduhack import normalize
from urduhack.urdu_characters import URDU_ALPHABETS
file_name: str = "words.txt"
file_bigram_name: str = "bigram_words.txt"
file_trigram_name: str = "trigram_words.txt"
location_file: str = "ner/locations.txt"
person_file: str = "ner/perso... |
var xdfxasm__hw_8h =
[
[ "XDFX_ASM_CTRL_OFFSET", "xdfxasm__hw_8h.html#gab1c260601f1123450c205d6c6a0bc308", null ],
[ "XDFX_ASM_CTRL_SHUTDOWN_MASK", "xdfxasm__hw_8h.html#ga6e9e6fde6fb0e9b0a4103d87fbaa5ec2", null ],
[ "XDfxasm_ReadReg", "xdfxasm__hw_8h.html#ga176bab706eb493327c1ad34a47d00c44", null ],
[ "... |
# Copyright(c) 2019 Jake Fowler
#
# 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, distr... |
"use strict";
const test = require("tape");
const got = require("got");
const puppeteer = require("puppeteer");
const pt = require("@gourmet/promise-tape");
const run = require("../lib/app");
let app, port;
test("start server", t => {
app = run({port: 0});
app.server.on("listening", () => {
port = app.server... |
#!/usr/bin/env python
import json
import os
import time
from random import choice
from locust import HttpUser
from locust import task
from locust import TaskSet
try:
import urllib.request as urlrequest
except ImportError:
import urllib as urlrequest
USERNAME = os.getenv("LOCUST_USERNAME") or "a@a.com"
PASSWOR... |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#pragma once
#include <react/renderer/core/ReactPrimitives.h>
namespace Microsoft::ReactNative {
facebook::react::SurfaceId getNextRootViewTag() noexcept;
}
|
# 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... |
from __future__ import print_function, absolute_import
import os
import platform
import re
import textwrap
import warnings
import numpy as np
from .support import (TestCase, override_config, override_env_config,
captured_stdout, forbid_codegen)
from numba import unittest_support as unittest
fro... |
from .._compat import Literal
import matplotlib.pyplot as plt
from typing import Union, Sequence, Dict
from scanpy.plotting._utils import (
_set_colors_for_categorical_obs,
_set_default_colors_for_categorical_obs,
_validate_palette,
)
from cycler import Cycler
DEFAULT_FIG_KWS = {"figsize": (3.44, 2.58), "d... |
//** jQuery Scroll to Top Control script- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com.
//** Available/ usage terms at http://www.dynamicdrive.com (March 30th, 09')
//** v1.1 (April 7th, 09'):
//** 1) Adds ability to scroll to an absolute position (from top of page) or specific element on the page ... |
const mongoose = require("mongoose");
const EmployeeSchema = mongoose.Schema(
{
name: String,
surname: String,
dob: Date,
fiscalCode: String,
address: {
addressRoad: String,
city: String,
country: String,
postalCode: Number,
},
salaries: [
... |
import React from 'react';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import CircularProgress from '@material-ui/core/CircularProgress';
const useStyles = makeStyles((theme) => ({
progress: {
margin: theme.spacing(2),
},
}));
const PeaLoadingSpinner = ({ noMargi... |
'use strict';
const PluralAttribute = require('./PluralAttribute');
/**
* @alias metamodel.ListAttribute
* @extends metamodel.PluralAttribute
*/
class ListAttribute extends PluralAttribute {
/**
* Get the type id for this list type
* @return {string}
*/
static get ref() {
return '/db/collection.Li... |
from dataclasses import dataclass
from bs4 import BeautifulSoup
import requests as rq
from os import system
import platform
import time
import os
import shutil
@dataclass
class Item:
des: str
url: str
@dataclass
class Img:
des: str
url: str
ref: str
basicURL = 'https://www.mzitu.com/'
sortBy = [... |
// Copyright (c) 2011-2013 The PPCoin developers
// Copyright (c) 2013-2014 The NovaCoin Developers
// Copyright (c) 2014-2018 The BlackCoin Developers
//Copyright (c) 2015-2020 The PIVX developers
//Copyright (c) 2020 The ogcnode developers
// Distributed under the MIT/X11 software license, see the accompanying
// fil... |
//
// TWXNSDate.h
//
// Copyright 2011 Trollwerks Inc. All rights reserved.
//
enum
{
kYearDays = 365,
kLeapYearDays = 366,
kLeapDayArrayIndex = 59,
kLeapDayOfYear = 60,
};
@interface NSDate (TWXNSDate)
+ (NSDate *)dayOfCurrentGregorianYear:(NSInteger)zeroBasedDay;
- (NSUInteger)dayOfYearGregorian;
-... |
import React from 'react';
import classnames from 'classnames';
import PrometheusChart from './charts/prometheus-chart';
import { formatMetric } from '../utils/string-utils';
import { QUERY_WINDOW_SECS } from '../constants/timer';
export default class Instance extends React.Component {
renderOther() {
const im... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# audiomate documentation build configuration file, created by
# sphinx-quickstart on Tue Nov 21 16:54:44 2017.
#
# 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
# ... |
/*
* acpi_thermal.c - ACPI Thermal Zone Driver ($Revision: 41 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* This program is fr... |
import BaseComponent from '../BaseComponent';
/**
* 弦图
* @author tengge / https://github.com/tengge1
*/
function ChordGraph() {
BaseComponent.call(this);
this.type = 'ChordGraph';
this.width = 400;
this.height = 400;
this.title = 'ChordGraph';
var data1 = [];
var data2 = [];
var r... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _propTypes = _interopRequireDefault(require("prop-types"));
var _react = _interopRequireDefault(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _carbonComponents = re... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... |
/*
* Copyright (c) 2016 Maxim Sobolev <sobomax@FreeBSD.org>
* 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
* notic... |
import cv2
import json
from map_config import map_config
import numpy as np
class Map(map_config):
def __init__(self):
print(self.obstacle)
def draw_map(self):
#绘制地图,地图障碍物(黑色实心),起点(蓝色空心点),终点(绿色实心点)
self.image=np.ones((self.height,self.width,3),dtype=np.uint8)*255
for shape in se... |
import pygame
import cStringIO
import sys
from time import time
from capclient import CapClient
from touchclient import TouchClient
from rotationclient import RotationClient
from adbclient import AdbClient
MENU_TAP = 2
MENU_TIMEOUT = 10
MENU_BORDER = 10
MENU_WIDTH = 15
NAV_WIDTH = 7
DOUBLECLICK_TIME = 0.2
class Ma... |
from django.conf import settings
from django.urls import include, path
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
urlpatterns = [
path("", TemplateView.as_view(template_name="pages/home... |
def f(x):
z = f(True)
w = f("foo")
return z
return f(1)
# (('y' . (int=4@3, y@1)) ('x' . (int=3@3, x@1))) -> tup:[int=3@3, int=4@3],
# (('y' . (int=2@2, y@1)) ('x' . (bool=False, x@1))) -> tup:[bool=False, int=2@2],
# (('y' . (int=2@2, y@1)) ('x' . (bool=False, x@1))) -> tup:[bool=False, int=2@... |
'use strict'
exports.toBooleanConfig = function toBooleanConfig (configValue) {
if (configValue && typeof configValue === 'string') {
return (configValue === 'true')
}
return configValue
}
|
import { useCallback, useEffect, useRef } from 'react';
function useMountedState() {
const isMounted = useRef(false);
const get = useCallback(() => isMounted.current, [isMounted]);
useEffect(() => {
isMounted.current = true;
return () => {
isMounted.current = false;
}
});
return get;
}
... |
/**
* @license
* Copyright 2019 Google LLC.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* Code distributed by Google as part of this project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
import ... |
import sys
sys.path.append("../")
from appJar import gui
def changer(btn):
print(btn, app.entry(btn), "changed")
def submit(btn):
print(btn, app.entry(btn), "submitted")
def validater(btn):
if btn == "A":
app.setEntryBg("e1", "red")
app.setEntryBg("le1", "red")
app.setEntryBg("ld1... |
# Copyright (C) 2020 Aidil Aryanto.
# All rights reserved.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
import datetime
import asyncio
from telethon import events
from telethon.errors.rpcerrorlist import YouBlocked... |
// routes.js
// Let's create a new express router:
var express = require('express');
var router = express.Router();
var mainController = require('./controllers/main.controller');
var eventsController = require('./controllers/events.controller');
// let's export our router:
module.exports = router;
// let's define ou... |
#include <malloc.h>
#ifdef WIN32
#include <io.h>
#else
#include <stdio.h>
#include <unistd.h>
#include <arpa/inet.h>
#endif
#include <fcntl.h>
#include <sys/stat.h>
#include <sccli.h>
int N_Get_File_Size(fd)
int fd;
{
struct stat stat_s;
if(fd==0)return -1;
if(fstat(fd,&stat_s))return -1;
return stat_s.st_size;
}
i... |
#-*- coding: utf-8 -*-
#'''
# @date: 2020/6/9 下午12:16
#
# @author: laygin
#
#'''
from .lmdb_dataset import hierarchical_dataset, AlignCollate, BatchBalancedDataset
|
import { mount } from 'enzyme';
import wait from 'waait';
import toJSON from 'enzyme-to-json';
import { MockedProvider } from 'react-apollo/test-utils';
import RequestReset, { REQUEST_RESET_MUTATION } from '../components/RequestReset';
const mocks = [
{
request: {
query: REQUEST_RESET_MUTATION,
varia... |
const Symbol = require('./Symbol');
const SymbolTypes = require('./enums/SymbolTypes');
class RootSymbol extends Symbol{
/**
* Construct RootSymbol instance.
* //might require name change to a line
* @param x
* @param y
* @param width
* @param height
* @param value
*/
co... |
import React from 'react';
import PT from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { connect } from 'react-redux';
import { Systemtittel } from 'nav-frontend-typografi';
import { formValueSelector } from 'redux-form';
import ModalFooter from '../../../felles-komponenter/modal/modal-footer';
i... |
from collections import Iterable
from mathsat import msat_term, msat_env
from mathsat import msat_make_true, msat_make_false
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_rational_type
from mathsat import msat_make_and as _msat_make_and
from mathsat import msat_make_or as _... |
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define ('three.PDBLoader', ['three'], factory);
}
else if ('undefined' !== typeof exports && 'undefined' !== typeof module) {
module.exports = factory (require ('three'));
}
else {
factory (root.THR... |
const debugModule = require("debug");
const debug = debugModule("lib:debug:printer");
const path = require("path");
const safeEval = require("safe-eval");
const DebugUtils = require("@truffle/debug-utils");
const Codec = require("@truffle/codec");
const selectors = require("@truffle/debugger").selectors;
const {
s... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from . import models
# Create your tests here.
class TestProfileModel(TestCase):
def test_profile_creation(self):
User = get_user_model()
user = User.objects.create(
... |
#pragma once
#include "C_Base.h"
#include <SFML/Graphics.hpp>
class C_Drawable : public C_Base {
public:
C_Drawable(const Component& type) : C_Base(type) {}
virtual ~C_Drawable() {}
virtual void UpdatePosition(const sf::Vector2f& vec) = 0;
virtual const sf::Vector2u& GetSize() = 0;
virtual void Draw(sf::RenderW... |
#!/usr/bin/env python3
"""
Sorting algorithms visualizer using Tkinter.
This module jest comprised of three ``components'':
- an array visualizer przy methods that implement basic sorting
operations (compare, swap) jako well jako methods dla ``annotating'' the
sorting algorithm (e.g. to show the pivot element);
- a... |