text stringlengths 3 1.05M |
|---|
import filterFromObject from './private/filter_from_object';
/**
* Similar to lodash's _.pick(), this returns a copy of the given object's
* own and inherited enumerable properties, selecting only the keys in
* the given array or whose value pass the given filter function.
* @param {object} obj Source... |
var tape = require('tape'),
JSDOM = require('jsdom').JSDOM,
d3 = require('../');
global.document = new JSDOM('<html><body></body></html>');
global.window = document.parentWindow;
tape('d3.history() method exists', function(test) {
test.equal(typeof d3.history, 'function');
test.end();
});
tape('d3.hi... |
const pinterestSquare = { 'pinterest-square': { width: 1536, height: 1792, paths: [{ d: 'M1248 128q119 0 203.5 84.5t84.5 203.5v960q0 119-84.5 203.5t-203.5 84.5h-725q85-122 108-210 9-34 53-209 21 39 73.5 67t112.5 28q181 0 295.5-147.5t114.5-373.5q0-84-35-162.5t-96.5-139-152.5-97-197-36.5q-104 0-194.5 28.5t-153 76.5-107.5... |
import pyeccodes.accessors as _
def load(h):
h.alias('mars.number', 'perturbationNumber')
h.alias('mars.method', 'methodNumber')
h.alias('mars.origin', 'centre')
h.alias('mars.refdate', 'referenceDate')
if (h.get_s('class') == "od"):
h.alias('mars.system', 'systemNumber')
|
module.exports = {
name: 'Alif Irfan Anshory',
github: 'alfari16',
email: 'alif.irfan16@gmail.com',
twitter: '@alif_irfan16',
linkedin: 'https://www.linkedin.com/in/alifirfananshory/',
skills: [
'vue.js',
'react.js',
'node.js',
'codeigniter',
'laravel',
'react native'
]
}
|
function openTab(evt, tabName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
... |
YUI.add("aui-node-accessible",function(e,t){var n=e.getClassName("sr-only");e.mix(e.Node.prototype,{hideAccessible:function(){this.addClass(n),this.onceAfter(this.showAccessible,this,"show")},showAccessible:function(){this.removeClass(n)},toggleAccessible:function(e){e=e!==undefined?e:this.hasClass(n),e?this.showAccess... |
from PythonQt import *
from qColadaAppPythonQt import *
from h5gtpy import h5gt
from h5geopy import h5geo
import os, slicer, ctk
import numpy as np
class DevRead():
"""Class used by `qColadaDevReader` and designated to work with `.DEV` (deviation) files
Returns:
DevRead: object instance
"""
r... |
exports.batchMultipleMessage2 = (event, callback) => {
const pubsubMessage = event.data;
const data = JSON.parse(Buffer.from(pubsubMessage.data, 'base64').toString());
console.log('batchMultipleMessage2 channel:', data.channel);
if (data.channel !== 'fuckbook') {
callback();
return;
}
console.log('f... |
from decimal import Decimal
from typing import Any, Dict, List, Optional
from hummingbot.connector.in_flight_order_base import InFlightOrderBase
from hummingbot.core.event.events import (
OrderType,
TradeType
)
class BalancerInFlightOrder(InFlightOrderBase):
def __init__(self,
client_ord... |
import sys
PY3 = sys.version_info[0] == 3
if PY3:
# Python 3
from collections.abc import Iterable, Mapping
# Mapping = dict
# Iterable = (list, tuple)
else:
# Python 2
from collections import Iterable, Mapping
from copy import deepcopy
class MeldDict(dict):
"""
A dict subclass which ... |
class ScrollExample_3():
def __init__(self):
self.btn_cnt = 1
#
# Create a list a with a floating button
#
list = lv.list(lv.scr_act())
list.set_size(280, 220)
list.center()
for btn_cnt in range(2):
list.add_btn(lv.SYMBOL.AUDIO,"Track {:d... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'SelectProgressUi.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialo... |
const fs = require("fs");
const path = require("path");
const { promisify } = require("util");
const stream = require("stream");
const forge = require("node-forge");
const archiver = require("archiver");
const debug = require("debug");
const got = require("got");
const barcodeDebug = debug("passkit:barcode");
const ge... |
import builtins
import itertools
import dask
import dask.array
import numpy
from ..media_type_registration import deserialization_registry
from .base import BaseArrayClient
from .utils import export_util
class DaskArrayClient(BaseArrayClient):
"Client-side wrapper around an array-like that returns dask arrays"
... |
from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
# This file is auto-generated by generate_classes so do not edi... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import json
from .. import const
from ..templates import templates
from ..package import PSMReader
from ..globals import *
import os
def addScript(name, command, description=""):
psm = PSMReader()
psm.add_script(
name=name,
command=command,
description=description,
)
psm.write(... |
import pytest
import pandas._testing as tm
@pytest.fixture
def datetime_series():
"""
Fixture for Series of floats with DatetimeIndex
"""
s = tm.makeTimeSeries()
s.name = "ts"
return s
@pytest.fixture
def string_series():
"""
Fixture for Series of floats with Index... |
import React from 'react';
import ReactDOM from 'react-dom';
import Header from './js/Header';
import reportWebVitals from './reportWebVitals';
ReactDOM.render(
<React.StrictMode>
<Header />
</React.StrictMode>,
document.getElementById('root')
);
// If you want to start measuring performance in your app, p... |
(window.webpackJsonp = window.webpackJsonp || []).push([
[25],
{
'1Kfe': function (e, t, o) {
e.exports = {
container: 'container-TZggBcGZ',
sectionTitle: 'sectionTitle-TZggBcGZ',
separator: 'separator-TZggBcGZ',
customButton: 'customButton-TZggBcGZ',
};
},
'9... |
#!/usr/bin/env python3
import time
from datetime import datetime
import signal
import os
import glob
import sys
from jsonlogger.logger import JSONLogger
from osmeterium.run_command import run_command, run_command_async
EXPIRE_TILES_DIR = os.environ.get('EXPIRE_TILES_DIR', '/mnt/expiretiles')
CONFIG_PATH = '/opt/tegola... |
# -*- coding:utf-8 -*-
import requests
from Crypto.Cipher import PKCS1_v1_5 as Cipher_pkcs1_v1_5
from Crypto.PublicKey import RSA
import base64
import random
import string
# 把原账号绑定微信 以防丢失
# 1. qq先登录 绑定手机
# 2. 解绑qq,重新用手机登录
# 3. 填写邀请码,并且注销账号
# 4. 反复循环前三步
# 随机名字
def rand_name():
name = '通友{}'
return name.forma... |
class TrieNode:
def __init__(self):
self.children = dict.fromkeys(list('abcdefghijklmnopqrstuvwxyz'), None)
self.word_end = None
def insert(root, word):
curr = root
for char in word:
if curr.children[char] is None:
curr.children[char] = TrieNode()
curr = curr.chi... |
// This file is part of Indico.
// Copyright (C) 2002 - 2021 CERN
//
// Indico is free software; you can redistribute it and/or
// modify it under the terms of the MIT License; see the
// LICENSE file for more details.
// management
import './management';
// editing view & timeline
import './editing';
|
"""hood URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vi... |
"""------------------------------------------------------------*-
Example of receiving signal from PS2 controller for MIS-CTU UV robot
Tested on: Raspberry Pi 3 B+
(c) Minh-An Dao 2020
version 1.00 - 17/04/2020
--------------------------------------------------------------
*
*
------------------------------... |
# 给定一个字符串数组,将字母异位词组合在一起。字母异位词指字母相同,但排列不同的字符串。
#
# 示例:
#
# 输入: ["eat", "tea", "tan", "ate", "nat", "bat"],
# 输出:
# [
# ["ate","eat","tea"],
# ["nat","tan"],
# ["bat"]
# ]
# 说明:
#
# 所有输入均为小写字母。
# 不考虑答案输出的顺序。
#
# 来源:力扣(LeetCode)
# 链接:https://leetcode-cn.com/problems/group-anagrams
# 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处... |
'use strict';
/**
* Module dependencies
*/
var url = require('url');
var streamparser = require('./parser');
var request = require('request');
var extend = require('deep-extend');
// Package version
var VERSION = require('../package.json').version;
function Twitter (options) {
if (!(this instanceof Twitter)) re... |
'use strict';
import defaultsDeep from 'lodash.defaultsdeep';
/*
* App configuration.
*
* Uses settings in config/production.js, with any properties set by
* config/staging.js or config/local.js overriding them depending upon the
* environment.
*
* This file should not be modified. Instead, modify one of:
*
*... |
// @flow
const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
.BundleAnalyzerPlugin;
const DashboardPlugin = require("webpack-dashboard/plugin");
... |
from mcpi.minecraft import Minecraft
from mcpi import block
from citsci_mcsensors import DisplayTube
from time import sleep, time
from mcclock import Clock
"""
SpaceCRAFT - Astro Pi competition[http://astro-pi.org/] entry
Conceived by Hannah Belshaw
Created by Martin O'Hanlon[http://www.stuffaboutcode.com]
For the Ras... |
from abc import ABC, abstractmethod
from typing import Union
import tensorflow as tf
from packaging.version import parse as version
if version(tf.version.VERSION) < version("2.6.0rc0"):
from tensorflow.python.keras.layers.convolutional import Conv
else:
from keras.layers.convolutional import Conv
from . impo... |
import pymongo
from ast import literal_eval as make_tuple
class DbModelInteraction:
def __init__(self, database_name):
"""
Подключение к базе данных
:param database_name: название БД на сервере
:type database_name: str
"""
self.last_id = -1
if type(database_name) ... |
#!/usr/bin/env python3
"""
Checks python directories to ensure nothing is missing, such as modules missing
from the listing in `__init__.py` files.
This uses python import, so this must be called from a proper python env where
the directories-under-test are accessible. In other words, it is best to call
from project ... |
# Lint as: python3
#
# Copyright 2020 The XLS Authors
#
# 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... |
import math
import numpy as np
import sys
import theano
sys.path.append('../code/')
import AEPDGP_net
import matplotlib.pyplot as plt
import time
print 'Theano version: ' + theano.__version__ + ', base compile dir: ' + theano.config.base_compiledir
# theano.config.compute_test_value = 'warn'
theano.config.optimizer = ... |
from distutils.core import setup
import py2exe
setup(console=["vChat2.0.py"])
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (C) Copyright IBM 2020.
#
# 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 o... |
/**
* Created by shusen.cui on 2020/11/26.
*/
layui.use('form', function(){
var form = layui.form;
form.render();
//监听提交
form.on('submit(formDemo)', function(data){
save_rigist();
//layer.msg(JSON.stringify(data.field));
return false;
});
});
function save_rigist() {
layer.confirm('是否确... |
#!/usr/bin/python
## Import the necessary modules
import time
import socket
## Use an ongoing while loop to generate output
while True :
## Set the hostname and the current date
host = socket.gethostname()
date = time.strftime("%Y-%m-%d %H:%M:%S")
## Convert the date output to a string
now = str(date)
## Ope... |
/*
* Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... |
import jsHelper, {
SearchResults,
SearchParameters,
} from 'algoliasearch-helper';
import { tagConfig } from '../../../lib/escape-highlight.js';
import connectRefinementList from '../connectRefinementList.js';
describe('connectRefinementList', () => {
const createWidgetFactory = () => {
const rendering = je... |
# -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from django.contrib import admin
from django.core.exceptions import ValidationError
from django.db import transaction
from django.utils.translation import ugettext_lazy as _
from .models import (
Practice, Difficulty, Level, Dive
)
... |
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const TerserPlugin = ... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
import {template} from "./UserWidgetPhotoTemplate.js";
import ComponentPhoto from "../js/Scene/SceneComponents/ComponentPhoto.js";
import {TypedValue} from "../js/Types/TypedValue.js";
export const component = {
inheritAttrs: false,
template: template,
props: {
tabindex: [Number,String],
c... |
import React from "react"
import Layout from "../components/Layout"
import Nav from "../components/Nav"
import { Image, Heading, Paragraph, Link } from "arwes"
export default () => (
<Layout>
<Nav />
<div className="main-wrapper">
<div className="wrapper">
<div style={{ margin: '0 auto', paddi... |
# -*- coding: utf-8 -*-
from pythainlp.tokenize import word_tokenize
from pythainlp.corpus import stopwords
#from pythainlp.spell.pn import correction
from pythainlp.spell import *
###### Word segmentation #######
text = 'จบไปแล้วใครยังฟินค้างอยู่ไลค์รัวๆกันได้เลยกับ11หนุ่มน้อยวัยฮอร์โมนพุ่งวงWannaOne'
#... |
import pytest
from indy_common.config import SCHEMA_ATTRIBUTES_LIMIT
from indy_node.test.api.helper import validate_write_reply, sdk_write_schema_and_check
from plenum.common.exceptions import RequestRejectedException, RequestNackedException
from plenum.common.util import randomString
from plenum.config import NAME_FI... |
from .bot import LamaGate |
"""
Created by Danil Lykov @danlkv on 14/02/19
"""
#from collections import UserDict #not json serializable
import json
from userdict import UserDict
class BaseNotif(UserDict):
def __init__(self,uid):
super().__init__()
self.data['user_id']=uid
class PomodoroNotif(BaseNotif):
def __init__(self,... |
from concurrent import futures
import logging
import mock
from nose import tools
from tornado import gen
from tornado import testing as tt
from flowz.artifacts import (ExtantArtifact, DerivedArtifact, ThreadedDerivedArtifact,
TransformedArtifact)
class ExceptionLoggingTest(tt.AsyncTestC... |
import loremIpsum from 'lorem-ipsum';
import slugify from 'slugify';
import repeat from './utils/repeat';
import { archivedMessage, newMessage } from './actions/message.actions';
import system from './system';
export function* makeMessage(prefix = '', index = 0, inc = 1) {
let id = index;
while (true) {
let te... |
"""Finds local system Python headers and libraries
Uses python-config to make them available to be used as a C/C++ dependency.
Example:
WORKSPACE:
load("//tools/workspace:python.bzl", "python_repository")
python_repository(
name = "python3",
version = "3",
)
BU... |
#!/usr/bin/python
"""
(C) Copyright 2020-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
import time
import os
import threading
import uuid
from itertools import product
import queue
from apricot import TestWithServers
from write_host_file import write_host_file
from ior_utils import IorC... |
#==================================================================================[a]=====
# Función cuenta regresiva:
#==================================================================================[a]=====
def cuentaregresiva(n):
""" Diseño:
Número: Natural.
Signatura:
N... |
'''Asset definitions for the simple_lakehouse example.'''
import pandas as pd
from lakehouse import Column, computed_table, source_table
from pandas import DataFrame as PandasDF
from pyarrow import date32, float64, string
from pyspark.sql import DataFrame as SparkDF
from pyspark.sql import Window
from pyspark.sql impor... |
const merge = require('webpack-merge')
const devEnv = require('./dev.env')
module.exports = merge(devEnv, {
NODE_ENV: '"production"',
GA: `"UA-170628607-1"`,
report: true
})
|
import React, { useState, useEffect } from "react";
import { jsx } from '@emotion/react';
import { Properties, Button, HyperText } from "../../../../components";
import { FormattedMessage } from "react-intl";
const { Term: T, Value: V } = Properties;
export function BibliographicCitations({
bibliographicCitations =... |
from rest_framework import generics, status
from rest_framework.response import Response
from django.core.exceptions import ObjectDoesNotExist
from .serializers import UserProfileSerializer
from .models import UserProfile
class ProfileView(generics.RetrieveUpdateAPIView):
'''
class view to update user profile... |
/**
* Copyright (c) 2017 HERE Europe B.V.
* See the LICENSE file in the root of this project for license details.
*/
#pragma once
#include "BitHelpers.h"
#include "Reader.h"
#include <boost/endian/conversion.hpp>
#include <cassert>
#include <type_traits>
namespace flatdata
{
/**
* This class allows reading/wri... |
import re
import inspect
import abc
import collections
from decorator import decorator
class TypecheckFailure(Exception):
pass
identity = lambda x: x
def extract(t):
m = re.match("<(type|class) '(.*)'>", str(t))
if m:
return m.groups()[1]
else:
return str(t)
class TypeChecker(obj... |
const _ = require('lodash');
const devConfigProps = require('./development');
const testConfigProps = require('./testing');
const prodConfigProps = require('./production');
let envConfig = {};
const config = {
dev: 'development',
test: 'testing',
prod: 'production',
port: process.env.PORT || 3000,
expireTime... |
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
function _getPrototypeOf(o) {
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ ||... |
/*!
* g.Raphael 0.51 - Charting library, based on Raphaël
*
* Copyright (c) 2009-2012 Dmitry Baranovskiy (http://g.raphaeljs.com)
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
*/
/*
* piechart method on paper
*/
/*\
* Paper.piechart
[ method ]
**
* Creates a pie cha... |
import React from 'react'
import { css } from '@emotion/core'
import Layout from '../components/layout'
import SEO from '../components/seo'
const News = () => {
return (
<Layout>
<SEO title="News" />
<div
style={{
display: 'flex',
flexDirection: 'row',
maxWidth: ... |
from Qt import QtWidgets, QtCore, QtGui
from openpype import (
resources,
style
)
from openpype.tools.utils import PlaceholderLineEdit
from .control import PublisherController
from .widgets import (
BorderedLabelWidget,
PublishFrame,
SubsetAttributesWidget,
InstanceCardView,
InstanceListVie... |
/**
* @author: KentProjects <developer@kentprojects.com>
* @license: Copyright KentProjects
* @link: http://kentprojects.com
*/
function scrollerTile(item, type, addStyle) {
var classList = "", lockedHTML = "", tileHTML = [], tileImage = "", subText = "";
// If colour required add to class list.
if (addStyle) {... |
import datetime
from django import VERSION as DJANGO_VERSION
from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
from django_contactme.conf import settings
# field type IPAddressField deprecated as of django version 1.7
if DJANGO_VERSION... |
from .cwltool_deps import (
needs_shell_quoting,
shellescape,
)
from .parser import (
tool_proxy,
tool_proxy_from_persistent_representation,
workflow_proxy,
)
from .representation import (
to_cwl_job,
to_galaxy_parameters,
)
from .runtime_actions import handle_outputs
__all__ = (
"tool_... |
import BaseError from '../base'
export * from './profile'
export * from './devices'
export * from './backup'
export * from './apps'
export class IdentityRevokedError extends BaseError {
constructor (message) {
super(message, 'IDENTITY_REVOKED')
}
}
export class InvalidIdentityPropertyError extends BaseError ... |
# -*- coding: utf-8 -*-
"""Clustering usage tests and examples."""
import numpy as np
from sktime.clustering.k_means import TimeSeriesKMeans
from sktime.clustering.k_medoids import TimeSeriesKMedoids
from sktime.datasets import load_arrow_head
def form_cluster_list(clusters, n) -> np.array:
"""Form a cluster lis... |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import ErrorMessage from '../components/ErrorMessage/ErrorMessage';
import PostsList from '../components/PostsList/PostsList';
import * as fromPosts from '../redux/modules/posts';
import Spinner from '..... |
import pprocess
import scipy.stats as st
import time
import numpy
def pointless_function(x):
rv = st.norm.rvs(loc=x, scale=1, size=2e8)
m = numpy.mean(rv)
return m
if __name__ == "__main__":
list_of_args = [1, 3, 10]
# Serial computation:
start = time.time()
serial = map(pointless_funct... |
"use strict";
var KTDatatablesSearchOptionsAdvancedSearch = function() {
$.fn.dataTable.Api.register('column().title()', function() {
return $(this.header()).text().trim();
});
var initTable1 = function() {
// begin first table
var table = $('#kt_table_1').DataTable({
responsive: true,
// Pa... |
# $Id$
#
# Copyright (C) 2001-2008 greg Landrum
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" contains the Cluster class for representing h... |
/**
* @license
* Copyright 2018 The FOAM Authors. All Rights Reserved.
* http://www.apache.org/licenses/LICENSE-2.0
*/
foam.CLASS({
package: 'foam.u2.view',
name: 'TableView',
extends: 'foam.u2.view.UnstyledTableView',
css: `
^tr {
background: white;
display: flex;
height: 48px;
... |
import discord
import asyncio
import commands
import json
from datetime import datetime
client = None
karma = {}
lastSave = datetime.fromtimestamp(0)
try:
with open('karma.json', 'r') as karmafile:
print("Got karma file!")
karma = json.loads(karmafile.read())
except:
print("No karma file!")
... |
from sklearn.model_selection import KFold, train_test_split
from sklearn.metrics import recall_score, precision_score, accuracy_score, f1_score
def cross_val_fit(model, X, y, N_FOLDS, cross_val, apply_smote, test_size, metric):
if metric=='accuracy':
metric_am = accuracy_score
elif metric=='f1_score':
metric_am ... |
# Author: Ewan Williams
# Date: 9 04 2016
# Python Intro Turtle Graphics
# Python has a rich "library" of functions.
# We are going to use "turtle" to do some simple graphics.
import turtle
from random import randint
if __name__ == "__main__":
# Setup our drawning surface
turtle.setup(800,600) # Sets up ... |
"""Image feature extractors based on color histograms and CNN embeddings."""
from copy import copy
from typing import List, Callable, Sequence, Optional, Any, Union
import cv2
import numpy as np
import torch
import torch.nn as nn
from albumentations import Compose, Normalize, Resize
from albumentations.pytorch import... |
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... |
# encoding: utf-8
__author__ = "Dimitrios Karkalousos"
# Taken and adapted from: https://github.com/NVIDIA/NeMo/blob/main/nemo/core/optim/novograd.py
import torch
from torch.optim.optimizer import Optimizer
__all__ = ["Novograd"]
def _check_valid_opt_params(lr, eps, betas):
"""Check if the given learning rate ... |
document.body.style.background = 'blue'; |
const path = require('path');
const join = path.join;
const basename = path.basename;
const fs = require('fs');
const spawn = require('cross-spawn');
const existsSync = fs.existsSync;
const chalk = require('chalk');
const emptyDir = require('empty-dir');
const info = require('./logger').info;
const error = require('.... |
#!/usr/bin/env python
#
# Author: Thamme Gowda [tg (at) isi (dot) edu]
# Created: 1/26/21
import mtdata
from mtdata.main import get_data
from argparse import Namespace
from pathlib import Path
from tempfile import TemporaryDirectory
def test_rapid1019():
#out_dir = Path('tmp-test-tmx1')
with TemporaryDirect... |
/*
SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: MIT
*/
#ifndef KSYNTAXHIGHLIGHTING_XML_P_H
#define KSYNTAXHIGHLIGHTING_XML_P_H
#include <QString>
namespace KSyntaxHighlighting
{
/** Utilities for XML parsing. */
namespace Xml
{
/** Parse a xs:boolean attribute. */
in... |
/* istanbul instrument in package npmtest_url */
/*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 () {
// ... |
"""Malfunction generators for rail systems"""
from typing import Callable, NamedTuple, Optional, Tuple
import numpy as np
from numpy.random.mtrand import RandomState
from flatland.envs.agent_utils import EnvAgent, RailAgentStatus
from flatland.envs import persistence
Malfunction = NamedTuple('Malfunction'... |
define(['esri/InfoTemplate'], function(InfoTemplate) {
return {
mapControls: {
options: {
basemap: 'gray',
center: [-122.913, 48.523],
zoom: 15,
minZoom: 14,
sliderPosition: 'bottom-right'
},
operationalLayers: [{
url: 'http://sjcgis.org/arcgis/r... |
/*!
* Bootstrap v3.2.0 (http://getbootstrap.com)
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createEle... |
"use strict";
angular.module("subutai.settings-advanced.service", [])
.factory("SettingsAdvancedSrv", SettingsAdvancedSrv);
SettingsAdvancedSrv.$inject = ["$http"];
function SettingsAdvancedSrv($http) {
var SettingsAdvancedSrv = {
getConfig: getConfig,
updateConfig: updateConfig,
sendCommand: sendCommand
};
... |
import ee
def show(desc, image, lon, lat):
"""
Auxiliary function to inspect array-images at given pixel
:param desc:
:param image:
:param lon:
:param lat:
:return:
"""
print('==> ' + desc + ' <==')
print(ee.ImageCollection([image]).getRegion(ee.Geometry.Point(lon, lat), 30))
... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var styled_icon_1 = require("@styled-icons/styled-icon");
exports.Gbx = React.forwardRef(function (props, ref) {
var attrs = {
"fill": "currentColo... |
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[13],{
/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/pages/vlogs/vlog-review.vue?vue&type=script&lang=js&":
/*!****************************************************************************************... |
import matplotlib.pyplot as plt
from itertools import product
from collections import defaultdict
dinucleotides = 'ATCG'
dinucleotides_perm = [
''.join(perm) for perm in product(dinucleotides, repeat=2)
]
genome_file_names = [
'bacteria',
'human',
]
for name in genome_file_names:
with open(f'../data... |
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... |
deepmacDetailCallback("0050c2b7d000/36",[{"a":"S.P.231 Km 3,500 BITONTO BARI IT 70032","o":"ELETECH Srl","d":"2009-11-08","t":"add","s":"ieee","c":"IT"}]);
|
#
# Utilities for manipulating the modules subsystem
#
import abc
import os
import re
from collections import OrderedDict
import reframe.core.fields as fields
import reframe.utility.os_ext as os_ext
import reframe.utility.typecheck as types
from reframe.core.exceptions import (ConfigError, EnvironError,
... |