text stringlengths 3 1.05M |
|---|
"""
Human-readable names for operators.
"""
import ast
OPERATION_DESCRIPTION = {
ast.Pow: "an exponent",
ast.Add: "an addition",
ast.Mult: "a multiplication",
ast.Sub: "a subtraction",
ast.Div: "a division",
ast.FloorDiv: "a division",
ast.Mod: "a modulo",
ast.LShift: "a left shift",
... |
# 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... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'form.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCor... |
const TgRequestContact = require("./TgRequestContact");
const TgSendAnimation = require("./TgSendAnimation");
const TgSendAudio = require("./TgSendAudio");
const TgSendDocument = require("./TgSendDocument");
const TgSendPhoto = require("./TgSendPhoto");
const TgSendText = require("./TgSendText");
const TgSendVideo = re... |
from typing import Tuple
import torch
import torch.distributed as dist
from torch import Tensor
from .core import (get_tensor_model_parallel_group, get_tensor_model_parallel_src_rank,
get_tensor_model_parallel_world_size)
from .core import ensure_divisibility
def divide(numerator, denominator):
... |
import os
import flask
from flask_cors import CORS
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import Flow
from googleapiclient.discovery import build
from controllers import Connections, Profile
from conversors import (
parse_userinfo_data,
parse_connections_data,
cre... |
#!/usr/bin/env jspm
import { dew } from './d.dew.js';
export default dew();
|
#!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'Daniel'
import tensorflow as tf
import numpy as np
# create data
x_data = np.random.rand(100).astype(np.float32)
y_data = x_data * 0.1 + 0.3
### create tensorflow structure start ###
# Weights = tf.Variable(tf.random_uniform_initializer([1], -1.0, 1.0))
# b... |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from conf.settings import ConfigMap
# 创建数据库db
db = SQLAlchemy()
def create_app(config):
'''
工厂模式创建app
@config: 'develop': 开发环境, 'product': 生产环境, 'test': 测试环境
'''
app = Flask(__name__)
# 加载配置文件
app.config.from_object(Confi... |
import tkinter
root = tkinter.Tk()
#視窗名稱
root.title('109-NKUST Information Technology Club')
#視窗大小
root.geometry('480x360')
# text:要顯示的文字
# bg:背景顏色
# font:自型設定
# width, height:寬, 高
lable = tkinter.Label(root, text='12/17有活動', bg='white',
font=('Arial', 12), width=30, height=2)
lable.place(relx=0.5,... |
let { updater } = require('@architect/utils')
let update = updater('Logs')
module.exports = function validate (/* opts*/) {
try {
if (process.env.ARC_AWS_CREDS === 'missing')
throw Error('missing or invalid AWS credentials or credentials file')
if (!process.env.AWS_REGION)
throw Error('@aws regi... |
var path = require('path');
var sessionUtils = require(path.resolve(__dirname,'../business_logic/session'));
var uuid = require('node-uuid');
var async = require('async');
var exceptions = require(path.resolve(__dirname,'../utils/exceptions'));
var ObjectId = require('mongodb').ObjectID;
var dalDb = require(path.resolv... |
#!/usr/bin/env python3
# Copyright (c) 2016-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test Hierarchical Deterministic wallet function."""
import os
import shutil
from test_framework.test_... |
#!/Users/localadmin/Library/Enthought/Canopy_64bit/User/bin/python2.7
import argparse
from bokeh.server.websocket import make_app
import logging
def build_parser():
parser = argparse.ArgumentParser(description="start bokeh websocket")
parser.add_argument("--url-prefix",
help="url prefix... |
/*!
* Qoopido.js library v3.3.9, 2014-6-3
* https://github.com/dlueth/qoopido.js
* (c) 2014 Dirk Lueth
* Dual licensed under MIT and GPL
*/
!function(t){window.qoopido.register("function/merge",t)}(function(t,e,n,o,r,u,f){"use strict";return function i(){var t,e,n,o,r,u=arguments[0];for(t=1;(e=arguments[t])!==f;t++)fo... |
/*!
* Copyright (c) 2015-2016, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
* Unless required by ... |
#!/usr/bin/env python
# coding=utf-8
import os
from subprocess import Popen, PIPE
import re
import platform
import socket
import time
import json
import threading
token = 'HPcWR7l4NJNJ'
server_ip = '192.168.47.130'
try:
import psutil
except ImportError as msg:
print(msg)
print("--------------------------... |
"""
Utilities to simplify the boilerplate for native lowering.
"""
from __future__ import print_function, absolute_import, division
import collections
import contextlib
import inspect
import functools
from enum import Enum
from .. import typing, cgutils, types, utils
from .. typing.templates import BaseRegistryLoade... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
from art.estimators.classification import TensorFlowV2Classifier, PyTorchClassifier
import numpy as np
import tensorflow as tf
import torch
from typing import Union, Tuple
class Classifier:
"""`Classifier` class."""
def __init__(
self,
classifier: Union[tf.Module, torch.nn.Module],
lo... |
#ifndef CLIENT_H
#define CLIENT_H
#include "client-state.h"
#include "user.h"
enum client_protocol {
CLIENT_PROTOCOL_IMAP = 0,
CLIENT_PROTOCOL_POP3
};
struct mailbox_source;
struct client_vfuncs {
void (*input)(struct client *client);
int (*output)(struct client *client);
void (*connected)(struct client *clien... |
import getpass
import os
def ensure_domain(domain):
if domain == "your-username.pythonanywhere.com":
username = getpass.getuser().lower()
pa_domain = os.environ.get("PYTHONANYWHERE_DOMAIN", "pythonanywhere.com")
return f"{username}.{pa_domain}"
else:
return domain
|
RD_VERSION = 0x00
GET_VALUE = 0x01
ERROR = -1
VCC = 65536
def getVersion(dev):
dev.send([RD_VERSION])
raw = dev.read(3)
return raw[1] + raw[2] * 256
def getValue(dev):
dev.send([GET_VALUE])
raw = dev.read(3)
if not(raw[1] == 255):
return VCC - (raw[1] + raw[2] * 256)
else:
... |
from cv2 import cv2
import numpy as np
import math
GAUSSIAN_SMOOTH_FILTER_SIZE = (5, 5)
ADAPTIVE_THRESH_BLOCK_SIZE = 19
ADAPTIVE_THRESH_WEIGHT = 9
def preprocess(imgOriginal):
imgGrayscale = extractValue(imgOriginal)
imgMaxContrastGrayscale = maximizeContrast(imgGrayscale)
height, width = imgGrayscale.sha... |
import numpy as np
import pytest
from pandas._libs import (
lib,
reduction as libreduction,
)
import pandas.util._test_decorators as td
import pandas as pd
from pandas import Series
import pandas._testing as tm
def test_series_grouper():
obj = Series(np.random.randn(10))
labels = np.array([-1, -1, ... |
import { g } from './basicVars.js';
import { mouseover, mousemove, mouseleave } from './hover.js'
function updateChart(continent, scales) {
const { xScale, yScale, g_xAxis, g_yAxis, xAxis, yAxis } = scales;
// Update the scales
xScale
.domain([0, d3.max(continent, (d) => d.value)]);
yScale
... |
import os
import sys
import argparse
import numpy as np
homepath = os.path.join('..', '..')
if not homepath in sys.path:
sys.path.insert(0, homepath)
import conf_cuhk_sar as conf
# Program arguments parser
data_txt = """
The input data. 'X' stands for image, 'A' stands for attribute, and 'S' stands
for segmenta... |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ... |
/**
* Copyright (c) Matthieu Jabbour. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
/* eslint-disable no-console */
/* eslint-disable import/no-unresolved */
process.env.NODE_ENV = 'development';
const fs ... |
#! /usr/bin/env python
"""A module for authenticating against and communicating with selected
parts of the Garmin Connect REST API.
"""
import json
import logging
import os
import os.path
import re
import sys
import zipfile
from datetime import timedelta, datetime
from builtins import range
from functools import wraps... |
//
// Copyright (c) articy Software GmbH & Co. KG. All rights reserved.
//
#pragma once
class UArticyImportData;
/**
*
*/
class ObjectDefinitionsGenerator
{
public:
static void GenerateCode(const UArticyImportData* Data);
private:
ObjectDefinitionsGenerator() {};
~ObjectDefinitionsGenerator() {};
};
|
/*
* Copyright Joyent, Inc. and other Node 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 rights to use, copy, m... |
# v. 1.2
# 07.09.2017
# Sergii Mamedov
"""
Gevent version.
Get metadata from all dois from a journal.
Journal`s urls: https://www.crossref.org/06members/51depositor.html
"""
import time
import json
import logging
import argparse
import requests
from tqdm import tqdm
import gevent
from gevent import monkey
# https:... |
from abc import abstractmethod
import re
import tensorflow as tf
import functools
from core.target_assigner import TargetAssignerExtend
from object_detection.core import box_list
from object_detection.core import box_predictor as bpredictor
from object_detection.core import model, box_list, box_list_ops, preprocessor... |
$("#date").click(function() {
var entitySelector = $("#tb").html('');
var params = {
url: ""
};
if($("#time1").val()!="" && $("#time2").val()!=""){
params.url='http://localhost/pi_dev/web/app_dev.php/dispo/dateajax/'+$("#date").val()+'/'+$("#time1").val()+'/'+$("#time2").val();
}
... |
import { CommonModule } from '@angular/common';
import { ɵɵdefineInjectable, Injectable, Optional, SkipSelf, InjectionToken, EventEmitter, Directive, ChangeDetectorRef, Input, Output, Component, ChangeDetectionStrategy, ViewEncapsulation, Inject, NgModule } from '@angular/core';
import { mixinDisabled, mixinInitialized... |
import numpy
from keras.layers import np
from keras.utils import Sequence
from utils import load_image, augment, preprocess, resize
APPLY_DATA_AUGMENTATION = True
class AutoencoderBatchGenerator(Sequence):
"""
Single image based batch generator. Generated inputs == generated labels (i.e., x == y) as require... |
import React from 'react'
import {Row} from 'antd'
import Header from './components/Header'
import './style/common.less'
export default class Common extends React.Component {
render() {
return (
<div>
<Row className="simple-page">
<Header menuType="second"/>
</Row>
<Row cl... |
/*
Lots of comments
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras ut lorem sem.
Vestibulum vehicula dolor ac elit dictum convallis. Vivamus rhoncus, neque id euismod tempor, justo nulla pellentesque nibh,
nec placerat mauris massa vel massa. Etiam cursus rutrum faucibus.
Mauris sem turpis, lacinia ... |
// 匹配带id_start属性的Unicode字符
const unicode_id_start_regex = /^([A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-... |
"""nomnom_server URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class... |
// var phonecatAnimations = angular.module('phonecatAnimations', ['ngAnimate']);
//
// phonecatAnimations.animation('.phone', function() {
//
// var animateUp = function(element, className, done) {
// if(className != 'active') {
// return;
// }
// element.css({
// position: 'absolute',
// ... |
import { useSelector, useDispatch } from "react-redux";
import * as sel from "selectors";
import * as ta from "actions/TransactionActions";
export function useHistoryTab() {
const window = useSelector(sel.mainWindow);
const tsDate = useSelector(sel.tsDate);
const currencyDisplay = useSelector(sel.currencyDisplay... |
# 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 ... |
import LinkComponent from '@ember/routing/link-component';
import layout from '../../templates/components/uk-tab/item';
export default LinkComponent.extend({
layout,
tagName: 'li',
activeClass: 'uk-active',
classNameBindings: ['disabled:uk-disabled'],
disabled: false
});
|
/**
******************************************************************************
* @file Project/Template/stm32f10x_it.h
* @author MCD Application Team
* @version V3.1.2
* @date 09/28/2009
* @brief This file contains the headers of the interrupt handlers.
*******************************... |
import tvm
from tvm import relay
from tvm.contrib import graph_executor as runtime
from tvm.relay.transform.pattern_manager.utils import is_function_node
from tvm.relay.transform.pattern_manager.target import measure, NUM_MEASUREMENTS_PER_REPEAT, NUM_REPEATS, AUTOSCH_LOG
from tvm.relay.transform.pattern_manager.target... |
# coding: utf-8
"""
Phaxio API
API Definition for Phaxio
OpenAPI spec version: 2.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class PhaxCode(object):
"""
NOTE: This class is auto generated by t... |
const expect = chai.expect;
import Vue from "vue";
import Row from "../src/grid/row.vue";
import Col from "../src/grid/col.vue";
Vue.config.devtools = false;
Vue.config.productionTip = false;
const Constructor1 = Vue.extend(Row);
const Constructor2 = Vue.extend(Col);
const init = (props, Constructor, fix) => {
... |
/*
* /MathJax/jax/output/PlainSource/jax.js
*
* Copyright (c) 2009-2018 The MathJax 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
*
* http://www.apache.org/lic... |
import cProfile
#------------------------------------------------------------------------------
# Debug
#------------------------------------------------------------------------------
#
# This file contains random snippets of code that I frequently use while
# developing and debugging parts of lighthouse. I don'... |
/*
* Copyright IBM Corp. 2004, 2010
* Interface implementation for communication with the z/VM control program
*
* Author(s): Christian Borntraeger <borntraeger@de.ibm.com>
*
* z/VMs CP offers the possibility to issue commands via the diagnose code 8
* this driver implements a character device that issues these ... |
# coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... |
#!/usr/bin/python2.4
#
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... |
from .syncer import JsonSyncer
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
|
from rest_framework.serializers import ModelSerializer
from .models import Task
from mmetrograd.users.models import User
class TaskListSerializer(ModelSerializer):
class Meta:
model = Task
fields = "__all__"
# fields = [
# "inn",
# "id",
# ]
class TaskDe... |
webpackJsonp([2],{1370:function(e,t,a){"use strict";t.a={data:function(){return{plugins:[{name:"vuetify-loader",href:"https://www.npmjs.com/package/vuetify-loader"},{name:"babel-plugin-transform-imports",href:"https://www.npmjs.com/package/babel-plugin-transform-imports"}]}}}},1371:function(e,t,a){"use strict";var o=fu... |
from app import app
import random
import string
import os
def random_file(type_file):
return "".join(random.sample(string.ascii_letters + string.digits, 32)) + "." + type_file
def upload(image):
"""
Upload image to Local
"""
try:
if not os.path.isdir(app.config["UPLOAD_FOLDER"]):
... |
# 509. Fibonacci Number
# 动态规划
# Runtime: 36 ms, faster than 44.34% of Python3 online submissions for Fibonacci Number.
# Memory Usage: 13 MB, less than 5.02% of Python3 online submissions for Fibonacci Number.
class Solution:
def fib(self, N: int) -> int:
if N == 0:
return 0
if N == 1:
... |
/*
YUI 3.16.0 (build 76f0e08)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("lang/calendar-base_hu",function(e){e.Intl.add("calendar-base","hu",{very_short_weekdays:["V","H","K","Sze","Cs","P","Szo"],first_weekday:1,weekends:[0,6]})},"3.16.0")... |
/* money.js 0.1.2, MIT license, josscrowcroft.github.com/money.js */
(function(g,j){var b=function(a){return new i(a)};b.version="0.1.2";var c=g.fxSetup||{rates:{},base:""};b.rates=c.rates;b.base=c.base;b.settings={from:c.from||b.base,to:c.to||b.base};var h=b.convert=function(a,e){if("object"===typeof a&&a.length){for(... |
/* trace:example/src/style-inc.css */
define(function(require, exports, module) {
var cssContent = ".menu{width:30px}";
var moduleUri = module && module.uri;
var head = document.head || document.getElementsByTagName("head")[0];
var styleTagId = "yom-style-module-inject-tag";
var styleTag = document.... |
// COPYRIGHT © 2021 Esri
//
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
//
// This material is licensed for use under the Esri Master License
// Agreement (MLA), and is bound by the terms of that agreement.
// You may redistribute... |
function getInfo(callback){
let timestamp = Math.floor(Date.parse(new Date())/1000)
let siteInfo
if(window.localStorage){
if(localStorage.infoTime>timestamp-3600){
siteInfo=JSON.parse(localStorage.siteInfo)
callback(siteInfo)
}else{
Vue.http.get('/api/geti... |
/*
* maintenance.c:
*
* Copyright (c) 2009-2016, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
*/
#include "pg_statsinfod.h"
#include <sys/types.h>
#include <sys/wait.h>
#define SQL_DELETE_SNAPSHOT "SELECT statsrepo.del_snapshot2(CAST($1 AS TIMESTAMPTZ))"
#define SQL_DELETE_REPOLOG "SELECT statsrepo.del_repolog2(... |
import numpy as np
from astropy import units as u
from poliastro.twobody.angles import E_to_nu, nu_to_E
from poliastro.util import alinspace
@u.quantity_input(min_nu=u.rad, ecc=u.one, max_nu=u.rad)
def sample_closed(min_nu, ecc, max_nu=None, num_values=100):
"""Sample a closed orbit
If ``max_nu`` is given, ... |
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/extensions/TeX/mathchoice.js
*
* Implements the \mathchoice macro (rarely used)
*
* -----------------------------------------... |
/**
*
* \file
*
* \brief This file is a skeleton for developing Ethernet network interface
* drivers for lwIP. Add code to the low_level functions and do a
* search-and-replace for the word "ethernetif" to replace it with
* something that better describes your network interface.
*
* Copyright (c) 2013-2018 Mic... |
/*
* Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import React from "react";
import SimpleTableFromJsonp from "./SimpleTableFromJsonp";
import DisplayODSp from "./DisplayODSp";
import Select from "react-select";
import queryGraphql from "..... |
/*global describe, it, require*/
import { File, Types } from "../lib/core/file";
let ContractsManager = require('embark-contracts-manager');
let Compiler = require('embark-compiler');
let Logger = require('embark-logger');
let TestLogger = require('../lib/utils/test_logger');
let Events = require('../lib/core/events')... |
"""Utilities for file download and caching."""
from __future__ import absolute_import
from __future__ import print_function
import functools
import tarfile
import os
import sys
import shutil
import hashlib
from six.moves.urllib.request import urlopen
from six.moves.urllib.error import URLError
from six.moves.urllib.er... |
/**
* Cesium - https://github.com/AnalyticalGraphicsInc/cesium
*
* Copyright 2011-2015 Cesium Contributors
*
* 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.apa... |
/**
* pong.c - Classic Pong implementation on the Amiga
*/
#include <stdio.h>
#include <string.h>
#include <hardware/custom.h>
#include <clib/exec_protos.h>
#include <clib/intuition_protos.h>
#include <clib/graphics_protos.h>
#include <clib/alib_protos.h>
#include <devices/keyboard.h>
#include <devices/input.h>
#in... |
import { motion } from "framer-motion";
import Link from "next/link";
import React, { useState } from "react";
import CardanoLogo from "../../lib/icons/CardanoLogo";
const gdsEase12 = {
duration: 0.7,
ease: [0.6, 0.01, -0.05, 0.9],
};
export default function LargeCards({ colors, list }) {
return (
<div clas... |
from talon import Context, Module, actions
ctx = Context()
mod = Module()
# Maps language mode names to the extensions that activate them. Only put things
# here which have a supported language mode; that's why there are so many
# commented out entries. TODO: make this a csv file?
language_extensions = {
# 'assem... |
export const hello = async (event) => {
return {
statusCode: 200,
body: JSON.stringify({
message: "NODE_ENV=" + process.env.NODE_ENV,
input: event,
}),
};
};
|
from django.test import TestCase, Client
from django.contrib.auth.models import User
from django.urls import reverse
from user_profile.forms import UserUpdateForm, ProfileUpdateForm
class MetaSetUp(TestCase):
fixtures = ["test_db.json"]
def setUp(self):
self.client = Client()
self.user = User... |
import typing
import numpy as np
def stack_delay_arr(
_arr: typing.Sequence[float], _num: int
) -> np.ndarray:
ret_list = []
for i in range(_num):
shift = i + 1
ret_list.append(_arr[_num - shift: -shift])
return np.stack(ret_list)
def stack_delay_arr_T(
_arr: np.ndarray,... |
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE127_Buffer_Underread__char_declare_memcpy_04.c
Label Definition File: CWE127_Buffer_Underread.stack.label.xml
Template File: sources-sink-04.tmpl.c
*/
/*
* @description
* CWE: 127 Buffer Under-read
* BadSource: Set data pointer to before the allocated memory ... |
//--------------------------------------------------------------------+
// fatfs diskio
//--------------------------------------------------------------------+
//extern "C"
#include "diskio.h"
#include "ff.h"
#ifdef __cplusplus
extern "C" {
#endif
DSTATUS disk_status ( BYTE pdrv )
{
(void) pdrv;
return 0;... |
#pragma once
namespace qif191
{
namespace t
{
class CUserDataXMLType : public TypeBase
{
public:
QIF191_EXPORT CUserDataXMLType(xercesc::DOMNode* const& init);
QIF191_EXPORT CUserDataXMLType(CUserDataXMLType const& init);
void operator=(CUserDataXMLType const& other) { m_node = other.m_node; }
static altova::... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 5, transform = "BoxCox", sigma = 0.0, exog_count = 0, ar_order = 0); |
# flake8: noqa
import abc
import sys
import pathlib
from contextlib import suppress
try:
from zipfile import Path as ZipPath # type: ignore
except ImportError:
from zipp import Path as ZipPath # type: ignore
try:
from typing import runtime_checkable # type: ignore
except ImportError:
def runtime... |
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'pastefromword', 'vi', {
confirmCleanup: 'Văn bản bạn muốn dán có kèm định dạng của Word. Bạn có muốn loại bỏ định dạng Word... |
# author: Fei Gao
# date: Sun Jun 1 18:45:42 2014
#
# Best Time To Buy And Sell Stock II
#
# Say you have an array for which the ith element is the price of a given stock
# on day i.
# Design an algorithm to find the maximum profit. You may complete as many
# transactions as you like (ie, buy one and sell one share of... |
def convert_to_number(algo):
binstr = ''.join(['0' if char == '.' else '1' for char in algo])
return int(binstr, 2)
def enhance1(iha, input_image, empty):
num_rows = len(input_image) + 4
num_cols = len(input_image[0]) + 4
image = []
for row in input_image:
image.append([empty, empty] + ... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNhY3Rpb25zX2ZpbmFuY2lhbF90eXBlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9uZXRzdWl0ZV93ZWJzZXJ2aWNlcy8yMDE5XzIvdHJhbnNhY3Rpb25zX2ZpbmFuY2lhb... |
module.exports = {
devServer: {
overlay: false,
},
};
|
import json
from typing import List, Tuple, Dict
import constants
import data.analysis.analysis_util as a_util
# adding comments to the number of reactions
N_REACTIONS = len(constants.FB_REACTIONS) + 1
N_BINS = 50
REACTION_NAMES = ([r.lower() for r in constants.FB_REACTIONS] + ["comment"])
def plot_histograms(n_bi... |
#ifndef _COMPILATOR_H_
#define _COMPILATOR_H_
/******************************************************************************/
// on suppose qu'il s'agit avr gcc
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/sleep.h>
#include <avr/wdt.h>
#include <avr/pgmspace.h>
// Redefinition des c... |
const express = require('express')
const router = express.Router();
const User = require('../models/user')
router.get('/', isLoggedIn, (req, res)=>{
// res.render('question.ejs',{user: req.user, questions: req.user.questions})
User.findByIdAndUpdate(req.user.id, {hasPlayed: true}, {new: true, upsert: true},... |
#!/usr/bin/python
import re, json, copy, sys
from main import *
### Hex to bin converter and vice versa for objects
def json_is_base(obj, base):
alpha = get_code_string(base)
if isinstance(obj, (str, unicode)):
for i in range(len(obj)):
if alpha.find(obj[i]) == -1:
return ... |
import { combineReducers } from 'redux';
const Reducers = combineReducers({});
export default Reducers;
|
# Theory: Comparisons
# Writing code without comparing any values in it will get you
# only so far. Now, it's time to master this skill.
# 1. Comparison operators
# Comparison or relation operations let you compare two values
# and determine the relation between them. There are ten
# comparison operators in Python:
... |
var PImage = require('../src/pureimage');
var fs = require('fs');
var fnt = PImage.registerFont('tests/fonts/SourceSansPro-Regular.ttf','Source Sans Pro');
// First test: render synchronously loading text
fnt.loadSync();
renderText('textSync');
// Second test: render asynchronously (font is loaded at this point so i... |
import matplotlib.pyplot as plt
a = input("Escribe el numero de personas que usan vehiculo: \n")
A = int(a)
while A < 0:
print("¡Ha escrito un número negativo! Inténtelo de nuevo")
a = input("Escribe el numero de personas que usan vehiculo: \n")
A = int(a)
b = input("Escribe el numero de person... |
// 为组件提供 install 方法,供组件对外按需引入
import Component from './src/index'
Component.install = Vue => {
Vue.component(Component.name, Component)
}
Object.assign(Component, {
title: '竞猜组件',
icon: 'iconfont iconbiaodan',
valueType: '',
defaultStyle: {
height: 375,
width: 375,
top: 0
}
})
export default Component
|
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
/**
* This JS file allows downloading png files from svg cavas. This codes belong to: https://github.com/exupero/saveSvgAsPng
*
*/
(function () {
var out$ = typeof exports != 'undefined' && exports || typeof define != 'undefined' && {} || this;
var doctype = '<?xml version="1.0" standalone="no"?><!DOCTYPE ... |
var group__DAP__Config__Timestamp__gr =
[
[ "TIMESTAMP_GET", "group__DAP__Config__Timestamp__gr.html#gaf9bdc40d3a256fc2cc4d26b295993d9c", null ]
]; |