text stringlengths 3 1.05M |
|---|
# Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
{
config.foo = true;
return config;
}
|
import * as Request from '../request'
import * as http from '../http'
import * as Time from '../time'
import * as Logger from '../logger'
import * as Listeners from '../listeners'
jest.mock('../http')
jest.mock('../logger')
jest.useFakeTimers()
describe('test request functionality', () => {
let dateNowSpy
let cr... |
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
from core.models import Recipe, Tag, Ingredient
from recipe.serializers import RecipeSerializer, RecipeDetailSerializer
RECIPES... |
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
"""Tests for the views of the ``roadmap`` app."""
from django.test import TestCase, RequestFactory
from ...views import RoadmapView
class RoadmapViewTestCase(TestCase):
"""Tests for the ``RoadmapView`` view class."""
def test_anonymous(self):
"""Should be callable when anonymous."""
req = Req... |
class ErasingCharacters:
def simulate(self, s):
l, f = len(s), True
while f:
f = False
for i in xrange(l-1):
if s[i] == s[i+1]:
s = s[:i] + s[i+2:]
l -= 2
f = True
break
re... |
import React, { Component } from 'react';
// charts
import HorizontalBarChart from './HorizontalBarChart';
import StackedChart from './StackedChart';
import LineChart from './LineChart';
import RadarChart from './RadarChart';
// css
import './Analytics.css';
// material ui
import AppBar from '@material-ui/core... |
# -*- coding: utf-8 -*-
#
# 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
#... |
"""weight_initialization
~~~~~~~~~~~~~~~~~~~~~~~~
This program shows how weight initialization affects training. In
particular, we'll plot out how the classification accuracies improve
using either large starting weights, whose standard deviation is 1, or
the default starting weights, whose standard deviation is 1 o... |
Ext.define('Shopware.apps.Rees46.view.element.Select', {
extend:'Shopware.apps.Base.view.element.Select',
alias:[
'widget.element-select',
'widget.element-combo',
'widget.element-combobox',
'widget.element-comboremote'
],
allowBlank: false,
typeAhead: false,
trans... |
import { isUndefined, isNull, exists, get } from '../lib/utils';
describe('utils.js', () => {
describe('isUndefined()', () => {
it('should return true if a value is undefined', () => {
let foo;
expect(isUndefined(foo)).toBe(true);
});
it('should return false if a value is not undefined', () ... |
# -*- coding: utf-8 -*-
'''
Encapsulate the different transports available to Salt. Currently this is only ZeroMQ.
'''
from __future__ import absolute_import
import time
import os
import threading
# Import Salt Libs
import salt.payload
import salt.auth
import salt.crypt
import salt.utils
import logging
from collectio... |
import Cos from "cos-js-sdk-v5";
var uploadImg = async function(file, type, callback) {
const cos = new Cos({
SecretId: "******************",
SecretKey: "*******************"
});
let filename = Date.now() + ".jpg";
cos.putObject(
{
Bucket: "ukulele-1301593316" /* 必须 ... |
# -*- coding: utf-8 -*-
import sys
import logging
import re
import xmlrpclib
import httplib
from django.conf import settings
from localshop.utils import now
from localshop.apps.packages import forms
from localshop.apps.packages import models
logger = logging.getLogger(__name__)
class ProxiedTransport(xmlrpclib.T... |
#import sys
#import pandas as pd
import numpy as np
#import config
#import os
#import mytools
def stockhistory(symbols,fromdate,todate):
from pandas_datareader import data, wb
try:
hist = data.DataReader(symbols, "yahoo", fromdate, todate)
#print hist
return hist
except Exception ... |
angular.module('phonegular.services')
/**
* Event dispatcher factory to use with your services.
*/
.factory('EventDispatcher', ['PhonegularClass', function(PhonegularClass) {
/**
* @constructor
*/
function EventDispatcher() {
PhonegularClass.call(this);
this._listeners = {};
}
phonegular.ext... |
class Node:
def __init__ (self,val):
self.left = None
self.right = None
self.value = val
class Tree:
def __init__(self):
self.root = None
def deltree(self):
self.root = None
def istreeempty(self):
return self.root == None
def PrintTree(self):
... |
from flask_jwt_extended import jwt_required
from flask_restplus import Namespace, reqparse, Resource, fields
from app.models.ingredient import Ingredient
from app.web.controllers.entities.basic_response import BasicResponse, BasicResponseSchema
from db import session
from schemas import IngredientClientSchema
ingredi... |
import Link from 'next/link'
import { signIn, signOut, useSession } from 'next-auth/client'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faGamepad, faRocket, faBars } from '@fortawesome/free-solid-svg-icons';
// The approach used in this component shows how to build a sign in and sign out... |
import sys
import random
print(sys.path)
print(sys.platform)
for i in range(10):
print(random.randint(1,10)) |
from django.shortcuts import render, HttpResponse, redirect
from django.views.generic import ListView, CreateView, TemplateView, UpdateView, DeleteView
from django.urls import reverse_lazy
from django.db.models import Q
from django.http import HttpResponseRedirect, FileResponse
from gestionStock.models import Proveedor... |
from functools import lru_cache
from typing import Any, Literal, Mapping, Protocol, Tuple, Type
from transformer.transformers.abstract import ExtraHashableModel, Transformer
from transformer.transformers.add_key import AddKeyValues, AddKeyValuesConfig
from transformer.transformers.aggregate_keys import (
Aggregate... |
/// Copyright (c) 2012 Ecma International. All rights reserved.
/// Ecma International makes this code available under the terms and conditions set
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
/// "Use Terms"). Any redistribution of this code must retain the above
/// copyright an... |
import pytest
from eth_utils import (
decode_hex,
)
def test_contract_deployment_no_constructor(web3, MathContract,
MATH_RUNTIME):
deploy_txn = MathContract.constructor().transact()
txn_receipt = web3.eth.wait_for_transaction_receipt(deploy_txn)
assert tx... |
import { resolve } from 'fs'
import reinstall from '../index'
import four from './four'
import five from './five.json'
const example = {
first: 1,
second: 2,
'third-e': [
'1',
'2',
'3',
'4',
],
five,
four,
}
const CONSTANT_NAME = 123
const valueName = 1 + CONSTANT_NAME
const getAsync = ... |
/* @flow */
var Reflux = require('reflux');
var AppActions = require('../actions.js');
function compareBy(func) {
return function(a, b) {
var a1 = func(a), b1 = func(b);
if (a1 < b1)
return -1;
if (a1 > b1)
return 1;
return 0;
};
}
var _playerSort = compareBy(function(p) { return p.Name.toLowerCase()... |
# Copyright 2020 Tensorforce Team. 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 la... |
var GMapsBaseLayer = require('../../../../src/geo/map/gmaps-base-layer');
describe('GMapsBaseLayer', function () {
it('should be type GMapsBase', function () {
var layer = new GMapsBaseLayer();
expect(layer.get('type')).toEqual('GMapsBase');
});
});
|
from . import mmd
from . import ragan
from . import rawgan
from . import sinkhorn_gan
from . import sinkhorn_sgd
from . import wgan
from . import linear_sinkhorn
from . import sing
|
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <F... |
# coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class CCEClusterInfo:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is ... |
/**
* Created by Administrator on 2017/7/12.
*/
import {
asmx
} from '@/utils'
/**
* Initial state
* @type {Object}
*/
const state = {
mapcenter: "118.133988, 24.5698",
maplevel: "10",
systitle: "天地图·厦门",
mapfullextent: "117.882220756,24.422481324,118.454166203,24.907266363",
xm_dataprovider: "提供单位:厦门市... |
"""
[5/7/2014] Challenge #161 [Medium] Appointing Workers
https://www.reddit.com/r/dailyprogrammer/comments/24ypno/572014_challenge_161_medium_appointing_workers/
# [](#IntermediateIcon) _(Intermediate)_: Appointing Workers
In the past, we've already tackled the challenge of deciding in which order to do certain jobs... |
#!/usr/bin/python3
"""
.. moduleauthor:: Albert Heinle<albert.heinle@gmail.com>
"""
#import threading
import multiprocessing
import constants
from nltk.tokenize import word_tokenize
import os
import logging
class Matcher(multiprocessing.Process):
"""
This is one of an army of in parallel running Threads.
... |
import unittest
from urllib.parse import urlencode
from django.core import mail
from django.core.exceptions import ValidationError
from django.template import Context
from django.template import Template
from django.urls import reverse
from .base import TestBase
from ..models import (
Person,
Role,
Traini... |
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2020 Nortxort
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,... |
"use strict";
function ForgetUnus() {
var hero = Players.GetPlayerHeroEntityIndex(Players.GetLocalPlayer());
if (Entities.GetUnitName(hero) == "npc_dota_hero_wisp") {
GameEvents.SendCustomGameEventToServer("formless_forget", {
"skillname_to_forget": "formless_unus",
"skill_index... |
// Generated by CoffeeScript 2.3.2
(function() {
'use strict';
var $, $async, CND, FS, NET, O, PATH, PS, RPC_SERVER, alert, badge, counts, debug, echo, help, info, rpr, urge, warn, whisper;
//###########################################################################################################
CND = requi... |
"""Describe Shelly logbook events."""
from __future__ import annotations
from typing import Callable
from homeassistant.const import ATTR_DEVICE_ID
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.typing import EventType
from . import get_device_wrapper
from .const import (
ATTR_... |
// import { delay } from 'redux-saga';
import { takeLatest, call, put, select } from 'redux-saga/effects';
import { getUserRoles } from '../AppHub/selectors';
import * as api from '../../utils/api';
import * as actions from './actions';
import * as C from './constants';
export const base = API.PAS;
export functio... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isEmpty = void 0;
/**
* Returns true if the received number represents the empty value (i.e., zero).
* @param {number} target
* @returns boolean
*/
var isEmpty = function (target) {
return target === 0;
};
exports.isEmpty = isEmp... |
module.exports = {
docs: {
'Getting started': [
'Installation',
'Screenshot tour',
'Roadmap'
],
'Guides': [
'guides/Source screen',
'guides/Backtrace screen',
'guides/Variable screen',
'guides/Thread screen',
'guides/REPL console screen',
'guides/Filte... |
const GenericCommand = require('../../models/GenericCommand');
module.exports = new GenericCommand(
async ({ Memer, msg, addCD }) => {
let { pocket } = await Memer.db.getUser(msg.author.id);
if (pocket.coin === 0) {
return { title: 'You have no coins.' };
}
let coinFlip = Memer.randomNumber(1, ... |
const { Router } = require('express')
const grantConfig = require('./utils/factory-grant-config')()
const getTokenFromCode = require('./utils/get-token-from-code')
const getStoryblokClient = require('./utils/get-storyblok-client')
const router = Router()
router.get('/callback', async function (req, res) {
const { s... |
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the BTRCENSE file. See the AUTHORS file for names of contributors.
//
// This file contains the specification, but not the implementations,
// of the types/operations/etc... |
module.exports = (app)=>{
app.router.resources('logs','/api/logs', app.controller.admin.log)
// app.post('/back/delete', app.controller.admin.main.delete);
// app.post('/back/updateRoles', app.controller.admin.main.updateRoles);
app.router.resources('nav','/api/auth', app.controller.admin.auth); // 菜单... |
import FastfoodIcon from "@material-ui/icons/Fastfood";
import LocalDrinkIcon from "@material-ui/icons/LocalDrink";
import CastForEducationIcon from "@material-ui/icons/CastForEducation";
import BusinessCenterIcon from "@material-ui/icons/BusinessCenter";
import CommuteIcon from "@material-ui/icons/Commute";
import Dri... |
export { clone } from './clone'
export { getCell } from './getCell'
export { setCell } from './setCell'
export { getCol } from './getCol'
export { getRow } from './getRow'
export { getSquare } from './getSquare'
export { getCoordinatesFromIndex } from './getCoordinatesFromIndex'
export { removeDuplicates } from './remo... |
"""
Write a Python program to remove key values pairs from a list of dictionaries.
"""
original_list = [{'key1':'value1', 'key2':'value2'}, {'key1':'value3', 'key2':'value4'}]
print("original list: ")
print(original_list)
new_list = [{k: v for k, v in d.items() if k != 'key1'} for d in original_list]
print("New List: "... |
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 14.2.1
description: >
ArrowParameters[Yield] :
...
CoverParenthesizedExpressionAndArrowParameterList[?Yield]
CoverParenthesizedExpressionAndArrowPar... |
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
/* Layout */
import Layout from '@/layout'
/* Router Modules */
import componentsRouter from './modules/components'
import tableRouter from './modules/table'
import nestedRouter from './modules/nested'
/**
* Note: sub-menu only appear when route... |
let handler = async (m, { conn, usedPrefix: _p }) => {
let info = `
*⚠GRUP BOT⚠*
1. https://chat.whatsapp.com/L508viIjjPwHpYEqgTxqj6
`.trim()
conn.fakeReply(m.chat, info, '0@s.whatsapp.net', '*🔥 BOT TERPERCAYA 🔥*', 'status@broadcast')
}
handler.help = ['gcb', 'gcbt']
handler.tags = ['main', 'update']
handler.comman... |
from django.apps import AppConfig
class LnurlserverConfig(AppConfig):
name = 'lnurlserver'
|
"""
Global fixtures and functions for pytest
pytest can only share fixtures between modules if they are declared here.
"""
import logging
import os
import pytest
from loguru import logger
import genomepy.providers
from genomepy.providers.base import BaseProvider
from genomepy.providers.ensembl import EnsemblProvider
... |
/*
** $Id: luasql.h,v 1.12 2009/02/07 23:16:23 tomas Exp $
** See Copyright Notice in license.html
*/
#ifndef _LUASQL_
#define _LUASQL_
#ifndef LUASQL_API
#define LUASQL_API
#endif
#define LUASQL_PREFIX "LuaSQL: "
#define LUASQL_TABLENAME "luasql"
#define LUASQL_ENVIRONMENT "Each driver must have an environment meta... |
(function() {
/**
* Профилировщик.
* @mixin
* @description
* Этот mixin надо подмешивать в прототип класса.
* ```js
* no.extend(ns.Update.prototype, no.profile);
* ```
*/
ns.profile = {};
/**
* Ставит начальную точку отчета для метрики.
* @param {string} l... |
// This file is part of InvenioRDM
// Copyright (C) 2020-2022 CERN.
// Copyright (C) 2020-2022 Northwestern University.
// Copyright (C) 2021-2022 Graz University of Technology.
//
// Invenio RDM Records is free software; you can redistribute it and/or modify it
// under the terms of the MIT License; see LICENSE file f... |
/* COPYRIGHT 2012 SUPERMAP
* 本程序只能在有效的授权许可下使用。
* 未经许可,不得以任何手段擅自使用或传播。*/
/**
* @requires SuperMap/BaseTypes/Class.js
* @requires SuperMap/Map.js
* @requires SuperMap/Projection.js
*/
/**
* Class: SuperMap.Layer
* 图层类。
*/
SuperMap.Layer = SuperMap.Class({
/**
* APIProperty: id
* {String}图层id,唯... |
#!/usr/bin/env python
import traceback
import sys,os,os.path,string,time
import re
import stat
import optparse
#-------------------------
import common
import UserCollector
import VOFrontend
from Condor import Condor
from Configuration import ConfigurationError
#-------------------------
#os.environ["PYTHONPATH"] = ""... |
// крестики, сердечки и цветочки (для красоты)
// †♥♥♥♥♥✿♥✿♥✿♥✿♥✿♥✿♥✿♥✿♥✿♥✿♥✿✿✿✿✿✿†
var desudesuicon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAADAFBMVEUYAAAoEhUXHBxKGhgVKxgQMgdUHRYpLS1OKx1pJyFGMTFhLCR0LSY3PT0fSix0MS08QTYtRjRuNix/PTWGPDdKTU4hXSx7QjReTEs7YCmASkZdVj4YbDKNSUJ0UE0xaDtZWVyIT0B6V... |
from django.urls import path
from .api import UserAPI, LoginAPI, RegisterAPI
from knox import views as knox_views
urlpatterns = [
path('login/', LoginAPI.as_view(), name="login"),
path('register/', RegisterAPI.as_view(), name="register"),
path('user/', UserAPI.as_view(), name="user"),
path('logout/', k... |
import numpy as np
import pickle
from sklearn.model_selection import KFold
import torch
import pandas as pd
import numpy as np
from sklearn import preprocessing
def csv_load(filename, cost_from_file):
# csv format
# 1st row : cost from 2nd col (align with column name in 2nd row) if
# cost_from_file if Tr... |
# 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... |
from maintain_frontend.services.validation.field_validator import FieldValidator
from maintain_frontend.services.validation.validation_error_builder import ValidationErrorBuilder
class ChargeTypeValidator(object):
@staticmethod
def validate(charge_type):
"""Specifies which validation methods should b... |
from datetime import datetime
import configparser
import argparse
import envoy
import boto
import os
import sys
import shutil
from boto.s3.key import Key
from ut.others.mo2s3 import default_conf
cfg = configparser.SafeConfigParser()
cfg_file = os.path.expanduser("~/.mo2s3.cfg")
if not os.path.isfile(cfg_file):
wit... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import guy,asyncio
class progress(guy.Guy): # name the class as the web/<class_name>.html
__doc__="""
<style>
body {background: #EEE}
.pb {
border:1px solid black;
background:white;
}
.pb div {
background:blue;
height:20%;
width:0px;
}
</style>
... |
# -*- coding: utf-8 -*-
# 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... |
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
module.exports = {
// All imported modules in your tests should be mocked automatically
// automock: false,
// Stop running tests after `n` failures
// bail: 0,
// The directory where... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace 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/LICENS... |
'''
This module samples from any probability distribution.
'''
__version__ = '0.1'
__author__ = 'Lucia F. de la Bella'
__contributor__='Jesus Rubio Jimenez'
__email__ = 'lucia.fonseca-de-la-bella@port.ac.uk'
__license__ = 'MIT'
__copyright__ = '2020, Lucia Fonseca de la Bella'
__all__ = [
'sampler',
'statist... |
/*
* Copyright 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" ... |
import React from 'react'
import PropTypes from 'prop-types'
import CodeMirror from 'codemirror'
import python from 'codemirror/mode/python/python' // eslint-disable-line no-unused-vars
import { Widget } from '@phosphor/widgets'
import { Kernel, ServerConnection } from '@jupyterlab/services'
import { OutputArea, Output... |
'use strict'
const settings = require('./settings')
const Backends = require('./backends')
const Clients = require('template-api/src/grpc/clients')
const App = require('./app')
const backends = Backends()
const clients = Clients(backends)
const app = App({
clients
})
app.listen(settings.port, () => {
console.log... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 12 09:39:20 2019
@author: ASUS
"""
class Solution:
def judgeCircle(self, moves: str) -> bool:
# stack = []
# for move in moves:
# stack.append(move)
# if len(stack) > 1 and (stack[-2:] == ['U','D'] or stack[-2:] == ['D','U'] or sta... |
# Code in this file is copied and adapted from
# https://github.com/openai/evolution-strategies-starter.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
# OPTIMIZERS FOR MINIMIZING OBJECTIVES
class Optimizer(object):
def __init__(sel... |
import React from 'react';
import { InputGroup, InputGroupAddon, Input } from 'reactstrap';
const Example = (props) => {
return (
<div>
<InputGroup size="lg">
<InputGroupAddon>@lg</InputGroupAddon>
<Input />
</InputGroup>
<br />
<InputGroup>
<InputGroupAddon>@norma... |
#an implementation of Newton's method for finding a sqaureroot of a number
#square root => a number I can multiply by itself to get n
def improve(guess, n):
return (1/2) * (guess + (n/guess))
def isGoodEnough(guess, n):
if (guess * guess) - n < 0.01: return True
else: return False
def approximate(guess... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import pprint
from collections import defaultdict
from .context_query_attention import StructuredAttention
from .encoder import StackedEncoder
from .cnn import DepthwiseSeparableConv
from .model_utils import save_pickle, mask_logits,... |
# -*- coding: utf-8 -*-
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
# coding: utf-8
"""
Pure Storage FlashBlade REST 1.6 Python SDK
Pure Storage FlashBlade REST 1.6 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.6
Contact: i... |
from os import path
from . import views
from django.urls import path
urlpatterns = [
path('', views.index, name='index'),
path('vypis/', views.ProblemyListView.as_view(), name='vypis')
] |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.utils.translation import gettext as _
from core import models
class UserAdmin(BaseUserAdmin):
ordering = ['id']
list_display = ['email', 'name']
fieldsets = (
(None, {'fields': ('email', ... |
import Tkinter as Tk
from src.ros_bridge.publishers.camera_control_publisher import CameraControlPublisher
class CameraControlFrame(Tk.Frame):
def __init__(self, parent, **kwargs):
self._pub = CameraControlPublisher()
Tk.Frame.__init__(self, parent, **kwargs)
self._label = Tk.Label(self, ... |
import importlib
import importlib.util
import logging
import os
import sys
from types import ModuleType
from typing import Any # noqa
class ServicePackageError(ImportError):
pass
try:
if ModuleNotFoundError:
pass
except Exception:
class ModuleNotFoundError(ImportError):
pass
class Se... |
var canvas, ctx;
var WIDTH, HEIGHT;
var points = [];
var running;
var canvasMinX, canvasMinY;
var doPreciseMutate;
var POPULATION_SIZE;
var ELITE_RATE;
var CROSSOVER_PROBABILITY;
var MUTATION_PROBABILITY;
var OX_CROSSOVER_RATE;
var UNCHANGED_GENS;
var mutationTimes;
var dis;
var bestValue, best;
var currentGeneration... |
#pragma once
// ------------------------------------ //
#include "Define.h"
// ------------------------------------ //
#include "Common/ThreadSafe.h"
#include "Common/DataStoring/NamedVars.h"
#include <boost/function.hpp>
namespace Leviathan{
#define GAMECONFIGURATION_GET_VARIABLEACCESS(x) NamedVars* x = NULL; Lock... |
import pymysql.cursors
from model.group import Group
from model.contact import Contact
class DbFixture:
def __init__(self, host, name, user, password):
self.host=host
self.name=name
self.user=user
self.password=password
self.connection=pymysql.connect(host=host, database=name... |
$.widget('mxx.solarPicker', {
options: {
yearStart: 1901,
yearEnd: new Date().getFullYear(),
date: new Date(),
onChange: null
},
_create: function(){
var self = this, $elem = $(this.element), opt = this.options;
this.dlts = $elem.find('select');
this.$year = this.dlts.eq(0);
this.$month = ... |
#!/usr/bin/env node
var program = require('commander')
var uploaderServer = require('../')
program
.option('-p, --port <n>', 'uploader server port, default on 3000', parseInt)
.option('-d, --dir <dir>', 'directory to store file')
.parse(process.argv)
uploaderServer(program)
|
/* Original code taken from https://github.com/cpsievert/LDAvis */
/* Copyright 2013, AT&T Intellectual Property */
/* MIT Licence */
'use strict';
var global_terms_1;
var global_lamData;
var merged_topic_to_delete = [];
var name_merged_topic_to_delete = [];
var old_topic_model_states = []; //here we are going to save... |
from pilco.models import SMGPR
import numpy as np
import os
from gpflow import autoflow
from gpflow import settings
import oct2py
octave = oct2py.Oct2Py()
dir_path = os.path.dirname(os.path.realpath("__file__")) + "/tests/Matlab Code"
octave.addpath(dir_path)
float_type = settings.dtypes.float_type
@autoflow((float_t... |
# Copyright 2017-2022 TensorHub, 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
# coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re
# pyth... |
'use strict'
const Fn = require('../fn')
function FnBang (pico, x, y, passive) {
Fn.call(this, pico, x, y, '*', true)
this.name = 'bang'
this.info = 'Bangs!'
this.draw = false
this.haste = function () {
this.passive = true
this.remove()
}
}
module.exports = FnBang
|
from utils.context import create_dir
from os.path import join, exists
import collections
class Vocabulary:
def __init__(self,
ctx,
dataset="small",
target="buggy",
min_frequency=0,
max_vocab_size=250,
downcase=Fa... |
// Values match queryOptions on https://www.npmjs.com/package/indeed-scraper
export const TERM_OPTIONS = [
{ key: "all", value:"all", text: "All Term Lengths"},
{ key: "temp", value:"temporary", text: "Temporary"},
{ key: "part", value:"parttime", text: "Part-time"},
{ key: "full", value: "fulltime", t... |
const colors = ["green", "red", "rgba(133,122,200)", "#f15025"];
const btn = document.getElementById('btn');
const color = document.querySelector('.color');
btn.addEventListener('click', () => {
//get random number between 0 and colors.length
const randomNumber = getRandNum();
document.body.style.backgrou... |
# Copyright Pincer 2021-Present
# Full MIT License can be found in `LICENSE` at the project root.
"""Sent when a stage instance is created."""
from __future__ import annotations
from typing import TYPE_CHECKING
from ..objects import StageInstance
from ..utils.conversion import construct_client_dict
from ..utils.typ... |
var m = require('mithril');
module.exports = m.trust('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="24" height="24"><defs><path id="a" d="M0 0h24v24H0V0z"/></defs><clipPath id="b"><use xlink:href="#a" overflow="visible"/></clipPath><path clip-path="url(#b)... |