text stringlengths 3 1.05M |
|---|
#ifndef SEAFILE_CLIENT_UTILS_SINGLETON_H
#define SEAFILE_CLIENT_UTILS_SINGLETON_H
/**
* This macro helps conveniently define singleton classes. Usage:
*
* // foo.h
* #include "utils/singleton.h"
* class Foo {
* SINGLETON_DEFINE(Foo)
* private:
* Foo()
* ...
* }
* // foo.cpp
* #include "foo.h"
... |
{
var object = {
a: 0,
b: 1,
c: 2
};
for (var key in object) {
if (key == 'a') {
delete object.b;
object.d = 3;
}
yield key;
yield object[key];
}
} |
import tensorflow.keras
from PIL import Image, ImageOps
import numpy as np
import requests
def get(img):
np.set_printoptions(suppress=True)
model = tensorflow.keras.models.load_model('keras_model.h5')
data = np.ndarray(shape=(1, 224, 224, 3), dtype=np.float32)
image = Image.open(requests.get(img, stream... |
# -*- coding: utf-8 -*-
"""
Raw ctypes wrappers of the cuBLAS library v7.0+ (libcublas.so.7.0)
For documentation see:
http://docs.nvidia.com/cuda/cublas
/usr/include/ cublas_api.h and cublas_v2.h
"""
import platform
import ctypes
import ctypes.util
import enum
from ctypes import *
### cuBLAS Library ###
libname = c... |
/*jslint browser: true */
/*jslint node: true */
/*global global, ActiveXObject, define, escape, module, pnotify, Proxy, jQuery, require, self, setImmediate, window */
/*!
* modified jQuery JavaScript Library v3.1.1
* @see {@link https://jquery.com/}
*
* Includes Sizzle.js
* @see {@link https://sizzlejs.com/}
*
... |
"""
Support for IntesisHome Smart AC Controllers
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/intesishome/
"""
import logging
# from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassis... |
from machine import I2C
import LSM6DSO
i2c = I2C(1)
lsm = LSM6DSO.LSM6DSO(i2c)
lsm.ax()
lsm.get_a()
lsm.get()
|
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat... |
import PIL
import scipy.misc
from io import BytesIO
import tensorboardX as tb
from tensorboardX.summary import Summary
class TensorBoard(object):
def __init__(self, model_dir):
self.summary_writer = tb.FileWriter(model_dir)
def image_summary(self, tag, value, step):
for idx, img in enumerate(... |
var a00532 =
[
[ "value_type", "a00532.html#aa3c63f3f5da681da27e2aa133f8bffd2", null ],
[ "opencl_async_msg", "a00532.html#a2ad7b779cdac9478994000840cd2ef8f", null ],
[ "opencl_async_msg", "a00532.html#aadd4b2e6518cf36405fd47ac87db7f19", null ],
[ "opencl_async_msg", "a00532.html#a4371b06eb85a3abaf7ba0c... |
/*
* This header is generated by classdump-dyld 1.5
* on Wednesday, October 27, 2021 at 3:23:08 PM Mountain Standard Time
* Operating System: Version 13.5.1 (Build 17F80)
* Image Source: /System/Library/PrivateFrameworks/iCloudQ... |
import base64
def make(backend):
class ExtendedDoubleRatchet(backend.DoubleRatchet):
def __init__(self, other_ik, *args, **kwargs):
super().__init__(*args, **kwargs)
self.__other_ik = other_ik
def serialize(self):
return {
"super" : super().s... |
"strict mode"
const NETWORK = process.env.OT_NETWORK;
if (NETWORK !== 'Polyjuice' && NETWORK !== 'Rinkeby') {
throw "NETWORK environment variable must be either Polyjuice or Rinkeby";
}
console.log(`Using ${NETWORK} network with ${process.env.OT_RPC_URL ? process.env.OT_RPC_URL : "default"} RPC URL`);
if (!proces... |
// LAF FreeType Wrapper
// Copyright (c) 2017 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef FT_HB_FACE_H_INCLUDED
#define FT_HB_FACE_H_INCLUDED
#pragma once
#include "base/string.h"
#include "ft/face.h"
#include <hb.h>
#include <hb-ft.... |
import Login from './Login'
export default Login; |
# CS 510 Cloud and Cluster Data Management
# Fall 2018
# Team Spartans:
# Punam Pal
# Haomin He
# Pallavi Gusain
# Yokesh Thirumoorthi
import logging
log = logging.getLogger()
log.setLevel('DEBUG')
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter("%(asctime)s [%(levelname)s] %(name)s: %(messa... |
"""Database Module. Currently wrapping up all Redshift, PostgreSQL and MySQL functionalities."""
import json
import logging
import uuid
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
from urllib.parse import quote_plus as _quote_plus
import boto3
import pandas as pd
import pyarrow as pa
import s... |
function init() {
em.setProperty("state", "0");
em.setProperty("leader", "true");
}
function setup(eim, leaderid) {
em.setProperty("state", "1");
em.setProperty("leader", "true");
var eim = em.newInstance("ZakumBattle" + leaderid);
eim.setProperty("zakSummoned", "0");
eim.setInstanceMap(280030000).... |
from django.db import models
# Create your models here.
class URL(models.Model):
url = models.URLField(max_length=1000)
short_url = models.CharField(max_length=1000, blank=True)
number_of_view = models.IntegerField(default=0)
owner = models.ForeignKey('auth.User', on_delete=models.CASCADE)
def _... |
import ssl
import pytest
from celery_exporter.utils import get_transport_scheme, generate_broker_use_ssl
@pytest.mark.parametrize("brokers", [("redis://foo", "redis"), ("amqp://bar", "amqp")])
def test_get_transport_scheme(brokers):
assert get_transport_scheme(brokers[0]) == brokers[1]
def test_generate_broker... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("cases", "0001_initial"), ("events", "0001_initial")]
operations = [
migrations.AddField(
model_name="alarm",
name="case",
field=models.ForeignKey(
on_... |
// Copyright 2021, University of Colorado Boulder
// Auto-generated by modulifyFontAwesomeIcons.js, please do not modify directly.
import Shape from '../../../../kite/js/Shape.js';
import korvueString from './korvueString.js';
export default new Shape( korvueString ); |
REPETITIONS = 10 ** 4
|
import Prompt from './Prompt'
export default Prompt
|
# Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... |
/* global describe,it */
var getSlug = require('../lib/speakingurl');
describe('getSlug languages', function () {
'use strict';
it('should replace language specific symbols', function (done) {
var symbolMap = {
'ar': {
'∆': 'delta',
'∞': 'la-nihaya',
... |
"use strict";
var Promise = require('bluebird'),
Property = require('./property'),
RID = require('../../recordid'),
utils = require('../../utils'),
errors = require('../../errors');
/**
* The class constructor.
* @param {Object} config The configuration for the class
*/
function Class(config) {
config = ... |
import LeafData from './LeafData'
import Property from "./Property";
class StateProvider
{
// Action
static deleteAction(id)
{
return { type: 'delete',id }
}
static addRootAction()
{
return { type: 'addRoot' }
}
static addSiblingAction(id)
{
return { type: 'a... |
# 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! ***
from .. import _utilities
import typing
# Export this package's modules as members:
from ._enums import *
from .app_service_environment import *
from .... |
import {
saveCurrentLocation,
getAuthData,
getPreviousLocation,
} from './navigation/navigation-helpers';
import { communication } from './communication';
import { settings } from './settings';
import { createAuth } from './auth.js';
import { saveInitParamsIfPresent } from './init-params';
import { config } from ... |
# Copyright 2020 Google LLC
#
# 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 writing, ... |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import hexlify,... |
# 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 ... |
import React from 'react';
import { Helmet } from 'react-helmet';
import Feed from './Feed';
import Chats from './Chats';
import Bar from './components/bar';
import './components/fontawesome';
import '../../assets/css/style.css';
const App = () => {
return (
<div className="container">
<Helmet>... |
#! /usr/bin/env node
'use strict';
process.env.NODE_ENV = 'development';
const fs = require('fs-extra');
const mri = require('mri');
const webpack = require('webpack');
const createConfig = require('../config/createConfigAsync');
const loadRazzleConfig = require('../config/loadRazzleConfig');
const devServer = require... |
import numpy as np
import properties
import scipy.sparse as sp
from scipy.constants import pi
from discretize.utils import (
kron3,
ndgrid,
av,
speye,
ddx,
sdiag,
spzeros,
interpolation_matrix,
cyl2cart,
)
from discretize.base import BaseTensorMesh, BaseRectangularMesh
from discreti... |
// COPYRIGHT © 2020 Esri
//
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
//
// This material is licensed for use under the Esri Master License
// Agreement (MLA), and is bound by the terms of that agreement.
// You may redistribute... |
'use strict';
/**
* Returns true if word occurrs in the specified word snaking puzzle.
* Each words can be constructed using "snake" path inside a grid with top, left, right and bottom directions.
* Each char can be used only once ("snake" should not cross itself).
*
* @param {array} puzzle
* @param {array} sear... |
/*
* turnstile_multihop: Tests turnstile and multi hop priority propagation.
*/
#ifdef T_NAMESPACE
#undef T_NAMESPACE
#endif
#include <darwintest.h>
#include <darwintest_multiprocess.h>
#include <dispatch/dispatch.h>
#include <pthread.h>
#include <launch.h>
#include <mach/mach.h>
#include <mach/message.h>
#include... |
#!/usr/bin/env python
# Save parameters every a few SGD iterations as fail-safe
SAVE_PARAMS_EVERY = 5000
import pickle
import glob
import random
import numpy as np
import os.path as op
def load_saved_params(label):
"""
A helper function that loads previously saved parameters and resets
iteration start.
... |
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/typescript/recommended',
'@vue/prettier',
'@vue/prettier/@typescript-eslint',
],
parserOptions: {
ecmaVersion: 2020,
... |
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '0012_auto_20150607_2207'),
('pages', '0014_socialplugin'),
]
operations = [
migrations.CreateModel(
name='FAQItemPlugin',
fields=[
('c... |
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.3
# kernelspec:
# display_name: Python 3
# name: python3
# ---
# + [markdown] id="view-in-github" colab_type="text"
# <a href="https://colab... |
import os
import sys
from PyQt5 import QtWidgets, QtMultimedia, uic, QtCore
class Form(QtWidgets.QDialog):
def __init__(self, parent=None):
QtWidgets.QDialog.__init__(self, parent)
self.ui = uic.loadUi(os.path.join(os.path.dirname(__file__), "form.ui"),self)
self.player = QtMultimedia.QMed... |
import Class from '../mixin/class';
import {default as Togglable, toggleHeight} from '../mixin/togglable';
import {$, $$, attr, filter, getIndex, hasClass, includes, index, isInView, scrollIntoView, toggleClass, unwrap, wrapAll} from 'uikit-util';
export default {
mixins: [Class, Togglable],
props: {
... |
from olo.field import ConstField, UnionField
from olo.errors import ValidationError, DbFieldVersionError
from .base import TestCase, Dummy, Foo
from .utils import patched_db_get, patched_db_get_multi
class TestField(TestCase):
def test_default(self):
d = Dummy.create()
self.assertEqual(d.age, 12)... |
const fs = require("fs");
const filepath = "./state.txt";
const getState = () => parseInt(fs.readFileSync(filepath), 10);
const setState = n => fs.writeFileSync(filepath, n);
const increment = () => fs.writeFileSync(filepath, getState() + 1);
const decrement = () => fs.writeFileSync(filepath, getState() - 1);
module.... |
/****************************************************************************
*
* Copyright 2016 Samsung Electronics 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... |
const Sequelize = require('sequelize');
require('dotenv').config();
let sequelize;
if(process.env.JAWSDB_URL){
sequelize = new Sequelize(process.env.JAWSDB_URL)
}
else {
sequelize = new Sequelize(
process.env.DB_NAME,
process.env.DB_USER,
process.env.DB_PASSWORD,
{
host: 'localhost',
di... |
(function($){
$(function(){
$('.sidenav').sidenav();
}); // end of document ready
})(jQuery); // end of jQuery name space
|
import React from 'react';
const HighlightContext = React.createContext({
highlightedPlayer: null,
setHighlightedPlayer: () => { },
});
export default HighlightContext;
|
/*---------------------------------------------------------------*/
/*--- begin guest_x86_defs.h ---*/
/*---------------------------------------------------------------*/
/*
This file is part of Valgrind, a dynamic binary instrumentation
framework.
Copyright (C) 2004-2015 Op... |
// Copyright (c) 2020, suganya and contributors
// For license information, please see license.txt
frappe.ui.form.on('Case', {
// refresh: function(frm) {
// }
});
|
import os
import ave.config
def load(home):
path = os.path.join(home, '.ave', 'config', 'gerrit.json')
return ave.config.load(path)
def validate(config):
for key in ['host', 'port', 'user']:
if key not in config:
raise Exception('missing gerrit configuration key: %s' % key)
if typ... |
// (C) Copyright 2015 Martin Dougiamas
//
// 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 agre... |
#include "../../lv_examples.h"
#if LV_USE_GRID && LV_BUILD_EXAMPLES
/**
* Demonstrate track placement
*/
void lv_example_grid_4(void)
{
static lv_coord_t col_dsc[] = {60, 60, 60, LV_GRID_TEMPLATE_LAST};
static lv_coord_t row_dsc[] = {40, 40, 40, LV_GRID_TEMPLATE_LAST};
/*Add space between the columns a... |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import json
import os
from xml.dom import minidom
from pants.backend.project_info.tasks.idea_plugin_gen import IDEA_PLUGIN_VERSION, IdeaPluginGen
from pants.base.build_environment import ... |
/**
******************************************************************************
* @file stm32f3xx_hal_rtc.c
* @author MCD Application Team
* @version V1.4.0
* @date 16-December-2016
* @brief RTC HAL module driver.
* This file provides firmware functions to manage the following
* ... |
/*
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang('sourcedialog', 'bn', {
toolbar: 'উৎস',
title: 'সোর্স'
});
|
'use strict';
// ---------------------------------------------------------------------------
const Exchange = require ('./base/Exchange');
const { AccountSuspended, BadRequest, BadResponse, NetworkError, DDoSProtection, AuthenticationError, PermissionDenied, ExchangeError, InsufficientFunds, InvalidOrder, InvalidNon... |
import torch
import torch.distributed as dist
import torch.nn as nn
from mmcv.cnn import ConvModule, Scale, bias_init_with_prob, normal_init
from mmcv.runner import force_fp32
from mmdet.core import (anchor_inside_flags, build_assigner, build_sampler,
images_to_levels, multi_apply, multiclass_n... |
const room = require("../room/room");
const template = require("./template");
const SocketHandler = template.SocketHandler;
const Worker = require("./../worker/worker").Worker; //worker
let tables = {};
let exitSocketList = []; //退房的socket
/**
* 开个定时器跑,清除已经离开房间的数据
*/
function cleanExitSocketData(){
... |
import mod1392 from './mod1392';
var value=mod1392+1;
export default value;
|
/** @type {import("../../../../").Configuration} */
module.exports = {
name: "compiler-name",
module: {
rules: [
{
test: /a\.js$/,
compiler: "compiler",
use: "./loader"
},
{
test: /b\.js$/,
compiler: "other-compiler",
use: "./loader"
}
]
}
};
|
const { Logger } = require("../config/logger");
const logger = Logger.getInstance();
const {
getUserFromUserEvents,
allEventsArray,
getAllEventsUserRegisteredFor,
filterEventData,
} = require("../services/UserEventsActivitiesService");
const { BadRequestError, NotFoundError } = require("../utils/errors");
//@e... |
import React from 'react';
import { Image, StyleSheet, Button, Text, View} from 'react-native';
import { ImagePicker } from 'expo';
import * as firebase from 'firebase';
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
pct:0,
foto:null
}
... |
const {Block, Attribute, Fragment, Slice} = require("../model")
const {Step, StepResult, PosMap, ReplaceStep} = require("../transform")
const {copyObj} = require("../util/obj")
const {Selection} = require("../edit")
// ;; A table node type. Has one attribute, **`columns`**, which holds
// a number indicating the amoun... |
/*! Copyright 2009-2017 Evernote Corporation. All rights reserved. */
function ReminderSetter(a,b,c,d,e,f,g,h,i,j){"use strict";function k(a){var b=document.querySelector("#date span.focused");if(b){clearTimeout(w);var c=parseInt(s.innerText||s.textContent),d=parseInt(q.innerText||q.textContent)-1,e=parseInt(r.innerTe... |
#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import "MGLFoundation.h"
#import "MGLTypes.h"
NS_ASSUME_NONNULL_BEGIN
typedef NSString *MGLStyleFunctionOption NS_STRING_ENUM NS_UNAVAILABLE;
extern MGL_EXPORT const MGLStyleFunctionOption MGLStyleFunctionOptionInterpolationBase __attribute__(... |
import React from 'react';
import People from '../../assets/People-asking.svg';
import { Icon } from 'antd';
const Historial = () =>{
return(
<div className="container-body-empty">
<h2>Historial</h2>
</div>
)
}
export default Historial |
// @flow
/*
Author: Ievgeniia Ozirna
Licensed under the CC BY-NC-ND 3.0: http://creativecommons.org/licenses/by-nc-nd/3.0/
*/
import { combineReducers } from 'redux';
import { createAction, handleActions } from 'redux-actions';
import { formReducer, modelReducer } from 'react-redux-form';
export type RequestState = {
... |
from rdflib import URIRef, Namespace
from rdflib.namespace import RDF
from pyproms.proms_report import PromsReport
from pyproms.prov_activity import ProvActivity
from pyproms.proms_error import *
class PromsInternalReport(PromsReport):
"""
Creates a PROMS-O Internal Report instance
This has the set o... |
import unittest
from subprocess import Popen, PIPE, STDOUT
import string
import random
import os
def string_generator(size=6, chars=string.ascii_uppercase + string.digits + " " + string.punctuation):
return ''.join(random.choice(chars) for _ in range(size))
def TestBase():
stdIn = string_generator()
p =... |
"""
Cerberus schema building utilities
"""
from cerberus import Validator
PRIMITIVES = [int, float, bool, str, dict, list]
def build_validator(**schema):
"""
Returns a function that validates an input dictionary,
based on the supplied validation schema.
"""
cerberus_schema = _build_schema(schema)... |
const request = require('supertest')
const { expressApp } = require('../app/express-app')
const { appConfig } = require('../app/app-config')
const SERVER_URL = appConfig.testServerUrl
const TAREGT_URL = appConfig.testTargetUrl
const LAUNCH_HC_PAGES_NUM = appConfig.launchHcPagesNum
const HTML_TEST_STRINGS = '<html>ok</h... |
"""
Functional test
Deletion Epic
Storyboard is defined within the comments of the program itself
"""
import unittest
from flask import url_for
from biblib.tests.stubdata.stub_data import UserShop, LibraryShop
from biblib.tests.base import TestCaseDatabase, MockEmailService
class TestDeletionEpic(TestCaseDatabase):... |
''' Test for inheritence '''
from __future__ import print_function
__revision__ = 1
# pylint: disable=too-few-public-methods
class AAAA(object):
''' class AAAA '''
def __init__(self):
pass
def method1(self):
''' method 1 '''
print(self)
def method2(self):
''' method 2 ... |
const express = require('express');
const app = express();
const cors = require('cors');
// const mongoose = require('./mongoose');
const bodyParser = require('body-parser');
const sessionHandler = require('./middlewares/sessionHandler');
const urlHandler = require('./middlewares/urlHandler');
const dbHandler = requi... |
# Copyright 2019 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... |
import React, { Component } from 'react';
import fs from 'fs';
import moment from 'moment'; // day-time
import { exec } from 'child_process';
// import { Link } from 'react-router'; // not currently needed
import styles from './Home.css';
// removed flow for now, will add later w/ type annotations etc.
export d... |
//
// AppDelegate.h
// Demo02_GitServer
//
// Created by jutao on 15/10/8.
// Copyright (c) 2015年 tarena. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
# Generated by Django 3.0.4 on 2020-04-18 17:10
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('comps', '0007_auto_20200418_1705'),
]
operations = [
migrations.RemoveField(
model_name='heatresult',
name='heat',
)... |
import React from 'react'
import SuccessIcon from "../../img/success.png";
const OrderConfirmation = () => {
return (
<>
<center>
<img alt="" className="img-circle" src={SuccessIcon} width="50px" height="50px" />
<br /><br />
<h4>Your order has b... |
/** PURE_IMPORTS_START .._.._Observable,.._.._operator_withLatestFrom PURE_IMPORTS_END */
import { Observable } from '../../Observable'
import { withLatestFrom } from '../../operator/withLatestFrom'
Observable.prototype.withLatestFrom = withLatestFrom
// # sourceMappingURL=withLatestFrom.js.map
|
import mask from 'json-mask';
import { Module } from '../../lib/di';
import DataFetcher from '../../lib/DataFetcher';
import createSimpleReducer from '../../lib/createSimpleReducer';
import callControlError from '../ActiveCallControl/callControlError';
import actionTypes from './actionTypes';
import proxify from '../..... |
// Copyright (c) 2003-2020 Xsens Technologies B.V. or subsidiaries worldwide.
// 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 abov... |
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Cycle=f()}})(f... |
"""
BFS time complexity : O(|E|)
BFS space complexity : O(|V|)
do BFS from (0,0) of the grid and get the minimum number of steps needed to get to the lower right column
only step on the columns whose value is 1
if there is no path, it returns -1
Ex 1)
If grid is
[[1,0,1,1,1,1],
[1,0,1,0,1,0],
[1,0,1,0,1,1],
[1,1... |
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolar... |
if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
os.path.split(parent_dir)[1] == 'pygame')
if not is_pygame_pkg:
sys.path.inser... |
# Copyright 2021 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.txt" file accom... |
/*! Lazy Load XT v0.8.11 2014-01-10
* http://ressio.github.io/lazy-load-xt
* (C) 2014 RESS.io
* Licensed under MIT */
(function ($, window, document) {
var options = $.lazyLoadXT,
matchMedia = window.matchMedia;
options.selector += ',picture';
$(document)
// remove default behaviour fo... |
import React, { Component } from "react";
import PropTypes from "prop-types";
import { connect } from "react-redux";
import LikesContent from "./LikesContent";
import * as actions from "store/actions";
class PostLikes extends Component {
static propTypes = {
children: PropTypes.node,
className: ... |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... |
from webclient.models import Image, ImageLabel, CategoryType
from django.conf import settings
from webclient.image_ops import convert_images
from PIL import Image as PILImage
from StringIO import StringIO
import numpy as np
import matplotlib.pyplot as plt
import requests
import urllib2
from webclient.image_ops import c... |
import requests,json
import re
def chouqian(msg,user_id):
res = requests.get(f'https://api.iyk0.com/gdlq/?msg={msg}&n={user_id}')
try:
res = json.loads(res.text)
if res['code'] == 200:
data = res['title']
data += '\n'+res['desc']
# for i in res['data']:
... |
"""
The MIT License (MIT)
Copyright © 2019 Jean-Christophe Bos & HC² (www.hc2.fr)
"""
import _thread
class MicroWorkersException(Exception) :
pass
class MicroWorkers :
# ============================================================================
# ===( Thread )==========================================... |
const route = (path, element) => ({path, element});
export default route;
|
exports.foo = 'foo';
exports = {};
exports.bar = 'bar';
global.hasWrappedExportsRun = true;
|
"use strict";
exports.__esModule = true;
exports.useReduxContext = useReduxContext;
var _react = require("react");
var _Context = require("../components/Context");
/**
* A hook to access the value of the `ReactReduxContext`. This is a low-level
* hook that you should usually not need to call directly.
*
* @retu... |