text stringlengths 3 1.05M |
|---|
// Copyright 2009 the Sputnik authors. All rights reserved.
/**
* The Date.prototype property "toLocaleString" has { DontEnum } attributes
*
* @path ch15/15.9/15.9.5/15.9.5.5/S15.9.5.5_A1_T2.js
* @description Checking absence of DontDelete attribute
*/
if (delete Date.prototype.toLocaleString === false) {
$ER... |
from __future__ import print_function
import argparse
import os
import numpy
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision.datasets import ImageFolder
from PIL import Image
import numpy as np
from torchvision import datasets, transforms
from torch.autogr... |
#include <stdio.h>
#include <time.h>
#include "bs.h"
#include "models/account.h"
#include "models/session.h"
Account *accountNew(int id, int createdAt, char *name,
char *email, char *username)
{
Account *account = malloc(sizeof(Account));
account->id = id;
account->createdAt = ... |
import styled from "styled-components"
export const Button = styled.button`
padding: 8px 16px;
background-color: rebeccapurple;
color: white;
border-radius: 4px;
cursor: pointer;
${props => (props.block ? "display : block; width: 100%;" : "")}
&:hover {
background: indigo;
}
`
|
"""The IPython kernel implementation"""
import asyncio
import builtins
from contextlib import contextmanager
from functools import partial
import getpass
import signal
import sys
from IPython.core import release
from IPython.utils.tokenutil import token_at_cursor, line_at_cursor
from traitlets import Instance, Type, ... |
const database = require('./mongo');
const regexpToInsert = /^insert.*$/;
const regexpToUpdate = /^update.*$/;
const regexpToDelete = /^delete.*$/;
const getCollection = require('./get-collection');
const handler = Object.freeze({
get:() => async(obj, args, context, info) => {
await database.connect();
... |
# Generated by Django 3.1.7 on 2021-05-11 08:17
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('flair', '0016_auto_20210502_0028'),
]
operations = [
migrations.CreateModel(
name='ActionLogging',
... |
# Generated by Django 2.2.8 on 2020-01-10 15:08
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='User',
f... |
import importlib
import configuration
import requests
import urllib
from fhirclient import client
from lib import mongodbConnection
from jsonreducer.ObservationReducer import ObservationReducer
from resources import aggregationResource
from bson.objectid import ObjectId
from datetime import datetime
import traceback
im... |
/*jslint browser: true, nomen: true, laxbreak: true*/
/*global ajaxurl */
"use strict";
jQuery(function ($) {
var deleted = 0;
var deleting = false;
var initial_orphans_count = 0;
var orphansCount = $('#wpml_orphans_count');
var orphansCheckCount = orphansCount.find('.check-orphans');
var or... |
$(function () {
// Validator download from https://jqueryvalidation.org/ //
$( document ).ready( function () {
$( "#login-form" ).validate( {
rules: {
password: {
required: true,
minlength: 8
},
email: {
... |
import Vue from 'vue'
import Router from 'vue-router'
import store from '../store'
import { mapGetters } from "vuex";
// in development-env not use lazy-loading, because lazy-loading too many pages will cause webpack hot update too slow. so only in production use lazy-loading;
// detail: https://panjiachen.github.io/v... |
from models.base.EntityBase import EntityBase
from infrastructure.json.BaseConverter import BaseConverter
@BaseConverter.register
class ApSchedulerJobEventBase(EntityBase):
def __init__(self,
EventId: int = None,
ApSchedulerJobId: str = None,
ApSchedulerJob=None,... |
from os.path import join, dirname
import datetime
import pandas as pd
from scipy.signal import savgol_filter
from bokeh.io import curdoc
from bokeh.layouts import row, column
from bokeh.models import (ColumnDataSource, DataRange1d,
HoverTool, Slider, Div)
from bokeh.palettes import Blues4, b... |
/* eslint-env mocha */
'use strict'
const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
const goodbye = require('it-goodbye')
const { collect } = require('streaming-iterables')
const pipe = require('it-pipe')
const AbortController = require('abort-contro... |
import numpy as np; pixmapData={'lock.png': b'\x80\x03cnumpy.core.multiarray\n_reconstruct\nq\x00cnumpy\nndarray\nq\x01K\x00\x85q\x02C\x01bq\x03\x87q\x04Rq\x05(K\x01K K K\x04\x87q\x06cnumpy\ndtype\nq\x07X\x02\x00\x00\x00u1q\x08K\x00K\x01\x87q\tRq\n(K\x03X\x01\x00\x00\x00|q\x0bNNNJ\xff\xff\xff\xffJ\xff\xff\xff\xffK\x00t... |
const url = location.href;
const params = url.split("?")[1];
const serverUrl = "http://localhost:3000/api";
let paramsObj = {};
$("#btn-minimal-resetpassword").click(function() {
$("#minimal-resetpassword-message").text("");
if($("#minimal-resetpassword-password").val() == "") {
$("#minimal-resetpassword-... |
from typing import overload
class A:
@overload
def foo(self, value: str) -> None:
pass
@overload
def foo(self, value: int) -> str:
pass
def foo(self, value):
return None
A().foo<caret>("") |
import numpy as np
from constants import Constants
def forces(coords, charges):
'''
coords: a 2D numpy array with columns X, Y and rows for each particle
[ [x1, y1],
[x2, y2],
...,
xN, yN] ]
charges: a numpy array containing the charges of each particle
returns a 2D numpy... |
# Copyright (c) Facebook, Inc. and its affiliates.
import numpy as np
from fairmotion.utils import constants, utils
from scipy.spatial.transform import Rotation
import warnings
"""
Glossary:
p: position (3,)
rad: radians
deg: degrees
A: Axis angle (3,)
E: Euler angle (3,)
Q: Quaternion (4,)
R: Rotation matrix (3,3)... |
import { combineReducers } from "redux";
import moviesReducer from "./moviesReducer";
import newmovieReducer from './newmovieReducer'
export default combineReducers({
moviesReducer,newmovieReducer
})
|
from rstem.accel import Accel
from rstem.button import Button
from rstem.mcpi import minecraft, control
import time
control.show(hide_at_exit=True)
keymap = {
Button(23) : control.left,
Button(14) : control.right,
Button(18) : control.forward,
Button(15) : control.backward,
}
accel = Accel()
whi... |
import os
import sys
import time
import threading
import ConfigParser
import paho.mqtt.client as mqtt
from twitter import *
class TwitterPusher(threading.Thread):
def _readConfig(self):
update = False
stop = False
if not os.path.isdir(self._homeDir):
print "Crea... |
#################################################################################
# Author:Ben, Concepta
# Username:maynardb, mjolimac
#
# Assignment: T03: Boustrophedon Turtles and Functions
# Purpose: To draw a square and fill it in with a boustrophedon pattern
########################################################... |
"""This module describes Invader's behaviour. """
import asyncio
import logging
from random import randint
from gamepad.unit import Unit
from simple_commander.utils.constants import DEFAULT_SPEED, STEP_INTERVAL, UNITS
from simple_commander.game.bullet import Bullet
class Invader(Unit):
def __init__(self, x, y... |
import errno
import os
from typing import Optional
import sqlalchemy as sa
from ibis.backends.base.sql.alchemy import AlchemyClient
from . import udf
from .compiler import SQLiteCompiler
class SQLiteClient(AlchemyClient):
"""The Ibis SQLite client class."""
compiler = SQLiteCompiler
def __init__(self... |
"""Generates a gin config from the current task/mixture list.
Usage: `python3 -m config.generate`
"""
from itertools import chain, product
from pathlib import Path
import t5
import conversational_ai.tasks # noqa: F401
WHITELIST = ["chitchat", "dailydialog", "convai2"]
sizes = ["small", "base", "large", "3b", "11b... |
/*=========================================================================
Program: Visualization Toolkit
Module: vtkOverlayPass.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is ... |
# Copyright (c) 2019 Microsoft Corporation
# Distributed under the MIT software license
from .all import * # noqa: F401,F403
from .distributed import * # noqa: F401,F403
|
/* global describe it beforeEach*/
import {Alert} from 'react-bootstrap';
import {expect} from 'chai';
import {Field} from 'redux-form';
import Login from '../../../src/components/ui/Login';
import React from 'react';
import {shallow} from 'enzyme';
import sinon from 'sinon';
describe('<Login/>', () => {
let wrappe... |
from panda3d.core import PerspectiveLens, OrthographicLens, AmbientLight, PointLight, Vec4, Vec3, Point3, \
WindowProperties, Filename, NodePath, Shader, GraphicsPipe, FrameBufferProperties, GraphicsOutput
from direct.showbase.ShowBase import ShowBase
import visualization.panda.inputmanager as im
import visualizati... |
from django.apps import AppConfig
class CommentConfig(AppConfig):
name = "comment"
|
from __future__ import unicode_literals # ensure that RichText.__str__ returns unicode
import re # parsing HTML with regexes LIKE A BOSS.
from django.utils.encoding import python_2_unicode_compatible
from django.utils.html import escape
from django.utils.safestring import mark_safe
from wagtail.wagtailcore.whiteli... |
###########################################################################
#
# Copyright 2018 Google 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
#
# https://www.apache.org/... |
"""
Test json formatting.
"""
from hamcrest import (
assert_that,
contains_inanyorder,
equal_to,
is_,
)
from microcosm.api import create_object_graph
from microcosm_flask.formatting import JSONFormatter
from microcosm_flask.tests.formatting.base import etag_for
def test_make_response():
graph = ... |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# Copyright (c) 2008-2021 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... |
var initJ2C = function(){
console.log('read -> ',371831)
read_element_descendant(371831, function(){
if(ctrl.request.parameters.p){
read_element(ctrl.request.parameters.p, function(){
read_element_children(ctrl.request.parameters.p, function(){
ctrl.project = ctrl.eMap[ctrl.request.parameters.p]
c... |
/* connection.c - the connection type
*
* Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this softw... |
import io
import os
import shutil
import subprocess
import sys
import pytest
import six
import pip._internal
from tests.lib import SRC_DIR, TestData
from tests.lib.path import Path
from tests.lib.scripttest import PipTestEnvironment
from tests.lib.venv import VirtualEnvironment
def pytest_collection_modifyitems(ite... |
from .utils import (
coerce_content_type,
get_filepaths,
open_sesame,
split_records,
split_record_fields,
unzip,
)
from .csv import read_csv, write_csv
from .http import read_http_stream, write_http_stream
from .json import read_json, read_json_mash, write_json
from .matrix import read_sparse_ma... |
from datetime import datetime
import pytest
from dagster import execute_pipeline
from google.cloud.bigquery import QueryJobConfig, Client
from hca_orchestration.pipelines import load_hca
from hca_orchestration.repositories.local_repository import load_hca_job
@pytest.mark.e2e
def test_load_updated_staging_area(
... |
import { DoiPreview } from './DoiPreview';
import { PUBLICATION_TYPE_RESEARCH_REPORT, DOCUMENT_TYPE_RESEARCH_REPORT } from 'config/general';
const setup = (testProps = {}, args = { isShallow: true }) => {
const props = {
publication: {},
...testProps,
};
return getElement(DoiPreview, props... |
import functools
from collections import OrderedDict
from copy import copy
from urllib.parse import urljoin
import pytest
import pytorch_testing_utils as ptu
import torch
from torch import nn
from pystiche import enc
from tests import asserts, mocks
class TestSelectURL:
def test_main(self):
key = "ava... |
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2020 Darby Johnston
# All rights reserved.
import djvCorePy.FileSystem as fs
import unittest
class PathTest(unittest.TestCase):
def test_ctor(self):
self.assertTrue(fs.Path().isEmpty())
self.assertEqual(fs.Path("/").get(), "/")
self... |
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram 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... |
import csv
import datetime
import io
import os
import sys
import time
from helpers import *
# Abstract base class for all reports that automates reading and writing reports etc.
class Report(object):
def __init__(self, configuration, dataDirectory, metaStats):
self.configuration = configuration
self.dataDirector... |
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
Copyleft (L) 2016 - 2019 RonanLana (HeavenMS)
This program is free software: you c... |
import os
def get_image_save_path():
base_path = os.path.dirname(__file__)
try:
f = open(base_path + '/../config/path_to_screen.txt', 'r')
path = f.read()
f.close()
except OSError:
f = open(base_path + '/../config/path_to_screen.txt', 'w')
path = input("Enter the p... |
# -*- coding: utf-8 -*-
import scrapy
import numpy as np
from faker import Factory
from douban_movie.dns_cache import _setDNSCache
from douban_movie.items import DoubanMovieItem, DoubanMovieCommentItem, DoubanMovieUser
# import urlparse # python2.x
from urllib import parse as urlparse # python3.x
f = Factory.create(... |
# -*- 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 Li... |
import time
import asyncio
from multiprocessing import cpu_count
from pulsar.apps.data.channels import backoff
from .producer import Producer, ConsumerMessage
HEARTBEAT = 2
class Consumer(Producer):
"""The consumer is used by the server side application
"""
def __repr__(self):
return 'consumer... |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
var x = Number.MAX_VALUE;
Number.MAX_VALUE = 1;
{
var __result1 = Number.MAX_VALUE !== x;
var __expect1 = false;
}
|
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... |
/*
* This file is part of FFmpeg.
*
* FFmpeg 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 option) any later version.
*
* FFmpeg is distributed... |
import torch
from torch.utils.data import RandomSampler
from pathlib import Path
import sys
FILE = Path(__file__).resolve()
ROOT = FILE.parents[0].parents[0] # CogKGE root directory
if str(ROOT) not in sys.path:
sys.path.append(str(ROOT)) # add CogKGE root directory to PATH
from cogkge import *
device=init_cog... |
/* BFD support for the Alpha architecture.
Copyright (C) 1992-2020 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
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 F... |
/*!
* nodeclub - controllers/topic.js
*/
/**
* Module dependencies.
*/
var validator = require('validator');
var at = require('../common/at');
var User = require('../proxy').User;
var Topic = require('../proxy').Topic;
var TopicCollect = require('../proxy').TopicCollect;
var EventProxy ... |
from __future__ import absolute_import, division, print_function
import copy
import logging
import math
import operator
import libtbx.phil
from cctbx import miller
from dials.array_family import flex
from dxtbx.model import Crystal
from scitbx import matrix
from scitbx.math import least_squares_plane, superpose
from... |
from xml.dom import minidom
from influxdb import InfluxDBClient
#variables
IP = ''
USERNAME = 'admin'
PASSWORD = 'admin'
DB_NAME = 'Healthkit'
NAME = 'Username'
#setup influx client
client = InfluxDBClient(IP, 8086, USERNAME, PASSWORD, DB_NAME)
client.create_database(DB_NAME)
#heartrate
xmldoc = minidom.parse('expor... |
!function(){function e(e,t){return new Promise(function(o,n){document.head.appendChild(Object.assign(document.createElement("script"),{src:e,onload:o,onerror:n},t?{type:"module"}:void 0))})}var t=[];function o(){"noModule"in HTMLScriptElement.prototype?e("./app.889b20bcbef01fce0e59.js"):e("./legacy/app.9971729f3b76ac16... |
import pygame, sys, math
pygame.init()
FPS = 60 # frames per second setting
fpsClock = pygame.time.Clock()
# set up the window
WIDTH = 400
HEIGHT = 300
screen = pygame.display.set_mode((WIDTH, HEIGHT), 0, 32)
pygame.display.set_caption('Verlet Simple Cloth System')
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (... |
import Vue from "vue";
import Router from "vue-router";
import Home from "../views/Home.vue";
import PageSettings from "../views/PageSettings.vue";
import PageUsers from "../views/PageUsers.vue";
import PageGocipe from "@/modules/uibuilder/views/PageGocipe.vue";
Vue.use(Router);
export default new Router({
mode: "h... |
""" Userbot module which contains afk-related commands """
from datetime import datetime
import time
from random import choice, randint
from telethon.events import StopPropagation
from telethon.tl.functions.account import UpdateProfileRequest
from userbot import ( # noqa pylint: disable=unused-import isort:skip
... |
/**
* @author Mehdi
* created on 04/06/2018
*/
(function(){
'use strict';
angular.module('AlMedinet')
.service("exampleService", ['$q',ExampleService]);
function ExampleService($q){
}
})();
|
from django.shortcuts import render
from posts.models import Post, Tag
from posts.views import tag
def home(request):
'''
cat_names = ["tech", "effective-altruism", "misc"]
cats = []
for cat_name in cat_names:
tag = Tag.objects.get(slug=cat_name)
posts = tag.posts.filter(state=Post.PUBL... |
/*
/ _____) _ | |
( (____ _____ ____ _| |_ _____ ____| |__
\____ \| ___ | (_ _) ___ |/ ___) _ \
_____) ) ____| | | || |_| ____( (___| | | |
(______/|_____)_|_|_| \__)_____)\____)_| |_|
(C)2013 Semtech
Description: Header for driver hw msp module
License: Revised BSD... |
"""
30 min
Write a function that provides change directory (cd) function for an abstract file system.
Notes:
* Root path is '/'.
* Path separator is '/'.
* Parent directory is addressable as '..'.
* Directory names consist only of English alphabet letters (A-Z and a-z).
* The function should support both relative and... |
//
// NSUserDefaults+Testing.h
// CriteoPublisherSdkTests
//
// Copyright © 2018-2020 Criteo. 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.apac... |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_connectivity_getconnectivityservicedetails_output_service import TapiConnectivityGetconnec... |
""" ListToTuple transforms some List node into more Efficient Tuple nodes. """
from pythran.analyses import Aliases
from pythran.tables import MODULES
from pythran.passmanager import Transformation
import gast as ast
patterns = (MODULES['numpy']['ones'],
MODULES['numpy']['zeros'],
MODULES['nu... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
# 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 not u... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
#
# Copyright (c) 2014 unfoldingWord
# http://creativecommons.org/licenses/MIT/
# See LICENSE file for details.
#
# Contributors:
# Jesse Griffin <jesse@distantshores.org>
"""
"""
import os
import sys
import codecs
from etherpad_lite import EtherpadLiteClient
from et... |
import pytest
from dataplicity.m2mmanager import M2MManager
from dataplicity.portforward import PortForwardManager
from mock import call, patch
_weakref_table = {}
class FakeClient(object):
pass
@pytest.fixture
def manager():
client = FakeClient()
_weakref_table['client'] = client
yield PortForward... |
"use strict";
var DashCI;
(function (DashCI) {
DashCI.app = angular.module("dashboard", [
"widgetGrid",
"ngMaterial",
"ngResource",
"angularCSS"
]);
var Config = /** @class */ (function () {
function Config() {
}
// suppress iOS' rubber band effect
... |
const stickermaker = (pushname, prefix, botName, ownerName) => {
return `
╔══✪〘 Informações 〙✪══
║
║───────⊹⊱✫⊰⊹───────
║➩ ❍ wa.me/5535984799661
║➩ ❍ Prefix: 「 ${prefix} 」
║➩ ❍ Criador: ${botName}
║➩ ❍ Nome: $ Andre2k
║➩ ❍ XP: ${reqXp}
║➩ ❍ Money: ${uangku}
───────⊹⊱✫⊰⊹───────
BJORNXZZ
──────... |
const db = require('../models/orderModel');
// Defining methods for the postsController
module.exports = {
findAll: function (req, res) {
db.find(req.query)
.sort({ created: -1 })
.then((dbModel) => res.json(dbModel))
.catch((err) => res.status(422).json(err));
},
findById: function (req, r... |
import torch
from torch import nn
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from maskrcnn_benchmark import _C
# TODO: Use JIT to replace CUDA implementation in the future.
class _SigmoidFocalLoss(Function):
@staticmethod
def forward(ctx, logits, targets, gamma... |
# Copyright 2017 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 applica... |
/* ----------------------------------------------------------------------------
* SAM Software Package License
* ----------------------------------------------------------------------------
* Copyright (c) 2012, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary fo... |
import tkinter as tk
from tkinter import ttk
class User_window:
def __init__(self, parent):
self.frame = ttk.Frame(parent)
self.parent = parent
self.children = {}
def grid(self):
self.frame.grid(sticky='wens')
def add_children(self, **kwargs):
for child in kwa... |
# Copyright (c) 2020 PaddlePaddle 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 appli... |
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('Integration | Component | channel-container', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(a... |
import React, { Component } from 'react';
// eslint-disable-next-line react/prefer-stateless-function
class Contact extends Component {
render() {
return (
<React.Fragment>
<h1>trang lien he</h1>
</React.Fragment>
);
}
}
export default Contact;
|
import os
from collections import namedtuple
from unittest import TestCase
from unittest.mock import patch, Mock
from plan_b.cli import do_work
MockIssue = namedtuple('MockIssue', ['key', 'fields'])
MockFields = namedtuple('MockFields', [
'issuetype', 'summary', 'assignee', 'reporter', 'created', 'resolutiondate... |
/**
* A transformer wrapper for transducers
* @private
* @param {Function} fn The function to wrap
* @return {Object} The wrapped function
*/
const _xwrap = fn => ({
'@@transducer/result': acc => acc,
'@@transducer/step': fn
})
module.exports = _xwrap
|
import unittest
import coverage
import os
from flask_script import Manager
from flask_migrate import MigrateCommand
from project import create_app, db
from project.api.models import User
COV = coverage.coverage(
branch=True,
include='project/*',
omit=[
'project/tests/*'
]
)
COV.start()
app = ... |
"""Some common katas in Python:
"""
"""FizzBuzz:
Write a program that prints each of the numbers 1 - 100 on a new line - however..
- If the number is a multiple of 3, print "Fizz" instead of the number.
- If the number is a multiple of 5, print "Buzz" instead of the number.
- If the number is a multiple o... |
////////////////////////////////////////////////////////////////////////////////
/// @file fcyBinaryHelper.h
/// @brief fancy二进制读写辅助
////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "fcyStream.h"
/// @addtogroup fancy库IO模块
/// @{
/////////////////////////////////... |
import React from "react";
import "./FlightDetails.css";
import axios from 'axios'
import ListFlights from "./listFlights";
import Button from '@mui/material/Button';
import "./flightSelectionCard.css"
import { useHistory } from "react-router-dom";
import Paper from '@mui/material/Paper';
import Grid from '@mui/materia... |
#!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitsend Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test BIP65 (CHECKLOCKTIMEVERIFY).
Test that the CHECKLOCKTIMEVERIFY soft-fork activates at (regtest) ... |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 OpenStack Foundation
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eBay Inc.
#
# Licensed under the Apach... |
// Copyright (c) 2012-2018 The Elastos Open Source Project
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef _JNIHELPERS_H_
#define _JNIHELPERS_H_
#include <jni.h>
jfieldID inline getHandleField(JNIEnv *env, jobject obj... |
import random
import urllib.request
import urllib.parse
import urllib.error
from splunk_eventgen.lib.outputplugin import OutputPlugin
from splunk_eventgen.lib.logging_config import logger
try:
import requests
from requests import Session
from requests_futures.sessions import FuturesSession
from concur... |
/*
* LSI/Engenio/NetApp E-Series RDAC SCSI Device Handler
*
* Copyright (C) 2005 Mike Christie. All rights reserved.
* Copyright (C) Chandra Seetharaman, IBM Corp. 2007
*
* 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
... |
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModu... |
/*
* Copyright © 2019 Lisk Foundation
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Remove stems from the tokenized words of the tweet.
Attention: Must only be applied on a "_tokenized" column!
Created on Fri Oct 8 10:09:23 2021
@author: sohaas
"""
from code.preprocessing.preprocessor import Preprocessor
from nltk.stem import SnowballStemmer
impor... |
const fs = require('fs');
const readline = require('readline');
const Canvas = require('canvas-lms-api');
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false,
});
function isValidHttpUrl(string) {
let url;
try {
url = new URL(string);
} cat... |