text stringlengths 3 1.05M |
|---|
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesa... |
#ifndef TEST_SUITE
#define TEST_SUITE 1
#include "xcloc_finter.h"
#include <stdbool.h>
#ifdef __cplusplus
extern "C"
{
#endif
int test_serial_xcloc(void);
int test_serial_fdxc(void);
int test_serial_dsmLocation(void);
int xcfft_computeXCsWithISCL(const bool ldoPhase,
const int nsignals, ... |
from django.contrib import admin
# Register your models here.
from users.models import Topic
from .models import helpSession
from reservations.models import Reservation
class BoardmanAdmin(admin.ModelAdmin):
pass
admin.site.register(helpSession, BoardmanAdmin)
admin.site.register(Reservation, BoardmanAdmin... |
/*!
{
"name": "SVG as an <img> tag source",
"property": "svgasimg",
"caniuse" : "svg-img",
"tags": ["svg"],
"aliases": ["svgincss"],
"authors": ["Chris Coyier"],
"notes": [{
"name": "HTML5 Spec",
"href": "http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element"
}]
}
!*/
var Modernizr ... |
def extractTheMustangTranslator(item):
"""
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or 'preview' in item['title'].lower():
return None
if 'The Six Immortals' in item['tags']:
return buildReleaseMessageWithType(item, 'The Six Immortals', vol, chp, frag=f... |
import _extends from "@babel/runtime/helpers/builtin/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/builtin/objectWithoutProperties";
// @inheritedComponent ButtonBase
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import withStyles from '../s... |
from digit import Digit, DigitType
from decimal_digit import DecimalDigit
from binary_digit import BinaryDigit
from octal_digit import OctalDigit
from hexadecimal_digit import HexadecimalDigit
digit1 = DecimalDigit()
digit1.digit_value = '12'
print(digit1.get_binary()) #1100
print(digit1.get_octal()) #14
print(digit1... |
import { getCurrentItem } from './ChartDataUtil';
import { last } from './index';
/* eslint-disable no-unused-vars */
function mouseBasedZoomAnchor({
xScale,
xAccessor,
mouseXY,
plotData,
fullData,
}) {
const currentItem = getCurrentItem(xScale, xAccessor, mouseXY, plotData);
return xAccessor(currentIte... |
from __future__ import print_function
from __future__ import absolute_import
from keras.layers import Input, Dense, Activation, Flatten, Convolution2D, MaxPooling2D, ZeroPadding2D, AveragePooling2D, TimeDistributed, convolutional, core
from roipool import RoiPoolingConv
from keras import backend as K
import tensorflow... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
from bheap import *
from fheap import *
# Dijkstra algorithm
def dijkstra_list(graph, start):
# distances and parents init
distance = {}
parent = {}
for node in graph:
distance[node] = 'inf'
parent[node] = 'nil'
alist = []
distance[start] = 0
alist.append((1, start))
... |
/*******************************************************************************
*
* DO NOT EDIT THIS FILE!
* This file is auto-generated by fltg from
* INTERNAL/fltg/xgs/mon/bcm56780_a0/bcm56780_a0_MON_ETRAP_THRESHOLD.map.ltl for
* bcm56780_a0
*
* Tool: $SDK/INTERNAL/fltg/bin/fltg
*
* Edits to this fi... |
// Room: /d/suzhou/lingyanta.c
// Last Modified by winder on May. 15 2001
inherit ROOM;
void create()
{
set("short", "้ๅทๅก");
set("long",@long
้ๅทๅก๏ผๅๅๆฐธๅคๅฏถไฝๅก๏ผๅงๅปบๆผๆจไปฃใ้ซ็ดไธๅๅค็ฑณ๏ผ็บไธ็ดๅ
ซ
้ขๅกใๅก่บซไธๅปๅฏซ็โ้ๅทๅกโไธๅๅคงๅญใ
long);
set("outdoors", "suzhou");
set("exits",([
"west" : __DIR__"lingyansi",... |
#
# [The "BSD license"]
# Copyright (c) 2012 Terence Parr
# Copyright (c) 2012 Sam Harwell
# Copyright (c) 2014 Eric Vergnaud
# 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. Redis... |
import * as URL from '../common/api_url'
import ApiUtils from '../scripts/api_utils'
export default {
data() {
return {
// ๅ
ฅๅใใฉใกใฟ
email: '',
password: '',
visible_password: false,
}
},
methods: {
/**
* ใญใฐใคใณๅฆ็
*/
... |
from django.urls import path
from .views import HelloAPIView
urlpatterns = [
path("greeting/", HelloAPIView.as_view(), name="greeting")
]
|
"""
File name: train.py
Author: Manuel Cugliari
Date created: 15/03/2020
Python Version: 3.7.4
"""
import argparse
import logging
from src.models.prophet import train_PROPHET
from src.models.regression import train_REGRESSION
from src.models.train_arima import train_ARIMA
from src.models.train_rnn_seq2... |
const utils = require('../utils/utils');
const authRoutes = require('./auth/auth-routes')
module.exports.setup = (app) =>{
//Rutas de autenticaciรณn
app.use('/auth', authRoutes);
//Ruta Home
app.get('/', (req, res)=>{
res.json(utils.jsonRespuesta(res.statusCode, req.originalUrl, "Home"))
... |
from rest_framework import viewsets
from django_rest_framework.pagination import StandardResultsSetPagination
from staff_models.staffs.class_models.staff_phone import StaffPhone
from staff_models.staffs.class_serializers.staff_phone_serializers import StaffPhoneSerializer
class StaffPhoneViewSet(viewsets.ModelViewSe... |
#!/usr/bin/env python3
#
# Electron Cash - lightweight Syscoin client
# Copyright (C) 2019 Axel Gembe <derago@gmail.com>
#
# 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,... |
/* eslint-disable no-param-reassign */
import AsuModel from './AsuModel';
import AssociationModel from './AssociationModel';
const DataModel = AsuModel;
export default class AsuOrm {
constructor(sequelizeDb, asuModelDefs) {
this.db = sequelizeDb;
this.asuModelDefs = asuModelDefs;
this.tableInfo = {};
... |
""" Biorthogonal 2.2 wavelet """
class Biorthogonal22:
"""
Properties
----------
near symmetric, not orthogonal, biorthogonal
All values are from http://wavelets.pybytes.com/wavelet/bior2.2/
"""
__name__ = "Biorthogonal Wavelet 2.2"
__motherWaveletLength__ = 6 # length of the mother... |
# -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making ่้ฒธๆบไบ-่็น็ฎก็(BlueKing-BK-NODEMAN) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance ... |
/*!
* fastshell
* Fiercely quick and opinionated front-ends
* https://HosseinKarami.github.io/fastshell
* @author Hossein Karami
* @version 1.0.5
* Copyright 2016. MIT licensed.
*/
!function(n,t,e,i){"use strict";t.PROFILE={},PROFILE.skillIndicator=function(){var t,e,i,s,l;return s={module:"pr_progress",helperCl... |
import random
from typing import Any, Dict, Tuple
import numpy as np
import torch
import yaml
from torch import nn
from determined import experimental, pytorch
class OnesDataset(torch.utils.data.Dataset):
def __len__(self) -> int:
return 64
def __getitem__(self, index: int) -> Tuple:
return... |
from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/heat-3d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/heat-3d/tmp_files/447.c')
procedure('kernel_heat_3d')
loop(0)
tile( 0,2,8,2 )
tile( 0,4,8,4 )
tile( 0... |
(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{1117:function(e,t,n){"use strict";n.r(t),n.d(t,"CryptonExplore",(function(){return _}));var a=n(0),r=n.n(a),o=n(6),i=n.n(o),c=n(5),l=n(67),s=n(35),u=(n(1118),n(9)),d=n(1144),p=(n(240),n(172),n(1145)),f=n(1150),m=n(1142);function y(e){return(y="function"==typeof S... |
#!/usr/bin/env python
#
# Copyright (c) 2020 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
receive geometry_nav_msgs::Twist and publish carla_msgs::CarlaEgoVehicleControl
use max wheel steer angle
"""
import sys
import rospy... |
"""
Revision ID: 0142_validate_constraint
Revises: 0141_remove_unused
Create Date: 2017-11-15 14:39:13.657666
"""
from alembic import op
from sqlalchemy.dialects import postgresql
revision = '0142_validate_constraint'
down_revision = '0141_remove_unused'
def upgrade():
op.execute('ALTER TABLE notifications VAL... |
"""normalize and stem a document corpus
"""
import sys
import csv
import re
from textblob.nltk.tokenize import RegexpTokenizer
from textblob.nltk.stem import PorterStemmer
tokenizer = RegexpTokenizer(r'\b[a-zA-Z]+\b')
stemmer = PorterStemmer()
writer = csv.writer(sys.stdout)
with open(sys.argv[1], 'r') as stream:
... |
import { YAMLSemanticError } from '../../errors.js'
import { createPair, Pair } from '../../ast/Pair.js'
import { Scalar } from '../../ast/Scalar.js'
import { YAMLMap, findPair } from '../../ast/YAMLMap.js'
import { resolveMap } from '../../resolve/resolveMap.js'
export class YAMLSet extends YAMLMap {
static tag = '... |
from activityio._util.misc import *
|
#!/usr/bin/env python3
# coding=utf-8
# ******************************************************************
# log4j-scan: A generic scanner for Apache log4j RCE CVE-2021-44228
# Author:
# Mazin Ahmed <Mazin at FullHunt.io>
# Scanner provided by FullHunt.io - The Next-Gen Attack Surface Management Platform.
# Secure your... |
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.test import TestCase
from django.core.urlresolvers import reverse
from decimal import Decimal
from . import helper
from .models import Order, Product, Cash, validate_product_name
def _helper():
list = []
... |
/******************************************************************************
*
* Copyright (C) 2002 - 2014 Xilinx, Inc. All rights reserved.
*
* 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 Softw... |
#!/usr/bin/python
""" Unit tests for the NodeChainFactory
:Author: Jan Hendrik Metzen (jhm@informatik.uni-bremen.de)
:Created: 2008/11/04
"""
import unittest
import sys
import os
if __name__ == '__main__':
# The root of the code
file_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(fil... |
import random
from math import sqrt, acos
def normalize(vector):
v_sum = vector.x + vector.y
return Vector2D(vector.x / v_sum, vector.y / v_sum)
class Vector2D:
def __init__(self, x, y):
self.x = x
self.y = y
def __add__(self, other):
return Vector2D(self.x + other.x, self.y ... |
# sql/visitors.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Visitor/traversal interface and library functions.
SQLAlchemy schema and express... |
import React, { useEffect, useState } from 'react'
import IconButton from 'material-ui/IconButton'
import AddCartIcon from 'material-ui-icons/AddShoppingCart'
import DisabledCartIcon from 'material-ui-icons/RemoveShoppingCart'
import API from "../../utils/API";
import { withRouter } from 'react-router-dom'
import query... |
import numpy as np
import pandas as pd
import quandl, datetime
import math
from sklearn import preprocessing, cross_validation, svm
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
from matplotlib import style
import pickle
style.use('ggplot')
df = quandl.get('WIKI/GOOGL')
df = df[['... |
#!/usr/bin/env python3
import numpy as np
import math
from sklearn.preprocessing import StandardScaler,Normalizer,MinMaxScaler
##scaling methods
def normZ(sumAll):
"""
entrada: matriz na qual as colunas precisam ter os atributos escalados
saida: matriz de mesma dimensao de entrada com atributos das colunas escalad... |
# Copyright 2017 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 by applicable law or ag... |
/*
* $Id: debug_kgetch2.c,v 1.3 2006-01-08 12:04:22 clib2devs Exp $
*/
#include "debug_headers.h"
/****************************************************************************/
LONG
KGetCh(VOID)
{
LONG result;
result = kgetc();
return(result);
}
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <time.h>
#include <pthread.h>
#include <jansson.h>
#include "jsonrpc.h"
#include "jsonsocket.h"
#include "jsonrpc_internal.h"
typedef pthread_cond_t json_cond_t;
typedef pthread_mutex_t json_mutex_t;
typedef void *(*json_malloc_t... |
import request from '@/utils/request'
import qs from 'qs'
export function list(data) {
return request({
url: '/organization/list',
method: 'post',
data: qs.stringify(data)
})
}
export function save(data) {
return request({
url: '/organization/save',
method: 'post',
data: qs.stringify(dat... |
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(r... |
from __future__ import print_function
import sys, os
sys.path.insert(1, os.path.join("..", "..", ".."))
import h2o
from tests import pyunit_utils
from h2o.estimators import H2OUpliftRandomForestEstimator
def uplift_train_predict(uplift_metric, x_names, treatment_column, response_column, train_h2o, seed):
print("... |
module.exports.getArgs = () => {
const args = {};
process.argv.slice(2, process.argv.length).forEach(arg => {
// long arg
if (arg.slice(0, 2) === '--') {
const longArg = arg.split('=');
const longArgFlag = longArg[0].slice(2, longArg[0].length);
const longArgValue = longArg.length > 1 ? lo... |
# Copyright 2017 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 "license" file acc... |
# -*- coding:utf-8 -*-
__author__ = 'Randolph'
import os
import sys
import time
import logging
sys.path.append('../')
logging.getLogger('tensorflow').disabled = True
import tensorflow as tf
from text_hmidp import TextHMIDP
from utils import checkmate as cm
from utils import data_helpers as dh
from utils import param... |
var Client = require("./client");
var COVERED_RATE_CENTER_PATH = "coveredRateCenters";
module.exports = {
list: function(client, query, callback){
if (arguments.length == 2) {
let args = Array.from(arguments);
args.forEach(arg => {
if (arg instanceof Client) {
client = arg;
... |
$(function(){
$("#gauge").dxLinearGauge({
scale: {
startValue: 0,
endValue: 30,
tickInterval: 5,
tick: {
color: "#536878"
},
label: {
indentFromTick: -3
}
},
rangeContainer: {
... |
import logging
import time
import arrow
import json
import threading
import requests
from copy import deepcopy
from data_mgmt.helpers import convert_to_api_payload
from data_mgmt.helpers.mqtt_pub import MQTTPublisher
from influxdb import InfluxDBClient
from influxdb.exceptions import InfluxDBClientError
from influxdb.e... |
'''
Short Problem Definition:
Marie invented a Time Machine and wants to test it by time-traveling to visit Russia on the Day of the Programmer (the 256th day of the year) during a year in the inclusive range from 1700 to 2700.
Link
Day of The Programmer ( https://www.hackerrank.com/challenges/day-of-the-programmer/pr... |
'''
file: Credentials.py
Sets up API credentials for future data requests
Please follow steps at https://github.com/capsci/ShareCalendar for more details
'''
__author__ = "Kapil Somani"
__email__ = "kmsomani@ncsu.edu"
__status__ = "Prototype"
import os
from apiclient.discovery import build
import oauth2c... |
import bisect
import re
from typing import List, Tuple
from tool.runners.python import SubmissionPy
REGEX = re.compile(r"target area: x=([-0-9]+)..([-0-9]+), y=([-0-9]+)..([-0-9]+)")
def find_vx(x1: int, x2: int, x_targets: List[int]) -> int:
if x1 <= 0 <= x2:
return 0
if x2 < 0:
m = -1
... |
# Copyright 2019 Pascal Audet & Helen Janiszewski
#
# This file is part of OBStools.
#
# 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 ri... |
'''
Given a string S of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them.
We repeatedly make duplicate removals on S until we no longer can.
Return the final string after all such duplicate removals have been made. It is guaranteed the answer is unique.
... |
# 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
from ... import _utilities, _tables
from... |
/*! jQuery UI - v1.10.4 - 2015-03-29
* http://jqueryui.com
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
jQuery(function(e){e.datepicker.regional.he={closeText:"ืกืืืจ",prevText:"<ืืงืืื",nextText:"ืืื>",currentText:"ืืืื",monthNames:["ืื ืืืจ","ืคืืจืืืจ","ืืจืฅ","ืืคืจืื","ืืื","ืืื ื","ืืื... |
import json
from unittest import TestCase
from unittest.mock import ANY
from unittest.mock import patch
from bthomehub.client import BtHomeClient
from bthomehub.exception import AuthenticationException
def mocked_requests_post(*args, **kwargs):
class MockResponse:
def __init__(self, text, status_code):
... |
import multiprocessing as mp
from ctypes import c_int32
import pytest
import torch
import torch.nn as nn
import hivemind
from hivemind.compression import (
CompressionBase,
CompressionInfo,
Float16Compression,
NoCompression,
PerTensorCompression,
RoleAdaptiveCompression,
SizeAdaptiveCompre... |
from unittest.mock import Mock
import factory
import pytest
from botocore.stub import Stubber
from django.conf import settings
from django.core.cache import cache
from django.core.management import call_command
from django.db.models.signals import post_save
from elasticsearch.helpers.test import get_test_client
from p... |
/*
Mantis PCI bridge driver
Copyright (C) Manu Abraham (abraham.manu@gmail.com)
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; either version 2 of the License, or
(at your option) any later v... |
"""Illustrates use of the :meth:`.AttributeEvents.init_scalar`
event, in conjunction with Core column defaults to provide
ORM objects that automatically produce the default value
when an un-set attribute is accessed.
"""
from sqlalchemy import event
def configure_listener(mapper, class_):
"""Establish attribute... |
viewModel.chart = new Object()
var crt = viewModel.chart
crt.setMode = (what) => () => {
crt.mode(what)
if (what == 'render') {
crt.refresh()
}
}
crt.categoryAxisField = ko.observable('customer.channelname')
crt.title = ko.observable('')
crt.data = ko.observableArray([])
crt.series = ko.observableArray([])
crt.c... |
jQuery(document).ready(function(){
"use strict";
$('.summernote').summernote({
height: 350, // set editor height
minHeight: null, // set minimum height of editor
maxHeight: null, // set maximum height ... |
'use strict';
var _ = require('lodash');
var async = require('async');
var Mustache = require('mustache');
var defaultRequest = require('request');
var MessageBroker = require('./messagebroker');
var Storage = require('./storage');
var fs = require('fs');
var path = require('path');
var Utils = require('./common/utils... |
var R = 255;
var G = 127;
var B = 127;
function setup() {
canvas = createCanvas(451,451);
canvas.parent('processing');
frameRate(5);
}
function draw() {
for (var rij = 0;rij < 450;rij += 50) {
R = random(0,255);
G = random(0,255);
B = random(0,255);
for (var kolom = 0;kolom < 450;kolom += 50) ... |
import numpy as np
from sklearn.model_selection import StratifiedKFold
def process_data(df, subset=1.0):
bboxes = np.stack(df["bbox"].apply(lambda x: np.fromstring(x[1:-1], sep=",")))
for i, column in enumerate(["x", "y", "w", "h"]):
df[column] = bboxes[:, i]
df = df.drop(columns=["bbox"])
d... |
from manga_py.provider import Provider
from .helpers.std import Std
class MangaDexCom(Provider, Std):
_links_on_page = 100
_home_url = ''
def get_archive_name(self) -> str:
vol = self.chapter['vol']
if len(vol) == 0:
vol = '0'
return self.normal_arc_name({
... |
from .model import instance_cache_key, cached_method # noqa
from .receivers import post_save_cache, pre_delete_uncache # noqa
from .managers import CacheManager # noqa
from .query import CacheQuerySet # noqa
from .proxy import CacheProxy # noqa
|
number = int(input())
bonus = 0
if number <= 100:
bonus = 5
elif number > 1000:
bonus = 0.1 * number
else:
bonus = 0.2 * number
if number % 2 == 0:
bonus = bonus + 1
elif number % 10 == 5:
bonus = bonus + 2
print(bonus)
print(bonus + number) |
import copy
from PySide6.QtSql import QSqlRelationalDelegate
from PySide6.QtWidgets import QSpinBox, QStyle
from PySide6.QtGui import QPixmap, QPalette
from PySide6.QtCore import QEvent, QSize, Qt
class BookDelegate(QSqlRelationalDelegate):
"""Books delegate to rate the books"""
def __init__(self, parent=Non... |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 23 15:33:11 2018
@author: abouhana
"""
import os
import arcpy
import re
from arcpy import env
from arcpy.sa import *
#initial directory with all the subfolders and raw satellite imagery
mydir = r"C:\Students\Hanan\Thesis_work\Data\4Band\Lebanon"
#direct... |
'use strict'
const filters = require('./filters')
/**
* Instagram filters
*/
// Normal: no filters
module.exports.normal = [(pixels) => {
return pixels
}]
// Clarendon: adds light to lighter areas and dark to darker areas
module.exports.clarendon = [(pixels) => {
pixels = filters.brightness.apply(this, [pixels... |
let expect = require('chai').expect;
let createCalculator = require("../04. Add Subtract").createCalculator;
describe("createCalculator()", function () {
let calc;
beforeEach(function () {
calc = createCalculator();
});
it("should return 0 for get;", function () {
let value = calc.get... |
from DC3D import dc3d0, dc3d
from numpy import empty
def dc3d0wrapper(alpha, xo, depth, dip, potency):
u = empty(3)
grad_u = empty((3, 3))
u[0], u[1], u[2],\
grad_u[0, 0], grad_u[0, 1], grad_u[0, 2],\
grad_u[1, 0], grad_u[1, 1], grad_u[1, 2],\
grad_u[2, 0], grad_u[2, 1], grad_u[2, 2... |
const <%= PascalCaseName %>ViewModel = require("./<%= OriginalName %>-view-model");
/* ***********************************************************
* Use the "onNavigatingTo" handler to initialize the page binding context.
*************************************************************/
function onNavigatingTo(args) {
... |
import os
import json
import pandas as pd
import numpy as np
from urllib.parse import urlparse
from matplotlib import pyplot as plt
import statsmodels
from statsmodels.stats.inter_rater import fleiss_kappa
def image_url_converter(url: str):
'''
convert the image url into image number
@param url... |
/* @flow */
import React from 'react';
import type { Node } from 'react';
import cn from 'classnames';
import { Video } from '../../Icons';
import { stopPropagation } from '../../../utils/common';
import Option from '../../Option';
export type Props = {
expanded: boolean,
onExpandEvent: Function,
doCollapse: Fu... |
module.exports = function createDreamTeam(members) {
if (!(members instanceof Array)) {
return false;
}
let i = 0;
let companyName = '';
while (members.length > i) {
if (typeof (members[i]) === 'string') {
let member = members[i].trim().toUpperCase... |
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-vendors"],{"00ee":function(e,t,n){var i=n("b622"),r=i("toStringTag"),o={};o[r]="z",e.exports="[object z]"===String(o)},"0366":function(e,t,n){var i=n("1c0b");e.exports=function(e,t,n){if(i(e),void 0===t)return e;switch(n){case 0:return function(){return ... |
import secrets
import random
import time
from posw import *
from util import *
def random_tests():
print("Selecting from (0, 1)^1")
print(opening_challenge(t=10))
print(sha256H(1, 10))
print(sha256H(11, 0))
print(sha256H(100, 1))
print(sha256H(11, 100))
g = nx.DiGraph()
g.add_node(1)... |
"use strict";
const URL = require("url");
function normalizeUrl(url) {
const parsedUrl = URL.parse(url);
const { pathname: oldPathname } = parsedUrl;
if (oldPathname.endsWith("/")) {
// strip ending
const pathname = oldPathname.slice(0, oldPathname.length - 1);
updatePathname(parsedUrl, pathname);... |
import R from 'ramda';
import { combineReducers, createStore, applyMiddleware, compose } from 'redux'
// import { combineReducers } from 'redux-immutable'
import { persistStore, autoRehydrate } from 'redux-persist'
import immutableTransform from 'redux-persist-transform-immutable'
import { enableBatching } from 'redux... |
# --------------
# Importing header files
import numpy as np
import pandas as pd
from scipy.stats import mode
import warnings
warnings.filterwarnings('ignore')
#Reading file
bank_data = pd.read_csv(path)
#Code starts here
#Load Dataset
bank = pd.read_csv(path)
# Display categorical vari... |
# -*- coding: utf-8 -*-
#
# six documentation build configuration file
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like ... |
/**
* Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you 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.o... |
define('jira/field/init-multi-group-pickers', ['jquery', 'wrm/context-path', 'jira/ajs/select/multi-select', 'jira/util/events/reasons', 'jira/util/events/types', 'jira/util/events', 'jira/field/group-picker-util'], function (jQuery, wrmContextPath, MultiSelect, Reasons, Types, Events, GroupPickerUtil) {
'use stric... |
import numpy as np
import torch
import torch.nn as nn
from sinkhorn import SinkhornDistance
class ScaledDotProductAttention(nn.Module):
def __init__(self, d_k):
super(ScaledDotProductAttention, self).__init__()
self.d_k = d_k
def forward(self, q, k, v, attn_mask, n_it=1):
# |q| : (batc... |
from unittest import mock, TestCase
from sqlalchemy.exc import SQLAlchemyError
from app.models.updaters.role_updater import RoleUpdater
class RoleUpdaterTestCase(TestCase):
def setUp(self):
job_uuid = 'hoy_es_hoy'
iam_client = mock.MagicMock()
iam_client.get_roles.return_value = [
... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractApplePrivateKey = void 0;
const PRIVATE_KEY_REGEX = /(-+BEGINPRIVATEKEY-+)(.+[^-])(-+ENDPRIVATEKEY-+)/;
function extractApplePrivateKey(key) {
let keyString = key.replace(/[\r\n\s]+/g, '');
const matches = keyString.matc... |
"""
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.15.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bu... |
"""
Experiment summary
------------------
Treat each province/state in a country cases over time
as a vector, do a simple K-Nearest Neighbor between
countries. What country has the most similar trajectory
to a given country?
"""
import sys
sys.path.insert(0, '..')
from utils import data
import os
import sklearn
impo... |
# Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... |
import path from 'path';
import resolve from 'rollup-plugin-node-resolve';
import common from 'rollup-plugin-commonjs';
import json from '@rollup/plugin-json';
import replace from '@rollup/plugin-replace';
export default {
input: {
main: path.resolve(__dirname, 'main/index.js'),
},
external: [
... |
import {Component} from "./cervus/core";
import {Light} from "./cervus/components";
// import create_gizmo from "./gizmo";
export default
class NearbyLight extends Component {
// mount() {
// this.gizmo = create_gizmo();
// }
set(values) {
super.set(values);
if (this.active) {
... |
#pragma once
#include "../BridgeApiDef.h"
BRIDGE_API void flinit(const wchar_t* rootDir, const wchar_t* dataDir);
BRIDGE_API void call_main(const wchar_t* moduleName);
BRIDGE_API int __system_property_get_hook(const char *name, char *value);
BRIDGE_API const void* __system_property_find_hook(const char *name);
BRI... |
from typing import Iterable, Union, List, Dict, Optional, Tuple
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
class SupervisedHead:
"""
(Under construction)
Implements the supervised head class to facilitate behavioral
analyses of model outputs.
"""
de... |