text stringlengths 3 1.05M |
|---|
from django.shortcuts import render
# Create your views here.
from .forms import RegisterForm
def register(request):
# if request.method == 'POST':
user_form = RegisterForm(request.POST)
if user_form.is_valid():
new_user = user_form.save(commit=False)
new_user.set_password(user_form.clea... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 7
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_2_0
from i... |
/*
* libipmeta
*
* Alistair King, CAIDA, UC San Diego
* corsaro-info@caida.org
*
* Copyright (C) 2013-2020 The Regents of the University of California.
*
* This file is part of libipmeta.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the fo... |
import io
from unittest import TestCase, mock
from python.implementations.problem2753 import Problem2753
class Test2753(TestCase):
def test_2753(self):
output = "97 e a\n98 e b\n99 e c\n100 e d\n101 e e\n102 e f\n103 e g\n104 e h\n105 e i\n106 e j\n107 e k" \
"\n108 e l\n109 e m\n110 e n... |
# Generated by Django 2.1.2 on 2018-10-23 12:54
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ussd', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='victim',
name='reported_... |
import React from "react";
import {
Jumbotron,
Container,
CardColumns,
Card,
Button,
} from "react-bootstrap";
// import { getMe, deleteBook } from '../utils/API';
import { useMutation, useQuery } from "@apollo/client";
import Auth from "../utils/auth";
import { removeBookId } from "../utils/localStorage";
i... |
import os
import csv
from protmapper.cli import run_main
here = os.path.abspath(os.path.dirname(__file__))
class ArgparseMock(object):
def __init__(self, input, output, peptide=None, no_methionine_offset=None,
no_orthology_mapping=None, no_isoform_mapping=None):
self.input = input
... |
from django.conf import settings
from django.core.mail import send_mail
from django.template.loader import render_to_string
def send_email_to_subscribers(sender, **kwargs):
subscripted = models.ThreadSubscription.objects.subscriptions(kwargs['instance'].content_object)
for u in [x for x in subscripted if x.e... |
from django.shortcuts import render, redirect, get_object_or_404
from authy.forms import SignupForm, ChangePasswordForm, EditProfileForm
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.contrib.auth import update_session_auth_hash
from authy.mode... |
/*!
* UI development toolkit for HTML5 (OpenUI5)
* (c) Copyright 2009-2016 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
sap.ui.define(['jquery.sap.global','./library','sap/ui/core/Control'],function(q,l,C){"use strict";var H=C.extend("sap.ui.commons.Hori... |
module.exports = {
locales: {
'/': {
lang: 'en-US',
title: 'Vuex',
description: 'Centralized State Management for Vue.js'
},
'/zh/': {
lang: 'zh-CN',
title: 'Vuex',
description: 'Vue.js 的中心化状态管理方案'
},
'/ja/': {
lang: 'ja',
title: 'Vuex',
descri... |
# SYNOPSIS: from asm import *
from os.path import basename, splitext
import json
#------------------------------------------------------------------------
# Public interface
#------------------------------------------------------------------------
# These definitions allow the use of Python notation as an ass... |
HandlebarsIntl.__addLocaleData({"locale":"vai","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"},"fields":{"year":{"displayName":"ꕢꘋ","relative":{"0":"this year","1":"next year","-1":"last year"},"relativeTime":{"future":{"other":"+{0} y"},"past":{"other":"-{0} y"}}},"month":{"displayName":"ꕪꖃ",... |
# Copyright 2017 ProjectQ-Framework (www.projectq.ch)
#
# 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 app... |
"""Adds config flow for Mill integration."""
from mill import Mill
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import DOMAIN
DATA_SCHEMA = vol.Schema... |
import unittest
def execfile(fn):
with open(fn) as f:
exec(f.read())
def simple_test():
execfile('examples/simple_test.py')
def mmap_test():
execfile('examples/mmap_test.py')
def precision_test():
execfile('examples/precision_test.py')
|
#
# 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 u... |
from typing import NewType
def getAge(age):
right_age = age
while (type(right_age) != int):
try:
int(right_age)
break
except:
right_age=input(f'oops, looks like you didn\'t enter a valid age.\nPlease enter a number\n')
return right_age
def hobbies(name, ... |
exports.name = "colorBrightness";
exports.description = "Elements should provide sufficient color brightness " +
"difference";
exports.rule = function(report) {
var fc = fiveui.color;
var MIN_DIFF = 125; // http://www.w3.org/TR/2000/WD-AERT-20000426#color
/**
* Return a weighted averag... |
import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '../views/Home'
const routes = [
{
path: '/',
redirect: '/dashboard'
},
{
meta: {
title: 'Panel de Control'
},
path: '/dashboard',
name: 'dashboard',
component: () =>
import(/* we... |
import _isBoolean from "lodash/lang/isBoolean"
import _isArray from "lodash/lang/isArray"
import _isFunction from "lodash/lang/isFunction"
import _isNull from "lodash/lang/isNull"
import _isNumber from "lodash/lang/isNumber"
import _isObject from "lodash/lang/isObject"
import _isRegExp from "lodash... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _createIcon = _interopRequireDefault(require("./util/createIcon"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _default = (0, _createIcon["defaul... |
import json
import os
import threading
from redis import StrictRedis, exceptions
class StatsRequestsQueue:
"""
Очередь неудачных запросов (наполняется из PyBreaker)
"""
def __init__(self):
redis_url = os.getenv('REDIS_URL', 'localhost')
if redis_url == 'localhost':
self.r =... |
#!/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.
from habitat.core.embodied_task import Measure
from habitat.core.registry import registry
from habitat.tasks.rearrange.... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-05-29 18:22
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... |
/* eslint-disable import/order */
const DBController = require('../database/dbController');
// eslint-disable-next-line import/order
// eslint-disable-next-line prefer-destructuring
const CronJob = require('cron').CronJob;
const pairsGenerator = require('./pairsGenerator');
const checkData = require('./checkDataCorrect... |
/* eslint-disable global-require */
require('./polyfills/MutationObserver.js')(global);
require('./polyfills/getSelection.js')(global);
if (typeof window !== 'undefined') {
global.window.resizeTo = (width, height) => {
global.window.innerWidth = width || global.window.innerWidth;
global.window.innerHeight = ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# python获取本机MAC地址
import uuid
def get_mac_address():
mac = uuid.UUID(int = uuid.getnode()).hex[-12:]
return ":".join([mac[e:e+2] for e in range(0, 11, 2)])
import socket
def get_IP_address():
my_computer_name = socket.getfqdn(socket.gethostname())
my_ip_a... |
"""
Renderers
"""
import copy
from collections import OrderedDict, defaultdict
from collections.abc import Iterable
import inflection
from django.db.models import Manager
from django.template import loader
from django.utils import encoding
from rest_framework import relations, renderers
from rest_framework.fields impo... |
/**********************************************************************************************************************
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. *
* ... |
ace.define("ace/mode/gherkin_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7... |
import _plotly_utils.basevalidators
class YpadValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="ypad", parent_name="heatmapgl.colorbar", **kwargs):
super(YpadValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
#to make the retrieval of data faster, we index the values we will look for in the tables.
#open the database
db = SQL("sqlite:///chembl_28.db")
#indexing
db.execute("CREATE INDEX Symbol_index ON HtfGandD (Symbol)")
db.execute("CREATE INDEX ensembl_index ON transcription_factors (Ensembl)")
db.execute("CREATE INDE... |
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
'use strict';
var assert = require('chai').assert;
var debug = require('debug')('e2etests:emptyd2cc2d');
var uuid = require('uuid');
var serviceSdk = require('azure-i... |
import bpy
from ..const import ALPHA_NODES, NODE_TAG, NORMAL_INPUTS
from ..nodes.duplicate import duplicate_nodes
from ..nodes.new import new_mixrgb_node, new_rgb_node
from ..nodes.node import (get_all_nodes_linked_from,
is_mixnode_in_node_tree,
... |
import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'
import { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'
import { getNow } from '../util/datetime'
import { compressData } from '.... |
/**
* Substrate API Sidecar v1.
* Substrate API Sidecar is a REST service that makes it easy to interact with blockchain nodes built using Substrate's FRAME framework.
*
* The version of the OpenAPI document: 1.0.0-oas3
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tec... |
import React, { useContext } from 'react'
import { Subtitle } from '../../global/styles'
import { Wrapper, Content, Arrow } from './styles'
import TimelineContent from './TimelineContent/TimelineContent'
import whiteArrow from '../../assets/white-arrow.png'
import { LanguageContext, Text } from '../../global/LanguagesC... |
#!/usr/bin/env python3
import sys
# We use our own fork of javalang, which is located within a submodule
from javalang import tokenizer
SPACE_SYMBOL = '▁'
NEWLINE_SYMBOL = '▏'
EOF_SYMBOL = '▗'
def replace_consecutive(s, x, y, y_after):
i = 0
new_s = ''
start = None
was_newline = False
while i < len(s):
... |
#ifndef __YuanRTOS_H
#define __YuanRTOS_H
#include <stdint.h>
#include "ARMCM3.h"
#endif
|
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[5],{
/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/pages/welcome.vue?vue&type=script&lang=js&":
/*!***************************************************************************************************... |
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_DELEGATED_RENDERER_LAYER_IMPL_H_
#define CC_DELEGATED_RENDERER_LAYER_IMPL_H_
#include "base/memory/scoped_ptr.h"
#include "cc/cc_export.h"
#in... |
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2022 Datadog, Inc.
#pragma once
#include <iostream>
#include <string>
#include "IMetricsSender.h"
class Dogstatsd... |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
from torch.autograd import Variable
import numpy as np
import torch.nn.functional as F
class STN3d(nn.Module):
def __init__(self):
super(STN3d, self).__init__()
self.conv1 = to... |
/**
* Copyright 2016 The AMP HTML 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 require... |
from datetime import datetime
from graphene_sqlalchemy import SQLAlchemyObjectType
from database.base import db_session
from database.model_planet import ModelPlanet
import graphene
import utils
# Create a generic class to mutualize description of planet attributes for both queries and mutations
class PlanetAttribute... |
$(function ($) {
"use strict";
jQuery(document).ready(function () {
$(".footer-area a").on("click", function(event){
if ($(this).is("[disabled]")) {
event.preventDefault();
$(this).parent().find('.check-error').html('Please meet all requirements first!');
}
... |
const { desktopCapturer } = require('electron')
desktopCapturer.getSources({ types: ['window', 'screen'] }).then(async () => {
const stream = await navigator.mediaDevices.getUserMedia({
audio: {
mandatory: {
chromeMediaSource: 'desktop'
}
},
video: ... |
#!/usr/bin/env python3
"""
Copyright 2018 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 applica... |
// Copyright 2018 Henry Robinson
//
// 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 wri... |
# Generated by Django 4.0.4 on 2022-04-19 07:41
import GamesPlay.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('game', '0002_alter_game_max_level_alter_game_summary'),
]
operations = [
migrations.AddField(
... |
import numpy as np
import h5py
class SimpleMaterial(object):
def __init__(self, material_type, num_groups):
self.name = material_type
self.num_groups = num_groups
self.total_xs = 1.0
self.chi = 1.0
self.inv_speed = 1.0
if self.name == 'fuel':
self.scatte... |
const express=require('express');
//引入用户路由器
const my2=require('./my2luyou.js');
const bodyParser=require('body-parser');
var server=express();
server.listen(5050);
server.use(express.static('./my2html'));
// server.use(express.static('../my2js'));
server.use(express.static('/index'));
//配置中间件,使用内置的qs
server.use(b... |
import React, { Component } from 'react';
import ZoneList from './ZoneList'
class Counter extends Component {
constructor(props) {
super(props);
this.state = {
counter: 0
};
this.handleClick = this.handleClick.bind(this);
}
handleClick(){
this.setState({
counter: this.state.cou... |
"""
grdsample - Resample a grid onto a new lattice
"""
from pygmt.clib import Session
from pygmt.helpers import (
GMTTempFile,
build_arg_string,
fmt_docstring,
kwargs_to_strings,
use_alias,
)
from pygmt.io import load_dataarray
__doctest_skip__ = ["grdsample"]
@fmt_docstring
@use_alias(
G="o... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 Nicira, 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
#... |
/**
* Asynchronously loads the component for NotFoundPage
*/
import Loadable from 'react-loadable';
import React from 'react';
import Loading from 'components/Loading';
export default Loadable({
loader: () => import('./index'),
loading: <Loading/>,
});
|
#!/usr/bin/python3
import json
import sys
import os.path
import sqlite3
import hashlib
import random
import string
if len(sys.argv) != 2:
print("This tool changes the password for user with a given email")
print("Usage: ./adminscripts/changePassword.py email")
sys.exit()
siteconfig = json.load(open(os.en... |
from django.core.urlresolvers import reverse
from raspberryio.project.tests.base import RaspberryIOBaseTestCase
class UserProfileFormTestCase(RaspberryIOBaseTestCase):
url_name = "profile_update"
def setUp(self):
self.user = self.create_user(data={'username': 'test', 'password': 'pwd'})
self... |
import React from 'react';
import PropTypes from 'prop-types';
import { styled } from 'styletron-react';
import withTheme from '../../util/withTheme';
const Container = withTheme(
styled('div', ({ styleProps: { theme } }) => ({
color: theme.mausgrau,
display: 'block',
fontWeight: 500,
fontSize: '10vw... |
/*
* Paper.js
*
* This file is part of Paper.js, a JavaScript Vector Graphics Library,
* based on Scriptographer.org and designed to be largely API compatible.
* http://paperjs.org/
* http://scriptographer.org/
*
* Copyright (c) 2011, Juerg Lehni & Jonathan Puckey
* http://lehni.org/ & http://jonathanpuckey.co... |
# https://leetcode.com/problems/middle-of-the-linked-list/
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def middleNode(self, head: ListNode) -> ListNode:
slow, fast = head, head
... |
//----------------------------------------------------------------------------------------------------------------------
// Generic CAN Message
// by Pierre Molinaro
//
// This file is common to the following libraries
// https://github.com/pierremolinaro/acan
// https://github.com/pierremolinaro/acan2515
// https://gi... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createClassFeaturePlugin = createClassFeaturePlugin;
Object.defineProperty(exports, "FEATURES", {
enumerable: true,
get: function () {
return _features.FEATURES;
}
});
function _helperFunctionName() {
const data = _inte... |
# Moon and Stars Mount Coupon | (2433461)
if sm.getSkillByItem() == 0:# Check whether item has an vehicleID stored, 0 if false.
sm.chat("An Error occurred whilst trying to find the mount.")
elif sm.hasSkill(sm.getSkillByItem()):
sm.chat("You already have the 'Moon and Stars' mount.")
else:
sm.consumeItem... |
import ee
import geemap
# Create a map centered at (lat, lon).
Map = geemap.Map(center=[40, -100], zoom=4)
dataset = ee.Image('WWF/HydroSHEDS/03CONDEM')
elevation = dataset.select('b1')
elevationVis = {
'min': -50.0,
'max': 3000.0,
'gamma': 2.0,
}
Map.setCenter(-121.652, 38.022, 8)
Map.addLayer(elevation, elev... |
import React from 'react'
import {
connectSearchBox
} from 'react-instantsearch-dom'
const CustomSearchBox = connectSearchBox(({ currentRefinement, refine }) => {
return (
<input
className='w-full focus:ring-transparent border-0 outline-none text-sm font-bold tracking-wider'
type="text"
place... |
import numpy as np
from rbm import GibbsSampler, RBM
no_visible = 10
no_hidden = 5
# RBM
rbm = RBM(
no_visible=no_visible,
no_hidden=no_hidden
)
# Gibbs sampler
g = GibbsSampler()
# Starting batch = random
batch_size = 3
visible_batch = np.random.randint(low=0, high=2, size=(batch_size, no_visible))
pr... |
# cTurtle.py is based on the following work:
# xturtle.py: a Tkinter based turtle graphics module for
#
# Copyright (C) 2006 Gregor Lingl, <glingl@aon.at>
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the ... |
__author__ = 'BENALI Fodil'
__email__ = 'fodel.benali@gmail.com'
__copyright__ = 'Copyright (c) 2021, AdW Project'
import logging
import sys
import numpy as np
import pandas as pd
from scipy import stats
from copulas import (
EPSILON, get_instance, get_qualified_name, random_state, store_args)
from copulas.margi... |
import * as React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<path d="M9 7H7v2h2V7zm0 4H7v2h2v-2zm0-8c-1.11 0-2 .9-2 2h2V3zm4 12h-2v2h2v-2zm6-12v2h2c0-1.1-.9-2-2-2zm-6 0h-2v2h2V3zM9 17v-2H7c0 1.1.89 2 2 2zm10-4h2v-2h-2v2zm0-4h2V7h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2zM5 7H... |
/* @flow */
"use strict"
/**
* Check whether a media feature is a range context one
*
* @param {string} media feature
* @return {boolean} If `true`, media feature is a range context one
*/
module.exports = function (mediaFeature/*: string*/)/*: boolean*/ {
return mediaFeature.indexOf("=") !== -1 || mediaFeature... |
import logging
from motor.motor_asyncio import AsyncIOMotorClient
from config import MONGODB_URI
from db.mongodb import db
async def connect_mongodb():
"""Connect to the database on startup"""
logging.debug("Connecting to database client")
db.client = AsyncIOMotorClient(MONGODB_URI)
async def disconnect_... |
from django.contrib.auth import get_user_model
from django.core.mail import EmailMultiAlternatives
from django.template.loader import get_template
from contracts.selectors import is_contract_expired
from employees.services import suspend
from notification.services import send_hr_notification_on_contract_expiry, send_e... |
# Author: Stan Fortoński
# Date: 02.05.2020
# Login To Facebook Test
import sys, unittest
sys.path.insert(0, '..')
from driver import getDriver
from tinder.login.facebooklogin import FacebookLogin
class TestFacebookLogin(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.driver = getDriver()
... |
#!/usr/bin/env python
# Importing modules
import os
# Defining functions
def GetCSV(InFile):
"""
Gets InFile and adds item(s) into a list
"""
OutList =[]
fd = open(InFile, 'r')
for line in fd:
OutList.append(line)
#print line
return OutList
def ProcCSV(lst):
"""
... |
from treelist import TreeList
a = TreeList()
for x in [1, 2, 3, 4, 5, 6, 7, 8]:
a.append(x)
print(a) |
import path from 'path'
import fs from 'fs'
export default function (args) {
const jwtFile = path.join(process.env.HOME, '.jwt')
return new Promise((resolve, reject) => {
// resolve(true)
fs.exists(jwtFile, (exists) => {
if (exists) {
fs.readFile(jwtFile, (err, data) => {
if (err) ... |
#A* -------------------------------------------------------------------
#B* This file contains source code for the PyMOL computer program
#C* Copyright (c) Schrodinger, LLC.
#D* -------------------------------------------------------------------
#E* It is unlawful to modify or remove this copyright notice.
#F* --------... |
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import contextlib
import logging
import os
import shutil
import tempfile
import textwrap
import urllib
from telemetry.internal.util import binary_manager
fr... |
# Copyright 2018 PerfKitBenchmarker 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 appli... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
"""Qpid-bow client framework."""
from asyncio import Event as AsyncioEvent
from enum import Enum, auto
from logging import getLogger
from typing import Optional, Type
from proton import Connection
from proton.handlers import MessagingHandler
from proton.reactor import Container, Backoff, EventBase
from qpid_bow.conf... |
# -*- coding: Latin-1 -*-
"""pefile, Portable Executable reader module
All the PE file basic structures are available with their default names
as attributes of the instance returned.
Processed elements such as the import table are made available with lowercase
names, to differentiate them from the upper case basic s... |
'use strict';
const mock = require('egg-mock');
describe('test/axios-plus.test.js', () => {
let app;
before(() => {
app = mock.app({
baseDir: 'apps/axios-plus-test',
});
return app.ready();
});
after(() => app.close());
afterEach(mock.restore);
it('should GET /', () => {
return app... |
/*
* Copyright (c) 2015, Vsevolod Stakhov
* 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 source code must retain the above copyright
* notice, this list of condi... |
#
# Copyright (c) 2017-2021 NVIDIA CORPORATION. All rights reserved.
# This file is part of the WebDataset library.
# See the LICENSE file for licensing terms (BSD-style).
#
"""Low level iteration functions for tar archives."""
import random
import re
import tarfile
import braceexpand
from .handlers import reraise_... |
let { webp2mp4 } = require('../lib/webp2mp4')
let handler = async (m, { conn, usedPrefix, command }) => {
if (!m.quoted) throw `balas stiker dengan perintah *${usedPrefix + command}*`
let mime = m.quoted.mimetype || ''
if (!/webp/.test(mime)) throw `balas stiker dengan perintah *${usedPrefix + command}*`
... |
import tkinter as tk
from tkinter import *
from PIL import Image, ImageTk
import ttk
import tkMessageBox
import json
from collections import OrderedDict
import activeWindows
def manage_configurations():
def delete_configuration(config_type):
try:
if config_type == "client":
... |
# Copyright (c) 2019 Paul Irofti <paul@irofti.net>
# Copyright (c) 2020 Denis Ilie-Ablachim <denis.ilie_ablachim@acse.pub.ro>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notic... |
OfficeWebUI = {
// Get DOM object properties
_gO: function(obj, coord) {
obj = document.getElementById(obj);
var val = obj["offset" + coord];
while ((obj = obj.offsetParent) != null) {
val += obj["offset" + coord];
}
return val;
},
About: functi... |
# TORNADO TIME
u = z*u
v = z*v
w = z*w
# As z gets to zero, u, v and w will be getting closer to zero too
## THE KEY TO MAKING THIS WORK IS normalize = FALSE below!!
|
jQuery(document).ready(function($){
// Menu Mobile
$('header.menuMobile .notificacoes div.item').click(function(){
var itemAtual = $(this);
itemAtual.toggleClass( 'aberto' );
if( $('header.menuMobile .notificacoes div.item.aberto').length > 1 ){
$('header.menuMobile .notificacoes div.item').each(function(){... |
#!/usr/bin/env python3
"""
This tool can generate the ASN1 input for OpenSSL asn1parse.
It allows to create keys with specifically chosen RSA parameters.
"""
import argparse
if __name__ == '__main__':
argparser = argparse.ArgumentParser(description="Generate RSA Key configuration for OpenSSL asn1parse.")
... |
import torch
from torch import nn
import torch.nn.functional as F
from torch_geometric.nn import GCNConv, CGConv, ChebConv
from torch_geometric.utils import to_dense_batch
#https://github.com/rusty1s/pytorch_geometric/issues/1502
class Net(torch.nn.Module):
'''带有graph输入的'''
def __init__(self, node_atom:int, n_... |
import { all, takeEvery, put, call } from 'redux-saga/effects'
import * as jwts from 'services/jwt'
import { message } from 'antd'
import { store as reduxStore } from 'index'
import actions from './actions'
const jwt = {
allServices: jwts.allServices,
updateService: jwts.updateService,
createService: jwts... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# helios documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 12 10:11:11 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# aut... |
#!/usr/bin/env python
#
# bettersocket documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... |
module.exports = {
transform: { '^.+\\.(js|jsx|ts|tsx)$': 'ts-jest' },
testMatch: ['<rootDir>/**/*(*.)@(test).[tj]s?(x)'],
testEnvironment: 'node',
testPathIgnorePatterns: [
'/node_modules/',
'<rootDir>/dist/',
'<rootDir>/templates/',
'<rootDir>/test/.staging/*',
'<rootDir>/test/.*/fixtures/... |
import torch
import torch.nn.functional as F
import diff_operators
import modules
def image_mse(mask, model_output, gt):
if mask is None:
return {'img_loss': ((model_output['model_out'] - gt['img']) ** 2).mean()}
else:
return {'img_loss': (mask * (model_output['model_out'] - gt['img']) ** 2).... |