text stringlengths 3 1.05M |
|---|
from p2p.constants import (
DISCOVERY_MAX_PACKET_SIZE,
)
from p2p.typing import Nonce
NONCE_SIZE = 12 # size of an AESGCM nonce
TAG_SIZE = 32 # size of the tag packet prefix
MAGIC_SIZE = 32 # size of the magic hash in the who are you packet
ID_NONCE_SIZE = 32 # size of the id nonce in who are you and auth tag ... |
#
# This file is part of urlwatch (https://thp.io/2008/urlwatch/).
# Copyright (c) 2008-2018 Thomas Perl <m@thp.io>
# 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 sour... |
const clipboard = require("electron").clipboard;
const Store = require("electron-store");
function checkClipboard(historyStore, callback) {
var currentContents = clipboard.readText("clipboard");
var allItems = historyStore.get("items");
var allItemsDescending = [...allItems];
allItemsDescending.sort(function ... |
// Definition of the socket class
#ifndef CODA_SOCKET_H
#define CODA_SOCKET_H
#ifdef _WIN32
#include <winsock.h>
#else
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#endif
#include <exception>
#include <iostream>
#include <memory>... |
/* -----------------------------------------------------------------------------
*
* (c) The GHC Team, 1998-2012
*
* Storage manager front end
*
* Documentation on the architecture of the Storage Manager can be
* found in the online commentary:
*
* http://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage... |
function validPassword(password,hash,salt)
{
var hashVerify=crypto.pbkdf2Sync(password,salt,10000,60,'sha512').toString('hex');
return hash === hashVerify;
}
module.exports = validPassword; |
# 2nd step of the process - constructing the index
import os, sys, math;
import pickle, glob, re;
from operator import itemgetter;
from os.path import join;
# read the tf and idf objects
# tff contains the tf dictionaries for each file as index
tfpck=open("tfpickle.pkl","rb");
tff=pickle.load(tfpck);
tfpck... |
import re
import string
class ValidPassword:
def validate(self, password):
if type(password) != str:
raise TypeError()
elif len(password) < 8:
return False
elif re.search('[0-9]', password) is None:
return False
elif re.search('[A-Z]', password) ... |
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import sys
import tempfile
class PyTensorflow(Package, CudaPackage):
"""TensorFlow is an Open Source Software Librar... |
from tqdm import trange
import torch
import time
import numpy as np
import pandemic_simulator as ps
from pandemic_simulator.environment.reward import RewardFunction, SumReward, RewardFunctionFactory, RewardFunctionType
from pandemic_simulator.environment.interfaces import InfectionSummary
from pandemic_sim... |
"""
.. warning:: `logging` package has been renamed to `loggers` since v0.7.0 and will be removed in v0.9.0
"""
from pytorch_lightning.utilities import rank_zero_warn
rank_zero_warn("`logging.mlflow` module has been renamed to `loggers.mlflow` since v0.7.0."
" The deprecated module name will be removed... |
import requests
from bs4 import BeautifulSoup
import re
from src import Booking, Lesson_Report
from typing import List
import numpy as np
class MyTutorParser:
session = requests.Session()
cookies = {"www.mytutor.co.uk": ""}
@staticmethod
def set_cookie(cookie: str):
MyTutorParser.session = re... |
// @flow
import React, { PureComponent } from "react";
import { translate, Trans } from "react-i18next";
import {
TouchableWithoutFeedback,
View,
StyleSheet,
Image,
Vibration,
} from "react-native";
import { SafeAreaView } from "react-navigation";
import * as Keychain from "react-native-keychain";
import { Pa... |
import torch
import numpy as np
import random
import os
import torch.nn as nn
def seed_torch(seed=1024):
random.seed(seed)
os.environ['PYTHONHASHSEED'] = str(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
torch.backends.cudnn... |
import matplotlib.pyplot as plt
import cv2
# 컬러 영상 출력
imgBGR = cv2.imread('images\cat.bmp')
#imgRGB = cv2.cvtColor(imgBGR, cv2.COLOR_BGR2RGB)
b, g, r = cv2.split(imgBGR)
imgRGB = cv2.merge([r, g, b])
plt.axis('off')
plt.imshow(imgRGB)
plt.show()
# 그레이스케일 영상 출력
imgGray = cv2.imread('images\cat.bmp', cv2.IMREAD_GRAYSC... |
# Generated by Django 2.0.5 on 2020-12-09 16:58
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('catalogo', '0006_auto_20201204_1141'),
]
operations = [
migrations.RenameModel(
old_name='Redes',
new_name='RedesProducto',
... |
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from dataclasses import dataclass
from pathlib import Path
from typing import TYPE_CHECKING, Iterable, Optional, Tuple
from pants.engine.objects import Collection
from pants.eng... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: bundles.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_d... |
#!/usr/bin/python
# -*- coding:utf-8 -*-
import sys
import os
picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic')
libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib')
if os.path.exists(libdir):
sys.path.append(libdir)
import logging
from ... |
var express = require('express');
var router = express.Router();
/* GET users listing. */
router.get('/', function(req, res, next) {
res.send('Xiao Ming, Xiao Li, Lao Wang');
});
module.exports = router;
|
/**************************************************************************//**
* @file
* Implementation of EVEL functions relating to json_object.
*
* License
* -------
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions ar... |
(function ($) {
var _userService = abp.services.app.user,
l = abp.localization.getSource('todo'),
_$modal = $('#UserCreateModal'),
_$form = _$modal.find('form'),
_$table = $('#UsersTable');
var _$usersTable = _$table.DataTable({
paging: true,
serverSide: true,
... |
/**
* Edit screen code
*
* @package WordPress
* @since 1.0.0
*
* @tags
* @phpcs:disable WordPress.WhiteSpace.OperatorSpacing.NoSpaceAfter
* @phpcs:disable WordPress.WhiteSpace.OperatorSpacing.NoSpaceBefore
* @phpcs:disable Generic.WhiteSpace.ScopeIndent.IncorrectExact
* @phpcs:disable Generic.WhiteSpace.Scope... |
# -*-coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import tensorflow as tf
import tensorflow.contrib.slim as slim
from libs.models.detectors.single_stage_base_network import DetectionNetworkBase
from libs.models.losses.losses_kl import LossKL
from libs.utils import bbox_transform... |
"use strict";
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "sym... |
import pandas as pd
import lightgbm
import xgboost
import catboost
""" LightGBM Model """
params = {'task' :'train',
'objective' :'binary',
'device' :'gpu',
'max_bin' :255,
'gpu_platform_id' :0,
'gpu_device_id' :0,
'gpu_u... |
from .loham import Demand
|
module.exports = function(grunt) {
grunt.registerTask( 'default', [ 'clean', 'copy', 'hapi', 'watch'] );
grunt.registerTask( 'build', [ 'clean', 'copy' ] );
grunt.registerTask( 'run', [ 'hapi', 'watch' ]);
grunt.initConfig({
watch: {
hapi: {
files: [
... |
import React from 'react'
import styled from 'styled-components'
type Props = {
currentBlock: number
}
const BlockNumber = ({ currentBlock }: Props ) => {
return (
<Block>
<span>Current Block: </span>
<a href={'https://etherscan.io/block/' + currentBlock} target="_blank">
{currentBlock}
... |
Ext.define('Jarvus.ext.override.util.InstantHistory', {
override: 'Ext.util.History',
// instantly update state
setHash: function(hash) {
this.callParent([hash]);
this.handleStateChange(hash);
},
// force prevention of duplicate events
handleStateChange: function(token) { ... |
module.exports={A:{A:{"2":"I D F E A oB","2052":"B"},B:{"1":"C N O Q J K L a JB MB R S T M V W G"},C:{"1":"1 2 3 4 5 6 7 8 9 AB BB CB DB EB FB dB HB TB P KB LB X NB OB PB QB RB IB GB Z UB VB WB XB SB a JB MB mB R S T M V W G","194":"0 nB YB H b I D F E A B C N O Q J K L c d e f g h i j k l m n o p q r s t u v w x y z v... |
/*******************************************************/
/* "C" Language Integrated Production System */
/* */
/* CLIPS Version 6.40 11/01/16 */
/* */
/* ... |
# https://leetcode.com/problems/contains-duplicate/
class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
result = len(nums) != len(set(nums))
return result
in1 = [1,2,3,1]
in2 = [1,2,3,4]
in3 = [1,1,1,3,3,4,3,2,4,2]
s = Solution()
s.containsDuplicate(in1) # True
s.containsDup... |
import atp_classes
FIELD_TABLE = 'fields'
'''
Q1 schema
EXPERIAN_GOLD = 'F001,F002,F003,F004,F005,F006,F007,F008,F009,F010,F011,F012,F013,F014,F015,F016,F017,F018,F019,F020,F021,F022,F023,F024,F025,F026,F027,F028,F029,F030,F031,F032,F033,F034,F035,F036,F037,F038,F039,F040,F041,F042,F043,F044,F045,F045_A,F045_B,F045_C,... |
'use strict';
exports.http = (request, response) => {
response.status(200).send('Column handler!');
};
exports.event = (event, callback) => {
callback();
}; |
const inspector = require('inspector')
const path = require('path')
// This test case will set a breakpoint 4 lines below
function debuggedFunction () {
let i
let accum = 0
for (i = 0; i < 5; i++) {
accum += i
}
return accum
}
let scopeCallback = null
function checkScope (session, scopeId) {
session.... |
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (C) NEC Electronics Corporation 2004-2006
*
* This file is based on the arch/mips/pci/ops-vr41xx.c
*
* Copyright 2001 MontaVista Software Inc.
*/
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <asm/addrspace.h>
#i... |
const obj1 = {
a: 1,
A: 2,
fn(arg) {
return `fn:${arg}`;
},
set z(v) {
this.x = v;
},
get z() {
return this.x;
}
};
let b = 1;
Object.defineProperty(obj1, "b", {
get() {
return this.c + 100;
},
set(v) {
this.c = v;
}
});
function verbose(obj) {
return new Proxy(obj, {
... |
//------------------------------------------------------------------ definition
// curry :: ((a, b, ...) -> z) -> (a -> b -> ... -> z)
const curry = (f, ...acc) =>
f.length <= acc.length
? f(...acc)
: (...args) =>
f.length <= [...acc, ...args].length
? f(...acc, ...args)
... |
import pygrok
from .parse import ParseRuleChainsConfig
class BaseFrontend(object):
def load_from_config(self):
raise Exception("Not implemented")
def load_rule_by_name_from_frontend(self, pattern_name):
raise Exception("Not implemented")
def load_rule_from_frontend(self, pattern):
... |
# 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 ... |
var sendCommand = require('./music.sendCommand.js');
module.exports = function getPlaylists(params) {
return sendCommand('getPlaylists', params);
}; |
"""
This file offers the methods to automatically retrieve the graph Anaerosalibacter sp. Marseille-P3206.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: pr... |
try:
from matplotlib import pyplot as plt
import BoardHelper
import DataHelper
from ChessGlobalDefs import *
import Plotter
import FeatureExtractor
import Classifiers
import time
except ImportError:
print("Import failed.")
a_random_file = "../dataset/train/1b1B1b2-2pK2q1-4p1rB-7k-8-... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from mathics.builtin.compile.types import int_type, real_type, bool_type, void_type
from ctypes import c_int64, c_double, c_bool, c_void_p
def pairwise(args):
"""
[a, b, c] -> [(a, b), (b, c)]
>>> list(pairwise([1, 2, 3]))
[(1, 2), (2, 3)]
"""
fi... |
# Generated by Django 3.1.4 on 2020-12-16 21:03
import django.core.validators
from django.db import migrations, models
import django_countries.fields
class Migration(migrations.Migration):
dependencies = [
('userauth', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
... |
QUnit.module("UUID.overwrittenUUID");
(function(QUnit) {
"use strict";
QUnit.test("UUID.overwrittenUUID preserves initialOccupant", function(assert) {
assert.expect(1);
assert.ok(UUID.overwrittenUUID === initialOccupant, "UUID.overwrittenUUID === initialOccupant: " + initialOccupant);
});
})(QUnit);
/... |
CKEDITOR.plugins.add('kityformula', {
lang: 'en,zh,ug,zh-cn',
init: function (editor) {
var pluginName = 'kityformula';
CKEDITOR.dialog.add(pluginName, this.path + 'dialogs/kityformula.js');
editor.addCommand(pluginName, new CKEDITOR.dialogCommand(pluginName));
editor.ui.addButt... |
import gql from "graphql-tag";
export const T1_MUTATION = gql`
mutation t1($input: Input!, $formSerializer: any) {
t1(input: $input)
@rest(
method: "POST"
path: "/...{args.input}"
type: "t1M"
bodySerializer: $formSerializer
) {
__typename
}
}
`;
|
import numpy as np
from scipy.spatial import distance
from scipy.special import expit
class UserModel:
detector = "cityblock"
min_samples = 3
def __init__(self, db, email):
self.db = db
self.email = email
# Device Properties
self.device_info = {
"isMobi... |
"""
Support for LimitlessLED bulbs.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.limitlessled/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.const import (
CONF_NAME, CONF_HOST, CONF_PORT, CONF_TYPE, STATE_ON... |
from django.contrib import admin
from .models import Chemical
@admin.register(Chemical)
class ChemicalAdmin(admin.ModelAdmin):
list_display = ('idx', 'uid', 'name') |
# coding: utf-8
'''
Python to Postgres type adaption is extended via the `type_adapter` decorator.
'''
import uuid
from datetime import datetime
from psycopg2.extensions import adapt, register_adapter, new_type, \
register_type
from ...json_io import serialize_json, deserialize_json
# Declare the list of adapted ... |
/*
jQWidgets v3.0.2 (2013-August-26)
Copyright (c) 2011-2013 jQWidgets.
License: http://jqwidgets.com/license/
*/
(function(a){a.extend(a.jqx._jqxGrid.prototype,{_initpager:function(){var k=this;var c=this.gridlocalization.pagergotopagestring;var j=this.gridlocalization.pagerrangestring;var n=this.gridlocalization.pag... |
/*
* This header is generated by classdump-dyld 1.0
* on Wednesday, March 22, 2017 at 9:07:58 AM Mountain Standard Time
* Operating System: Version 10.1 (Build 14U593)
* Image Source: /System/Library/AccessibilityBundles/UIKit.axbundle/UIKit
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limne... |
# Copyright 2017-2019 TensorHub, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas E... |
#!/usr/bin.env python
# Copyright (C) Pearson Assessments - 2020. All Rights Reserved.
# Proprietary - Use with Pearson Written Permission Only |
import { options, Fragment } from 'preact';
/** @typedef {import('preact').VNode} VNode */
let vnodeId = 0;
/**
* @fileoverview
* This file exports various methods that implement Babel's "automatic" JSX runtime API:
* - jsx(type, props, key)
* - jsxs(type, props, key)
* - jsxDEV(type, props, key, __source, __se... |
from distutils.version import LooseVersion
import os
import raven
import cumulusci
from cumulusci.core.utils import ordered_yaml_load, merge_config
from cumulusci.core.config import BaseTaskFlowConfig
from cumulusci.core.exceptions import (
ConfigError,
DependencyResolutionError,
KeychainNotFound,
Ser... |
import textwrap, base64
def b64_encode(b):
return base64.b64encode(b).decode()
def b64_decode(s):
return base64.b64decode(s)
def b64url_encode(b):
return base64.urlsafe_b64encode(b).decode()
def b64url_decode(s):
return base64.urlsafe_b64decode(b64_restore_padding(s))
def b64_restore_padding(unpadd... |
import React from 'react';
import {connect} from 'react-redux';
import {openModal} from "../../store/router/actions";
import {ModalPage, ModalPageHeader, PanelHeaderButton, withPlatform, IOS, Title, Header, Text, Group, Div} from "@vkontakte/vkui";
import Icon24Dismiss from '@vkontakte/icons/dist/24/dismiss';
import... |
from .core import Query
|
n,m,*a=map(int,open(0).read().split())
c=[0]*-~n
for x in a[:m]:c[x]+=1
q=c.index(0)
for p,x in zip(a,a[m:]):c[p]-=1;c[x]+=1;q=min(q,p+q*c[p])
print(q) |
"""Nu
Revision ID: 64fd044a9531
Revises:
Create Date: 2019-02-19 16:39:30.763691
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '64fd044a9531'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Al... |
from .. import haven_utils
from .. import haven_results as hr
from .. import haven_utils as hu
from .. import haven_share as hd
import os
import pprint
import json
import copy
import pprint
import pandas as pd
from . import widgets as wdg
try:
import ast
from ipywidgets import Button, HBox, VBox
from ipyw... |
## Function to compute the Run length matrix
# The script has been written by Xunkai Wei <xunkai.wei@gmail.com>
# Beijing Aeronautical Technology Research Center
def grayrlmatrix(I, Offset=np.array([1,2,3,4]), NumLevels=None, GrayLimits=None):
"""
Description
-------------------------------------------
Compute... |
export const RESET = 'RESET'
export const SET_ERROR = 'SET_ERROR'
export const SET_RETRIEVED = 'SET_RETRIEVED'
export const SET_UPDATED = 'SET_UPDATED'
export const SET_VIOLATIONS = 'SET_VIOLATIONS'
export const TOGGLE_LOADING = 'TOGGLE_LOADING'
export const UPDATE_RETRIEVED = 'UPDATE_RETRIEVED'
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
... |
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
from flask_restful import Resource
from flask import jsonify, request
from app import db
from models.beer import Beer
from models.ingredient import Ingredient
from validators.beerschema import beer_schema
class BeersController(Resource):
... |
from flask import Flask, render_template, jsonify
from functools import lru_cache
import os
app = Flask(__name__)
from app.db_interface import Database
db = Database()
@app.route('/')
@lru_cache(maxsize=1)
def hello_world():
return render_template('index.html')
@app.route('/vis')
@lru_cache(maxsize=1)
def visua... |
'use strict';
angular.module('recipe')
.directive('imageUploadModal', function () {
return {
replace: true,
restrict: 'E',
templateUrl: 'recipe-lib/image-upload/image-upload-modal.html',
controller: 'imageUploadModalCtrl',
scope: {
recipe: '=',
imageSavedCallback: '='
}
};
})
.controller('imageUp... |
import Vue from 'vue'
import Router from 'vue-router'
import RouterStorage from 'vue-router-storage'
import Path from '../history-path'
Vue.use(Router)
Vue.use(RouterStorage)
Vue.config.productionTip = false
Vue.component('history-path', Path)
const App = {
name: 'App',
template: `
<div id="app">
<h1>... |
from django.db import models
from autosequence import AutoSequenceField
class SimpleModel(models.Model):
sequence = AutoSequenceField()
class ModelWithStartAt(models.Model):
sequence = AutoSequenceField(start_at=100)
class ModelWithUnique(models.Model):
name = models.CharField(max_length=200)
seq... |
import React, { ReactNode, Children, ReactChild } from 'react';
import PropTypes from 'prop-types';
interface ISwitchCaseProps{
value: any;
}
interface ISwitchProps{
value: any;
}
export class SwitchCase extends React.Component<ISwitchCaseProps> {
static propTypes = {
// eslint-disable-next-line
... |
var panelBarList = $('.panelBarView-elements');
// =============================================
// Sortable
// =============================================
var sortable = Sortable.create(panelBarList[0], {
forceFallback: true,
filter: ".panelBarView-element--fixed",
chosenClass: "panelBarView-elemen... |
(function(root, factory) {
if(typeof define === 'function' && define.amd) {
define(function(require, exports, module) {
root.fixtures = module.exports = factory(require('jquery'));
});
} else {
root.fixtures = factory(root.jQuery);
}
}(window, function($) {
var fixtu... |
const state = {
typeList: [] // 分类列表
}
const mutations = {
SET_TYPE: (state, typeList) => {
state.typeList = typeList
}
}
export default {
namespaced: true,
state,
mutations
}
|
var NAVTREEINDEX135 =
{
"group___c_m_s_i_s__core___debug_functions.html#gabae0610bc2a97bbf7f689e953e0b451f":[1,1,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,0,204],
"group___c_m_s_i_s__core___debug_functions.html#gabae0610bc2a97bbf7f689e953e0b451f":[1,1,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,0,205],
"group___c_m_s_i_s__core___debug_funct... |
import pybamm
import numpy as np
import scipy.interpolate as interp
import matplotlib.pyplot as plt
def make_comsol_model(
comsol_variables, mesh, param, y_interp=None, z_interp=None, thermal=True
):
"Make Comsol 'model' for comparison"
comsol_t = comsol_variables["time"]
# interpolate using *dimens... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
from django.conf import settings
from actstream import action as actstream_action
from django.contrib.auth import get_user
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import Permission
from django.http import HttpResponse, JsonResponse, HttpResponseBadRequest, HttpResponseR... |
import _ from 'lodash';
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import YTSearch from 'youtube-api-search';
import SearchBar from './components/search_bar';
import VideoList from './components/video_list';
import VideoDetail from './components/video_detail';
const API_key = 'AIzaSyB8... |
import '@tarojs/async-await';
import Taro, { Component } from '@tarojs/taro';
import { Provider } from '@tarojs/redux';
import Home from './pages/home';
import dva from './utils/dva';
import models from './models';
import './styles/base.scss';
const dvaApp = dva.createApp({
initialState: {},
models: models,
});
co... |
var searchData=
[
['applymaterial',['applymaterial',['../class_model_wrapper.html#a58ed4d89e4202a0609a04fa29f88cfca',1,'ModelWrapper']]]
];
|
from ..utils.RestApiClient import RestApiClient, ResponseWrapper
import urllib.parse
import json
import base64
from urllib.parse import urlencode
class APIClient():
# API METHODS
# These methods are used to call Splunk's API methods through http requests.
# Each method makes use of the http methods below ... |
/*
* sanitize a string into a printable format.
*
* Copyright (C) 1998-2002 D. Hugh Redelmeier.
* Copyright (C) 2003 Michael Richardson <mcr@freeswan.org>
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Library General Public License as published by
* ... |
"""
A CLI for the Vuforia Cloud Recognition Service API.
"""
from __future__ import annotations
import dataclasses
import io
import sys
from pathlib import Path
from typing import Any, Callable, Dict, Tuple
import click
import wrapt
import yaml
from vws import CloudRecoService
from vws.exceptions.cloud_reco_exceptio... |
"""Web socket API for OpenZWave."""
import logging
from openzwavemqtt.const import (
ATTR_CODE_SLOT,
ATTR_LABEL,
ATTR_POSITION,
ATTR_VALUE,
EVENT_NODE_ADDED,
EVENT_NODE_CHANGED,
)
from openzwavemqtt.exceptions import NotFoundError, NotSupportedError
from openzwavemqtt.util.lock import clear_use... |
import re
from datetime import date, datetime
from urllib.request import Request, urlopen
import matplotlib.pyplot as plt
import nltk
import numpy as np
import pandas as pd
import requests
from bs4 import BeautifulSoup
from lxml.html import fromstring, html5parser
from nltk.corpus import stopwords
from sklearn.feature... |
import collections
import configparser
class IniDict(collections.abc.MutableMapping):
def __init__(
self, dict_type=collections.OrderedDict, key_xform=lambda str: str.lower()
):
self.__dict = dict_type()
self.key_xform = key_xform
def __delitem__(self, key):
self.__dict.__... |
# ============================================================================
# Getting financial data from yahoo finance using webscraping
# Author - Mayank Rasu
# Please report bugs/issues in the Q&A section
# =============================================================================
import requests
f... |
/* (C) Sidi HAMADY */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <malloc.h>
#include <string.h>
#include "CZTS_Parameters.h"
/*
* Electron SRH lifetime as a function of position
* Statement: MATERIAL
* Parameter: F.TAUN
* Arguments:
* x location... |
import first_run
import scanner
import sentry_sdk
import os
import praw
import config
import datetime
sentry_sdk.init(
config.SENTRY_URL,
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production.
traces_sample_r... |
#pragma once
#include "lib/stdint.h"
// 超级块,位于分区第一个扇区
struct SuperBlock
{
uint32_t magic; // 用来标识文件系统类型,支持多文件系统的操作系统通过此标志来识别文件系统类型
uint32_t sector_count; // 本分区总共的扇区数
uint32_t inode_count; // 本分区中inode数量
uint32_t partition_lba_base; // 本分区的起始lba地址
uint32_t block_bitmap_lba; /... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
# (c) 1998-2020 all rights reserved
def test():
"""
Verify that the manager of the global state is accessible
"""
# access
import journal
# verify we have access to the global state
chr... |
const express = require("express");
const logger = require('morgan');
const mongoose = require('mongoose');
const PORT = process.env.PORT || 8080;
const app = express();
app.use(logger("dev"));
app.use(express.urlencoded({ extended : true}));
app.use(express.json());
app.use(express.static("public"));
mongoose.conn... |
from .fragment import Fragment
from .text_container import TextContainer
class Sentence(Fragment):
def __init__(self, owner: TextContainer, start: int, finish: int, lang=""):
Fragment.__init__(self, owner, start, finish)
self.lang: str = lang
self.importance: float = 0.0
def __repr__(... |
#!/usr/bin/python
import random
import re
RN = "\r\n"
EndChunk = "0\r\n\r\n"
def Chunked(data):
return hex(len(data))[2:]+RN+data+RN
class Payload():
def __init__(self, host=None):
self.header = None
self.body = None
self.method = "GET"
self.endpoint = "/"
self.host = host
self.cl = -1
def __str__(... |
window.addEventListener('DOMContentLoaded', () => {
const menu = document.querySelector('.header__navmenu'),
menuItem = document.querySelectorAll('.header__navmenu-item'),
hamburger = document.querySelector('.header__mini-nav'),
body = document.querySelector('body');
hamburger.addEventListener('cli... |