text stringlengths 3 1.05M |
|---|
/**
* Copyright IBM Corp. 2019, 2020
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* Code generated by @carbon/icon-build-helpers. DO NOT EDIT.
*/
'use strict';
var Icon = require('../Icon-399ca71f.js');
var React = require... |
# Copyright (c) 2012-2016 The PlanBcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Planbcoin base58 encoding and decoding.
Based on https://planbcointalk.org/index.php?topic=1026.0 (public domain)
'''
import ha... |
import "./styles.css";
import GetAppIcon from "@material-ui/icons/GetApp";
import MoreVertIcon from "@material-ui/icons/MoreVert";
function Header() {
return (
<div className="header-container">
<div className="header-content-container">
<div className="logo-container">
<div className="l... |
import React from 'react';
import PropTypes from 'prop-types';
import ComponentFactory from './ComponentFactory';
const Subscript = ({ nodeData, ...rest }) => (
<sub>
{nodeData.children.map((child, index) => (
<ComponentFactory {...rest} key={index} nodeData={child} />
))}
</sub>
);... |
# Copyright 2021 DeepMind Technologies 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 or agr... |
import React from "react";
export default function SurveyQuestionnaire() {
return (
<div className="newUserForm">
<h1>Survey</h1>
<p>
Take a quick survey to find your perfect match! These
questions are answered by the numbers 1 through 5. If you
really, really disagree with th... |
// 7.2.1. RequireObjectCoercible ( argument )
// The abstract operation ToObject converts argument to a value of type Object according to Table 12:
// Table 12: ToObject Conversions
/*
|--------------------------------------------------------------------------------------------------------------------------------------... |
# This program has been developed by students from the bachelor Computer Science at Utrecht University within the
# Software and Game project course
# ©Copyright Utrecht University Department of Information and Computing Sciences.
"""
Django settings for mofa project.
Generated by 'django-admin startproject' using Dja... |
import sqlalchemy
from .db_session import SqlAlchemyBase
class DBGame(SqlAlchemyBase):
__tablename__ = 'games'
id = sqlalchemy.Column(sqlalchemy.Integer,
primary_key=True, autoincrement=True)
chat_id = sqlalchemy.Column(sqlalchemy.Integer, nullable=True)
player_name = sqlal... |
#!/usr/bin/env python3
"""Execute a submission"""
import argparse
import os
import signal
import subprocess
import tempfile
import time
import json
import traceback
import socket
import logging
import pathlib
import sys
episode_length = 2 * 60 * 1000
class LocalExecutionConfig:
"""Configuration for local execut... |
import json
import os
import pytest
import shutil
import subprocess
from eth_utils import (
is_checksum_address,
is_dict,
to_text,
)
from web3.utils.toolz import (
assoc,
)
from .utils import (
kill_proc_gracefully,
)
KEYFILE_PW = 'web3py-test'
GETH_16_FIXTURE = {
'datadir': 'geth-16-datad... |
# Generated by Django 3.0.5 on 2020-04-18 23:34
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... |
start_number = int(input())
sum_numbers = 0
while sum_numbers < start_number:
number = int(input())
sum_numbers += number
else:
print(sum_numbers) |
import os
import sys
import unittest
from torch.testing._internal.common_utils import GRAPH_EXECUTOR, ProfilingMode, \
num_profiled_runs, enable_profiling_mode_for_profiling_tests
from torch.testing._internal.common_jit import check_against_reference
import torch
# Make the helper files in test/ importable
pytorch... |
# -*- coding: utf-8 -*-
"""
@author: KBK
"""
import random
from scipy.stats import norm
import sys
from editdistance import eval as lev
def readLyrics(idir,fw_freqdict={},bw_freqdict={}):
"""
returns a dict in following form:
word : {successor1: probability, successor2:probability}
"""
... |
Vue.component('task-list', {
template: `
<ul>
<task v-for="task in tasks">{{ task.task }}</task>
</ul>
`,
data() {
return {
tasks: [
{ task: 'Go to the store', complete: true },
{ task: 'Collect mail', complete: false },
... |
/*
Software Uart (Lite)
By Liyanboy74
https://github.com/liyanboy74
*/
#include "main.h"
#define Number_Of_SoftUarts 2
#define SoftUartTxBufferSize 32
#define SoftUartRxBufferSize 64
typedef enum {
SoftUart_OK,
SoftUart_Error
}SoftUartState_E;
typedef struct{
uint8_t Tx[SoftUartTxBufferSize];
uint8_t ... |
// Copyright 2020 Phyronnaz
#pragma once
#include "CoreMinimal.h"
#include "VoxelMinimal.h"
#include "IVoxelPool.generated.h"
UENUM(BlueprintType)
enum class EVoxelTaskType : uint8
{
// Meshing of chunks that don't have collisions and are not visible
ChunksMeshing,
// Meshing of not visible chunks th... |
export default function fullNameFromIdentityString(identityStr) {
return identityStr.split(':')[1];
}
|
import React, { Component } from "react";
import Fade from "@material-ui/core/Fade";
import { PropTypes } from "prop-types";
import ReactMarkdown from "react-markdown";
import SectionHeader from "./SectionHeader";
import appState from "../store/appState";
import { getListOf } from "./util";
import { observer } from "m... |
RULES = 'B3/S23'
WIDTH = 160
HEIGHT = 90
CELL_SIZE = 8 # for windowed mode
DENSITY = .2
CYCLE_SLEEP = .1
DISPLAY_FPS = True
FULLSCREEN = False
|
function toggle() {
let button = document.querySelector('.button');
let divExtra = document.getElementById('extra');
if (button.textContent === 'More' ) {
divExtra.style.display = 'block';
button.textContent = 'Less';
}
else{
divExtra.style.display = 'none';
butt... |
//
// MHHTTPService+Live.h
// WeChat
//
// Created by senba on 2017/10/19.
// Copyright © 2017年 CoderMikeHe. All rights reserved.
// 获取直播相关的接口
#import "MHHTTPService.h"
#import "MHLiveRoom.h"
@interface MHHTTPService (Live)
/// https://live.9158.com/Room/GetHotLive_v2?cache=3&lat=22.54192103514200&lon=113.96939... |
import pytest
import requests
from airtech_api.utils import success_messages
from mock import Mock
from airtech_api.utils.constants import PAYSTACK_INITIALIZE_URL
from airtech_api.utils.error_messages import serialization_errors
from airtech_api.booking.models import Booking
from django.utils import timezone
from tests... |
from .foo import inc
|
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Thread management for memcached.
*/
#include "memcached.h"
#include <assert.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#ifdef __sun
#include <atomic.h>
#endif
#define ITEMS_P... |
#
# PySNMP MIB module Nortel-Magellan-Passport-TextualConventionsMIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-Magellan-Passport-TextualConventionsMIB
# Produced by pysmi-0.3.4 at Wed May 1 14:26:10 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 ... |
try:
import numpy
except ImportError:
print "Numpy is not installed"
try:
import matplotlib
except ImportError:
print "Matplotlib is not installed"
try:
import scipy
except ImportError:
print "Scipy is not installed"
|
// Set up Answer
var answer = "Now that's a good question!";
module.exports.ask = function(question) {
console.log(question);
return answer;
}; |
from django.urls import path, re_path
from . import views
urlpatterns = [
path(r'dnscanner/',views.SannerDnDetailView.as_view({"get":"list"}),name="dnscanner"),
path(r'list/', views.DnListViewSet.as_view({"get": "list", "post": "create"}), name="dnlist"),
re_path(r'^list/(?P<pk>\d+)/$', views.DnListViewSet.as_view({
... |
define("ace/snippets/visualforce",["require","exports","module"], function(require, exports, module) {
"use strict";
exports.snippetText =undefined;
exports.scope = "visualforce";
}); (function() {
window.require(["ace/snippets/visualforce"], function(m) {
if... |
import json
import csv
from tqdm import tqdm, trange
import argparse
import random
import math
import sys
import numpy as np
import os
import pdb
import ast
import copy
import codecs
import sys
csv.field_size_limit(sys.maxsize)
import torch
from torch.utils.data import TensorDataset, DataLoader, RandomSampler, Sequent... |
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
// 1.list保存用户信息
list:0,
// 2.isLogin 保存用户登录状态
isLogin:false,
// 3.保存用户的书架信息
bookShelf:0,
// 4.保存用户书籍的书籍长度(书籍数量)
booki:0
},
mutations: {
// 1.用户登录成功后调用
data(state,res){
... |
#include "evas_common.h"
#include "evas_private.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <gif_lib.h>
static Eina_Bool evas_image_load_file_head_gif(Image_Entry *ie, const char *file, const char *key, int *error) EINA_ARG_NONNULL(1, 2, 4);
static Eina_Bool evas_image_load_file_data_... |
#include <rthw.h>
#include <rtthread.h>
#include <rtdevice.h>
#include <u8g2_port.h>
// You may reference Drivers/drv_gpio.c for pinout
// In u8x8.h #define U8X8_USE_PINS
#define ST7920_8080_PIN_D0 31 // PB15
#define ST7920_8080_PIN_D1 30 // PB14
#define ST7920_8080_PIN_D2 ... |
#!/usr/local/bin/python3.6
"""
The first pass at importing data to Wikidata.
Journal articles are definitely eligible to be included on Wikidata, and there
is plenty of rich metadata to pick from, so we can just iterate through each
entry and do it totally automatic.
"""
import codeswitch
import json
import os
import... |
# Copyright 2018 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... |
/**
* Theme: Dastone - Responsive Bootstrap 4 Admin Dashboard
* Author: Mannatthemes
* Form Repeater
*/
$(document).ready(function () {
'use strict';
$('.repeater-default').repeater();
$('.repeater-custom-show-hide').repeater({
show: function () {
$(this).slideDown();
},
hide: function (r... |
'use strict'
const _ = require('lodash')
const utils = require('./utils')
const Hoek = require('hoek')
const generator = require('./generator')
let schema = require('./schema')
const Joi = require('joi')
const internals = {
prepareRequestParameters (definitions, scope, schema) {
const swaggerProperties = genera... |
import logging
from typing import Any, AsyncIterator, Awaitable, Generator, Set
from async_generator import asynccontextmanager
import trio
from alexandria.abc import Endpoint, SessionAPI # noqa: F401
from alexandria.abc import (
Datagram,
EventAPI,
EventsAPI,
MessageAPI,
TAwaitable,
TEventPa... |
# SPDX-License-Identifier: Apache-2.0
#
# http://nexb.com and https://github.com/nexB/scancode.io
# The ScanCode.io software is licensed under the Apache License version 2.0.
# Data generated with ScanCode.io is provided as-is without warranties.
# ScanCode is a trademark of nexB Inc.
#
# You may not use this software ... |
from tensorflow.python.keras.layers import Conv2D
from tensorflow.python.keras.layers import AveragePooling2D
from tensorflow.python.keras.layers import Flatten
from tensorflow.python.keras.layers import Dense
from tensorflow.python.keras.models import Sequential
def lenet():
model = Sequential()
model.add(Co... |
import React from 'react';
const CurrentTemp = (props) => {
return (
<div>
<h2>
{Math.round(props.temperature)}˚F
</h2>
<div>
Feels like : {Math.round(props.apparentTemperature)}˚F
</div>
</div>
)
}
export default CurrentTemp;
|
/*!
* froala_editor v4.0.3 (https://www.froala.com/wysiwyg-editor)
* License https://froala.com/wysiwyg-editor/terms/
* Copyright 2014-2021 Froala Labs
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('froala-editor')) :
typeof define === 'function... |
var sdg=window.sdg||{};!function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var e=window.Slick||{};e=function(){function e(e,o){var s,n,l,r=this;if(r.defaults={accessibility:!0,adaptiveHei... |
from aiocloudflare.commons.auth import Auth
class References(Auth):
_endpoint1 = "user/load_balancers/pools"
_endpoint2 = "references"
_endpoint3 = None
|
import React, {Component} from 'react'
import Helmet from 'react-helmet';
import {Row, Col, Card, Button, message, Form, Input, Breadcrumb} from 'antd';
const FormItem = Form.Item;
const TextArea = Input.TextArea;
import PageTitle from '../components/PageTitle';
class UpdateInformation extends Component {
construc... |
#!/usr/bin/env python3
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the avoid_reuse and setwalletflag features."""
from test_framework.test_framework import Baddcoin... |
const paths = {
scripts: {
src: 'index.js',
all: './elements/*.js',
build: '../talis-ui/src/main/content/jcr_root/etc/designs/talis/build.js',
dest: {
path: '../talis-ui/src/main/content/jcr_root/etc/designs/talis',
fileName: 'build.js',
}
},
styles: {
src: 'main.css',
all: './*.css',
build: '.... |
import React, { useState } from "react";
import EducationCard from "./EducationCard";
import EducationEditForm from "./EducationEditForm";
//EducationCard, EditForm 임포트
function Education({ isEditable, education, setEducations}) {
const [edit, setEdit] = useState(false);
return (
<>
{edit ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from SimPEG import Utils
from SimPEG.EM.Base import BaseEMProblem
from .SurveyDC import Survey_ky
from .FieldsDC_2D import Fields_ky, Fields_ky_CC, Fields_ky_N
from .Fiel... |
import unittest
import numpy as np
import torch
from torch import nn
import torch_testing as tt
from gym.spaces import Box
from all.core import State
from all.policies import GaussianPolicy
STATE_DIM = 2
ACTION_DIM = 3
class TestGaussian(unittest.TestCase):
def setUp(self):
torch.manual_seed(2)
s... |
import {expect} from 'chai';
import {spec} from 'modules/pubmaticBidAdapter';
import * as utils from 'src/utils';
const constants = require('src/constants.json');
describe('PubMatic adapter', () => {
let bidRequests;
let bidResponses;
beforeEach(() => {
bidRequests = [
{
bidder: 'pubmatic',
... |
define(["jquery","core/ajax","core/config","block_navigation/ajax_response_renderer"],function(a,b,c,d){function e(a){return a.closest("[data-block]").attr("data-instanceid")}function f(a){return a.closest("[data-block]").attr("data-block")}var g=c.wwwroot+"/lib/ajax/getnavbranch.php";return{load:function(b){b=a(b);var... |
#!/usr/bin/env python2
"""
builtin_def.py
Metadata:
- Is used for lookup in cmd_eval.py
- Should be used for completion
- complete names of builtins
- complete flags they take
- handle aliases : . and source, [ and test
- Should be reflected in the contents of the 'help' builtin
NOTE: bash has help -d -m -s. ... |
function openNav(){
document.getElementById("sidenav").style.width = "100%";
document.getElementById("menu-button").style.display = 'none';
}
function closeNav(){
document.getElementById("sidenav").style.width = '0';
document.getElementById("menu-button").style.display = 'block';
} |
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
/* Layout */
import Layout from '@/layout'
/* Router Modules */
import chartsRouter from './modules/charts'
import tableRouter from './modules/table'
/**
*注意:子菜单仅在route children.length>=1时出现
*详情见:https://panjiachen.github.io/vue-element-admin-s... |
import React, {Component} from 'react'
import {AppRegistry, View, Text, Animated} from 'react-native'
class FadeInView extends Component {
constructor(props) {
super(props)
this.state = {
fadeAnim: new Animated.Value(0)
};
}
componentDidMount(){
Animated.timing(
this.state.fadeAnim,
... |
import React from 'react'
import { Preloader, Placeholder } from 'react-preloading-screen'
import Header from '../components/hashcraft/Header'
import Footer from '../components/hashcraft/Footer'
import GoTop from '../components/hashcraft/GoTop'
import PageTitle from '../components/hashcraft/PageTitle'
import ProjectCon... |
import { startOfDay, endOfDay, parseISO } from 'date-fns';
import { Op } from 'sequelize';
import Appointment from '../models/Appointment';
import User from '../models/User';
class ScheduleController {
async index(req, res) {
const userIsProvider = await User.findOne({
where: {
id: req.userId,
... |
import { observable, action } from 'mobx';
import pinyin from '../han';
import contacts from './contacts';
import wfc from '../wfc/wfc'
import UserInfo from '../wfc/model/userInfo';
import GroupInfo from '../wfc/model/groupInfo';
import Conversation from '../wfc/model/conversation';
import ConversationType from '../w... |
/*
* sophia database
* sphia.org
*
* Copyright (c) Dmitry Simonenko
* BSD License
*/
/*
* Copyright (c) 2008-2010 Massachusetts Institute of Technology
* Copyright (c) 2004-2006 Intel Corporation
*
* This software program is licensed subject to the BSD License,
* available at http://www.opensource.org/lice... |
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'typescript',
'typescript/react',
'typescript/prettier',
'typescript/prettier-react',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
... |
import asyncio
import re
from unittest import mock
from kafka.protocol.group import (
JoinGroupRequest_v0 as JoinGroupRequest,
SyncGroupResponse_v0 as SyncGroupResponse,
LeaveGroupRequest_v0 as LeaveGroupRequest,
HeartbeatRequest_v0 as HeartbeatRequest,
)
from kafka.protocol.commit import (
OffsetC... |
function camelCase(name) {
return name.charAt(0).toLowerCase() + name.slice(1);
}
export class ValueConverterResource {
constructor(name) {
this.name = name;
}
static convention(name) {
if (name.endsWith('ValueConverter')) {
return new ValueConverterResource(camelCase(name.su... |
/*
AngularJS v1.3.15
(c) 2010-2014 Google, Inc. http://angularjs.org
License: MIT
*/
(function(q,d,C){'use strict';function v(r,k,h){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(a,f,b,c,y){function z(){l&&(h.cancel(l),l=null);m&&(m.$destroy(),m=null);n&&(l=h.leave(n),l.then(func... |
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import xmlrunner
import unittest
import imp
from os.path import abspath, dirname, split as splitpath, join as joinpath
import logging
logger = logging.getLogger(__name__)
if not logger.root.handlers:
import logging.config
LOGGER_... |
import React from 'react';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router-dom';
import { Container, Row, Col, ListGroup, ListGroupItem, Button } from 'reactstrap';
import FontAwesome from 'react-fontawesome';
import styled from 'styled-components';
// imported components
class Survey... |
from types import ModuleType, MethodType
from src.all_exceptions import MutatorException
def unbind(f):
"""
Function that unbinds a given function if it's actually binded to an object. If it's not binded to an object it'll
raise a TypeError Exception
:param f: function to unbind from an object
:typ... |
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
'use strict';
const md5File = require('md5-file/promise');
module.exports = function hashAssetFiles(asset) {
return Promise.all(asset.files.map(md5File)).then(hashes => {
asset.fileHashes = hashes;
return asset;
});
};
|
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[12],{
/***/ "./node_modules/immutable/dist/immutable.js":
/*!**************************************************!*\
!*** ./node_modules/immutable/dist/immutable.js ***!
\**************************************************/
/*! no static exports found */
... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
# credit goes to @snapdragon and @devpatel_73 for making it work on this userbot.
#
# Original author of the UniBor... |
import sys
input_file = sys.argv[1]
sampler_printout = sys.argv[2]
with open(sampler_printout, 'r') as f:
while True:
line = f.readline()
if 'Obtained total momentum:' in line:
energy = float(line.split('(')[1].split()[0])
break
pi0 = 0
rho0 = 0
eta = 0
with open(input_fi... |
# Lint as: python3
# Copyright 2018 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 ... |
#!/usr/bin/env python
#
# Wrapper script for starting the biopet-vcfstats JAR package
#
# This script is written for use with the Conda package manager and is copied
# from the peptide-shaker wrapper. Only the parameters are changed.
# (https://github.com/bioconda/bioconda-recipes/blob/master/recipes/peptide-shaker/pep... |
import React from 'react';
import { graphql } from 'gatsby';
import SEO from '../../components/SEO';
import Layout from '../../layouts/index';
const Team = (props) => {
const teams = props.data.allMarkdownRemark.edges;
return (
<Layout bodyClass="page-teams">
<SEO title="Team" />
<div className="in... |
from ops import *
from utils import *
import time
from tensorflow.contrib.data import prefetch_to_device, shuffle_and_repeat, map_and_batch
import numpy as np
from glob import glob
class StarGAN(object) :
def __init__(self, sess, args):
self.model_name = 'StarGAN'
self.sess = sess
self.chec... |
# -- encoding:utf-8 --
"""
Create by ibf on 2018/6/21
"""
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
# 设置字符集,防止中文乱码
mpl.rcParams['font.sans-serif'] = [u'simHei']
mpl.rcParams['axes.unicode_minus'] = False
# 1. 随机数据产生
# 给定随机数种子:当程序多次运行的时候,可以保证每次运行时候随机的数据都是一样的
np.random.... |
#include <stdio.h>
int main() {
int i;
char *a[] = {"Carrot","Onion","Potato"};
char **p = a;
for(i=0; i<3; i++) {
printf("%c\n", *(p[i]+1));
}
return 0;
}
|
# -*- coding: UTF-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from ..models import MyModel
class MyModelListViewTest(TestCase):
@classmethod
def setUpClass(cls):
super(MyModelListViewTest, cls).setUpClass()
cls.instance = MyModel.objects.create(title="Test"... |
# Copyright 2016 Quora, 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 writing, so... |
const Validator = require("validator");
const isEmpty = require("is-empty");
module.exports = function validatePurchaseLocationInput(data) {
let errors = {};
// Convert empty fields to an empty string so we can use validator functions
data.name = !isEmpty(data.name) ? data.name : "";
data.userID = !isEmpty(da... |
# 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.
"""Integrations tests for the LLVM CompilerGym environments."""
from compiler_gym.envs import CompilerEnv
from tests.test_main import main
pyt... |
define([
"core/framework/Tundra",
"core/framework/ITundraPlugin",
"core/asset/AssetFactory",
"plugins/avatar/asset/AvatarDescAsset",
], function(Tundra, ITundraPlugin, AssetFactory, AvatarDescAsset)
{
var AvatarPlugin = ITundraPlugin.$extend({
__init__ : function()
{
... |
#ifndef DALI_TOOLKIT_TEXT_RENDERER_H
#define DALI_TOOLKIT_TEXT_RENDERER_H
/*
* Copyright (c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* htt... |
import os
from django.conf.global_settings import LANGUAGES as DJANGO_LANGUAGES
import dj_database_url
###################
# Django Settings #
###################
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = os.getenv("DJANGO_SECRET_KEY", "not-secret-at-all")
DEBUG = bool(int(os... |
"""
Copyright (c) rwightman
https://gist.github.com/rwightman/f2d3849281624be7c0f11c85c87c1598
"""
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.utils import _pair, _quadruple
class MedianPool2d(nn.Module):
""" Median pool (usable as median filter when strid... |
import os
with open(
os.path.join(
os.path.dirname(__file__),
'text.grammar'
)
) as f:
text = f.read()
|
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "NR-RRC-Definitions"
* found in "/home/labadmin/hlal/rrc_15.3_asn.asn1"
* `asn1c -D ./15_3_rrc/ -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-example`
*/
#include "CellGroupConfigRrc.h"
#include "MAC-CellGroup... |
/****************************************************************************
****************************************************************************
***
*** This header was automatically generated from a Linux kernel header
*** of the same name, to make information necessary for userspace to
*** call i... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import os
import threading
from queue import Queue
import requests
import tensorflow as tf
import model
# In[4]:
get_ipython().run_cell_magic(
"time",
"",
'tf.reset_default_graph()\nsess = tf.InteractiveSession()\nmodel.Model(3, 256, 64, 2, 0.0001)\nses... |
export function convertState(state) {
switch (Number(state)) {
case 0:
return 'Tạo sản phẩm';
case 1:
return 'Đã thanh toán';
case 2:
return 'Đã giao hàng';
default:
return 'Tạo sản phẩm';
}
} |
import sys,os
sys.path.append("..")
import numpy as np
import tensorflow as tf
from example import hvd_distributed_classifier as bert_classifier
from bunch import Bunch
from data_generator import tokenization
from data_generator import hvd_distributed_tf_data_utils as tf_data_utils
from model_io import model_io
from e... |
"""
m2g.utils.cloud_utils
~~~~~~~~~~~~~~~~~~~~~~
Contains utility functions for working on the cloud with AWS.
"""
# standard library imports
from configparser import ConfigParser
import os
import sys
# package imports
import boto3
def get_credentials():
"""Searches for and returns AWS_ACCESS_KEY_ID and AWS_SE... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import unittest
from os.path import join as joinpath
import ffmpymedia
from tests import TEST_FILE_PATH
class TestMediaUse(unittest.TestCase):
def test_compare_two_files(self):
# User1 wants to compare two media files to see if their stream layouts are t... |
#pragma once
#include <MetaNN/facilities/cont_metafuns/helpers.h>
namespace MetaNN::ValueSequential
{
template <typename TValueSeq, auto val>
struct Contains_;
template <template<auto...> class TValueCont, auto val, auto... vals>
struct Contains_<TValueCont<vals...>, val>
{
constexpr s... |
"use strict";
const { expect } = require("chai");
const i18n = require("../../src/middleware/i18n");
describe("i18n class check", () => {
let originalPuzzle = null;
let cwd = "";
before(() => {
originalPuzzle = global.puzzle;
global.puzzle = require("./middlewarePuzzle");
cwd = process.cwd();
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. 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... |
from django.apps import AppConfig
class UsersConfig(AppConfig):
name = "django_test.users"
verbose_name = "Users"
def ready(self):
"""Override this to put in:
Users system checks
Users signal registration
"""
try:
import users.signals # noqa F4... |