text stringlengths 3 1.05M |
|---|
const path = require('path');
const postcss = require('rollup-plugin-postcss');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
const pkg = require('./package.json');
const rollupPostCssConfig = (destination) => postcss({
plugins: [
autoprefixer(),
cssnano({
preset: 'd... |
const path = require('path');
const webpack = require('webpack');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin;
const CircularDependencyPlugin = require('circular-dependency-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const env = process.env.NODE... |
const { JWK, JWT } = require('jose');
const {
entityKeyPriv,
entityKeyPub,
entityOrgId,
entityKeyFragment,
ektaOrgId
} = require('../../config');
const { createToken } = require('../../../shared/utils/auth');
require('chai').should();
describe('Authentication and Authorization Utilities', () => {
describe... |
#pragma once
#include "common.h"
#include <libconfig.h>
typedef struct
{
color_t textColor;
color_t frontWaveColor;
color_t middleWaveColor;
color_t backWaveColor;
color_t backgroundColor;
color_t highlightColor;
color_t separatorColor;
color_t borderColor;
color_t borderTextColor;... |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* ... |
import io
import pandas as pd
import requests
from pydatajson.time_series import get_distribution_time_index
class CSVReader:
def __init__(self, distribution, verify_ssl=False, file_source=None):
self.distribution = distribution
self.verify_ssl = verify_ssl
self.file_source = file_source
... |
//
// SceneDelegate.h
// Instagram
//
// Created by mattpdl on 7/6/21.
//
#import <UIKit/UIKit.h>
@interface SceneDelegate : UIResponder <UIWindowSceneDelegate>
@property (strong, nonatomic) UIWindow * window;
@end
|
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 = Reflect.decorate(d... |
/*!
* Draggabilly PACKAGED v2.1.1
* Make that shiz draggable
* http://draggabilly.desandro.com
* MIT license
*/
!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jque... |
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translato... |
import json
import pytest
from .test_access_key import basic_auth
from ..submit_genelist import (
GeneListSubmission,
VariantUpdateSubmission,
CommonUtils,
)
pytestmark = [pytest.mark.setone, pytest.mark.working]
GENELIST_PATH = "src/encoded/tests/data/documents/gene_lists/"
VARIANT_UPDATE_PATH = "src/e... |
#!/usr/bin/python3
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Write a program which takes 2 digits, X,Y as input and generates a
# 2-dimensional array. The element value in the i-th row and j-th column
# of the array should be i*j.
#
# Note: i=0,1.., X-1; j=0,1,¡Y-1.
#
# Example
#
# ... |
"""Questão 1. Faça um programa que leia um arquivo texto contendo uma lista de endereços IP e
gere um outro arquivo, contendo um relatório dos endereços IP válidos e inválidos. O arquivo
de entrada possui o seguinte formato:
200.135.80.9
192.168.1.1
8.35.67.74
257.32.4.5
85.345.1.2
1.2.3.4
9.8.234.5
192.168.0.256
E o... |
import librosa
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import librosa.display
from typing import List
def audio_process(songname: str, mono: bool = True, duration: int = 30) -> pd.DataFrame:
"""
:return: DataFrame of all the features
:rtype: Pandas DataFrame
:param mono:... |
import sys
import pandas as pd
pd.options.display.max_columns = 30
import numpy as np
from time import time
import glob
#
import warnings
warnings.filterwarnings('ignore')
#
from sklearn.metrics import accuracy_score, confusion_matrix, classification_report#, ConfusionMatrixDisplay, plot_confusion_matrix
from sklearn.... |
import time
from PIL import Image
from . import test_image, test_black_image, angle_to_page
from tests.utility import tobytes
img = Image.open(test_image())
black = test_black_image().read()
connected = False
current_frame = None
def connect():
global connected
connected = True
return connected
def di... |
#define BUILD_SUFFIX e5f3f7514-dirty
#define BUILD_DATE "2018-02-17 13:11:15 +0200"
|
from .base import JsonError
from .traceback import TracebackMixin
class ApplicationJsonError(JsonError):
DEFAULTS = {
'error_code' : 'application_error',
'developer_message' : 'An unhandled application error ocurred.',
'status_code' : 500,
}
class TracebackApplicationJsonError(Traceba... |
from typing import Any, Callable, List, Dict, Union, Optional, Sequence, Tuple
from numpy import ndarray
from collections import OrderedDict
from scipy import sparse
import os
import sklearn
import numpy
import typing
import pandas as pd
import uuid
# Custom import commands if any
from sklearn.preprocessing import Norm... |
const datedTransaction = (amount) => {
const date = new Date();
const [month, day, year] = [date.getMonth(), date.getDate(), date.getFullYear()];
const [hour, minutes, seconds] = [date.getHours(), date.getMinutes(), date.getSeconds()];
const transaction = {
amount: amount,
month: m... |
/*
SM64 Level Script Decoder
shygoo 2017
License: MIT
*/
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include "lsdec.h"
#define LSD_MAX_SCRIPTS 70
#define LSD_INDENT_STR " "
#define SWAP16(i) ((((i) & 0xFF) << 8) | (((i) & 0xFF00) >> 8))
#define SWAP32(i)... |
"""
"""
### IMPORTS
import numpy as np
import json
from dipferromagtheory import resdir
def sigma_lambda(q, q_mean, dlam):
"""
Standard deviation of the wavelength distribution in q space
Parameters
----------
q : float
momentum/q transfer value
q_mean : float
ave... |
/**
* Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you 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.o... |
from __future__ import division
from __future__ import print_function
import sys
import numpy as np
import tensorflow as tf
import os
class DecoderType:
BestPath = 0
BeamSearch = 1
WordBeamSearch = 2
class Model:
"minimalistic TF model for HTR"
# model constants
batchSize = 50
imgSize = (128, 32)
maxText... |
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "WLAMapUtil.h"
#import "WLAMapView.h"
#import "WLLocationUtil.h"
#import "WLAliObjCache.h"
#import "WLRoutePlanUtil.h... |
# -*- coding: utf-8 -*-
'''
State module to manage Elasticsearch indices
.. versionadded:: 2015.8.0
.. deprecated:: 2017.7.0 Use elasticsearch state instead
'''
# Import python libs
from __future__ import absolute_import
import logging
# Import salt libs
log = logging.getLogger(__name__)
def absent(name):
'''... |
/**
* @license
* Copyright (C) 2017 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
*
* Unless require... |
import rethinkdb as r
import datetime
import itertools as itt
def remove_old_days(db_name, older_than=8, silent=True):
"""Deletes old days (tables) from a database.
db_name [str]: an existing RethinkDB database.
older_than [int]: delete days before this number of days ago.
Defaults to 8, which wi... |
(async() => {
// Load data and continents.
const data = await d3.json('data.json')
const continents = await d3.json('continents.json')
// Add static chart.
const chart = dalian.BubbleChart('chart-step-4', '#chart-step-4')
// Bind data.
.data(data[1950].map(d => ({
name: d.name,
value: {
... |
allUsersData = {
color: '#FF9D00',
name: 'Active Users',
data: [
[1553702560000,1],[1553702561000,1],[1553702562000,1],[1553702563000,1],[1553702564000,1],[1553702565000,1],[1553702566000,1],[1553702567000,1]
],
tooltip: { yDecimals: 0, ySuffix: '', valueDecimals: 0 }
, zIndex: 20
, yAxis: 1
}; |
const APP_PREFIX = 'my-site-cache-';
const VERSION = 'v1';
const CACHE_NAME = APP_PREFIX + VERSION;
const DATA_CACHE_NAME = "data-cache-" + VERSION;
const FILES_TO_CACHE = [
"/",
"./index.html",
"./css/styles.css",
"./js/idb.js",
"./js/index.js",
"./manifest.json",
"./icons/icon-72x72.png",
"./icons/... |
import argparse
import sys
from . import __version__
from .md_comments import parse_markdown_comments
from .xml_comments import parse_xml_comments
from .github import create_issues
from blessings import Terminal
term = Terminal()
class Cli:
@classmethod
def out(cls, content):
sys.stdout.write(conte... |
from typing import cast, Any, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Text
from confirmation.models import Confirmation, create_confirmation_link
from django.conf import settings
from django.template import loader
from django.utils.timezone import now as timezone_now
from zerver.decorator import sta... |
//>>built
define(
"dojo/cldr/nls/nyn/gregorian", //begin v1.x content
{
"dateFormatItem-yM": "M/y",
"field-dayperiod": "Nyomushana/nyekiro",
"dateFormatItem-yQ": "Q y",
"field-minute": "Edakiika",
"eraNames": [
"Kurisito Atakaijire",
"Kurisito Yaijire"
],
"dateFormatItem-MMMEd": "E, MMM d",
"field-day-relat... |
import sys
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
class table_3_2(QWidget):
qss = """
QWidget {
background: rgb(221, 221, 221);
border : 0px solid;
}
QTableWidget {
background: rgb(221,... |
#
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The exos_vlans class
It is in this file where the current configuration (as dict)
is compared to the provided configuration (as dict) and the command set
necessary to bri... |
/**
* @ignore
*/
var Ozone = Ozone ? Ozone : {};
/**
* @ignore
* @namespace
*/
Ozone.launcher = Ozone.launcher ? Ozone.launcher : {};
Ozone.launcher.WidgetLauncherContainer = function(eventingContainer) {
this.launchChannelName = "_WIDGET_LAUNCHER_CHANNEL";
this.windowManager = null;
if (... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_chatterbot', '0016_statement_stemmed_text'),
]
operations = [
migrations.RemoveField(
model_name='tag',
name='statements',
),
migrations.AddFi... |
/**
* Copyright Schrodinger, LLC
* 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.
*
* This is utility that hand... |
import sanitizeHtml from 'sanitize-html';
import { clusterConfig } from './../clusterConfig';
import { getAlternativePath } from './getAlternativePath';
export const getToken = () => {
let token = null;
if (sessionStorage.getItem('luigi.auth')) {
try {
token = JSON.parse(sessionStorage.getItem('luigi.aut... |
from helpers import *
import unittest
class TestSourceKit(unittest.TestCase):
def test_empty_yaml(self):
with mktemp("\n") as path:
code, out, err = run_command(path)
self.assertEqual(code, 1)
self.assertEqual(out, "")
self.assertEqual(
err,
... |
import { classKey, methodKey, methodSideKey } from './pathMapper';
/*
locationObj & paramsObj represent the returning values of built-in React hooks
*/
export const isLandingPath = (locationObj, paramsObj) =>
/^\/doku$/.test(locationObj.pathname) && paramsObj[classKey()] == null;
export const isHelpBookPath = (lo... |
from jqfactor import * |
"""
WSGI config for mylib project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTING... |
document.addEventListener("DOMContentLoaded", function(event) {
inputtext = document.getElementById('inputtext')
inputtext.addEventListener('paste', (e) => {
e.stopPropagation();
e.preventDefault();
// Get pasted data via clipboard API
var clipboardData = e.clipboardData || wi... |
const process = require("process");
const _ = require("lodash");
const path = require("path");
const grpc = require("@grpc/grpc-js");
const protoLoader = require("@grpc/proto-loader");
const { setupDatabase } = require("./setupDB");
const { influxClient } = require("./influxClient");
const AVAILABLE_TAGS = [
'trial... |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Unselected(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "barpolar"
_path_str = "barpolar.unselected"
_valid_props = {"marker", "textfont"}
#... |
#ifndef HAL_QUADROTOR_IDLE_H
#define HAL_QUADROTOR_IDLE_H
// Base controller type
#include <hal_quadrotor/control/Controller.h>
namespace hal
{
namespace quadrotor
{
//! A quadrotor Emergency controller
/*!
A more elaborate class description.
*/
class Idle : public Co... |
let person_app = new Vue(
{
el: "#person-app",
data: {
confirm_delete: false,
person: {},
secondary_person: {},
secondary_families: [],
families: [],
selected_family: {},
first_name: '',
selected_child:{}... |
$("pre").each(function (){
$(this).animate({
scrollTop: $(this).scrollTop() - $(this).offset().top + $(this).find(".highlighted").offset().top - 50
}, 1000);
return this;
}); |
"""Intermediate representation of functions."""
from typing import List, Optional, Sequence
from typing_extensions import Final
from mypy.nodes import FuncDef, Block, ArgKind, ARG_POS
from mypyc.common import JsonDict
from mypyc.ir.ops import (
DeserMaps, BasicBlock, Value, Register, Assign, AssignMulti, Control... |
const express = require('express');
const router = express.Router();
// import route modules
const { propertyId, workorder, getAdminSettings, updateSettings } = require('./adminRouter');
// router.get('/property/:id', propertyId);
// router.get('/workorder', workorder);
router.get('/getusersettings/:email', getAdminS... |
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 27 17:52:26 2019
@author: David
"""
from nets.pspnet import mobilenet_pspnet
import numpy as np
import random
import copy
import os
from PIL import Image
#class_colors = [[0,0,0],[0,255,0]]
NCLASSES = 2
HEIGHT = 256
WIDTH = 256
model = mobilenet_pspn... |
import { PlatformLocation } from '@angular/common';
import { Injectable } from '@angular/core';
import { getDOM } from '../../dom/dom_adapter';
import { supportsState } from './history';
export class BrowserPlatformLocation extends PlatformLocation {
constructor() {
super();
this._init();
}
... |
(function (angular) {
/*
jQuery-plugin template for SALSAH
converts the linear standoff
of SALSAH richtext values to HTML
by Lukas Rosenthaler & Tobias Schweizer
*/
/*
modified as ANGULAR Plugin (2015) by Stefan Münni... |
class DoubleLinkedListNode {
// Double Linked List Node built specifically for LFU Cache
constructor(key, val) {
this.key = key;
this.val = val;
this.freq = 0;
this.next = null;
this.prev = null;
}
}
class DoubleLinkedList {
// Double Linked List built specifically for LFU Cache
construct... |
# -*- coding: utf-8 -*-
#
# Django-Select2 documentation build configuration file, created by
# sphinx-quickstart on Sat Aug 25 10:23:46 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerate... |
"use strict";(self.webpackChunkvuepress=self.webpackChunkvuepress||[]).push([[7506],{5453:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-4e3486b6",path:"/notes/python/python%E5%9F%BA%E7%A1%80/python%E5%9F%BA%E7%A1%80.html",title:"python 基础",lang:"zh-CN",frontmatter:{title:"python 基础",date:"2021-11-14T09:34:18.000... |
"""
gltf.py
------------
Provides GLTF 2.0 exports of trimesh.Trimesh objects
as GL_TRIANGLES, and trimesh.Path2D/Path3D as GL_LINES
"""
import json
import base64
import collections
import numpy as np
from .. import util
from .. import visual
from .. import rendering
from .. import resources
from .. import transfor... |
import React from 'react';
import {SignUpDialog, WelcomeDialog} from './SignupDialog';
import Game from './Game.js';
import Dialog from './Dialog.js';
import Calculator from './Calculator.js';
import FilterableProductTable from './FilterableProductTable.js';
import {PRODUCTS} from './FilterableProductTable.js';
import ... |
const { Scenes } = require('telegraf');
const { BaseScene } = Scenes;
const {menu} = require('../lib/helpers');
const moment = require('moment');
const DISCLAIMER_TEXT = `Ребята, привет. Это бот Игоря Кочергина, автора канала @igvestor
Здесь вы узнаете, какие акции я беру в свои и клиентские портфели.
<b>Этот бот ид... |
var pg = require('pg');
//or native libpq bindings
//var pg = require('pg').native
var conString = "postgres://zdwkvtfh:Jc3rLhG14M9TR2U77iz8PX8Lgb-UyHZl@queenie.db.elephantsql.com:5432/zdwkvtfh"
//Can be found in the Details page
var client = new pg.Client(conString);
client.connect(function(err) {
if(err) {
re... |
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy.testing as npt
from openvino.tools.mo.front.common.partial_infer.utils import int64_array, shape_array, strict_compare_tensors, \
dynamic_dimension_value
from openvino.tools.mo.graph.graph import Node
from openvino.tool... |
#!/usr/bin/env python
#
# COPYRIGHT:
# The Leginon software is Copyright 2003
# The Scripps Research Institute, La Jolla, CA
# For terms of the license agreement
# see http://ami.scripps.edu/software/leginon-license
#
import event, leginondata
import watcher
import threading
import targethand... |
import React from "react";
import PropTypes from "prop-types";
import { Container, Grid, Checkbox } from "basis";
import KitchenSinkLayout from "./KitchenSinkLayout";
import KitchenSinkForm from "./KitchenSinkForm";
function FormWithCheckbox({
initialValue = false,
color,
label,
disabled,
helpText,
optiona... |
// Copyright 2010 Susumu Yata <syata@acm.org>
#ifndef NWC_TOOLKIT_MULTIKEY_SORT_H_
#define NWC_TOOLKIT_MULTIKEY_SORT_H_
#include <algorithm>
namespace nwc_toolkit {
namespace multikey_sort {
enum { QUICK_SORT_LOWER_LIMIT = 10 };
template <typename T>
class CharToUCharWrapper {
public:
typedef T Type;
};
templa... |
def read_input(file):
return list(map(lambda x: x.rstrip(), file.readlines()))
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
self.directions = [self.move_east, self.move_south, self.move_west, self.move_north]
self.current_dir = 0
def turn_left(self, step):
... |
/**
* @license
* Copyright 2015 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 requir... |
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2016 Intel Corporation
*/
#include <rte_common.h>
#include <rte_crypto.h>
#include <rte_string_fns.h>
#include <cmdline_parse_string.h>
#include <cmdline_parse_num.h>
#include <cmdline_parse_ipaddr.h>
#include <cmdline_socket.h>
#include <cmdline.h>
#include "... |
# Copyright (c) 2012-2016 Seafile Ltd.
import logging
from constance import config
from django.core.exceptions import ValidationError
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext as _
from django.urls import reverse
from django.http import HttpResponseRedirect
try... |
#!/usr/bin/env python3
from ost_parser import OST_ROOT
TEST_PATH = OST_ROOT / "2021/01/97920B-310A"
TEST_EVLA = TEST_PATH / "20B-310_sb39241368_1_1.evla"
TEST_VCI = TEST_PATH / "20B-310_sb39241368_1_scan01_1.vci"
|
export default { title: 'Tooltip/Tooltip/Pointer' };
export const left = () => `
<span class="tooltip">
<button class="icon-btn tooltip__host" aria-describedby="tooltip-1" aria-expanded="true" aria-label="Info">
<svg class="icon icon--settings" focusable="false" height="16" width="16" aria-hidden="true">
... |
angular.module('ui.dashboard.CommonApp').service('ui.dashboard.ArcService',function(){
var ArcService = function(){};
ArcService.prototype.polarToCartesian = function(centerX, centerY, radius, angleInDegrees) {
var angleInRadians = (angleInDegrees-90) * Math.PI / 180.0;
return {
x: center... |
//"use strict";
// never EVER do this
totalGlobalVariable = "My total global variable";
console.log(totalGlobalVariable);
let someVarToDelete = "Don't hurt me";
delete someVarToDelete;
console.log(someVarToDelete);
// type coershion
//always compare both value and types with === and !==
let variableA;
let variab... |
class IEditableCollectionView:
""" Defines methods and properties that a System.Windows.Data.CollectionView implements to provide editing capabilities to a collection. """
def AddNew(self):
"""
AddNew(self: IEditableCollectionView) -> object
Adds a new item to the collection.
Returns: The new i... |
#ifndef HTTP_CONN_H
#define HTTP_CONN_H
#include <sys/epoll.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/uio.h>
#include <stdarg.h>
#in... |
extern char *ram[1000];
void addToRAM(FILE *p, int *start, int *end);
void clearRAM(int start, int end); |
import contextlib
import csv
import inspect
import itertools
import time
import typing as T
from datetime import datetime
from functools import partial
import chex
import flax
import jax
import jax.numpy as jnp
import optax
import tabulate
from tqdm.auto import tqdm # notebook compatible
from . import pytypes as PT
... |
# This module provides the api twython object, which is used to access the api
# import time, to enable the sleep function
import time
# Import twython
from twython import Twython
from twython import Twython
# import the api keys
import apikeys
# import threading, to schedule the reset
from threading import Timer
# im... |
# Copyright (c) 2013 OpenStack Foundation
# 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 ... |
(function($){
$.fn.validationEngineLanguage = function(){
};
$.validationEngineLanguage = {
newLang: function(){
$.validationEngineLanguage.allRules = {
"required": { // Add your regex rules here, you can take telephone as an example
"regex": "n... |
# type: ignore
import ctypes
import types
from pathlib import Path
import pefile # to parse some headers uwu ~ nekit
from gd.enums import Protection
from gd.memory.utils import Structure, extern_fn
from gd.platform import system_bits
from gd.typing import Dict, Iterator, Optional, Type, Union
__all__ = (
"allo... |
class TransportError(IOError):
pass
class Fault(IOError):
def __init__(self, message, code, actor, detail):
super(Fault, self).__init__(message)
self.message = message
self.code = code
self.actor = actor
self.detail = detail
|
export const api = {
getUser: "http://localhost:3001/user",
getEmployees: "http://localhost:3001/employees",
updateEmployee: "http://localhost:3001/employees",
};
|
import { gql, useQuery } from "@apollo/client";
const GET_DOGS = gql`
query GetDogs {
dogs {
id
breed
}
}
`;
export function Dogs({ onDogSelected }) {
const { loading, error, data } = useQuery(GET_DOGS);
if (loading) return "Loading...";
if (error) return `Error! ${error.message}`;
r... |
!function(e,a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?a(require("jquery")):a(e.jQuery)}(this,function(n){n.fn.appear=function(r,e){var d=n.extend({data:void 0,one:!0,accX:0,accY:0},e);return this.each(function(){var s,a,e,u=n(this);u.appeared=!1,r?(s=n(window)... |
// Copyright (c) 2011-2013 The PPCoin developers
// Copyright (c) 2013-2014 The NovaCoin Developers
// Copyright (c) 2014-2018 The BlackCoin Developers
// Copyright (c) 2015-2019 The COVID19 developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/l... |
class Solution(object):
def minMoves2(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
median = sorted(nums)[len(nums) / 2]
return sum(abs(num - median) for num in nums) |
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression, SGDClassifier
from sklearn.metrics import accuracy_score
from sklearn.naive_bayes import GaussianNB
from sklearn.neighbors import KNeighborsClassifier
from sklearn.tree import DecisionTreeClassifier
from skle... |
import React from 'react';
import Show from '../components/show';
import BarStackHorizontal from '../components/tiles/barstackhorizontal';
export default () => {
return (
<Show
events
margin={{
top: 80,
left: 80,
right: 40,
bottom: 100,
}}
component={BarSta... |
from sample import PayPalClient
from paypalcheckoutsdk.payments import CapturesRefundRequest
import json
class RefundOrder(PayPalClient):
"""Request body for building refund request. This can be updated with values in case of partial refund. """
@staticmethod
def build_request_body():
"""Metho... |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
import pytest
from django.urls import reverse
from metadeploy.conftest import format_timestamp
from ..constants import ORGANIZATION_DETAILS
from ..models import Job, Plan, PreflightResult
@pytest.mark.django_db
def test_user_view(client):
response = client.get(reverse("user"))
assert response.status_code =... |
function currentSizeIndex(currentSizeIdx = 0, action) {
switch (action.type) {
case 'CHANGE_SIZE':
return action.currentSizeIndex;
default:
return currentSizeIdx;
}
}
function currentQuantity(currentQty = 1, action) {
switch (action.type) {
case 'CHANGE_QUANTITY':
return action.curr... |
#!/usr/bin/env python
#
# Copyright 2007 Doug Hellmann.
#
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
# copies and tha... |
#!/usr/bin/env python
import socket, subprocess, time
hostname = socket.gethostname()
commands = """
wget http://cvmfs.ihep.ac.cn/pub/cepc/cepc_test_job.tgz
tar xvfz cepc_test_job.tgz
cd cepc_test_job
echo
echo Job Start
./simu.sh
echo
if [ $? -eq 0 ]; then
echo Job Done.
else
echo Job Failed.
fi
"""
start ... |
import os, sys, gc
import pygrib, cfgrib
import numpy as np
import xarray as xr
import pandas as pd
import multiprocessing as mp
import matplotlib.pyplot as plt
from glob import glob
from datetime import datetime, tidmedelta
os.environ['OMP_NUM_THREADS'] = '1'
upgrade_date = datetime(2020, 9, 29, 6)
nbm_dir = '/sc... |
#!/usr/bin/python
"""Build a new Docker image and helm package.
This module assumes py is a top level python package.
"""
import argparse
import datetime
import glob
import json
import logging
import os
import shutil
import tempfile
import yaml
from google.cloud import storage # pylint: disable=no-name-in-module
f... |
module.exports = {
title: '216鞋吧',
/**
* @type {boolean} true | false
* @description Whether fix the header
*/
fixedHeader: false,
/**
* @type {boolean} true | false
* @description Whether show the logo in sidebar
*/
sidebarLogo: false
}
|
/**
* marked - a markdown parser
* Copyright (c) 2011-2019, Christopher Jeffrey. (MIT Licensed)
* https://github.com/markedjs/marked
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).marked=t()}(this,function(){"use ... |