text stringlengths 3 1.05M |
|---|
import unittest
from funclib import fn
class TestDict(unittest.TestCase):
def test_index(self):
persons = [{"name": "Tom", "age": 12},
{"name": "Jerry", "age": 20},
{"name": "Mary", "age": 35}]
self.assertEqual(fn.index({"name": 'Jerry'}, persons), 1)
self.assertEqua... |
/*
* Copyright (c) 2008 CACE Technologies, Davis (California)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* not... |
import numpy as np
import cv2
import sys
def main(argv):
if (int(argv[1]))==0: # read a mask image and a ROI and erase the masked parts from the roi
roi = cv2.imread(argv[2],0)
if roi is None:raise Exception("imageUtils no ROI at "+str(argv[2]))
treeMask = cv2.imread(argv[3],0)
... |
from django.db import models
# Create your models here
from user.models import CustomUser
class DoctorClinic(models.Model):
user = models.ForeignKey(CustomUser, default = 1, verbose_name="username", on_delete = models.SET_DEFAULT)
doctor_name = models.CharField(max_length=256)
specialty = models.CharField(max_... |
import Toast from 'react-native-root-toast';
export function showToast(message) {
Toast.show(message, {
duration: Toast.durations.SHORT,
position: Toast.positions.CENTER,
shadow: true,
animation: true,
hideOnPress: true,
delay: 0,
});
}
|
from __future__ import unicode_literals
import datetime
import json
import re
from jinja2 import Environment, DictLoader, TemplateNotFound
import six
from six.moves.urllib.parse import parse_qs, urlparse
from werkzeug.exceptions import HTTPException
from moto.core.utils import camelcase_to_underscores, method_names_... |
# coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# 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... |
def swap_case(s):
return "".join([char.lower() if char.isupper() else char.upper() for char in s])
if __name__ == '__main__':
print(swap_case(input())) |
var $ = require('jquery')
var _ = require('underscore')
var Marionette = require('marionette')
var tpl = require('tpl/servers/parameters/list_item.html')
var template = _.template(tpl)
module.exports = Marionette.ItemView.extend({
tagName: 'tr',
template: template,
events: {
'click button.delete': 'delete... |
export default {
setUser(state, payload) {
state.token = payload.token
// state.userId = payload.userId
// state.imageLink = payload.imageLink
state.didAutoLogout = false
},
setAutoLogout(state) {
state.didAutoLogout = true
},
}
|
"""
Simple script for preprocessing youtube comments data.
This example show you how to clean data from negative comments.
If you want clean positive comments replace:
columns = ['id','user','date','timestamp','likes']
data['rate'] = 1
output = save as other name, such as mergetYT2.csv
"""
# Import necessary packag... |
from ctypes import *
import unittest, sys
from test import support
################################################################
# This section should be moved into ctypes\__init__.py, when it's ready.
from _ctypes import PyObj_FromPtr
################################################################
try:
fro... |
function component() {
const element = document.createElement('div');
// Lodash, currently included via a script, is required for this line to work
element.innerHTML = 'Vendor estuvo aqui';
return element;
}
// document.body.appendChild(component());
|
// import models
const Product = require('./Product');
const Category = require('./Category');
const Tag = require('./Tag');
const ProductTag = require('./ProductTag');
Product.belongsTo(Category, {
foreignKey: 'category_id',
});
Category.hasMany(Product, {
foreignKey: 'category_id',
});
Product.belongsToMany(... |
/* eslint-disable import/no-extraneous-dependencies */
const webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin');
const PATHDIR = require('... |
/*
* 1-Wire implementation for the ds2760 chip
*
* Copyright © 2004-2005, Szabolcs Gyurko <szabolcs.gyurko@tlt.hu>
*
* Use consistent with the GNU GPL is permitted,
* provided that this copyright notice is
* preserved in its entirety in all copies and derived works.
*
*/
#include <linux/kernel.h>
#include <li... |
import math
class Planet:
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
self.x_vel = 0
self.y_vel = 0
self.z_vel = 0
def apply_velocity(self):
self.x += self.x_vel
self.y += self.y_vel
self.z += self.z_vel
def potent... |
# GPIO Zero: a library for controlling the Raspberry Pi's GPIO pins
# Copyright (c) 2016-2019 Dave Jones <dave@waveform.org.uk>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must r... |
/**
* @module ol/control/ZoomSlider
*/
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (va... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, ... |
# encoding: utf-8
import os
import torch
import torch.distributed as dist
from yolox.data import get_yolox_datadir
from yolox.exp import Exp as MyExp
class Exp(MyExp):
def __init__(self):
super(Exp, self).__init__()
self.num_classes = 40
self.depth = 0.33
self.width = 0.50
... |
import pyclesperanto_prototype as cle
import numpy as np
def test_variance_sphere():
test1 = cle.push(np.asarray([
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
]))
reference = cle.push(np.asarray([
[0, 0, 0, 0, 0],
... |
# coding=utf-8
# Copyright 2020 The Edward2 Authors.
#
# 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... |
/*-
* Copyright (c) 2007-2012 Dominique Li <dominique.li@univ-tours.fr>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright... |
#!/usr/bin/env python
#
# Copyright 2016 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... |
// MODULES //
import React, { Component, Fragment } from 'react';
import ReactDraggable from 'react-draggable';
import ProgressBar from 'react-bootstrap/ProgressBar';
import Button from 'react-bootstrap/Button';
// MAIN //
class ScoreSetter extends Component {
constructor( props ) {
super( props );
this.state... |
/*++
Copyright (c) 1995 Microsoft Corporation
Module Name:
floatfns.h
Abstract:
Prototypes for floating point instructions.
Author:
20-Jun-1995 t-orig
Revision History:
--*/
DISPATCH(FLOAT_GP0);
DISPATCH(FLOAT_GP1);
DISPATCH(FLOAT_GP2);
DISPATCH(FLOAT_GP3);
DISPATCH(FLO... |
import React from 'react';
import PwChangeForm from '../../components/Forms/PwChangeForm';
import * as GS from '../../components/GlobalStyle';
import HeadTitle from '../../components/HeadTitle';
import { withAuthentication } from '../../higher-order-component/with-authentication';
const PwChangePage = () => {
retur... |
# coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import numpy as np
import torch
from torch.autograd import Variable, grad
from torch.nn.init import xavier_normal
from torchvision import datasets, transforms
import torchvisio... |
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])... |
# encoding: utf-8
# -*- coding: utf-8 -*-
"""==================================================================
Copyright(c) 2016-2017 Hangzhou Hikvision Digital Technology Co.,Ltd
文件名称: Base.py
简要描述: 通讯基础模块,提供通信类的创建、测试类的封装
编写测试用例时需要导入Base模块
作 者: Qiu Jiangping
完成日期: 2017-5-11
修订说明:
===================... |
/*
+----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is ... |
import os
import pathlib
import pytest
import hetnetpy.hetnet
import hetnetpy.readwrite
from .readwrite_test import extensions, formats
def test_creation(tmpdir):
# Convert py._path.local.LocalPath to a string
tmpdir = str(tmpdir)
# Construct metagraph
metaedge_tuples = [
("compound", "dis... |
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
requir... |
'use strict';
const Blockchain = require('./blockchain');
const dappConfig = require('./dapp-config.json');
const ClipboardJS = require('clipboard');
const BN = require('bn.js'); // Required for injected code
const manifest = require('../manifest.json');
///+import
module.exports = class DappLib {
/*>>>>>>>>>>>>>... |
import tensorflow as tf
def model_fn(features, labels, mode, params):
input = features["input"]
# TODO: put this in a file and use index_table_from_file instead (set up graph using init op)
vocabulary = tf.constant(list(" abcdefghijklmnopqrstuvwxyz"), name="vocab")
# use the vocabulary lookup table
... |
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2012, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of so... |
import React, { Component } from 'react';
import { Link, Redirect } from 'react-router-dom';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { login } from '../../actions/auth';
export class Login extends Component {
state = {
username: '',
password: '',
};
static propT... |
from django.forms import ModelForm
from kombi.models import Freighter
class RegisterForm(ModelForm):
class Meta:
model = Freighter
fields = ['name','code','phone']
|
#!/usr/bin/env python3
import math
import torch
from torch.distributions import MultivariateNormal as TMultivariateNormal
from torch.distributions.kl import register_kl
from torch.distributions.utils import _standard_normal, lazy_property
from .. import settings
from ..lazy import DiagLazyTensor, LazyTensor, delazif... |
/*
* This header is generated by classdump-dyld 1.5
* on Wednesday, October 27, 2021 at 3:22:23 PM Mountain Standard Time
* Operating System: Version 13.5.1 (Build 17F80)
* Image Source: /System/Library/PrivateFrameworks/HealthT... |
#define _XOPEN_SOURCE 500
#include <string.h>
#include "sway/commands.h"
#include "log.h"
struct cmd_results *bar_cmd_id(int argc, char **argv) {
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "id", EXPECTED_EQUAL_TO, 1))) {
return error;
}
const char *name = argv[0];
const char *oldname = confi... |
from typing import List
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def __init__(self):
self.preorder = None
self.reverses = None
def buildTree(self, preorder: List[int], inorder: List[int]) -> TreeNode:... |
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" fil... |
from hamcrest.core.base_matcher import BaseMatcher
from hamcrest.core.core.anyof import any_of
from hamcrest.core.helpers.hasmethod import hasmethod
from hamcrest.core.helpers.wrap_matcher import wrap_matcher
__author__ = "Jon Reid"
__copyright__ = "Copyright 2011 hamcrest.org"
__license__ = "BSD, see License.txt"
c... |
const assert = require('assert');
const path = require('path');
const util = require('./utils');
const async = require('async');
const BigNumber = require("bignumber.js");
const testdata = require('./data/secp2561k_data.json');
var secp256k1;
const bytecode = "0x6060604052611286806100126000396000f3606060405260e060020... |
/*!
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com
Version 1.6.2
Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011-2016 Harvest http://getharvest.com
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
This file is g... |
// Copyright (c) 2022 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... |
import torch
import numpy as np
def get_positional_table(d_pos_vec, n_position=1024):
position_enc = np.array([
[pos / np.power(10000, 2*i/d_pos_vec) for i in range(d_pos_vec)]
if pos != 0 else np.zeros(d_pos_vec) for pos in range(n_position)])
position_enc[1:, 0::2] = np.sin(position_enc[1:, ... |
import time,requests,subprocess,select,re,yaml
TARGET_FILE='/var/log/apache2/access.log'
ip_re = re.compile("(\d{1,3}\.){3}\d{1,3}")
payload_re = re.compile("^.+\.hta.+$")
headers = {'Content-Type' : 'application/x-www-form-urlencoded'}
try:
conf = yaml.safe_load(open('config.yaml'))
except IOError as e:
print(dir(... |
"use strict"
const fs = require('fs');
const path = require('path');
var print = {};
var cssPagedMedia = (function() {
var style = document.createElement('style');
document.head.appendChild(style);
return function(rule) {
style.innerHTML = rule;
};
}());
print.toPDF = (filename, filepath) =>... |
import NoCache from "./cache/no-cache";
import InMemoryCache from "./cache/in-memory-cache";
import LocalStorageCache from "./cache/local-storage-cache";
const encode = encodeURIComponent;
const formatUrl = (method, query) => {
const queryStr = Object.keys(query)
.map((key) => {
const val = q... |
#!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1... |
import React from 'react';
import ReactDOM from 'react-dom';
import './index.scss';
import App from './components/home/App';
import * as serviceWorker from './serviceWorker';
ReactDOM.render(<App />, document.getElementById('root'));
// If you want your app to work offline and load faster, you can change
// unregiste... |
/* libhs - public domain
Niels Martignène <niels.martignene@protonmail.com>
https://koromix.dev/libhs
This software is in the public domain. Where that dedication is not
recognized, you are granted a perpetual, irrevocable license to copy,
distribute, and modify this file as you see fit.
See the LIC... |
# Copyright 2020 The Cirq Developers
#
# 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
# Copyright 2020 The GPflow Contributors. 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... |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
!function(a){function b(a,b,c,d){this.bubbles=!1,this.cancelBubble=!1,this.cancelable=!1,this.data=b||null,this.origin=c||"",this.lastEventId=d||"",this.type=a||"message"}function c(){return window.XDomainRequest&&window.XMLHttpRequest&&void 0===(new XMLHttpRequest).responseType?!0:!1}if(!a.EventSource||a._eventSourceI... |
// @flow
import React from 'react';
import get from 'lodash/get';
import colours from '../../styles/colours.less';
import Icon from '../Icon';
type Props = {
data?: {
name: string,
icon: string,
details: {
infix_upgrade: {
buff: {
description: Array<string>,
},
},
... |
class MouseActionConverter(TypeConverter):
"""
Converts a System.Windows.Input.MouseAction object to and from other types.
MouseActionConverter()
"""
def CanConvertFrom(self,*__args):
"""
CanConvertFrom(self: MouseActionConverter,context: ITypeDescriptorContext,sourceType: Type) -> bool
D... |
#!/usr/bin/env python
####################
# Required Modules #
####################
# Generic/Built-in
import asyncio
import json
import os
import shutil
from pathlib import Path
from typing import Dict, List, Any
# Libs
import aiohttp
import mlflow
import torch as th
# Custom
from rest_rpc import app
from rest_rp... |
/*
* This source file is part of the EdgeDB open source project.
*
* Copyright 2016-present MagicStack Inc. and the EdgeDB authors.
*
* 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... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# bu... |
import JSONLevelScene from './JSONLevelScene';
import Prefab from '../prefabs/Prefab';
import TextPrefab from '../prefabs/TextPrefab';
import Player from '../prefabs/world/Player';
import Map from '../prefabs/world/Map';
// import Door from '../prefabs/world/Door';
class WorldScene extends JSONLevelScene {
construct... |
/**
* 统计专题图封装层封装,传入数据即可显示统计专题图内容
*/
import GraphThemeLayer from './GraphThemeLayer'
export default GraphThemeLayer
|
from django.urls import path
from linuxmachinebeta.contact.views import email_list_view
app_name = "contact"
urlpatterns = [
path("", email_list_view, name="email-list"),
]
|
# -*- coding:utf-8 -*-
"""
Author:
Weichen Shen,wcshen1994@163.com
Reference:
[1] Guo H, Tang R, Ye Y, et al. Deepfm: a factorization-machine based neural network for ctr prediction[J]. arXiv preprint arXiv:1703.04247, 2017.(https://arxiv.org/abs/1703.04247)
"""
from itertools import chain
import tensorflow ... |
import {authenticatedMethod, RpcMethod} from './../../../../jsonRpc';
import MnemonicWords from 'mnemonic.js';
/**
* Encrypt an account from the wallet
*/
class DeleteAccount extends RpcMethod
{
constructor(name, oWallet) {
super(name);
this._oWallet = oWallet;
}
async... |
import React from 'react'
import { Link, graphql } from 'gatsby'
import { Box } from '@chakra-ui/react'
import Seo from '../components/seo'
import kebabCase from 'lodash/kebabCase'
class TagsPage extends React.Component {
render() {
const { data } = this.props
const pageTitle = 'Tags'
const tags = da... |
import React, { useState, useEffect } from 'react';
import { useDispatch } from 'react-redux';
import Login from '../components/login/Login';
import { signInUser } from '../redux/token/tokenOperation';
import Progress from '../components/loader/Progress';
const callFakeAPI = delay =>
new Promise(resolve => {
set... |
# encoding: utf-8
# ExternalIntegration, ExternalIntegrationLink, ConfigurationSetting
import inspect
import json
import logging
from abc import abstractmethod, ABCMeta
from contextlib import contextmanager
from enum import Enum
from flask_babel import lazy_gettext as _
from sqlalchemy import (
Column,
Foreign... |
//
// QYHRetainCycleDetector.h
// QYHRetainCycleDetector
//
// Created by qinyihui on 2020/3/17.
// Copyright © 2020 qinyihui. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for QYHRetainCycleDetector.
FOUNDATION_EXPORT double QYHRetainCycleDetectorVersionNumber;
//! Project... |
'''
MIT License
Copyright (c) 2021 Caio Alexandre
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish... |
/*global exports:false,require:false
*/
var grunt, gruntload;
grunt = require('grunt');
gruntload = require('../lib/index')(grunt);
exports['gruntload'] = {
'getNpmTasks auto': function(test) {
var tasks;
tasks = gruntload.getNpmTasks();
test.deepEqual(tasks, ['grunt-contrib-coffee', 'grunt-contrib-j... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.BreadCrumb = void 0;
var _react = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _classnames = _interopRequireDefault(require("classnames"));
function _interopRequi... |
#!/usr/bin/env python
"""
CI build script
(C) 2017 Jack Lloyd
Botan is released under the Simplified BSD License (see license.txt)
"""
import os
import platform
import subprocess
import sys
import time
import tempfile
import optparse # pylint: disable=deprecated-module
def get_concurrency():
"""
Get default ... |
// threejs.org/license
(function(l,za){"object"===typeof exports&&"undefined"!==typeof module?za(exports):"function"===typeof define&&define.amd?define(["exports"],za):za(l.THREE=l.THREE||{})})(this,function(l){function za(){}function C(a,b){this.x=a||0;this.y=b||0}function ea(a,b,c,d,e,f,g,h,k,m){Object.defineProperty... |
//-----------------------------------------------------------------------------
// Copyright (c) 2013 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restr... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.tools import float_compare
class StockScrap(models.Model):
_name = 'stock.scrap'
_inherit = ['mail.thread']
_order = '... |
#pragma once
#include "Board.h"
#include "Marble.h"
#include "Deck.h"
#include "Player.h"
#include "CardList.h"
#include "Game.h"
#include "GameLog.h"
#include "Move.h"
#include "MoveList.h"
#include "PlayerColor.h"
#include "MarbleColor.h"
std::string ComputerPlayerDescription(TGMPlayer* player);
std::string MarbleD... |
from electronics_abstract_parts import *
from .PassiveResistor import ESeriesResistor, ChipResistor, AxialResistor, AxialVerticalResistor
from .PassiveCapacitor import SmtCeramicCapacitor, SmtCeramicCapacitorGeneric
from .PassiveInductor import SmtInductor
from .Leds import SmtLed, ThtLed, IndicatorLed, VoltageIndicat... |
/**
*
* @copyright © 2010 - 2019, Fraunhofer-Gesellschaft zur Foerderung der
* angewandten Forschung e.V. All rights reserved.
*
* BSD 3-Clause License
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. R... |
const INITIAL_STATE = {
name: '',
image: '',
email: '',
password: '',
admin_id: null,
typeOfAccess: '',
isAuthenticate: false,
loading: false,
error: false,
success: false,
};
export default (state = INITIAL_STATE, action) => {
if (action.type === 'POST_USER_AUTH_REQUEST') {
return {
is... |
'''
请实现一个函数用来匹配包括'.'和'*'的正则表达式。
模式中的字符'.'表示任意一个字符,而'*'表示它前面的字符可以出现任意次(包含0次)。
在本题中,匹配是指字符串的所有字符匹配整个模式。
例如,字符串"aaa"与模式"a.a"和"ab*ac*a"匹配,但是与"aa.a"和"ab*a"均不匹配
'''
class Solution(object):
# s,pattern都是字符串
def match(self, s, pattern):
if not s or not pattern:
return False
# 如果s和pattern匹配, 直接True
if s==pattern:
... |
const http = require('http');
const app = require('./app');
const port = process.env.PORT || 3000;
const server = http.createServer(app);
server.listen(port);
|
# coding: utf-8
"""
Cisco Intersight OpenAPI specification.
The Cisco Intersight OpenAPI specification.
OpenAPI spec version: 1.0.9-1461
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class TopSystem(object)... |
import React from 'react';
import { IndexRoute, Route, Redirect } from 'react-router';
import ViewerQuery from './ViewerQuery';
import { AppContainer, MainContainer } from '../relay/containers';
import { SignupContainer, LoginContainer, ExportContainer } from '../ui/containers';
export default (
<Route path='/' comp... |
# Generated by Django 3.2.4 on 2021-10-01 19:35
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Postinfo',
fields=[
('id', ... |
#!/usr/bin/env python3
# Copyright (c) 2018-2019 The Talkcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the Partially Signed Transaction RPCs.
"""
from decimal import Decimal
from test_framework.test_... |
import * as React from "react"
import { chakra, Icon, Stack, Link } from "@chakra-ui/core"
import { MdEdit } from "react-icons/md"
import { graphql, useStaticQuery } from "gatsby"
export function GithubLink({ path }) {
const data = useStaticQuery(query)
const { repository } = data.site.siteMetadata
if (!reposit... |
/**
******************************************************************************
* @file stm32f429i_discovery_gyroscope.h
* @author MCD Application Team
* @brief This file contains definitions for stm32f429i_discovery_gyroscope.c
* firmware driver.
***********************************... |
import { graphql, handleMutation } from '../gateway/graphql'; import * as _ from "lodash";
const getAll = () => graphql`
query getAllPatientTypes {
patientTypes {
id
name
immunizations(order: "reverse:createdAt") {
createdAt
description
id
name
periods {
... |
import { createSelector } from 'reselect';
import { initialState } from './reducer';
/**
* Direct selector to the checkout state domain
*/
const selectCheckoutDomain = state => state.get('checkout', initialState);
/**
* Other specific selectors
*/
/**
* Default selector used by Checkout
*/
const makeSelectCh... |
// Libs
import React, { useState } from "react";
// Components
import { CheckboxGroup } from "../CheckboxGroup";
export default {
title: "Design System/Molecules/Inputs/CheckboxGroup",
component: CheckboxGroup,
parameters: {
docs: {
description: {
component: `
\`\`\`js
... |
/*!
* mustache.js - Logic-less {{mustache}} templates with JavaScript
* http://github.com/janl/mustache.js
*/
/*global define: false Mustache: true*/
(function defineMustache (global, factory) {
if (typeof exports === 'object' && exports && typeof exports.nodeName !== 'string') {
factory(exports); // CommonJ... |
/**
@file
@author Nicholas Gillian <ngillian@media.mit.edu>
@version 1.0
@brief
*/
/**
GRT MIT License
Copyright (c) <2012> <Nicholas Gillian, Media Lab, MIT>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"... |
# 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 use ... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Chris Caron <lead2gold@gmail.com>
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files(the "Software"), to deal
# in th... |
# coding=utf-8
from __future__ import unicode_literals
from .base import Base
from .generator import generator_of
from .normal import normal_attr
from zhihu_oauth.zhcls.urls import (
COMMENT_CONVERSION_URL,
COMMENT_REPLIES_URL,
)
__all__ = ['Comment']
class Comment(Base):
def __init__(self, cid, cache,... |