text stringlengths 3 1.05M |
|---|
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include "Pass.h"
/**
* This pass only makes sense when applied at the end of a redex optimization
* run. It does... |
import os.path as op
import numpy as np
from ginipls.data.data_utils import load_data
from ginipls.__main__ import init_and_train_pls
from ginipls.models.ginipls import PLS, PLS_VARIANT
from ginipls.config import GLOBAL_LOGGER
logger = GLOBAL_LOGGER
def main():
X_train = [[2.0, 0.0, 7.0, 4, 5.2, 9.7], ... |
from .client import Client
from .server import Server
class Slient(Client, Server):
"""
Merges the methods of class:`.Client` & class:`.Server` to allow intercommunication
between two discord bots.
"""
def __init__(
self,
bot,
host="localhost",
base_port = 8654,
... |
/*
* Copyright 2018, University Corporation for Atmospheric Research
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
#ifdef _WIN32
#include ... |
/*
* FreeRTOS V202112.00
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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 Software without restriction, incl... |
import React, { PureComponent } from 'react';
import Icon from '../Icon';
import { Popover, Badge, Avatar } from 'antd';
import { router } from 'dva';
import cx from 'classnames';
import './style/index.less';
import logoImg from 'assets/images/logo.svg';
import SearchBox from './SearchBox';
const { Link } = router;
/*... |
router = require("@system.router")
export default {
data: {
title: '热门推荐',
increased: true,
opacity: 0.1,
msgbox_style: {
'display': 'none'
},
msgbox_style1: {
'display': 'none'
},
messageTitle: "口袋故事",
messageSubtitle:... |
// @flow
import { StyleSheet } from 'react-native';
import { viewportWidth, viewportHeight } from '../../Themes/';
export default StyleSheet.create({
container: {
flexDirection: 'column',
justifyContent: 'flex-start',
alignItems: 'center',
width: viewportWidth(100),
height: viewportHeight(100),
... |
#pragma once
#include "YarnSimNetHeter.h"
#include "Saver.h"
#include "Random.h"
#include "indicators/progress_bar.hpp"
#include "boost/format.hpp"
#include <cmath>
using namespace indicators;
void train_heter_full(std::string save_path, std::string data_path,
int epoch, int iter, int batch, int sample, int steps, ... |
import styles from './template.css';
import template from './template';
import AoflElement from '@aofl/web-components/aofl-element';
/**
* @summary IconTwotoneColorLensElement
* @class IconTwotoneColorLensElement
* @extends {AoflElement}
*/
class IconTwotoneColorLensElement extends AoflElement {
/**
* Creates... |
# (C) Copyright 2005-2021 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... |
import os
project_path = os.getenv("PROJECT_PATH")
data_path = os.path.join(project_path, "data")
output_path = os.path.join(project_path, "output")
model_cp_path = os.path.join(output_path, "model_checkpoint")
logger_path = os.path.join(output_path, "logs")
result_path = os.path.join(output_path, "result")
result_m... |
# CPU: 0.06 s
for _ in range(int(input())):
s, d = map(int, input().split())
# a + b = s => a = s - b
# a - b = d => a = b + d (assume a >= b)
# s - b = b + d
# b = (s - d) / 2
b = (s - d) / 2
a = s - b
if b >= 0 and b.is_integer():
print(int(a), int(b))
else:
print("impossible")
|
from django import forms
from django.core.exceptions import ValidationError
from app.training.models import Topic, Content
from app.widgets.ace import AceWidget
class TopicAdminForm(forms.ModelForm):
class Meta:
model = Topic
fields = '__all__'
widgets = {'course': forms.HiddenInput}
... |
import os
import setuptools
here = os.path.abspath(os.path.dirname(__file__))
# Get __version__ variable
exec(open(os.path.join(here, 'pytorch_pfn_extras', '_version.py')).read())
setuptools.setup(
name='pytorch-pfn-extras',
version=__version__, # NOQA
description='Supplementary components to acc... |
import {
CREATE_ORDER_REQUEST,
CREATE_ORDER_SUCCESS,
CREATE_ORDER_FAIL,
MY_ORDERS_REQUEST,
MY_ORDERS_SUCCESS,
MY_ORDERS_FAIL,
ALL_ORDERS_REQUEST,
ALL_ORDERS_SUCCESS,
ALL_ORDERS_FAIL,
UPDATE_ORDER_REQUEST,
UPDATE_ORDER_SUCCESS,
UPDATE_ORDER_FAIL,
UPDATE_ORDER_RESET,
DELETE_ORDER_REQUEST,
DE... |
import React from 'react';
import MapboxGL from '@react-native-mapbox/maps';
import {
View,
Image,
StyleSheet,
Dimensions,
Text,
ActivityIndicator,
} from 'react-native';
import BaseExamplePropTypes from './common/BaseExamplePropTypes';
import Page from './common/Page';
const styles = StyleSheet.create({
... |
from setuptools import find_packages, setup
__version__ = "1.5.1"
# Load README
with open('README.md', encoding='utf-8') as f:
long_description = f.read()
setup(
name='chemprop',
author='Kyle Swanson, Kevin Yang, Wengong Jin, Lior Hirschfeld, Allison Tam',
author_email='chemprop@mit.edu',
descrip... |
# -*- coding: utf-8 -*-
"""
Form implementation generated from reading ui file 'ui1.ui'. This module defines all the PyQT classes for creating the
Graphical User Interface. This file was generated automatically and editing it is not recommended.
"""
#
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All cha... |
/** redux-logger with different defaults. */
const IS_BROWSER = typeof window === 'object'
const repeat = (str, times) => (new Array(times + 1)).join(str)
const pad = (num, maxLength) => repeat('0', maxLength - num.toString().length) + num
const formatTime = (time) => `@ ${pad(time.getHours(), 2)}:${pad(time.getMinut... |
from dataclasses import dataclass
from typing import Optional
from ects.types.blockchain_format.sized_bytes import bytes32
from ects.util.ints import uint8, uint64
from ects.util.streamable import Streamable, streamable
@dataclass(frozen=True)
@streamable
class SubEpochSummary(Streamable):
prev_subepoch_summary_... |
import BaseComponent from '../core/base-component.js'
class ButtonGroup extends BaseComponent {
static get EVENTS() {
return {
ANSWER: 'answer',
CORRECTION: 'correction',
}
}
constructor({
rootElement,
childsSelector,
childActiveClass,
answerCondition = (activeButton) => activ... |
console.log('hello from main js');
var x,
calculate = function(number1, number2) {
return {
add: function() {
return number1 + number2;
},
subtract: function() {
return number1 - number2;
},
multiply: function() {
... |
'use strict'
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const path = require('path')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlug... |
import numpy as np
from numpy import testing
from skimage import data, color
from skimage.util import img_as_bool
from skimage.morphology import binary, grey, selem
lena = color.rgb2gray(data.lena())
bw_lena = lena > 100
def test_non_square_image():
strel = selem.square(3)
binary_res = binary.binary_erosio... |
/* -------------------------------------------------------------------------
* i2c-algo-bit.c i2c driver algorithms for bit-shift adapters
* -------------------------------------------------------------------------
* Copyright (C) 1995-2000 Simon G. Vogl
This program is free software; you can redistribute it ... |
from .ack import AckProtocolEntity
class OutgoingAckProtocolEntity(AckProtocolEntity):
'''
<ack type="{{delivery | read}}" class="{{message | receipt | ?}}" id="{{MESSAGE_ID}} to={{TO_JID}}">
</ack>
<ack to="{{GROUP_JID}}" participant="{{JID}}" id="{{MESSAGE_ID}}" class="receipt" type="{{read | }}">
... |
import datetime
import math
import time
from funcy.colls import walk_values, get_in
from funcy.seqs import take
from funcy import rpartial
from smokebase.exceptions import AccountDoesNotExistsException
from toolz import dissoc
from .amount import Amount
from .blockchain import Blockchain
from .converter import Conver... |
exports.min = function min(array) {
if (array === undefined || array.length === 0) return 0;
let min = array[0];
for (let i = 0; i < array.length; i += 1){
array[i] < min ? min = array[i] : min = min;
}
return min;
}
exports.max = function max (array) {
if (array === undefined || array.... |
// Generated by LispyScript v1.0.0
var display = function(value) {
return console.log(value);
};
var warn = function(value) {
return console.warn(value);
};
var newline = function() {
return console.log("");
};
var round = function(value) {
return parseInt(value,10);
};
var flip = function(fn) {
ret... |
# -*- coding: utf-8 -*-
# Copyright 2021 Tampere University and VTT Technical Research Centre of Finland
# This software was developed as a part of the ProCemPlus project: https://www.senecc.fi/projects/procemplus
# This source code is licensed under the MIT license. See LICENSE in the repository root directory.
# Auth... |
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import React from 'react';
import ReactDOM from 'react-dom';
import Markdown ... |
import os
from coinbase.wallet.client import Client
from portfolio import Portfolio
API_KEY = os.environ.get("COINBASE_API_KEY")
API_SECRET = os.environ.get("COINBASE_API_SECRET")
Portfolio.init(API_KEY, API_SECRET)
portfolio = Portfolio() |
import logging
import re
from streamlink.compat import urlparse
from streamlink.plugin import Plugin, PluginError, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
from streamlink.stream.http import HTTPStream
from streamlink.utils.parse import parse_qsd
log = loggi... |
import json
import numpy as np
from PIL import Image, ImageDraw
import os
def draw(I, boxes):
for box in boxes:
draw = ImageDraw.Draw(I)
# Draw bounding box in neon yellow
top, left, bottom, right = box[:4]
draw.rectangle([left, top, right, bottom], outline=(204, 255, 0))
d... |
'use strict';
var SynapsePay = require('../../lib/SynapsePay');
var _ = require('lodash');
// Make sure we are running in sandbox
SynapsePay.apiBase = SynapsePay.apiSandbox;
SynapsePay.clientId = "4528d2e0a2988064d8ac";
SynapsePay.clientSecret = "dcbf52b16040c94a35f345b7e2c285f936d673c9";
SynapsePay.User.login("3ac38... |
KISSY.add(KISSY.noop,{
requires:[
'./delegate',
'./delegate-advanced',
'./event',
'./fire',
'./focus',
'./group',
'./mouse'
]
}); |
const { events } = require('./data.json');
export default (req, res) => {
if (req.method === 'GET') {
res.status(200).json(events);
} else {
res.setHeader('Allow', ['GET']);
res.status(405).json({ message: `Method ${req.method} is not allowed` });
}
};
|
#%%
import sys
from typing import Any, List
import pandas as pd
sys.path.append('C:/Users/panos/Documents/Διπλωματική/code/fz')
from arfftocsv import function_labelize
# %%
def function_concat_df(dest: List[str], labels: List[str],
source: List[str])->pd.DataFrame:
"""
function that takes the dir of a number of csvs,... |
// Helper functions for emitting HTML from Javascript
let valid = function (value) {
return (typeof (value) !== "undefined") && (value !== null);
};
let block = function (block, attributes, content) {
let result = "<" + block;
if (valid (attributes)) {
let attributeNames = Object.keys (attributes);... |
from bs4 import BeautifulSoup
import requests
import csv
import sys
from urllib.error import HTTPError
sys.path.append("..")
import mytemp
import time
data={
'wid':'346171123114509',
'dateGroup':'9month'
}
header={
'Referer':'http://data.weibo.com/index/newindex?visit_type=trend&wid=3461711... |
from __future__ import division, print_function, unicode_literals
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "t 0.1, s, t 2, s, t 5.1, s, q"
tags = "point_to_world"
import cocos
from coco... |
"""Review learning information"""
from fastapi import APIRouter
from pydantic import BaseModel
router = APIRouter()
class ReviewInfo(BaseModel):
number_of_reviews: int
neighborhood: str
@router.post('/review_info')
async def review_neighborhood(info: ReviewInfo):
result = "The number of review is: " + s... |
"""
Builds the tensorflow graph neural networks for the actor and critic
"""
import tensorflow as tf
from settings import Settings
def build_Q_network(state, trainable, reuse, scope):
"""
Defines a Q network that predicts the Q-value (expected future return)
from taking a certain action from a given stat... |
import React from 'react';
import SignUp from './SignUp';
import HorizontalForm from './HorizontalForm';
import FormElements from './FormElements';
const RegularForms = () => (
<div>
<div className="row">
<div className="col-md-6">
<SignUp onSubmit={values => alert('Enter values: ' + JSON.stringify... |
/*
* 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 ... |
# coding=utf-8
# Copyright 2018 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/LICENSE-2.0
#
# Unless required by applicable... |
import math
import os
import torch
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
BatchNorm2d = nn.BatchNorm2d
def conv_bn(inp, oup, stride):
return nn.Sequential(
nn.Conv2d(inp, oup, 3, stride, 1, bias=False),
BatchNorm2d(oup),
nn.ReLU6(inplace=True)
)
def conv_1x1_... |
from rest_framework import viewsets
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.parsers import MultiPartParser
from rest_framework.response import Response
from rest_framework import status
from .serializers import PostSeriali... |
# qubit number=3
# total number=47
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from... |
import argparse
import os
import sys
import torch
# yapf: enable
# yapf: disable
sys.path.append(os.path.abspath(os.path.join(__file__, '../..'))) # isort:skip # noqa
import agilegan # isort:skip # noqa
from mmgen.apis import init_model, sample_uncoditional_model # isort:skip # noqa
def parse_args():
pars... |
const gulp = require('gulp');
const rename = require('gulp-rename');
const replace = require('gulp-replace');
const del = require('del');
/**
* Cleans the prpl-server build in the server directory.
*/
gulp.task('prpl-server:clean', () => {
return del('server/build');
});
/**
* Copies the prpl-server build to the... |
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import Carousel from './Carousel'
import * as serviceWorker from './serviceWorker';
ReactDOM.render((
<Carousel width={400} height={400}>
<img
draggable="false"
src="https://timgsa.baidu.com/t... |
/**
* Configuration container
*/
class Configuration {
/**
* Create a new configuration
* @param {String} privateKey
* @param {String} publicKey
* @constructor
*/
constructor(privateKey, publicKey) {
this.privateKey = privateKey;
this.publicKey = publicKey;
}
}
... |
#!/usr/bin/env python3
"""Home Assistant setup script."""
from datetime import datetime as dt
from setuptools import find_packages, setup
import homeassistant.const as hass_const
PROJECT_NAME = "Home Assistant"
PROJECT_PACKAGE_NAME = "homeassistant"
PROJECT_LICENSE = "Apache License 2.0"
PROJECT_AUTHOR = "The Home A... |
import tempfile
import os
from PIL import Image
from django.contrib.auth import get_user_model
from rest_framework import status
from rest_framework.test import APITestCase
from django.urls import reverse
from core.models import Recipe, Tag, Ingredient
from recipe.serializer import RecipeSerializer, RecipeDetailSeri... |
// dear imgui: Renderer Backend for modern OpenGL with shaders / programmatic pipeline
// - Desktop GL: 2.x 3.x 4.x
// - Embedded GL: ES 2.0 (WebGL 1.0), ES 3.0 (WebGL 2.0)
// This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, custom..)
// Implemented features:
// [X] Renderer: User tex... |
import store from '../store.js';
import AppConstants from '../constants/AppConstants';
const add = (type, content, duration = 3000) => {
const _id = Date.now();
const toast = { _id, type, content };
store.dispatch({
type : AppConstants.APP_TOAST_ADD,
toast,
});
setTimeout(() =>... |
/**
* Created by thomas on 2016-09-29 at 17:06.
*
* MIT Licensed
*/
var error = require("../error"),
send = require("../send");
module.exports = Contestant;
function Contestant(instance, ws, quiz_id, id) {
this.instance = instance;
this.model = instance.model;
this.ws = ws;
this.quiz_id = quiz... |
/* Generated by RuntimeBrowser
Image: /System/Library/Frameworks/UIKit.framework/UIKit
*/
@interface UIFeedbackGenerator : NSObject {
long long _activationCount;
NSObject<OS_dispatch_source> * _autoDeactivateTimer;
long long _autoDeactivationCount;
_UIFeedbackGeneratorConfiguration * _configurati... |
/*************************************************************************
**
** GSC-18128-1, "Core Flight Executive Version 6.7"
**
** Copyright (c) 2006-2019 United States Government as represented by
** the Administrator of the National Aeronautics and Space Administration.
** All Rights Reserved... |
import React from 'react';
import { storiesOf } from '@storybook/react';
import { ParticlesContainer } from './ParticlesContainer';
const svgParams = {
fps_limit: 28,
particles: {
number: {
value: 200,
density: {
enable: false,
},
},
line_linked: {
color: '#3CA9D1',
... |
ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRule... |
/*
CF3
Copyright (c) 2015 ishiura-lab.
Released under the MIT license.
https://github.com/ishiura-compiler/CF3/MIT-LICENSE.md
*/
#include<stdio.h>
#include<stdint.h>
#include<stdlib.h>
#include"test1.h"
int8_t x3 = 1;
int8_t x4 = 25;
uint32_t x13 = UINT32_MAX;
int64_t x21 = INT64_MAX;
uint32_t x26 = 19U;
uint16_... |
"""DNS Authenticator for Domain-Offensive."""
import logging
import requests
import zope.interface
from certbot import errors
from certbot import interfaces
from certbot.plugins import dns_common
logger = logging.getLogger(__name__)
ACCOUNT_URL = 'https://www.do.de/account/letsencrypt/'
API_URL = 'https://www.do.de... |
import DataService from '../DataService';
import fetchAction from './fetch';
export const BUILDS_REQUEST = 'BUILDS_REQUEST';
export const BUILDS_SUCCESS = 'BUILDS_SUCCESS';
export const BUILDS_FAILURE = 'BUILDS_FAILURE';
export const fetchBuilds = fetchAction([BUILDS_REQUEST, BUILDS_SUCCESS, BUILDS_FAILURE], DataServ... |
#pragma once
#include "skse/Utilities.h"
#include "skse/PapyrusVM.h"
class VMState;
class VMValue;
class VMClassRegistry;
struct StaticFunctionTag;
class EffectSetting;
class VMArgList
{
public:
VMArgList();
~VMArgList();
MEMBER_FN_PREFIX(VMArgList);
DEFINE_MEMBER_FN(GetOffset, UInt32, 0x00C3A... |
/*
* Copyright (C) 2005 - 2014 TIBCO Software Inc. All rights reserved.
* http://www.jaspersoft.com.
* Licensed under commercial Jaspersoft Subscription License Agreement
*/
/**
* @version: $Id: designer.contextmenu.js 6613 2014-07-18 09:12:59Z kklein $
*/
/*
* used to show dynamic menu based on context
* @p... |
import re
# put your regex in the variable template
template = r"Scaramouch."
string = input()
match = re.match(template, string)
if match:
print("Match")
else:
print("No match")
|
from logging.config import fileConfig
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from alembic import context
from source.infrastructure.settings import application_settings
from source.infrastructure.sqlalchemy import metadata
from source.infrastructure import tables
# this is the Alembic... |
import classnames from 'classnames';
import React, {Component} from 'react';
import {Link, withRouter} from 'react-router-dom';
import DataList from 'react/components/data_list';
import {SortDir, ColumnMeta, ListType} from '../types';
export default class SharedDesignList extends Component {
constructor(props, co... |
import * as React from 'react';
import IconButton from '@material-ui/core/IconButton';
import Badge from '@material-ui/core/Badge';
import MailIcon from '@material-ui/icons/Mail';
function notificationsLabel(count) {
if (count === 0) {
return 'no notifications';
}
if (count > 99) {
return 'more than 99 n... |
# -*- coding: utf-8 -*-
'''
Created on 29.11.2012
@author: 802300
'''
import datetime
from colors import *
from vis_calendar import *
class FDDEinzugNeu(BaiscCalendarModel):
tight = False
def beginn_vorlauf(self,due,vorlauf,bank,target):
einreichung_target = target.relative_workday(d... |
import os
import sys
import json
import argparse
from collections import abc
import time
from collections import defaultdict
from easydict import EasyDict
from tqdm import tqdm
import torch
import torch.nn.functional as F
from transformers import AutoTokenizer, PretrainedConfig
from utils.logger import LOGGER, TB_LOGGE... |
import React from "react";
// reactstrap components
import {
Button,
Card,
CardHeader,
CardBody,
FormGroup,
Form,
Input,
InputGroupAddon,
InputGroupText,
InputGroup,
Row,
Col
} from "reactstrap";
class Login extends React.Component {
render() {
return (
<>
<Row style={{displ... |
from __future__ import unicode_literals
import mock
import transaction as db_transaction
from freezegun import freeze_time
from sqlalchemy.exc import IntegrityError
from billy.models import tables
from billy.tests.functional.helper import ViewTestCase
@freeze_time('2013-08-16')
class TestDBSession(ViewTestCase):
... |
/*
* This header is generated by classdump-dyld 1.0
* on Saturday, June 1, 2019 at 6:50:16 PM Mountain Standard Time
* Operating System: Version 12.1.1 (Build 16C5050a)
* Image Source: /System/Library/AccessibilityBundles/AXSpeechImplementation.bundle/AXSpeechImplementation
* classdump-dyld is licensed under GPLv3, Cop... |
import requests
import threading
import time
import traceback
import re
import queue
from cmg.event import Event
from study_tool.russian.types import Aspect
from study_tool.russian.types import Case
from study_tool.russian.types import Gender
from study_tool.russian.types import Person
from study_tool.russian.types imp... |
from flask import Blueprint, request, render_template, redirect, flash, abort
from flask_login import login_manager, login_required, logout_user, LoginManager, login_user, current_user
from wtforms import Form, StringField, PasswordField, validators
from wtforms.validators import ValidationError
from .models import db,... |
"""walletproject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.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... |
#Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved.
#Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved.
#
#THE BSD LICENSE
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions
#are met:
#
... |
"""project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/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... |
import BaseComponent from '../base/Base';
import NestedComponent from '../nested/NestedComponent';
import _ from 'lodash';
import { uniqueKey } from '../../utils/utils';
export default class DataMapComponent extends NestedComponent {
static schema(...extend) {
return BaseComponent.schema({
label: 'Data Map... |
from ..taskapp.celery import app
from .models import Session, Offer
from django.core import files
import io
import requests
from slugify import slugify
@app.task
def create_offer(bot, item_name, item_description, giver_id,
contact_info, location_name, lat, lng, photo_file_id=None):
offer = Offer... |
import request from '@/utils/request'
export function GetAllRelationTree() {
return request({
url: '/Authorize/GetRelationTree',
method: 'get'
})
}
export function GetRelationTree(userID) {
return request({
url: '/Authorize/GetRelationTree?userID=' + userID,
method: 'get'
})
}
export function... |
import * as R from 'ramda'
import * as ObjectUtils from '@core/objectUtils'
import * as DateUtils from '@core/dateUtils'
import { uuidv4 } from '@core/uuid'
import * as Validation from '@core/validation/validation'
import * as Step from './processingStep'
import * as Calculation from './processingStepCalculation'
ex... |
#!/usr/bin/env python3
'''
###############################################################################
###############################################################################
## ##
## _ ___ ___ ___ ___ ___ ... |
from swsscommon import swsscommon
import os
import re
import time
import json
import redis
def getCrmCounterValue(dvs, key, counter):
counters_db = swsscommon.DBConnector(swsscommon.COUNTERS_DB, dvs.redis_sock, 0)
crm_stats_table = swsscommon.Table(counters_db, 'CRM')
for k in crm_stats_table.get(key)[1... |
/* This testcase is part of GDB, the GNU debugger.
Copyright 2011-2021 Free Software Foundation, Inc.
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 3 of the License, or
... |
n,a,b,c = [int(x) for x in input().split()]
dp = [-1]*(n+1)
dp[0]= 0
for x in set([a,b,c]):
for i in range(1,n+1):
if i-x >= 0 and dp[i-x] >= 0:
dp[i] = max(dp[i-x] + 1, dp[i])
# print(dp)
print(dp[-1])
# print(max(dp))
# 0 1 2 3 4 5
# 2 1 1 1
# 3 ... |
/**
*
* @param {String} equation Equation as string eg. '(5 * 4 - (7 ** 2 + 6) / 6)'
* @returns {Number} Result of the equation string following BODMAS
* @Note This function only supports the following operators: Parentheses: ( ), Exponent: **, Mulitplication: *,
* Division: /, Addition: +, Subraction: -
*/
exp... |
import numpy as np
import scipy as sp
import scipy.spatial
def find_near_points(boundary, target, r=6):
"""
Returns a bool with which points in target are too close to boundary
Where too close is:
dist < r * boundary.h_max
Parameters:
boundary, required, class(boundary_element)
... |
import { isModelReference } from '../utils/reference';
export default {
/**
* Determines whether an attribute is a reference.
* If it is not, return `null` or `undefined`.
* Otherwise return an object with properties:
* - `id` The id of the referenced model (either m3 or `@ember-data/model`)
* - `ty... |
const quizData = {
quiz1: "clear",
quiz2: "float",
quiz3: "margin",
quiz4: ".content",
quiz5: "clear",
};
var count = 0;
var score = 0;
// listen to form submission and get user data
var userForm = document.getElementById("form");
userForm.addEventListener("submit", (e) => {
e.preventDefault();
var userD... |
class SkipBackend(Exception):
pass
class BackendRegistry(list):
def __init__(self, registry_name, iterable):
super(BackendRegistry, self).__init__(iterable)
self.registry_name = registry_name
def __add__(self, value):
if value.registry_name != self.registry_name:
raise... |
from django.db import models
from analysis.person import Person
from analysis.web_simulation import WebSimulation
from analysis.virus import Virus
from web import settings
from django.utils import timezone
from django.urls import reverse
from data_structures.mwaytree import MWayTree, MWayTreeNode
from queue import Queu... |
const config = require('config');
const db = config.get('db');
module.exports = {
type: db.type || "mysql",
host: db.host || "localhost",
port: db.port || 3306,
username: db.username || "root",
password: db.password || "",
database: db.database || "contentry",
synchronize: db.synchronize ||... |
#!/usr/bin/python3
import numpy as np
import pandas as pd
import dask.array as da
import sys
import os
#fluidity_fp = '/mnt/c/Users/julia/fluidity/fluidity-master/python'
DA_project_fp = '/mnt/c/Users/julia/Documents/Imperial/DA_project'
#sys.path.append(fluidity_fp)
sys.path.append(DA_project_fp)
import vtktools... |
/*! Hammer.JS - v2.0.8 - 2016-04-23
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
* Licensed under the MIT license */
!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.f... |
const express = require('express')
const auth = require('../../middlewares/auth')
const validate = require('../../middlewares/validate')
const userValidation = require('../../validations/user.validation')
const userController = require('../../controllers/user.controller')
const router = express.Router()
router
.rou... |