text stringlengths 3 1.05M |
|---|
# -*- coding: UTF-8 -*-
import os
import re
import time
from urllib.parse import quote
import aria2p
import feedparser
import requests
from jinja2 import Template
from pymongo import MongoClient
from .utils import default_user_agent, escapeText, postData
class Anime:
def __init__(self, config, rss):
e... |
;(function(angular, debug) {
'use strict';
angular
.module('airpub')
.controller('global', ['$scope', globalCtrler]);
function globalCtrler($scope) {
if (!airpubConfigs)
return console.error(new Error('airpub 缺少必要的配置文件!'));
$scope.configs = airpubConfigs;
}
})(window.angular, wind... |
# pylint: disable=missing-docstring, protected-access
import asyncio
import pytest
from sanic_sse.pub_sub import PubSub
def test_pubsub_register_and_unregister():
pubsub = PubSub()
client_id = pubsub.register()
assert len(pubsub._channels[None]) == 1
assert isinstance(client_id, str)
client_id... |
# Decawave DW1000 ranging demo
# Copyright (c) Jeremy P Bentham 2019. See iosoft.blog for details
import sys, time
from ctypes import sizeof, LittleEndianStructure as Structure, Union
from ctypes import c_ubyte as U8, c_short as U16, c_ulonglong as U64
from dw1000_regs import Reg, DW1000, msdelay
from dw1000_sp... |
# Copyright 2015 Oursky 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 in writing, ... |
#!/usr/bin/python
row_0 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
row_m1 = [24, 26, 31, 32, 38, 42]
row_m2 = [2, 6, 8, 16, 36, 48]
row_m3 = [6, 7, 9, 18, 27, 46]
row_m4 = ... |
export default {
getDevice: state => state.device,
getParameters: state => state.parameters,
getCachedParameters: state => state.cachedParameters,
hasCachedParams: state => state.hasCachedParams,
getQueuedTasks: state => state.queuedTasks,
getDeviceTemplates: state => state.deviceTemplates,
}
|
# coding=utf-8
from Base.PackName import APP
from Base.Common import Common
from Base.OnlineDevices import OnelineDevices as od
class UnInstall:
def Uninstall(self):
packName = APP().get_apk_package()
connectDevices = od().get_conn_dev()
commands = []
for device in connectDevices... |
#!/usr/bin/env pytest
# -*- coding: utf-8 -*-
###############################################################################
# $Id $
#
# Project: GDAL/OGR Test Suite
# Purpose: Test KEA driver
# Author: Even Rouault, <even dot rouault at spatialys dot com>
#
########################################################... |
"""Support for AVM FRITZ!SmartHome thermostate devices."""
from __future__ import annotations
from typing import Any
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
ATTR_HVAC_MODE,
HVAC_MODE_HEAT,
HVAC_MODE_OFF,
PRESET_COMFORT,
PRESET... |
# Copyright (c) 2016, German Neuroinformatics Node (G-Node)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted under the terms of the BSD License. See
# LICENSE file in the root of the Project.
from __future__ import (absolute_import, division, ... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import enum
import os
import logging
import subprocess
import sys
from typing import AnyStr, Iterable, List
# This mo... |
# Generated by Django 2.2.7 on 2019-12-09 22:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('courses', '0007_L18N'),
]
operations = [
migrations.AddField(
model_name='course',
name='template_id',
f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: mnist-disturb.py
# Author: Yuxin Wu <ppwwyyxxc@gmail.com>
import os
import argparse
from tensorpack import *
from tensorpack.dataflow import dataset
import tensorflow as tf
from disturb import DisturbLabel
import imp
mnist_example = imp.load_source('mnist_exampl... |
from rest_framework import serializers
from cccatalog.api.models import ImageList, Image
from cccatalog.api.serializers.image_serializers import ImageDetailSerializer
import secrets
class ImageListBaseSerializer(serializers.ModelSerializer):
images = serializers.SlugRelatedField(
many=True,
querys... |
from sympy.abc import t, w, x, y, z, n, k, m, p, i
from sympy.assumptions import (ask, AssumptionsContext, Q, register_handler,
remove_handler)
from sympy.assumptions.assume import global_assumptions
from sympy.assumptions.ask import (compute_known_facts, known_facts_cnf,
know... |
var applyStickConstraint = function (stick, strategy) {
var length = stick.length;
var offset_to_maintain_distance = function () {
var deltaBetweenTwoParticles = stick.particle2.getPosition().newSubtract(stick.particle1.getPosition());
var lengthOfDelta = deltaBetweenTwoParticles.length();
var differe... |
from typing import List, Tuple
from spacy.pipeline import Lemmatizer
from spacy.tokens import Token
from spacy.vocab import Vocab
from typing import Optional, List, Dict, Tuple
from thinc.api import Model
import spacy
class Dostoevsky_russianLemmatizer(Lemmatizer):
def __init__(
self,
vocab: Voca... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
#
#
# ---------------[ READ ME ]------------------------
#
# This Script Is Only For Educational Purposes.
# I will Not Take Any Type Of Responsibility.
# Use This Script On Your Own Responsibility.
# No Warranty, No Responsibility
#
#########################################... |
import styled from 'styled-components';
import {FaTimes} from 'react-icons/fa';
import {Link as LinkS} from 'react-scroll';
import {Link as LinkR} from 'react-router-dom';
export const SidebarContainer = styled.aside`
position:fixed;
z-index: 999;
width: 100%;
height: 100%;
background: #0d0d0d;
... |
from django.core.exceptions import ImproperlyConfigured
from django.contrib import auth
class LemonldapAuthenticationMiddleware(object):
"""
HTTP headers used :
- user_infos key name
- header key name
- is required
- default value if not provided
"""
headers = [
('userna... |
$(document).ready(function(){
Vecas.validacionGeneral('form-general');
$('#icono').on('blur', function(){
$('#mostrar-icono').removeClass().addClass('fas '+$(this).val());
});
}); |
'use strict';
import React, { StyleSheet, Dimensions,} from 'react-native';
let {width, height} = Dimensions.get('window')
const styles = StyleSheet.create({
profileContainer:{
backgroundColor: '#d6f5f5',
height: height,
width:width,
flex: 1,
justifyContent: 'space-around',
},
... |
import os
import pytest
import shutil
from pathlib import Path
from cookiecutter import main
CCDS_ROOT = Path(__file__).parents[1].resolve()
@pytest.fixture(scope='function')
def default_baked_project(tmpdir):
temp = tmpdir.mkdir('data-project')
out_dir = Path(temp).resolve()
main.cookiecutter(
... |
# Generated by Django 3.2 on 2021-04-20 20:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('predict', '0004_delete_npkvalues'),
]
operations = [
migrations.AddField(
model_name='cropshistory',
name='k',
... |
/* istanbul instrument in package npmdoc_ipp */
/*jslint
bitwise: true,
browser: true,
maxerr: 8,
maxlen: 96,
node: true,
nomen: true,
regexp: true,
stupid: true
*/
(function () {
'use strict';
var local;
// run shared js-env code - pre-init
(function () {
// i... |
// Generated by CoffeeScript 1.6.3
(function() {
var $;
$ = jQuery;
$.awesomeCropper = function(inputAttachTo, options) {
var $applyButton, $cancelButton, $container, $cropSandbox, $fileSelect, $imagesContainer, $inputAttachTo, $progressBar, $resultIm, $sourceIm, $urlSelect, $urlSelectButton, a, cleanImages... |
import unified from 'unified'
import parse from 'rehype-parse'
import vfile from 'vfile'
import generate from '@babel/generator'
import hastToBabelAst from './index'
function transform(code) {
const hastTree = unified()
.use(parse, {
fragment: true,
space: 'svg',
emitParseErrors: true,
du... |
# coding: utf-8
"""
Line Items
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v3
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from hu... |
#!/usr/bin/env python3
import argparse
import json
import sys
if len(sys.argv) < 3:
print("syntax: "+sys.argv[0]+" INFILE OUTFILE")
sys.exit(0)
with open(sys.argv[1], "r") as infile:
genesis = json.load(infile)
with open(sys.argv[2], "w") as outfile:
json.dump(genesis, outfile, indent=2, sort_keys=Tr... |
function page (path) {
return () => import(/* webpackChunkName: '' */ `~/pages/${path}`).then(m => m.default || m)
}
export default [
{ path: '/', name: 'welcome', component: page('welcome.vue') },
{ path: '/login', name: 'login', component: page('auth/login.vue') },
{ path: '/register', name: 'register', com... |
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.15/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.
//>>built
define("dojo/_base/declare dojo/dom-construct dojo/_base/array dojo/_base/lang dojo/Deferred dojo/prom... |
import {Meteor} from 'meteor/meteor';
import {check} from 'meteor/check';
import { Todos } from '../todos/todos';
if (Meteor.isServer) {
Meteor.publish('tasks1', function tasksPublication() {
return Todos.find({});
});
Meteor.publish('tasks2', function tasksPublication() {
return Todos.find({});
});
... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file ui_cmd_console_dlg.ui
#
# Created by: PyQt5 UI code generator 5.15.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtC... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import numpy
from PyDSTool.common import (
isUniqueSeq,
makeSeqUnique,
invertMap,
)
def test_isUniqueSeq_returns_true_for_empty_list():
assert isUniqueSeq([])
def test_isUniqueSeq_returns_true_for... |
module.exports = Server
var bencode = require('bencode')
var debug = require('debug')('bittorrent-tracker')
var dgram = require('dgram')
var EventEmitter = require('events').EventEmitter
var http = require('http')
var inherits = require('inherits')
var portfinder = require('portfinder')
var series = require('run-serie... |
# Copyright 2019 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
const jwt = require('jsonwebtoken');
module.exports = function(req, res, next){
// Get the token from the header
const token = req.header('x-auth-token');
// Check if no token
if(!token){
return res.status(401).json({msg: 'No token, authorization denied'});
}
//Verify token
try ... |
/*! wavesurfer.js 1.1.1 (Mon, 04 Apr 2016 09:49:47 GMT)
* https://github.com/katspaugh/wavesurfer.js
* @license CC-BY-3.0 */
'use strict';
/**
* Purpose:
* User can add regions over the wavesurfer audio visualizations to help mark segments of the
* audio clip. Original code can be found here:
* https://githu... |
#! /usr/bin/env python
# PuLP : Python LP Modeler
# Copyright (c) 2002-2005, Jean-Sebastien Roy (js@jeannot.org)
# Modifications Copyright (c) 2007- Stuart Anthony Mitchell (s.mitchell@auckland.ac.nz)
# $Id: pulp.py 1791 2008-04-23 22:54:34Z smit023 $
# Permission is hereby granted, free of charge, to any person obt... |
from string import Formatter
def reagex(pattern, **group_patterns):
"""
Utility function for writing regular expressions with many capturing groups in a readable,
clean and hierarchical way. It is just a wrapper of ``str.format`` and it works in the same way.
A minimal example::
pattern = rea... |
import requests
from meya import Component
from meya.cards import Card, Cards, Button
class ChuckNorrisJoke(Component):
def start(self):
"""This demonstrates the use of a multi card reading data from
an external datasource and then using various button types to
transition to different sta... |
from django.conf.urls import url, include
from .common import urlpatterns as common_urlpatterns
#from rest_framework_swagger.views import get_swagger_view
import debug_toolbar
from django.conf.urls.i18n import i18n_patterns
urlpatterns = i18n_patterns(
url(r'^__debug__/', include(debug_toolbar.urls)),
# url(r'... |
const tsconfig = require('./tsconfig.json')
const moduleNameMapper = require('tsconfig-paths-jest')(tsconfig)
module.exports = {
transform: {
'.(ts|tsx)': 'ts-jest'
},
testEnvironment: 'node',
testRegex: '(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'css'],
... |
# -*- coding: UTF-8 -*-
from __future__ import print_function
import os
import sys
import shutil
def by_size():
'''match file type and size'''
pass
def by_hash():
'''match file content sha1'''
pass
def main():
pass
if __name__ == '__main__':
main() |
# Copyright 2014 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 required by applicable law or a... |
#!/usr/bin/env python
"""
pyvim: Pure Python Vim clone.
Usage:
pyvim [-p] [-o] [-O] [-u <pyvimrc>] [<location>...]
Options:
-p : Open files in tab pages.
-o : Split horizontally.
-O : Split vertically.
-u <pyvimrc> : Use this .pyvimrc file instead.
"""
from __future__ ... |
from rest_framework_json_api import serializers
from .models import User, Group
class UserSerializer(serializers.ModelSerializer):
"""This class is used to manage how we pass User to the client app."""
class Meta:
model = User
exclude = ['email', 'password']
class GroupSerializer(serializers... |
#!/home/tarek/Desktop/Vygit/ENV/bin/python3
#
# The Python Imaging Library.
# $Id$
#
# convert image files
#
# History:
# 0.1 96-04-20 fl Created
# 0.2 96-10-04 fl Use draft mode when converting images
# 0.3 96-12-30 fl Optimize output (PNG, JPEG)
# 0.4 97-01-18 fl Made optimize an option (PNG, ... |
import pygame
# Dimensions
WIDTH, HEIGHT = 800, 800
ROWS, COLS = 8, 8
PIECES = 12
SQUARE_SIZE = WIDTH // COLS
# Colors
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
RED = (255, 0, 0)
BLUE = (0, 0, 255)
GREY = (128, 128, 128)
# Assets
crown_size = (44, 25)
crown_image = pygame.image.load("assets/crown.png")
CROWN = pyg... |
from ..utils import Command
from ...lib.site import SiteManager
class UpdateCommand(Command):
"""
Update an existing site
"""
def setup(self, subparsers):
parser = super(UpdateCommand, self).setup(subparsers)
parser.add_argument('-i', '--site_id', required=True, type=str, help="Si... |
# -*- encoding: utf-8
from sqlalchemy import Column
from sqlalchemy import Computed
from sqlalchemy import delete
from sqlalchemy import extract
from sqlalchemy import func
from sqlalchemy import Index
from sqlalchemy import insert
from sqlalchemy import Integer
from sqlalchemy import literal
from sqlalchemy import lit... |
# coding: utf-8
from __future__ import unicode_literals
import os
import re
import sys
from .common import InfoExtractor
from .youtube import YoutubeIE
from ..compat import (
compat_etree_fromstring,
compat_str,
compat_urllib_parse_unquote,
compat_urlparse,
compat_xml_parse_error,
)
from ..utils ... |
export const disabledEnum = [
{ value: true, name: '禁用' },
{ value: false, name: '启用' }
]
export const cancelEnum = [
{ value: true, name: '取消' },
{ value: false, name: '正常' }
] |
#!/usr/bin/env python
import rospy
import math
import numpy as np
from duckietown_msgs.msg import Twist2DStamped, LanePose, WheelsCmdStamped, BoolStamped, FSMState
import time
class lane_controller(object):
def __init__(self):
self.node_name = rospy.get_name()
self.lane_reading = None
self... |
import tkinter as tk
class ModalWindow(tk.Toplevel):
"""
The basic modal window which all others are inherited from.
"""
def __init__(self, parent, title=None):
tk.Toplevel.__init__(self, parent)
self.transient(parent)
self.sock = None
self.server = None
self.error_message = None
if title:
self.tit... |
const path = require('path');
// Export a function. Accept the base config as the only param.
module.exports = async ({ config, mode }) => {
// config.output.publicPath = 'http://localhost:6006/'
config.resolve.extensions.push('.vue');
config.resolve.alias['@'] = path.resolve(__dirname, '../src');
// `mode` ha... |
from __future__ import annotations
from typing import Any
from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
class AzureDefenderOnContainerRegistry(BaseResourceCheck):
def __init__(self) -> None:
name =... |
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import get_user_model
User = get_user_model()
class CustomUserCreationForm(UserCreationForm):
class Meta(UserCreationForm.Meta):
model = User
fields = UserCreationForm.Meta.fields
|
/*
* 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 .depth import Depth
from .doctree2md import Translator, Writer
from docutils import nodes
from pydash import _
import html2text
import os
import sys
h = html2text.HTML2Text()
class MarkdownTranslator(Translator):
depth = Depth()
enumerated_count = {}
table_entries = []
table_rows = []
tables ... |
import { Router } from 'express';
import * as PostController from '../controllers/post.controller';
import * as CameraController from '../controllers/camera.controller';
import * as WeatherController from '../controllers/weather.controller';
const router = new Router();
// Get all Camera Images
router.route('/camera')... |
/**
* @file CSFileObjContainer.h
*/
#ifndef _INC_CSFILEOBJCONTAINER_H
#define _INC_CSFILEOBJCONTAINER_H
#include "CScriptObj.h"
#include <vector>
class CSFileObj;
class CSFileObjContainer : public CScriptObj
{
private:
std::vector<CSFileObj *> sFileList;
int iFilenumber;
int64 iGlobalTimeout; // in t... |
#pragma once
#include "fmt/format.h"
namespace forrest {
enum class LogLevel
{
info,
verbose,
debug,
trace
};
struct LogGlobals
{
const char* program_name = "";
LogLevel level = LogLevel::info;
};
extern LogGlobals g_log;
template <typename... Args>
[[noreturn]] void log_fatal(const char* ... |
module.exports = {
publicPath: '/${app_name}/',
devServer: {
proxy: {
${proxy_settings}
}},
configureWebpack: {
module: {
rules: [
{
test: /.html$/,
loader: "vue-template-loader",
exclude: /index.html/
}
]
}
},
... |
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[80],{
/***/ "./frontend/src/@core/comp-functions/forms/form-utils.js":
/*!***************************************************************!*\
!*** ./frontend/src/@core/comp-functions/forms/form-utils.js ***!
\********************************************... |
import argparse
import tarfile
from collections import defaultdict
from typing import Dict
from sacrerouge.data import Pyramid, PyramidAnnotation
from sacrerouge.io import JsonlWriter
def load_pyramids(eval_tar: str) -> Dict[str, Dict[str, Pyramid]]:
pyramids = defaultdict(dict)
with tarfile.open(eval_tar, '... |
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('products-list-container'));
|
import ast
import functools
import inspect
import re
import sys
import textwrap
import traceback
import numpy as np
import taichi.lang
from taichi.core.util import ti_core as _ti_core
from taichi.lang import impl, util
from taichi.lang.ast.checkers import KernelSimplicityASTChecker
from taichi.lang.ast.transformer imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
由于股票的输入数据可能有SH/SZ,需要删除
"""
import os
import pandas as pd
# 从当前config_tdx类中加载配置文件
import config_tdx as config
input_file = os.path.join(config.configs['root_dir'], 'BIG_20170930.csv')
output_file = os.path.join(config.configs['root_dir'], 'BIG_20170930_out.csv')
df = ... |
import shutil
import time
import torch
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
from core.utils.copy_weights import copy_weights
def train(train_loader, model, criterion, optimizer, epoch, args):
batch_time = AverageMeter('Time', ':6.3f')
data_t... |
'''
Description:
email: 359066432@qq.com
Author: lhj
software: vscode
Date: 2021-09-12 09:03:10
platform: windows 10
LastEditors: lhj
LastEditTime: 2021-09-21 16:22:59
'''
from django.db.models import signals
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.... |
#! /usr/bin/python3
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
"""
Interface to press buttons in a target
--------------------------------------
"""
import time
import json
import ttbl
class impl(object):
"""
Implementation interface for a button driver
"""
def p... |
#!/usr/bin/env python
"""
Module to interact with Binarly services <https://www.binar.ly>
This module provides programmatic access to APIs for:
* Fast arbitrary length lookups in millions of indexed files
* Automatic file-based IOC generation from files or clusters of files
* Machine Learning assisted file... |
"""
A Baby class and methods that use the Baby class.
Authors: David Mutchler, Vibha Alangar, Dave Fisher, Amanda Stouder,
their colleagues and Russel Staples.
""" # DONE: 1. PUT YOUR NAME IN THE ABOVE LINE.
def main():
"""
After you have made the Baby class, run this module. If your Baby
c... |
#!/usr/bin/env python
from __future__ import absolute_import, print_function
import errno
import logging
import time
import threading
import unittest
import mock
import pykka
from . import testutil
import arvnodeman.baseactor
class BogusActor(arvnodeman.baseactor.BaseNodeManagerActor):
def __init__(self, e):
... |
from datetime import datetime
import pytz
import sys
import traceback
import discord
from discord.ext import commands
from dotenv import load_dotenv
load_dotenv()
from globalvars import DISCORD_TOKEN, get_raid_roles, get_veteran_roles
from extra import ExtraCmds
from raiding import RaidingCmds
from a... |
'use strict';
const ValidationService = require('../services/validation-service');
/**
* Image-related actions
*/
class ImageService {
constructor(playerContainer, playerStatBoard, notificationService) {
this.playerContainer = playerContainer;
this.playerStatBoard = playerStatBoard;
this... |
/*
* This header is generated by classdump-dyld 1.0
* on Wednesday, March 22, 2017 at 9:04:06 AM Mountain Standard Time
* Operating System: Version 10.1 (Build 14U593)
* Image Source: /System/Library/PrivateFrameworks/SAObjects.framework/SAObjects
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias... |
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const core = require('./core-5bb2836d.js');
require('./config-03608b68.js');
const helpers = require('./helpers-daa1c8c5.js');
const theme = require('./theme-bb3a6213.js');
const haptic = require('./haptic-742c7479.js');
const Toggle = clas... |
# Faça um programa que tenha uma lista chamada números e duas funções chamadas sorteia() e somaPar(). A primeira função
# vai sortear 5 números e vai colocá-los dentro da lista e a segunda função vai mostrar a soma entre todos os valores
# pares sorteados pela função anterior.
numeros = list()
def sorteia():
f... |
'use strict'
let co = require('co')
let cli = require('heroku-cli-util')
function * run (context, heroku) {
yield cli.action('Refreshing Automatic Certificate Management', heroku.request({
method: 'PATCH',
path: `/apps/${context.app}/acm`,
headers: {'Accept': 'application/vnd.heroku+json; version=3.ceda... |
const defaults = {
duration: 400,
easing: 'easeOut',
opacity: 0,
x: -500,
y: 0
}
const addPx = num => (num === 0 || typeof num === 'string') ? num : `${num}px`
export const fly = (t, params) => {
const options = t.processParams(params, defaults)
const x = addPx(options.x)
const y = addPx(options.y)
... |
/**
* @author v.lugovsky
* created on 16.12.2015
*/
function isObject(e){return e===Object(e)}function isArray(e){return Array.isArray(e)}function isFile(e){return e instanceof File}function objectToFormData(e,t,o){return t=t||new FormData,Object.keys(e).forEach(function(a){var i=o?o+"["+a+"]":a;!isObject(e[a])||isA... |
module.exports={A:{A:{"2":"WB","8":"H E G C B A"},B:{"8":"D u g I J K"},C:{"1":"0 1 2 3 4 5 6 7 U V W X v Z a b c d e O N h i j k l m n o p q r s t y L","2":"UB","8":"z F M H E G C B A D u g I J K Y P f Q R S T SB RB"},D:{"1":"0 1 2 3 4 5 6 7 f Q R S T U V W X v Z a b c d e O N h i j k l m n o p q r s t y L AB GB DB VB... |
import os
import pickle
import numpy as np
def parse_sigma_output(f):
"""
Extract the GW results of a calculation with BerkeleyGW.
Returns
-------
dict :
nspin : int
Number of spins
nkpt : int
Number of k-points
nband : int
Number of b... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_toupper.c :+: :+: :+: ... |
number = int(input())
even_sum = 0
odd_sum = 0
for i in range(1, number + 1):
current_number = int(input())
if i % 2 == 0:
even_sum += current_number
else:
odd_sum += current_number
if even_sum == odd_sum:
print("Yes")
print(f"Sum = {even_sum} ")
else:
diff = even_sum - odd_s... |
/*
* QLogic Fibre Channel HBA Driver
* Copyright (c) 2003-2008 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
#ifndef __QLA_GBL_H
#define __QLA_GBL_H
#include <linux/interrupt.h>
/*
* Global Function Prototypes in qla_init.c source file.
*/
extern int qla2x00_initialize_ada... |
'use strict'
require(__dirname + '/test-helper')
var Connection = require(__dirname + '/../../../lib/connection')
test('connection can take existing stream', function () {
var stream = new MemoryStream()
var con = new Connection({ stream: stream })
assert.equal(con.stream, stream)
})
test('using closed stream', ... |
var _ = require('lodash');
var a = _.shuffle(_.range(10,20));
var count = 0;
var start = new Date();
var done = false;
while (!done) {
done = true;
for (var i = 0; i < a.length; i++) {
if(a[i]>a[i+1]) {
done = false;
var tmp = a[i];
a[i] = a[i+1];
a[i+1] = tmp;
}
console.log(+... |
#pragma once
// include most used header files
#include "transform.h"
|
from django.shortcuts import render
from django.http import HttpResponseRedirect
from .forms import AssetForm, AdministrationForm
from .models import Asset, Building, WeekOf
from datetime import datetime as dt
from datetime import timedelta as td
from .view_functions import format_csv
from urllib.parse import unquote
... |
"""Testing MutatedBatchNormalization."""
import numpy as np
import tensorflow as tf
from emtf_nnet.keras.layers import MutatedBatchNormalization
def test_me():
input_shape = (4, 40)
x = tf.random.normal(input_shape)
y = tf.keras.layers.BatchNormalization(momentum=0.9, epsilon=0.1)(x)
expected_output = y.nu... |
/**************************************************************************/
/* */
/* WWIV Version 5 */
/* Copyright (C)1998-2021, WWIV Software Services */
/* ... |
from optparse import OptionParser
from .blind_watermark import WaterMark
usage1 = 'blind_watermark --embed --pwd 1234 image.jpg "watermark text" embed.png'
usage2 = 'blind_watermark --extract --pwd 1234 --wm_shape 111 embed.png'
optParser = OptionParser(usage=usage1 + '\n' + usage2)
optParser.add_option('--embed', de... |
register = (function () {
var handleResponse = function (response, status) {
console.log(response);
console.log(status);
}
return {
push: function () {
var name = $('#name').val();
var lastName = $('#lastName').val();
var password = $('#password... |
import os.path as osp
import torch
import pandas as pd
from sentence_transformers import SentenceTransformer
from torch_geometric.data import HeteroData, download_url, extract_zip
from torch_geometric.transforms import ToUndirected, RandomLinkSplit
url = 'https://files.grouplens.org/datasets/movielens/ml-latest-smal... |
import React from 'react';
import { Footer, Header } from './';
/**
* Default site layout component
*/
const DefaultLayout = ({ wrapperClass, menuDoc, children }) => {
return (
<div data-scroll-container className={wrapperClass}>
<Header menuDoc={menuDoc} />
{children}
<Footer />
</div>
... |
#!/bin/env python
# -*- coding: utf-8 -*-
"""Queue
by Valentyn Stadnytskyi
created: Nov 4, 2017
last update: February, 2019
Queue is an abstract data structure, somewhat similar to Stacks. Unlike stacks, a queue is open at both its ends.One end is always used to insert data (enqueue) and the other is ... |