text stringlengths 3 1.05M |
|---|
function solve() {
document.querySelector('#searchBtn').addEventListener('click', clickHandler);
function clickHandler() {
let input = document.getElementById('searchField');
let rows = document.querySelectorAll('.container tbody tr');
if (input == null || rows == null) {
throw new Er... |
from dataSetGenerator import *
data = np.load("./negative_img_dataTest.npy")
labels = np.load("./negative_img_labelsTest.npy")
classes = np.load("./negative_img_classes.npy")
picShow(data,labels,classes,just=1,predict=None,autoClose = False, Save_as = "pic", save_to = "images") |
# Copyright 2018 Iguazio
#
# 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, softwa... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Bertrand256
# Created on: 2017-05
import datetime
import json
import logging
import sys
from typing import List, Tuple, Optional, Callable, Dict, Any
from urllib.error import URLError
import random
import re
import sqlite3
import threading
import time
import cod... |
var _forEachInstanceProperty = require("../core-js/instance/for-each");
var _Object$getOwnPropertyDescriptor = require("../core-js/object/get-own-property-descriptor");
var _filterInstanceProperty = require("../core-js/instance/filter");
var _concatInstanceProperty = require("../core-js/instance/concat");
var _Obje... |
import numpy
import random
import moviepy.editor as mpy
SURFACEWIDTH = 1920
SURFACEHEIGHT = 1280
# returns a numpy array which represents a single frame
def make_np_array(t):
frame = []
for i in range(SURFACEHEIGHT):
currentRow = []
for j in range(SURFACEWIDTH):
currentPixel = []
for k in rang... |
# Copyright 2019 TsumiNa. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
def sha256(fname):
from hashlib import sha256
hasher = sha256()
with open(fname, "rb") as f:
for chunk in iter(lambda: f.read(65536), b""):
... |
from telethon import events
import subprocess
from telethon.errors import MessageEmptyError, MessageTooLongError, MessageNotModifiedError
import io
import asyncio
import time
from userbot.utils import admin_cmd
import glob
import os
try:
import instantmusic , subprocess
except:
os.system("pip install instantmusic")
... |
"""
Support for ISY994 binary sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.isy994/
"""
import asyncio
import logging
from datetime import timedelta
from typing import Callable
from homeassistant.core import callback
from homeas... |
import Button from '/InDecisionTeam/button.js';
export default class MainMenu extends Phaser.Scene {
constructor(){
super({key: 'main menu'});
}
preload(){
this.load.image('fondo', '/InDecisionTeam/sprites/fondo.jpg');
this.load.image('button','/InDecisionTeam/sprites/grey_button00.p... |
import torch
from torch.utils.data import DataLoader # 데이터로더
from gluonnlp.data import SentencepieceTokenizer
from kogpt2.utils import get_tokenizer
from kogpt2.utils import download, tokenizer
from kogpt2.model.torch_gpt2 import GPT2Config, GPT2LMHeadModel
from kogpt2.data import Read_Dataseimport torch
from torch.ut... |
__author__ = 'andrew.bascom'
# -*- coding: utf-8 -*-
import sys
sys.path.append("..")
import c2_test_case
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from selenium.common.exceptions import TimeoutExcept... |
/**
* Welcome to your Workbox-powered service worker!
*
* You'll need to register this file in your web app and you should
* disable HTTP caching for this file too.
* See https://goo.gl/nhQhGp
*
* The rest of the code is auto-generated. Please don't update this file
* directly; instead, make changes to your Wor... |
describe('template', function () {
var app = window.app
var template
beforeEach(function () {
template = new app.Template()
})
it('should have a default template', function () {
expect(template.defaultTemplate).toEqual('<li data-id="{{id}}" class="{{completed}}"><div class="view"><i... |
function makeData() {
"use strict";
return [makeRandomData(20), makeRandomData(20)];
}
function run(svg, data, Plottable) {
"use strict";
var xScale = new Plottable.Scales.Linear();
var xAxis = new Plottable.Axes.Numeric(xScale, "bottom");
var yScale = new Plottable.Scales.Linear();
var yAxis = new Pl... |
import { emptyFnc } from '../../utils';
export const getPublicInstance = emptyFnc('getPublicInstance');
export const getRootHostContext = emptyFnc('getRootHostContext');
export const getChildHostContext = emptyFnc('getChildHostContext');
export const prepareForCommit = emptyFnc('prepareForCommit');
export const resetA... |
import os
from qtpy import QtGui as QG
from hydrus.core import HydrusConstants as HC
#
BLANK_PERCEPTUAL_HASH = b'\x80\x00\x00\x00\x00\x00\x00\x00' # first bit 1 but everything else 0 means only significant part of dct was [0,0], which represents flat colour
CAN_HIDE_MOUSE = True
CANVAS_MEDIA_VIEWER = 0
CANVAS_PRE... |
import React from 'react'
import PropTypes from 'prop-types'
import Footer from '../footer'
import Loading from '../loading/'
import Navbar from '../navBar/'
import * as S from './styles'
function Layout ({ children, loading, credentials, navBarBgActive }) {
return (
<>
<Navbar credentials={credentials} ... |
/*!
* OpenUI5
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
sap.ui.define(["sap/ui/thirdparty/jquery","sap/ui/core/util/LibraryInfo","sap/base/Log","sap/ui/documentation/sdk/util/Resources","sap/base/util/Version","sap/ui/core/li... |
var tmp = "computedName1", tmp1 = "computedName2", tmp2 = "computedName3", tmp3 = "computedname4", tmp4 = "computedname5", tmp5 = "computedname6";
// @target:es6
class D {
foo() {
}
[tmp]() {
}
[tmp1](a) {
}
[tmp2](a1) {
return 1;
}
bar() {
return this._bar;
}
... |
# Takes a list of table names and schema as input, and returns a dictionary of table -> ADF TabularTranslators
# Used to type cast columns / include column headers in the ADF pipeline.
# Brodie Hicks, 2021.
import logging
import os
import azure.functions as func
import azure.durable_functions as df
from functools imp... |
#!/usr/bin/env python3
import sys
assert sys.version_info >= (3,9), "This script requires at least Python 3.9"
world = {
"name": "Zork",
"passages": [
{
"name": "West of House",
"links": [
{
"linkText": "NORTH",
"passageName": "North of House",
}
],
"... |
from django.db.models import F, Sum
from usaspending_api.accounts.models import AppropriationAccountBalances
from usaspending_api.accounts.serializers import FederalAccountByObligationSerializer
from usaspending_api.common.exceptions import InvalidParameterException
from usaspending_api.common.views import CachedDetail... |
Router.map(function() {
// For authentication
this.route("home", {
path: "/"
});
// Shown in an iframe on your store
this.route("testContent", {
path: "/testContent"
});
});
|
<<<<<<< HEAD
import Task from "./components/Task"
let element;
let inputElement;
=======
import Task from "./components/Task/index.js"
let element;
let input;
>>>>>>> fe277fcee38e1b953a813f52fa2d0a9fceacf0f6
function runOnLoad()
{
// Create a container for us
element = document.createElement("div");
element... |
"""ownphotos URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... |
#!/usr/bin/python2.7
# Copyright 2010 Google 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 agree... |
from dataclasses import dataclass
from typing import List
import pytest
from anchore_engine.configuration import localconfig
from anchore_engine.services.policy_engine.engine.feeds.config import (
compute_selected_configs_to_sync,
get_provider_name,
get_section_for_vulnerabilities,
is_sync_enabled,
)
... |
import React from "react";
import PropTypes from "prop-types";
import Moment from "react-moment";
class DirectMsg extends React.Component {
render() {
const { msg, user } = this.props;
return (
<p className="my-msg">
<img
className="info-avatar"
src={require(`../../global/Av... |
# coding=utf-8
# Copyright 2021 {{cookiecutter.authors}} and The HuggingFace Inc. team. 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/lice... |
# 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... |
import os
from flask import Flask, render_template, request, redirect, url_for, session
from werkzeug.security import generate_password_hash, check_password_hash
from flask_pymongo import PyMongo
from api.v1.consume_itunes import check_cache
from datetime import timedelta
app = Flask(__name__)
base_url = os.getenv("... |
/*
* adv7842 - Analog Devices ADV7842 video decoder driver
*
* Copyright 2013 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
*
* This program is free software; you may redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundat... |
'use strict';
const { assert, REST } = require( 'api-testing' );
describe( 'Math check endpoint test', () => {
const client = new REST( 'rest.php/math/v0' );
it( 'should get a 200 response for a good request', async () => {
const { status, body } = await client.post( '/check/tex', {
q: '\\sin x'
},
'app... |
import nltk
nltk.download('punkt')
nltk.download('stopwords')
nltk.download('wordnet')
|
/*
*
* This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
*
* Copyright 2007-2019 Broadcom Inc. All rights reserved.
*
* this module is used to store and acquire all of the device lock's, semaphores, mutexes etc.
*/
#ifndef _... |
# Django settings for ssltest project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'databa... |
class Solution:
def largestPerimeter(self, A):
A.sort(reverse=True)
for i in range(len(A)-2):
if A[i+1]+A[i+2]>A[i]:
return A[i]+A[i+1]+A[i+2]
return 0
|
import React from 'react'
import Link from 'next/link'
function FooterNavs(props) {
const lists = props.lists.map((list, i) => {
return (
<li key={i}>
<Link href={list.link}>
<a className={`${list.head ? 'footer-head-list' : ''} font-a7`}>
{list.name}</a>
</Link>
... |
import { Grid } from '@material-ui/core';
import { toast } from 'react-toastify';
import Axios from 'axios';
import React, { Fragment, useState ,Component, useEffect } from 'react';
import { withStyles, makeStyles } from '@material-ui/core/styles';
import Paper from '@material-ui/core/Paper';
import Table from '@materi... |
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include "common.h"
#include <glib/gstdio.h>
#include <ccnet.h>
#include "utils.h"
#include "log.h"
#include "seafile-session.h"
#include "commit-mgr.h"
#include "branch-mgr.h"
#include "repo-mgr.h"
#include "fs-mgr.h"
#include "seafile-er... |
import { StyleSheet, Text, View } from 'react-native';
import { colors } from '../../../configuration';
import { normalize } from '../../utils/normalize';
const styles = StyleSheet.create({
container: {
alignItems: 'flex-start',
backgroundColor: colors.white,
flex: 1,
flexDirection: 'column... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcpy.c :+: :+: :+: ... |
import numpy as np
import tensorflow as tf
# reproducible
np.random.seed(1)
tf.set_random_seed(1)
class PolicyGradient:
def __init__(self,
n_actions,
n_features,
learning_rate = 0.01,
reward_decay = 0.1,
output_graph = False,
weights = ... |
import * as math from "./math";
/* eslint-disable no-alert, no-console */
console.log(math.pi);
console.log(math.sum(5,3));
/* eslint-enable no-alert, no-console */
|
# -*- coding: utf-8 -*-
'''
:codeauthor: :email: `Mike Place <mp@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing libs
from tests.support.unit import TestCase
from tests.support.mock import MagicMock
# Import Salt libs
from sa... |
from __future__ import print_function
from mpi4py import MPI
import numpy as np
import matplotlib.pyplot as plt
import sys
# Import SU2
import pysu2
from tacs import TACS, elements, constitutive
from funtofem import TransferScheme
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
# initialize SU2
SU2_CFD_ConfigFile = 'sz_... |
#ifndef usb_serial_h__
#define usb_serial_h__
#include <stdint.h>
#ifdef __cplusplus
extern "C"{
#endif
/**************************************************************************
*
* Configurable Options
*
**************************************************************************/
// You can change these to g... |
/*
* Copyright (c) 2016 Will Shown. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, m... |
// RUN: %ucc -o %t %s
// RUN: %t
#define passert(a, b) if(a != b){printf("%d != %d (%s == %s)\n", a, b, #a, #b); abort();}
int printf(), abort();
main()
{
int *pi[3];
void *pv[3];
int (*fi[3])();
void (*fv[3])();
int (*p_to_ar)[3];
passert(sizeof(pi), sizeof(int *) * 3);
passert(sizeof(pv), sizeof(void *... |
/*
* Copyright (c) 1989, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Guido van Rossum.
*
* Copyright (c) 2011 The FreeBSD Foundation
* All rights reserved.
* Portions of this software were developed by David... |
define({
"_widgetLabel": "Напрямки",
"_featureAction_DirectionFrom": "Напрямки з цього місця",
"_featureAction_DirectionTo": "Напрямки до цього місця",
"_featureAction_OpenInDirections": "Відкрити у «Напрямки»",
"_featureAction_OpenRoute": "Відкрити маршрут",
"_featureAction_EditRoute": "Редагувати маршрут"... |
module.exports = function(map) {
return function(iface, pid) {
var search = [ '*' ]
, ns, id, i, len;
for (i = 0, len = search.length; i < len; ++i) {
ns = map[search[i]];
id = ns && ns[iface];
if (id) { return id; }
}
};
}
|
def __bootstrap__():
global __bootstrap__, __loader__, __file__
import sys, pkg_resources, importlib.util
__file__ = pkg_resources.resource_filename(__name__, '_sfc64.cpython-39-darwin.so')
__loader__ = None; del __bootstrap__, __loader__
spec = importlib.util.spec_from_file_location(__name__,__file... |
import pytest
import torch
from willard.const import dirac
from willard.type import qreg
def test_init_qreg():
qr = qreg()
qr.bits(1)
got = qr.state
wanted = dirac.ket('0')
assert(torch.equal(got, wanted))
qr.bits(1)
got = qr.state
wanted = dirac.ket('00')
assert(torch.equal(got, ... |
import { ELEMENT_KEY } from '../../src/constants'
let manualMockResponse
const path = '/session'
const defaultSessionId = 'foobar-123'
let sessionId = defaultSessionId
const genericElementId = 'some-elem-123'
const genericSubElementId = 'some-sub-elem-321'
const genericSubSubElementId = 'some-sub-sub-elem-231'
const... |
import * as React from 'react';
import Layout from "../components/layout";
import Seo from "../components/seo";
import GradientBox from "../components/GradientBox";
import {
Box,
Button,
Container,
Grid, Pagination,
Stack,
Typography
} from "@mui/material";
import ChevronLeft from "@mui/icons-material/Chevr... |
from . import utils
import functools
def watch_login(status_code=302, msg='',
get_username=utils.get_username_from_request):
"""
Used to decorate the django.contrib.admin.site.login method or
any other function you want to protect by brute forcing.
To make it work on normal functions ... |
//
// Created by firely-pasha on 6/20/17.
//
#ifndef SPACEINVADERS_TEXURE2D_H
#define SPACEINVADERS_TEXURE2D_H
#include <QtCore/QString>
#include <QOpenGLWidget>
#include <QtGui/QImage>
#include <GL/gl.h>
#include <QtOpenGL/QGLWidget>
#include <QVector2D>
class QImage;
class Texture2D
{
private:
GLuint texture... |
import string
### DO NOT MODIFY THIS FUNCTION ###
def load_words(file_name):
'''
file_name (string): the name of the file containing
the list of words to load
Returns: a list of valid words. Words are strings of lowercase letters.
Depending on the size of the word list, this function ... |
'''
webcam_test.py
Rekha Seethamraju
An example to demonstrate the use of the WebCam library
for PyBBIO.
This example program is in the public domain.
'''
from bbio import *
from bbio.libraries.WebCam import WebCam
cam = WebCam()
s = 0
def setup():
pass
def loop():
global s
location = "pic"+str(s)
... |
/**
******************************************************************************
* @file TIM/OCInactive/main.c
* @author MCD Application Team
* @version V3.6.0
* @date 20-September-2021
* @brief Main program body
**************************************************************************... |
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[250],{3489:function(e,n,t){"use strict";t.r(n),n["default"]="<template>\n <div style=\"max-width: 800px; width: 100%;\">\n <q-splitter\n v-model=\"splitterModel\"\n :limits=\"[30, 100]\"\n emit-immediately\n >\n <template v-slot:befor... |
function CGame(oData){
var _bUpdate;
var _iNumCards;
var _iCurCard;
var _iWinnings;
var _iCurWin;
var _iCurWinningSymbol;
var _aOccurrencePrizes;
var _oListenerBlock;
var _oContainerGrid;
var _oBoard;
var _oInterface;
var _oTopGui;
var _oAreYouSurePanel;
... |
/**
* Finnish (Suomi) language functions
*
* @author Santhosh Thottingal
*/
( function ( $ ) {
'use strict';
$.i18n.languages.fi = $.extend( {}, $.i18n.languages[ 'default' ], {
convertGrammar: function ( word, form ) {
// vowel harmony flag
var aou = word.match( /[aou][^äöy]*$/i ),
origWord = word;... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import requests
import re
class UserInfo:
'''
This class try to take some user info (following, followers, etc.)
'''
user_agent = ("Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 "
"(KHTML, like Gecko) Chrome/48.0.256... |
from math import sqrt, isclose
EPSILON = 0.00001
def equal(a,b):
"""
checks if the two parameters are equal by using the Epsilon parameter of ten thousandth
"""
if abs(a-b)<EPSILON:
return True
return False
class Tuple:
def __init__(self, x, y, z, w):
self.... |
#/usr/bin/python
import time, os
from datetime import datetime
import RPi.GPIO as GPIO
import picamera
import local_settings as l
import telepot
import atexit
def init():
GPIO.setmode(GPIO.BCM)
GPIO.setup(23, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)
bot = telepot.Bot(l.telegram['token'])
return bot
def ... |
import { moduleForComponent } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import {
find,
findAll,
scrollTo
} from 'ember-native-dom-helpers';
import getNumbers from 'dummy/lib/get-numbers';
import { paddingBefore, paddingAfter } from 'dummy/tests/helpers/measurement';
import { prepend, re... |
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/v4.5.9/LICENSE
*/
(function(t,r){"use strict";if(typeof define==="function"&&define.amd){define(r)}else if(typeof exports==="object"){module.exports=r()}els... |
// RDKit
onRuntimeInitialized: initRDKitModule().then(function(instance) {
RDKitModule = instance;
console.log('RDKit version: ' + RDKitModule.version());
});
// list.js
var listObj = new List('mols2grid', {
valueNames: {{ value_names }},
item: {{ item_repr }},
page: {{ n_items_per_page }},
pagi... |
from __future__ import unicode_literals
from django.db import models
# Create your models here.
class Movie(models.Model):
m_id= models.CharField(primary_key=True,max_length=32)
name= models.CharField(max_length=64)
director= models.CharField(max_length=64,null=True, blank=True)
year= models.CharField... |
// @flow
import DocsDataAttributes from './DocsDataAttributes';
import DocsDecoratorTypes from './DocsDecoratorTypes';
import asElement from './asElement';
import clearInlineFontStyles from './clearInlineFontStyles';
import convertImageElementToPlaceholderElement from './convertImageElementToPlaceholderElement';
impor... |
# model settings
model = dict(
type='SOLOv2',
pretrained='torchvision://resnet18',
backbone=dict(
type='ResNet',
depth=18,
num_stages=4,
out_indices=(0, 1, 2, 3), # C2, C3, C4, C5
frozen_stages=1,
style='pytorch'),
neck=dict(
type='FPN',
in... |
import requests
import base64
import random
import json
from ..utils import get_content, calculate_hmac, request_url, warn, uuid4
from ..errors import NotificationError
__all__ = ('send_change_notification', 'make_request_retrying', 'subscribe',
'unsubscribe')
INVALID_LINK = "The Link header should conta... |
__author__ = 'patras'
from domain_exploreEnv import *
from timer import DURATION
from state import state, rv
DURATION.TIME = {
'survey': 5,
'monitor': 5,
'screen': 5,
'sample': 5,
'process': 5,
'fly': 3,
'deposit': 1,
'transferData': 1,
'take': 2,
'put': 2,
'move': 10,
'... |
const getContainerStyles = ({ isCentered, screens, padding }) => {
const baseStyle = { width: '100%' }
const mediaScreens = screens.reduce(
(accumulator, screen) => ({
...accumulator,
[`@media (min-width: ${screen})`]: {
maxWidth: screen,
},
}),
{}
)
const paddingStyles =... |
import urllib.request, urllib.parse, urllib.error
img = urllib.request.urlopen('http://data.pr4e.org/cover3.jpg')
fhand = open('cover3.jpg', 'wb')
size = 0
while True:
info = img.read(100000)
if len(info) < 1: break
size = size + len(info)
fhand.write(info)
print(size, 'charaters copied.')
fhand.close... |
import numpy as np
import pandas as pd
from typing import Optional
R = None
def _lazy_load():
global R
if R is not None:
return R
#
from rpy2.robjects import r
#
r('''
library("R.utils")
library("RCurl")
library("DESeq2")
library("limma")
library("statmod")
library("edgeR")
diffExpressio... |
module.exports = {
purge: {
content: [
'./resources/**/*.blade.php',
'./resources/**/*.js',
'./resources/**/*.vue',
],
},
darkMode: false,
theme: {
extend: {
colors: {
laravel: '#ff2d20',
},
},
},
variants: {
extend: {},
},
plugins: [],
}
|
"""
Creatable pages used in CodeRed CMS.
"""
from modelcluster.fields import ParentalKey
from coderedcms.forms import CoderedFormField
from coderedcms.models import (
CoderedArticlePage,
CoderedArticleIndexPage,
CoderedEmail,
CoderedFormPage,
CoderedWebPage
)
from django.db import models
from wagtai... |
/*****************************************************************************
* ugBASIC - an isomorphic BASIC language compiler for retrocomputers *
*****************************************************************************
* Copyright 2021-2022 Marco Spedaletti (asimov@mclink.it)
*
* Licensed unde... |
/*
* Adaptec AHA-154[02][BC] Intelligent Host Adapter.
* Also works for Buslogic BT-747 EISA adapter in non-native mode.
*/
#include "all.h"
#include "io.h"
#include "mem.h"
enum {
Port = 0x330, /* factory defaults: I/O port */
CtlrID = 7, /* adapter SCSI id */
Irq = 11, /* interrupt request level */
};
en... |
import React from 'react'
const name = [
{
id: 1,
name: 'Arto Hellas',
}
]
class App extends React.Component {
constructor(props) {
super(props)
this.state = {
persons: name,
newName: '',
numero: ''
}
this.lisaaNimi = this.lisaaNimi.bind(this)
this.kasitele = this.... |
import json
import os
from os import path
import sys
from bugswarm.common import log
from pair_filter import utils
from pair_filter.constants import DOCKERHUB_REPO_NAME, DOCKERHUB_IMAGES_JSON
def generate_image_file():
image_list = dict()
for repo_name in DOCKERHUB_REPO_NAME:
image_list[repo_name] =... |
import os
from pathlib import Path
from textwrap import dedent
from cgr_gwas_qc.testing import chdir, make_snakefile
from cgr_gwas_qc.testing.comparison import file_hashes_equal, file_rows_almost_equal
def test_chdir(tmp_path):
"""Test that chdir actually changes directory."""
# GIVEN: our current working di... |
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django_filters import CharFilter, ModelChoiceFilter
from .models import Topology, Path, Trail
from geotrek.common.filters import OptionalRangeFilter, StructureRelatedFilterSet
from geotrek.infrastructure.filters import Infra... |
from ipaddress import ip_network
from django.utils.translation import gettext_lazy as _
from django.core.exceptions import ValidationError
from django.db import models
from django.forms.fields import CharField
def validate_ipv46_address_with_subnet(v: str):
try:
ip = ip_network(v)
return str(ip)
... |
# Tests for norpix_reader.py
import os
from datetime import datetime
import unittest
import nose
import numpy as np
import pims
import pims.norpix_reader
tests_path, _ = os.path.split(os.path.abspath(__file__))
class _common_norpix_sample_tests(object):
"""Test the Norpix .seq reader on a sample file."""
def... |
#!/usr/bin/env pytest
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test read functionality for OGR Arc/Info generate driver.
# Author: Even Rouault <even dot rouault at spatialys.com>
#
############################################... |
"use strict";
exports.__esModule = true;
exports.default = pick;
function pick(object, keys) {
return keys.reduce(function (obj, key) {
if (typeof object[key] !== 'undefined') {
obj[key] = object[key];
}
return obj;
}, {});
} |
# -*- coding: utf-8 -*-
import .\data_proc\parse as p |
/* $Id: VBoxClient.h $ */
/** @file
*
* VirtualBox additions user session daemon.
*/
/*
* Copyright (C) 2006-2017 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify ... |
import { css } from 'lit-element';
export default css`
.container {
padding: 100px;
width: 100%;
}
input {
width: 600px;
height: 30px;
font-size: 20px;
}
button {
height: 37px;
}
`; |
# -*- coding: utf-8 -*-
"""Setup script for aiida-psi4"""
import json
from setuptools import setup, find_packages
if __name__ == '__main__':
# Provide static information in setup.json
# such that it can be discovered automatically
with open('setup.json', 'r') as info:
kwargs = json.load(info)
s... |
# Generated by Django 2.0.4 on 2018-04-11 19:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('guests', '0017_auto_20180219_0108'),
]
operations = [
migrations.RemoveField(
model_name='party',
name='category',
... |
window.onresize = function() {
var content = document.getElementById('content');
content.style.minHeight = '100vh';
}
function ExpandTopMenuBooks() {
$('#books-menu-default').slideToggle(150);
} |
from django.test import TestCase
from ...api.exeline import Exeline
from .fixtures.fixtures import get_json_fixture
VALID_CUSTOMER_NO = 30
INVALID_CUSTOMER_NO = 20
def mock_request(filename):
def get(*args):
return {
"GetMemberDataResult": {
"Members": get_json_fixture(filenam... |
from __future__ import print_function, absolute_import, division
import os
import subprocess
import numpy as np
import time
from astropy.utils.console import ProgressBar
from astropy import log
from astropy.extern import six
import warnings
__all__ = ['ytCube']
class ytCube(object):
""" Light wrapper of a yt obj... |
'''
To run the script, run the following command the same direcotry.
git clone https://github.com/bukun/pycsw_helper.git
'''
import os
import uuid
import html2text
from tornado.escape import xhtml_unescape
from pycsw_helper.csw_helper import MRecords
from torcms.model.post_model import MPost
mrec = MRecords()
... |