text stringlengths 3 1.05M |
|---|
from .simple_revert import (
make_diff,
merge_diffs,
download_changesets,
revert_changes,
)
from .common import (
read_auth,
obj_to_dict,
dict_to_obj,
HTTPError,
RevertError,
api_request,
changes_to_osc,
changeset_xml,
upload_changes,
API_ENDPOINT,
)
|
import unittest
from common.utils import read_file
from .hyper import Hyper
class TestHyper3D(unittest.TestCase):
def setUp(self):
lines = read_file("d17/data/sample1.txt")
self.space = Hyper.parse_from_2D(lines, 3)
def test_initialize(self):
expected = read_file("d17/data/expected0.t... |
# 该程序用于将振动时域信号转换为频域信号
import numpy as np
import matplotlib.pyplot as plt
from scipy import pi
from scipy.fftpack import fft, rfft, fftfreq, rfftfreq
from scipy.signal import blackman, hann, hamming, kaiser, bartlett
from user_func_package import *
time_series = np.array([0,0.002,0.004,0.006,0.008,0.01,0.012,0.014,0.0... |
"""Reply to an image/sticker with .mmf` 'text on top' ; 'text on bottom
base by: @r4v4n4
created by: @A_Dark_Princ3
if you change these, you gay.
"""
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon import events
from io import BytesIO
from PIL import Image
import asyncio
import time
from dat... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import traceback
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.coverage',
'sphinx.ext.doctest',
'sphinx.ext.extlinks',
'sphinx.ext.ifconfig',
'sphinx.ext.napoleon',
'sphinx.ext.todo',... |
const Video = require('../models/video');
const VIDEOS_ITEMS_PER_PAGE = 10;
exports.getVideos = async (req, res, next) => {
const page = +req.query.page || 1;
try {
const numberOfVideos = await Video.countDocuments();
const videos = await Video.find()
.limit(VIDEOS_ITEMS_PE... |
# Copyright The OpenTelemetry Authors
#
# 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 ... |
/*
Copyright (C) 2021 The Falco Authors.
This file is dual licensed under either the MIT or GPL 2. See MIT.txt
or GPL2.txt for full copies of the license.
*/
#include "ppm_events_public.h"
#ifdef __KERNEL__
#include <linux/compat.h>
#include "ppm.h"
#else
#ifndef UDIG
#define CAPTURE_CONTEXT_SWITCHES
#define CAPTUR... |
import numpy as np
def SIMPLE(u_ps,v_ps,p_ps,del_h,del_v,del_t):
from GaussianElimination import gauss
import BoundaryCondition
geo_mat_shape = np.shape(p_ps)
cols = geo_mat_shape[0]
rows = geo_mat_shape[1]
abs_Conv = 0
#Define an Answer Array in 3D to be the Return Parameter
Ans... |
"""
You are given an array prices where prices[i] is the price of a given stock on the ith day.
You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock.
Return the maximum profit you can achieve from this transaction. If you cannot achieve... |
import React, { useState,useEffect } from 'react'
import $ from 'jquery';
import Select from 'react-select';
import { Form, Button, FormGroup, FormControl, ControlLabel } from "react-bootstrap";
import {
CButton,
CCard,
CCardBody,
CCardHeader,
CCol,
CContainer,
CJumbotron,
CRow,
CEmbed,
CDropdown,
... |
(function(){var l,m,n,r,o,j,i,p,t,s,k=Array.prototype.slice,u=Array.prototype.indexOf||function(c){for(var a=0,b=this.length;a<b;a++)if(a in this&&this[a]===c)return a;return-1},v=Object.prototype.hasOwnProperty,q=function(c,a){function b(){this.constructor=c}for(var e in a)v.call(a,e)&&(c[e]=a[e]);b.prototype=a.protot... |
#!/usr/bin/env python
# -*- encoding: utf-8
"""
Python source code - replace this with a description of the code and write the
code below this text.
"""
from os import environ
from cloudfs import *
client_id = environ['HUBIC_CLIENT_ID']
client_secret = environ['HUBIC_CLIENT_SECRET']
ref_token = environ['HUBIC_REFRE... |
/*******************************************************************************
* Copyright 2020 Pinterest, 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
*
* http://www.apac... |
# Single Channel Noise Removal using Iterative Wiener Filtering
# Copyright (C) 2019 Eric Bezzam, Laurent Colbois, Lionel Desarzens
#
# 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 ... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... |
import React, {Component} from 'react';
import PubSubHandler from './PubSubHandler';
import PubSubPublisher from './PubSubPublisher';
import AppBar from 'material-ui/AppBar';
import IconButton from 'material-ui/IconButton';
import NavigationClose from 'material-ui/svg-icons/navigation/close';
import FlatButton from '... |
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE126_Buffer_Overread__char_alloca_loop_54b.c
Label Definition File: CWE126_Buffer_Overread.stack.label.xml
Template File: sources-sink-54b.tmpl.c
*/
/*
* @description
* CWE: 126 Buffer Over-read
* BadSource: Set data pointer to a small buffer
* GoodSource: S... |
//
// Point.h
//
#ifndef POINT_H
#define POINT_H
#include<iostream>
class Point
{
public:
Point(void) : x(0), y(0) {}
Point(int xin, int yin) : x(xin), y(yin) {}
int norm2(void) const { return x*x + y*y; }
Point operator+(const Point& rhs) const;
Point operator-(const Point& rhs) const;
int x, y;
};
std... |
from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns(
'',
url(r'^$',
views.MediafileListView.as_view(),
name='mediafile_list'),
url(r'^new/$',
views.MediafileCreateView.as_view(),
name='mediafile_create'),
url(r'^(?P<pk>\d+)/edit/$',
... |
ace.define("ace/snippets/jsx",["require","exports","module"], function(require, exports, module) {
"use strict";
exports.snippetText =undefined;
exports.scope = "jsx";
}); (function() {
ace.require(["ace/snippets/jsx"], function(m) {
if (typeof module == "obj... |
"use strict";(self.webpackChunksolaswidget=self.webpackChunksolaswidget||[]).push([[501],{501:(t,e,n)=>{n.r(e),n.d(e,{Bounds:()=>tp,CanvasHandler:()=>Tg,CanvasRenderer:()=>Ug,DATE:()=>ee,DAY:()=>ne,DAYOFYEAR:()=>re,Dataflow:()=>Ki,Debug:()=>m.cG,Error:()=>m.jj,EventStream:()=>Ui,Gradient:()=>ud,GroupItem:()=>np,HOURS:(... |
var moment = require('moment');
var util = require('./util');
var Workflow = require('./workflow');
var articles = 0;
var currentTime = moment();
var dest;
var images = [];
var magazine;
var workflow = new Workflow();
workflow.addStep('Load magazine', function (done) {
var page = workflow._page;
page.open(magazin... |
# Stefan Bordei 2021
# Implementation of some of the objects in Pandas.
import numbers
class MySeries:
def __init__(self, data, index=None, name=None):
"""
Indexed series stored as a dict.
:param data: list, dict
Contains data stored in series.
:param index: ... |
import pytest
from pydantic import ValidationError
from ray.serve.config import (DeploymentConfig, DeploymentMode, HTTPOptions,
ReplicaConfig)
from ray.serve.config import AutoscalingConfig
def test_deployment_config_validation():
# Test unknown key.
with pytest.raises(Validatio... |
# Copyright (C) 2013 Nippon Telegraph and Telephone 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
import FDServices from 'FDServices';
import React, {Component} from 'react';
import {
Card,
CardHeader,
CardBody,
CardTitle,
Table,
Row,
Col,
UncontrolledDropdown,
DropdownToggle,
DropdownMenu,
DropdownItem,
Label,
FormGroup,
Input,
Button,
ButtonToolbar,
UncontrolledTooltip,
Modal, ... |
import { get } from "ember-metal/property_get";
import run from "ember-metal/run_loop";
import jQuery from "ember-views/system/jquery";
import EmberView from "ember-views/views/view";
import ContainerView from "ember-views/views/container_view";
var View, view;
QUnit.module("EmberView - replaceIn()", {
setup: funct... |
# -*- coding: utf-8 -*-
"""
Copyright 2017-2018 Shota Shimazu.
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 appl... |
import autofit as af
from autoastro.galaxy import galaxy as g
class Result(af.Result):
def __init__(
self,
instance,
figure_of_merit,
previous_model,
gaussian_tuples,
analysis,
optimizer,
):
"""
The result of a phase
"""
s... |
import React from 'react'
import {expect} from 'chai'
import {setup} from '../src'
/**
* The idea behind this is one could insert a custom stringifier like `flatted` for handling circular references.
*/
describe('setup custom stringifier', () => {
it('should match snapshots with a custom stringify function', () =>... |
from django.conf import settings
from django.utils.functional import lazy, memoize, SimpleLazyObject
def lazy_profile(request):
"""
Returns context variables required by templates that assume a profile
on each request
"""
def get_user_profile():
if hasattr(request,'profile'):
r... |
from openpyxl import load_workbook
filename = 'aalh_iit_tiedtkes_001.xlsx'
wb = load_workbook(filename)
ws = wb['Metadata Template']
minimumcol = 8
maximumcol = 8
minimumrow = 7
maximumrow = 154
iterationrow = 7
targetcol = 46
linkstring = 'Terms associated with the photograph are: '
for row in ws.it... |
/* ************************************************************************
* Copyright 2016-2019 Advanced Micro Devices, Inc.
* ************************************************************************ */
// general case for any alpha, beta, lda, ldb, ldc
template <typename T>
static __device__ void geam_device(rocb... |
import React from 'react';
import { useStaticQuery, graphql } from 'gatsby';
import styled from 'styled-components';
import Img from 'gatsby-image';
import SEO from '../components/seo';
import cssObj from '../styles/cssObj';
const ErrorContainer = styled.div`
display: grid;
justify-items: center;
align-co... |
import React, { Component } from 'react';
import { connect } from "react-redux";
import * as authorActions from "../../actions/authorActions";
import { bindActionCreators } from "redux";
import { withRouter } from "react-router-dom";
import AuthorEditForm from './AuthorEditForm';
import AuthorDetailsForm from './Auth... |
from .definitions import *
from . import html_engine
from .html_engine import save_report
|
import {TaskFileFromString} from '../bld/taskFileFromString';
import {SequenceSpy} from './sequenceSpy';
describe('TaskFileFromString', () => {
it('can create a file from a string', async () => {
let ffs = new TaskFileFromString(new SequenceSpy([
{name: 'update', args:['wrote file "/tmp/test.txt"']}
])... |
/* specplus2.c: Spectrum +2 specific routines
Copyright (c) 1999-2011 Philip Kendall
$Id: specplus2.c 804 2016-06-01 10:46:07Z fredm $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; ... |
Clazz.declarePackage ("J.render");
Clazz.load (["J.render.ShapeRenderer"], "J.render.HalosRenderer", ["JW.C"], function () {
c$ = Clazz.decorateAsClass (function () {
this.isAntialiased = false;
Clazz.instantialize (this, arguments);
}, J.render, "HalosRenderer", J.render.ShapeRenderer);
Clazz.overrideMethod (c$, "rend... |
"""AC 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-based view... |
# This file is part of the django-environ-2.
#
# Copyright (C) 2021 Serghei Iakovlev <egrep@protonmail.ch>
# Copyright (C) 2013-2021 Daniele Faraglia <daniele.faraglia@gmail.com>
#
# For the full copyright and license information, please view
# the LICENSE file that was distributed with this source code.
import os
imp... |
import { handleActions } from 'redux-actions';
import { Map, List, fromJS } from 'immutable';
import { requestPostAPI } from 'components/GRUtils/GRRequester';
import * as commonHandleActions from 'modules/commons/commonHandleActions';
const COMMON_PENDING = 'securityRule/COMMON_PENDING';
const COMMON_FAILURE = 'secur... |
(function(undefined) {
if (!("Intl"in self&&"DateTimeFormat"in self.Intl&&"formatToParts"in self.Intl.DateTimeFormat&&self.Intl.DateTimeFormat.supportedLocalesOf("mn").length
)) {
// Intl.DateTimeFormat.~locale.mn
/* @generated */
// prettier-ignore
if (Intl.DateTimeFormat && typeof Intl.DateTimeFormat.__addLocal... |
import { Component, ElementRef, HostListener, Renderer, ViewEncapsulation } from '@angular/core';
import { Config } from '../../config/config';
import { isPresent } from '../../util/util';
import { Key } from '../../util/key';
import { NavParams } from '../../navigation/nav-params';
import { ViewController } from '../.... |
from marshmallow import validate, validates, validates_schema, \
ValidationError, post_dump
from api import ma, db
from api.auth import token_auth
from api.models import User, Post
paginated_schema_cache = {}
class EmptySchema(ma.Schema):
pass
class DateTimePaginationSchema(ma.Schema):
class Meta:
... |
import random
import time
import speech_recognition as sr
# Enhancement!
# Result will be spoken like Alexa or google says
# Need to work on this part
def recognize_speech_from_mic(recognizer, microphone):
"""Transcribe speech from recorded from `microphone`.
Returns a dictionary with three keys:
"succes... |
module.exports = function(app, express){
var photosController = require('../photos/photos-controller.js');
app.get('/', function(req, res){
res.render('index');
});
app.get('/api/feed', photosController.getAllPhotos);
} |
'''
Rather than overlaying univariate histograms of intensities in distinct channels, it is also possible to view the joint variation of pixel intensity in two different channels.
For this final exercise, you will use the same color image of the Helix Nebula as seen by the Hubble and the Cerro Toledo Inter-American Ob... |
import React, { Component } from 'react';
import Identicon from 'identicon.js';
import makeBlockie from 'ethereum-blockies-base64';
class Navbar extends Component {
render() {
return (
<nav className="navbar navbar-dark fixed-top bg-dark flex-md-nowrap shadow mb-5">
<div class="container">
... |
#include "testing_utils.h"
/*
* Perform dot product of two matrices
*/
// Inplace transpose
void transpose(float **m, int n){
float temp;
for(int i=0; i<n; i++)
for(int j=i; j<n; j++){
temp = m[i][j];
m[i][j] = m[j][i];
m[j][i] = temp;
}
}
void dotProduct(... |
'''Retweet:
Retweet总共包含两个功能
1./今日新图 [标签]
该功能负责查询特定标签下今日最新的推文
2.自动推送
该功能会自动推送在配置里指定的用户/标签的最新消息
'''
from pathlib import Path
from datetime import datetime
import nonebot
from nonebot import on_command, require
from nonebot.adapters import Bot, Event
from nonebot.typing import T_State
from non... |
import re
import numpy as np
import astropy.modeling.models as models
import astropy.units as u
from astropy.wcs import WCSSUB_SPECTRAL
from glue.core.message import (SubsetCreateMessage,
SubsetDeleteMessage,
SubsetUpdateMessage)
from regions import Rectang... |
import logging
from app import db
logger = logging.getLogger(__name__)
db.Model.metadata.reflect(db.engine)
class OrderType(db.Model):
"""Create a data model for the database to be set up for capturing songs
"""
try:
__table__ = db.Model.metadata.tables['ordertypes']
except:
logger.e... |
/*
AUTHOR: FABER BERNARDO JUNIOR
DATE: 11/30/2021
PROGRAM SYNOPSIS: Compute the imput to make a series of triangles even and odd
ENTRY DATA: shapeValue, amountValue
OUTPUT DATA: triangle
*/
#include <stdio.h>
int main() {
int shapeValue, amountValue;
int processValue = 1;
int lines;
int columns;
char even... |
import _plotly_utils.basevalidators
class TextsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="textsrc", parent_name="waterfall", **kwargs):
super(TextsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
var PollerCollection = function(pollers) {
this.pollers = {};
this.addDefaultPollers();
};
PollerCollection.prototype.addDefaultPollers = function() {
this.add(require('./http/httpPoller.js'));
this.add(require('./https/httpsPoller.js'));
this.add(require('./oauthHttps/httpsPoller.js'));
this.add(require('... |
const mongoose = require("mongoose"),
Schema = mongoose.Schema;
const Token = new Schema(
{
userId: {
type: mongoose.Types.ObjectId,
ref: "User"
},
deviceToken: String,
platform: String,
},
);
module.exports = mongoose.model("Token", Token);
|
/*{
"targets": ["omnifocus"],
"type": "action",
"label": "清除选中 task 的推迟时间",
}*/
(() => {
const { getFlattenTasks } = require("@tomyail-workflow/omni-shared");
return new PlugIn.Action((selection, sender) => {
const target = selection.tasks;
getFlattenTasks(target).forEach((task) => {
task... |
let session = require('express-session');
let latestTweets = require('latest-tweets');
let User = require('../models/users.models');
let Follower = require('../models/followers.models');
let Feed = require('../models/tweet.models');
let commonFunction = require('./common.controller');
// -------------------------GET ... |
module.exports = {
rules: {
// 单引号
'string-quotes': 'single',
// 禁止未知的伪类选择器。
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: ['global', 'export', '/^my-/'],
},
],
// 禁止未知的 @ 规则。
'at-rule-no-unknown': null,
// 禁止在具有较高优先级的选择器后出现被其覆盖的较低优先级的选择器。... |
# -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
# ====================================================================
# Copyright (c) 2013 Carnegie Mellon University. All rights
# reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... |
from django.apps import AppConfig
class StreamingConfig(AppConfig):
name = 'streaming'
|
export default {
aliases: [ 'revoke' ],
args: [
{
name: 'accounts...',
desc: 'one or more specific accounts to revoke credentials'
}
],
desc: 'log out all or specific accounts from the AMPLIFY platform',
options: {
'-a, --all': 'revoke all credentials; supersedes list of accounts',
'--json': 'outputs... |
'''
a utility that stores lists of responses
categorized for the commands they are used for
'''
eightBall = [
'yes', 'no.', 'maybe?', 'idk dude', 'ask me later, I might answer then', 'why are you asking me?', 'I\'m not qualified to answer', 'sure, whatever',
'nah fam', 'fuck no', 'why would you?', '...... |
from django.contrib.auth.models import AbstractUser
from django.db import models
# Create your models here.
class User(AbstractUser):
mobile = models.CharField(max_length=11, unique=True, verbose_name='手机号')
class Meta:
db_table = 'tb_users'
verbose_name = '用户'
verbose_name_plural = v... |
from django.contrib import admin
from django.urls import path
from django.conf.urls import url
from graphene_django.views import GraphQLView
from urlShortener.views import short_url
urlpatterns = [
path('admin/', admin.site.urls),
path('graphql/', GraphQLView.as_view(graphiql=True)),
url(r'^(?P<short_url... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "typedDependencies", {
enumerable: true,
get: function get() {
return _dependenciesTyped.typedDependencies;
}
});
Object.defineProperty(exports, "ResultSetDependencies", {
enumerable: true,
get: ... |
#pragma once
#include "RE/B/BSLightingShaderMaterialBase.h"
#include "RE/N/NiColor.h"
namespace RE
{
class BSLightingShaderMaterialHairTint : public BSLightingShaderMaterialBase
{
public:
inline static constexpr auto RTTI = RTTI_BSLightingShaderMaterialHairTint;
virtual ~BSLightingShaderMaterialHairTint(); /... |
'use strict';
var config = require('../../src/lib/config');
var tape = require('tape');
tape('lib/config', function (t) {
t.test('should pull values from a .chippyrc file', function (t) {
t.equal(config('name'), 'chippy');
t.end();
});
t.test('should pull values from a package.json file', function (t) ... |
import os
def find(name, path):
for root, _, files in os.walk(path):
for file in files:
if 'sway-ipc' in file:
print(file)
return os.path.join(root, name)
print(find('sway-ipc.1000.1601.sock', '/run/user/'))
|
angular.module("schemaForm").run(["$templateCache", function($templateCache) {$templateCache.put("directives/decorators/bootstrap/actions-trcl.html","<div class=\"btn-group schema-form-actions {{form.htmlClass}}\" ng-transclude=\"\"></div>");
$templateCache.put("directives/decorators/bootstrap/actions.html","<div class... |
///////////////////////////////////////////////////////////////////////////////
// Global variables
///////////////////////////////////////////////////////////////////////////////
var nanocube_server_url = 'http://hdc.cs.arizona.edu/nanocube/10040/';
//var nanocube_server_url = 'http://localhost:29512/';
var quadtree_... |
# Copyright 2019- Robot Framework Foundation
#
# 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 la... |
module("core");
test("Framework Basic", function () {
eq(typeof FrameworkFactory, 'object');
eq(FrameworkFactory.version, '1.1.0');
var ns = FrameworkFactory.create();
neq(ns, undefined, 'The namespace ns must not be undefined.');
neq(ns, null, 'The namespace ns must not be null.');
eq(ns.versi... |
from tests_common import functions
from ui_tests.caseworker.pages.BasePage import BasePage
class FlagsListPage(BasePage):
BUTTON_ADD_FLAG_ID = "button-add-a-flag"
CHECKBOX_ONLY_SHOW_DEACTIVATED_NAME = "status"
def click_add_a_flag_button(self):
self.driver.find_element_by_id(self.BUTTON_ADD_FLAG_... |
/* eslint-disable react/jsx-wrap-multilines */
import React, { Component } from 'react'
import { Button, Card, CardBody, CardHeader, Col, Row } from 'reactstrap'
import ReactTable from 'react-table'
import 'react-table/react-table.css'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { Re... |
/*##################################################|*/
/* #CMS.PLACEHOLDERS# */
CMS.$(document).ready(function ($) {
// assign correct jquery to $ namespace
$ = CMS.$ || $;
/*!
* Placeholders
* @public_methods:
* - CMS.API.Placeholder.addPlugin(obj, url);
* - CMS.API.Placeholder.editPlugin(placeholder_id, ... |
import Equality from "./Equality.js";
// safeEquals...........................................................................................................
test("safeEquals undefined/undefined true", () => {
const left = undefined;
const right = undefined;
expect(Equality.safeEquals(left, right)).toBeTr... |
#!/usr/bin/python3
"""multiplies 2 matrices by using the module NumPy."""
import numpy
def lazy_matrix_mul(m_a, m_b):
"""multiplies 2 matrices"""
return (numpy.matmul(m_a, m_b))
|
/**
* Copyright (c) 2019 Leonardo Vencovsky
*
* This file is part of the C Macro Collections Libray.
*
* 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 wi... |
Arrivals = new Meteor.Collection("arrivals");
ThingStatus = new Meteor.Collection("information"); |
import pandas as pd
from pathlib import Path
import matplotlib.pyplot as plt
import seaborn as sns
import scanpy as sc
import json
from scipy.stats import zscore
import numpy as np
#----------------------------------------------------------------
f_gl='./out/a02_preserve_01_hm-pp/gene.json'
f_ada='./raw/count/h5ad/con... |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2021 BigML
#
# 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 ... |
import React from "react"
import PortfolioImage from "./portfolio_image"
const WebPreview = (props) => {
return (
<div
style={{
marginBottom: "4rem",
}}
>
<h2 style={{ textAlign: "center" }}>{props.titleLink}</h2>
<p> {props.text} </p>
<PortfolioImage name={props.img_nam... |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
import pytest
from indico.modules.events.timetable.models.entrie... |
import json
from flask import Blueprint, Response, jsonify, request
from cache import cache, make_cache_key
from db import db
from models.caseDevelopments import CaseDevelopments
from models.cases import (
CasesPerBundesland3DaysBefore, CasesPerBundeslandToday,
CasesPerBundeslandYesterday, CasesPerLandkreis3D... |
"""
WSGI config for api project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_... |
import logging
import time
import paramiko
from .local import LocalShell
from ....util import Bunch
log = logging.getLogger(__name__)
logging.getLogger("paramiko").setLevel(logging.WARNING) # paramiko logging is very verbose
__all__ = ('RemoteShell', 'SecureShell', 'GlobusSecureShell', 'ParamikoShell')
class Rem... |
/*Scripts For Request - SomeBottle*/
var $ = new Object();
$.ls = new Array();
$.lss = '';
$.hash = window.location.href;
var SC = function (e) {
if (e == 'body') {
return document.body;
} else {
return document.getElementById(e);
}
}
$.chash = function (h) { /*校验hash*/
if ($.tr(window.location.hre... |
/*
* cordova.plugins.zbtprinter.print = function(str, successCallback, errorCallback) {
cordova.exec(successCallback, errorCallback, 'ZebraBluetoothPrinter', 'print', [str]);
};
*/
//var ZebraBluetoothPrinterLoader = function (require, exports, module) {
var exec = require("cordova/exec");
function ZebraBlu... |
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
# coding=utf-8
# Copyright 2020 The Facebook AI Research Team 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://www.apache.org/licenses/LIC... |
/*
* File: controller_initialize.h
*
* MATLAB Coder version : 3.1
* C/C++ source code generated on : 22-Jun-2020 09:41:24
*/
#ifndef CONTROLLER_INITIALIZE_H
#define CONTROLLER_INITIALIZE_H
/* Include Files */
#include <math.h>
#include <stddef.h>
#include <stdlib.h>
#include "rt_defines.h"
#include "... |
import React from "react";
import { Switch, Route } from "react-router-dom";
import HomePage from "./pages/HomePage";
import Page404 from "./pages/Page404";
class App extends React.Component {
constructor(...args) {
super(...args);
}
render() {
const App = () => (
<div>
<Switch>
... |
(window.webpackJsonpcheckoutLoader=window.webpackJsonpcheckoutLoader||[]).push([[2],{160:function(e){e.exports=JSON.parse('{"optimized_checkout":{"address":{"address_line_1_label":"Adresse","address_line_1_required_error":"Es muss eine Adresse angegeben werden","address_line_2_label":"Wohnung/Etage/Gebäude","address_li... |
/*
* jQuery mmenu counters addon
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
* www.frebsite.nl
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_ADDON_ = 'counters';
var _c, _d, _e, glbl,
addon_initiated = false;
$[ _PLUGIN_ ].prototype[ '_addon_' + _ADDON_ ] = function()
{
if ( !addon_init... |
import { withNextInputAutoFocusForm } from 'react-native-formik';
import { View } from 'react-native';
export default withNextInputAutoFocusForm(View);
|
const nodeFetch = require('node-fetch')
const crypto = require('crypto')
const UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1'
/**
* https://www.cnblogs.com/vipstone/p/5514886.html
* 作者 王磊
*/
class Aes {
constructor(... |
"""
1329. Sort the Matrix Diagonally
Dificulty: Medium
Given a m * n matrix mat of integers, sort it diagonally in ascending order from the top-left
to the bottom-right then return the sorted array.
Example 1:
Input: mat = [[3,3,1,1],[2,2,1,2],[1,1,1,2]]
Output: [[1,1,1,1],[1,2,2,2],[1,2,3,3]]
"""
from typing import... |