text stringlengths 3 1.05M |
|---|
import ConfigParser
import os
import os.path
import shutil
import signal
import subprocess
import sys
import time
from hlib.tests import *
class AppServer(object):
_appservers = {}
@staticmethod
def fetch_config(section):
from testconfig import config
dir = config[section]['dir'].strip()
if not os... |
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your op... |
# coding=utf-8
# author: al0ne
# https://github.com/al0ne
from lib.verify import get_list
from lxml import etree
from lib.Requests import Requests
import chardet
import re
req = Requests()
def get_title(url):
code = 0
try:
r = req.get(url)
code = r.status_code
coding = chardet.detec... |
import numpy as np
import pandas as pd
import os
from src.model.models import oneshot_bsm, oneshot_sim, oneshot_inference
from src.model.train import train_oneshot
import keras.backend as K
config = K.tf.ConfigProto()
config.gpu_options.allow_growth = True
session = K.tf.Session(config=config)
EPOCH = 50
EPOCH_RG = 1... |
import socketio from 'socket.io-client'
export default {
namespaced: true,
state: {
socket: null,
preSocketId: null
},
actions: {
initialSocket ({ state }) {
state.socket = socketio(`http://${document.location.hostname}`)
},
connect ({ state }) {
state.preSocketId = state.socket... |
/**
* @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'cy', {
button: 'Gosod iaith',
remove: 'Tynnu iaith'
} );
|
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : language.py
@Time : 2020/08/19
@Author : Yaronzz
@Version : 1.0
@Contact : yaronhuang@foxmail.com
@Desc :
'''
from tidal_dl.lang.arabic import LangArabic
from tidal_dl.lang.chinese import LangChinese
from tidal_dl.lang.croa... |
"""
This file offers the methods to automatically retrieve the graph Staphylothermus marinus.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 202... |
import flask
from layab.flask_restx import enrich_flask
def test_default():
app = flask.Flask(__name__)
enrich_flask(app, cors=False, compress_mimetypes=None, reverse_proxy=True)
@app.route("/proxy")
def proxy():
return flask.jsonify(
{"scheme": flask.request.scheme, "client": fla... |
import os
import yaml
from .base_config import BaseConfig, ConfigError, DEFAULT_PUNCTUATION, DEFAULT_CLITIC_MARKERS, DEFAULT_COMPOUND_MARKERS
class G2PConfig(BaseConfig):
def __init__(self):
self.punctuation = DEFAULT_PUNCTUATION
self.clitic_markers = DEFAULT_CLITIC_MARKERS
self.compound_m... |
/*
* This header is generated by classdump-dyld 1.0
* on Sunday, September 27, 2020 at 11:52:18 AM Mountain Standard Time
* Operating System: Version 14.0 (Build 18A373)
* Image Source: /System/Library/PrivateFrameworks/NanoTimeKitCompanion.framework/NanoTimeKitCompanion
* classdump-dyld is licensed under GPLv3, Copyri... |
"""usercenter URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/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-ba... |
(function(){var f=Object,g=document,h="appendChild",l="evaluate",n="createElement",p="setAttribute",q="propertyIsEnumerable",r="push",s="length",t="prototype",u="call",v="",w=" != ",x="#.###%",y="#4ECDC4",z="#556270",A="#C7F464",B="#E5E5E5",C="#F2F2F2",D="% (",E="&end_time=",aa="&granularity=",ba="&start_time=",ca="&va... |
/* system/debuggerd/debuggerd.c
**
** Copyright 2012, The Android Open Source Project
**
** 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
... |
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ re... |
"""
Definition of the :class:`LaboratoryViewSet` class.
"""
from accounts.models.laboratory import Laboratory
from accounts.serializers.laboratory import LaboratorySerializer
from pylabber.views.defaults import DefaultsMixin
from rest_framework import viewsets
class LaboratoryViewSet(DefaultsMixin, viewsets.ModelView... |
# Copyright (c) 2018 NVIDIA Corporation
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
from six.moves import range
import inspect
import tensorflow as tf
from tensorflow.contrib.cudnn_rnn.python.ops import cudnn_rnn_ops
from tensorflow.python.framework import ... |
from django.urls import path
from particulier.views import particulier_views
app_name = 'particulier'
urlpatterns = [
path('', particulier_views, name='particulier_home')
]
|
sap.ui.define(['sap/uxap/BlockBase'], function (BlockBase) {
"use strict";
var myBlock = BlockBase.extend("sap.uxap.testblocks.employmentblockjob.EmploymentBlockJob", {
metadata: {
views: {
Collapsed: {
viewName: "sap.uxap.testblocks.employmentblockjob.EmploymentBlockJobCollapsed",
type: "XML"
... |
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Bot Framework: http://botframework.com
//
// Bot Framework Emulator Github:
// https://github.com/Microsoft/BotFramwork-Emulator
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// ... |
/** @jsx jsx */
import { jsx } from "@emotion/core";
import { has } from "lodash";
import PropTypes from "prop-types";
import MaterialSelect from "@material-ui/core/Select";
import {
FormControl,
OutlinedInput,
MenuItem,
FormLabel,
FormHelperText
} from "@material-ui/core";
import { ThemeProvider } from "@ma... |
from math import sqrt
executar = True
while(executar):
numeroTestes = 0
n = int(input("Informe um número: "))
primo = True
for i in range(2, int(sqrt(n)) + 1):
numeroTestes += 1
if(n % i == 0):
primo = False
divisor = i
break
if(primo):
pr... |
import React from 'react'
import Layout from '../components/layout'
import "../components/myStyles.css"
import angular1 from '../images/angular1.png'
import react1 from '../images/react1.png'
import java1 from '../images/java1.jpg'
import python1 from '../images/python1.png'
import reactnative1 from '../images/react-... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. py:currentmodule:: OxfordInstruments.MapRaw.MapRawFormat
:synopsis: Read Oxford Instruments map in the raw format.
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
Read Oxford Instruments map in the raw format.
"""
#################... |
# -*- coding: utf-8 -*-
# Copyright European Organization for Nuclear Research (CERN) since 2012
#
# 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-... |
import db
import environment
from src.modeling.shap_manager.meta import get_meta
import numpy as np
def load_dataset(table_name=environment.MAIN_TABLE, limit=None):
print("Loading {} ".format(table_name))
df = db.get_dataframe(table_name, limit=limit)
df.replace("NULL",np.nan,inplace=True)
return d... |
from django.shortcuts import render
from rest_framework.generics import ListAPIView, CreateAPIView, RetrieveAPIView
from rest_framework.permissions import IsAuthenticated
from .models import Tag
from .serializers import TagModelSerializer
class TagListView(ListAPIView):
model = Tag
serializer_class = TagModel... |
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// ... |
import React, { useState, useEffect } from "react";
import Kanji from "./Kanji";
import Radical from "./Radical";
import Examples from "./Examples";
import Info from "../layout/Info";
import KawaiiCat from "../KawaiiCat";
import styled from "styled-components";
import { Colors } from "../../helpers/theme";
const Style... |
var x = require('./bar_lib'); // 'bar_lib' does not work!
console.log(x);
|
/****************************************************************************
* arch/xtensa/src/esp32/esp32_spicache.c
*
* 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 copy... |
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Refl... |
/*
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Artem Y. Polyakov <artpol84@gmail.com>.
* All rights reserved.
* Copyright (c) 2015-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserve... |
jQuery(function($){$.datepicker.regional['ru']={closeText:'Выбрать',prevText:'<Пред',nextText:'След>',currentText:'Сегодня',monthNames:['Январь','Февраль','Март','Апрель','Май','Июнь','Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],monthNamesShort:['Январь','Февраль','Март','Апрель','Май','Июнь','Июл... |
#!/bin/python3
from pid import PIDArduino
from autotune import PIDAutotune
from kettle import Kettle
from collections import deque, namedtuple
import sys
import math
import logging
import argparse
import matplotlib.pyplot as plt
LOG_FORMAT = '%(name)s: %(message)s'
Simulation = namedtuple(
'Simulation',
['na... |
from __future__ import absolute_import, division, print_function
import platform
import sys
from threading import Thread, Lock
import json
import warnings
import time
import stripe
import pytest
if platform.python_implementation() == "PyPy":
pytest.skip("skip integration tests with PyPy", allow_module_level=True... |
# from task4 import detle
# from pprint import pprint
# from link import url2
# import requests,json,os
# from bs4 import BeautifulSoup
# def l(i,n):
# lis=[]
# if os.path.exists("all_movie_detailes.json"):
# with open("all_movie_detailes.json","r") as file:
# data=json.load(file)
# return data
# else:
# ... |
from fnmatch import translate
from bs4 import BeautifulSoup
from django.core.validators import URLValidator
from django.http import request, response
from django.shortcuts import redirect, render
from links.forms import UrlForm
import requests
import re
from links.utils import Crawler
import networkx as nx
from .utils ... |
from Character import Character
class CharacterArray:
def __init__(self):
self.arr = []
def __len__(self):
return len(self.arr)
def __str__(self):
returnString = []
for hero in self.arr:
returnString.append(str(hero))
return str(retur... |
import base64
import time
import os
import json
import pip
import zlib
from nimbella import redis
def main(args):
dest = args.get("fiscal_code")
subj = args.get("subject")
mesg = args.get("markdown")
if dest and subj and mesg:
id = str(zlib.crc32(dest.encode("utf-8")))
red = redis()
... |
#-*- coding: utf-8 -*-
#
# Created on Dec 17, 2012
#
# @author: Younes JAAIDI
#
# $Id: bb5c78b887c1c53f3e77c86d558755ae21c3d6f4 $
#
from .exceptions import SyntheticError
from .i_naming_convention import INamingConvention
from .synthetic_member import SyntheticMember
from contracts import contract, new_contract
new_c... |
import unittest
import os
from dao.unverified_reminder_history_dao import UnverifiedReminderHistoryDAO
from dao.unverified_reminder_messages_dao import UnverifiedReminderMessagesDAO
class TestUnverifiedReminderHistoryDAO(unittest.TestCase):
def setUp(self):
self.db_addr = "database/test_db.db"
os.p... |
/*
* Copyright (c) 2021, kleines Filmröllchen <malu.bertsch@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/HashMap.h>
#include <AK/Types.h>
#include <AK/Variant.h>
#include <AK/Vector.h>
#include <LibAudio/Buffer.h>
#include <LibDSP/Envelope.h>
namespace LibDSP {
// FIXME: Aud... |
//Magnifying Glass
if ( !window.requestAnimationFrame ) {
window.requestAnimationFrame = ( function() {
return window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function( /* function FrameRequestCallback */ callback... |
# main_preprocessing.py
#
# Manual preprocessing script to annotate data and mark ICA components.
# This file might not be up to date, as the actual cleaning was performed
# with main_preprocessing_auto.ipynb
#
import os.path as op
import mne
from data_analysis.functions_preprocessing import \
(split_raws, mark_b... |
'use strict';
var userToken = process.env.PINTEREST_USER_TOKEN;
var pinterest = require('../../../lib')(userToken);
var sectionsRequest = async function () {
/**
* passing parameters
* -------------------
*
* section (required) (The section name in the format: <username>/<board_name>/<section_name>)
... |
import GlobalUpdater from "./global-updater";
import Action from "../action/action";
export default class Updater {
running = false;
rootAction: Action;
constructor(rootAction) {
this.rootAction = rootAction;
}
start() {
GlobalUpdater.add(this);
return this;
}
update(dt) {
if (!this.... |
var testCase = require('nodeunit').testCase,
cron = require('../lib/cron');
module.exports = testCase({
'test stars (* * * * * *)': function(assert) {
assert.expect(1);
assert.doesNotThrow(function() {
new cron.CronTime('* * * * * *');
});
ass... |
class Node(object):
# Doubly linked node
def __init__(self, data=None, next=None, prev=None):
self.data = data
self.next = next
self.prev = prev
class doubly_linked_list(object):
def __init__(self):
self.head = None
self.tail = None
self.count = 0
def a... |
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2016 The Bitcoin Core developers
// Copyright (c) 2020 The PIVX developers
// Copyright (c) 2021 The ENZO developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php... |
# Copyright 2018 Spanish National Research Council (CSIC)
#
# 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... |
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var React = require('react');
var core = require('@mantine/core');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
var React__default = /*#__PURE__*/_interopDefaultLegacy(React... |
# coding:utf-8
import os
import requests
import json
import urllib
import base64
import datetime
import configparser
import pandas as pd
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from QUANTAXIS.QAMarket.QAOrderHandler import QA... |
import styled from 'styled-components';
import _SearchIcon from '@material-ui/icons/Search';
export const SearchCont = styled.div`
display: flex;
height: 52px;
flex-direction: row;
justify-content: space-between;
background-color: white;
box-shadow: 0 0 4px 0 rgba(0,0,0,0.2);
border-radius... |
import argparse
import json
import logging
import random
import os
from itertools import chain
from typing import Set
import numpy as np
import torch
import torch.nn as nn
from rationale_benchmark.utils import (
write_jsonl,
load_datasets,
load_documents,
intern_documents,
intern_annotations
)
fr... |
/*jshint globalstrict:false, strict:false */
/* global getOptions, assertEqual, assertUndefined, fail, arango */
////////////////////////////////////////////////////////////////////////////////
/// @brief test for security-related server options
///
/// @file
///
/// DISCLAIMER
///
/// Copyright 2010-2012 triagens Gmb... |
/*
* Name: wx/msw/genrcdefs.h
* Purpose: Emit preprocessor symbols into rcdefs.h for resource compiler
* Author: Mike Wetherell
* Copyright: (c) 2005 Mike Wetherell
* Licence: wxWindows licence
*/
#define EMIT(line) line
EMIT(#ifndef _WX_RCDEFS_H)
EMIT(#define _WX_RCDEFS_H)
#ifdef _MSC_FU... |
# Time: O(n)
# Space: O(1)
class Solution(object):
def maxSumTwoNoOverlap(self, A, L, M):
"""
:type A: List[int]
:type L: int
:type M: int
:rtype: int
"""
for i in xrange(1, len(A)):
A[i] += A[i-1]
result, L_max, M_max = A[L+M-1], A[L-1],... |
// in src/Dashboard.js
import * as React from "react";
import { Card, CardContent, CardHeader } from '@material-ui/core';
export default () => (
<Card>
<CardHeader title="Welcome to the administration" />
<CardContent>Add the dashboard contents here...</CardContent>
</Card>
);
|
import datetime as dt
import os
import requests
from dotenv import load_dotenv
from file_handler import download_image, get_filename
def download_image_from_nasa_apod(nasa_token,
count=30,
path_to_save='images/'):
api_url = 'https://api.nasa.gov... |
const Errors = require('common-errors');
const { ActionTransport } = require('@microfleet/core');
const key = require('../../redis-key');
const { AGREEMENT_DATA, FREE_PLAN_ID } = require('../../constants');
const { deserialize } = require('../../utils/redis');
/**
* @api {amqp} <prefix>.agreement.forUser Get agreeme... |
import React, { Component } from 'react';
import * as PropTypes from 'prop-types';
import { compose } from 'ramda';
import { withRouter } from 'react-router-dom';
import { withStyles } from '@material-ui/core/styles/index';
import Menu from '@material-ui/core/Menu';
import MenuItem from '@material-ui/core/MenuItem';
im... |
/*
* File: DebugCommandManager.h
* Author: thomas
*
* Created on 12. November 2010, 09:50
*/
#ifndef DebugCommandManager_H
#define DebugCommandManager_H
#include <Tools/DataStructures/DestructureSentinel.h>
#include "DebugCommandExecutor.h"
#include <string>
#include <iostream>
class DebugCommandManager
:... |
from idm.objects import dp, MySignalEvent
from idm.api_utils import set_online_privacy
@dp.longpoll_event_register('+оффлайн')
@dp.my_signal_event_register('+оффлайн')
def hide_online(event: MySignalEvent):
if set_online_privacy(event.db):
msg = '🍭 Онлайн скрыт'
else:
msg = '🐶 Произошла ошиб... |
/*!
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/!function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"%0 of %1","Block quote":"Block quote",Bold:"Bold","Bulleted List":"Bulleted List",Cancel:"Cancel","Can... |
// @flow
import path from 'path';
import { uploadObject } from '../../Utils/GDevelopServices/Preview';
const gd: libGDevelop = global.gd;
export type TextFileDescriptor = {|
filePath: string,
text: string,
|};
type PendingUploadFileDescriptor = {|
Key: string,
Body: string,
ContentType: 'text/javascript' | ... |
# coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class NationalTestCase(Integrati... |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... |
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2014 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @overview
*
* Many thanks to Adam Saltsman (@ADAMATOMIC) for creating Flixel, from which both Phaser and my love of ... |
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SRC_STORAGE_FSHOST_FS_MANAGER_H_
#define SRC_STORAGE_FSHOST_FS_MANAGER_H_
#include <fidl/fuchsia.device.manager/cpp/wire.h>
#include <fidl/fuchsia... |
import json
from src.utils import get_image_quality
from src import config
if __name__ == "__main__":
quality_dict = dict()
count = 0
for path in config.cover_dir.glob('*'):
image_name = path.name
quality = get_image_quality(config.cover_dir / image_name)
quality_dict[image_name]... |
/**
* @module models/civil_services/senate
* @version 1.0.0
* @author Peter Schmalfeldt <me@peterschmalfeldt.com>
*/
var DataTypes = require('sequelize');
var db = require('../../config/sequelize');
/**
* United States Senate
* @type {object}
* @property {number} id - Unique ID
* @property {string} state_name... |
'use strict';
/**
* twig helper: {% component name='component-name' data='data-variation' template='template-variation' additionalData={ param1: 'value', param2: true } %}
*
* Usage
* {% component name='button' data='button-fancy' %}
*
*/
const fs = require('fs');
const path = require('path');
const extend = re... |
# -*- coding: utf-8 -*-
""" Auto Encoder Example.
Using an auto encoder on MNIST handwritten digits.
References:
Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. "Gradient-based
learning applied to document recognition." Proceedings of the IEEE,
86(11):2278-2324, November 1998.
Links:
[MNIST Dataset] ht... |
import axios from 'axios'
import config from '../../build/config'
import util from '../libs/util'
class ServerError extends Error {
constructor(code, message) {
super(message)
this.code = code
}
}
const errorParser = (response) => {
if (response.status === 200 || response.status === 204) {
return response
}... |
import numpy as np
import math
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn import Module, Parameter
from torch.nn.modules.utils import _pair
from scipy.special import binom
import sys
import glob
import os
sys.path.append("..")
import utils
from simplex_helpers import complex_volume
... |
import os
from pathlib import Path
import random
import torch
from torch.nn import MSELoss
from torch.nn.functional import relu
from quapy.method.aggregative import *
from quapy.util import EarlyStop
class QuaNetTrainer(BaseQuantifier):
def __init__(self,
learner,
sample_size,... |
/* Target-dependent code for the ALPHA architecture, for GDB, the GNU Debugger.
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of ... |
/*
* mbed SDK
* Copyright (c) 2017 ARM Limited
*
* 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 o... |
from flask_restful import Resource
from models.store import StoreModel
class Store(Resource):
@classmethod
def get(cls, name):
store = StoreModel.find_by_name(name)
if store:
return store.json()
return {'message': 'Store not found'}, 404
@classmethod
def post(cls, ... |
import React from "react";
import { Link } from "gatsby";
import logo from "../img/logo.png";
const Navbar = class extends React.Component {
constructor(props) {
super(props);
this.state = {
active: false,
navBarActiveClass: "",
};
}
toggleHamburger = () => {
// toggle the active boo... |
import '../overflow-group/overflow-group.js';
import '../selection/selection-select-all.js';
import '../selection/selection-summary.js';
import { css, html, LitElement } from 'lit-element/lit-element.js';
import { LocalizeCoreElement } from '../../lang/localize-core-element.js';
import { RtlMixin } from '../../mixins/r... |
var Class = require('../utils/Class');
var Event = require('../events/Event');
var SoundEvent = new Class({
Extends: Event,
initialize:
function SoundEvent (sound, type)
{
Event.call(this, type);
this.sound = sound;
}
});
module.exports = SoundEvent;
|
// CRT
#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
// STL
#include <cmath>
#include <algorithm>
#include <random>
#include <iterator>
#include <numeric>
#include <ratio>
#include <valarray>
#include <comple... |
'use strict';
const Promise = require('bluebird');
const { default: replaceEnum } = require('sequelize-replace-enum-postgres');
const TABLE_NAME = 'repository_user';
const COLUMN_NAME = 'role';
const ENUM_NAME = `enum_course_user_${COLUMN_NAME}`;
const OLD_ROLES = { COURSE_AUTHOR: 'COURSE_AUTHOR', COURSE_ADMIN: 'COU... |
import os
import sys
import time
import random
import pandas as pd
def dbGetQuery(query: str, source: str='oracle', sep: str=',', dtype=None):
"""
데이터베이스에서 query 를 실행한 결과물을 DataFrame으로 반환한다.
params
query: str, valid query statement
source: str, data source, hive or oracle
sep: str, 분할자, def... |
"use strict";
(function (DelegateFolderPermissionLevel) {
DelegateFolderPermissionLevel[DelegateFolderPermissionLevel["None"] = 0] = "None";
DelegateFolderPermissionLevel[DelegateFolderPermissionLevel["Editor"] = 1] = "Editor";
DelegateFolderPermissionLevel[DelegateFolderPermissionLevel["Reviewer"] = 2] = "... |
# Copyright 2001 by Tarjei Mikkelsen. All rights reserved.
# Copyright 2007 by Michiel de Hoon. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Code to work with the KEGG En... |
/*
* Copyright (C) 2011 IBM Corporation
*
* Author:
* Mimi Zohar <zohar@us.ibm.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, version 2 of the License.
*/
#include <linux/module... |
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S8.5_A2.1;
* @section: 8.5, 7.8.3;
* @assertion: Number type represented as the double precision 64-bit format IEEE 754;
* @description: Use 2^53 + 2 number and do... |
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSObject.h"
@class CBCentralManager, CBCharacteristic, CBService, NSArray, NSData, NSString, WABlueToothDevice;
@protocol WABleAdpterLogicDelegate <NSObject>
- (void)onBl... |
import imix.utils.distributed_info as dist_info
import torch
import os
import random
from imix.utils.third_party_libs import PathManager
from imix.utils.logger import setup_logger
from imix.utils.collect_running_env import collect_env_info
import argparse
import json
from imix.utils.config import set_imix_work_dir, se... |
require('dotenv').config()
const prettify = require('@funcmaticjs/pretty-logs')
const RedisObjectCache = require('@funcmaticjs/redis-objectcache')
// Goalbook Fist to Five Backend
// const GOOGLESPREADSHEET_ID = "1liBHwxOdE7nTonL1Cv-5hzy8UGBeLpx0mufIq5dR8-U"
// Supersheets Public View Test
const GOOGLESPREADSHEET_ID ... |
#ifndef PX_CONTEXT_UTILS_H
#define PX_CONTEXT_UTILS_H
#include "pxCore.h"
pxError makeInternalGLContextCurrent(bool current);
#endif //PX_CONTEXT_UTILS_H
|
#include "actions.h"
#include "bar.h"
#include "client.h"
#include "config.h"
#include "core.h"
#include "monitor.h"
#include "stack.h"
#include "util.h"
#include "variables.h"
#include "xevents.h"
// just quit from wm
void quit(const Arg* arg) {
running = 0;
}
// set selected tags to arg.ui tagmask
void view(const... |
export default {
cartGoodsList(state) {
return state.cartGoods
},
cartListLen(state) {
return state.cartGoods.length
}
} |
import $ from 'jquery'
import Backbone from 'backbone'
module.exports = Backbone.Model.extend({})
|
/*!
* OpenUI5
* (c) Copyright 2009-2019 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
// Provides control sap.ui.core.mvc.XMLView.
sap.ui.define([
'sap/ui/thirdparty/jquery',
'./View',
"./XMLViewRenderer",
"sap/base/util/merge",
'sap/ui/base/Managed... |
const path = require("path");
const Dotenv = require("dotenv-webpack");
module.exports = {
mode: "development",
entry: "./src/js/index.js",
devtool: "inline-source-map",
target: "electron-renderer",
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
... |
import random
from models.bert import initialize_bert_based_model
import numpy as np
import sys
from numpy.core.numeric import False_
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import torchvision
import torchvision.transforms as ... |