text stringlengths 3 1.05M |
|---|
# sudo apt install wxglade for gui builder
# https://wiki.wxpython.org/AnotherTutorial
import wx
import pcbnew
class SimpleGui(wx.Frame):
def __init__(self, parent, board):
wx.Frame.__init__(self, parent, title="this is the title")
self.panel = wx.Panel(self)
label = wx.StaticText(self... |
import React from "react"
import styled from "@emotion/styled"
import Img from "gatsby-image";
import {css} from "@emotion/core";
const SkinnyContainer = styled.aside`
grid-area: hero;
@media only screen and (min-width: 64.063em) {
position: sticky;
top: 0;
height: 100vh;
widt... |
# coding=utf-8
"""Setup file for distutils / pypi."""
try:
from ez_setup import use_setuptools
use_setuptools()
except ImportError:
pass
from setuptools import setup, find_packages
setup(
name='pyrenn',
version='0.1',
package_dir={'': 'python'},
py_modules=['pyrenn'],
license='GPL',
... |
import json
import os
import subprocess
import logging
from fairing.backend.native import NativeBackend
logger = logging.getLogger('fairing')
# This class can contain any specifities related to kubeflow services.
# i.e. if kubeflow provides a TensorBoard CRD we could use it here
class KubeflowBackend(NativeBackend):... |
from django.urls import path, include
from .views import Storage_listViewSet
from rest_framework import routers
router = routers.DefaultRouter()
router.register('storage_list', Storage_listViewSet, basename="Storage_list")
urlpatterns = [
path('', include(router.urls)),
]
|
#Mathis Van Eetvelde 2019
#refer to LICENSE.md for copyright and licensing info
import sys
import os
chromedriverMainPath = os.path.join(os.getcwd(), "chromedriver")
macpath = os.path.join(chromedriverMainPath, "macosdriver")
macchromedriverpath = os.path.join(macpath, "chromedriver")
zipmacpath = macchromedriverpat... |
from typing import List
from src.models.board import Board
from src.models.player import Player
from src.models.snake import Snake
from src.models.ladder import Ladder
from src.services.dice_service import DiceService
class GameService:
def __init__(self, board_size: int = 100, num_dice: int = 1):
self.b... |
import request from '../utils/request'
const BASE_URI = '/dev-api'
/* request.get('/db.json').then(response => {
console.log(response.data)
}) */
/* request({
method: 'get',
url: '/db.json'
}).then (response => {
console.log(response.data)
}) */
export default {
getList () {
const req = request ({
... |
"""
Extracts path data for a user or a set of users and analyses with pathpy.
"""
import csv
import json
import os
import numpy as np
import matplotlib.pyplot as plt
import igraph
import pathpy as pp
import collections
from scipy.stats import chi2
from collections import Counter
from pandas import DataFrame
import pand... |
#ifndef CONFLUO_CONTAINER_MONOLOG_MONOLOG_LINEAR_BLOCK_H_
#define CONFLUO_CONTAINER_MONOLOG_MONOLOG_LINEAR_BLOCK_H_
#include "atomic.h"
#include "io_utils.h"
#include "storage/storage.h"
#include "storage/swappable_encoded_ptr.h"
namespace confluo {
namespace monolog {
using namespace ::utils;
template<typename T, ... |
"""
Copyright (c) 2019-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
from enum import IntEnum
# ... |
/* =============================================================================
____ ___ ____ ___ _ _ ___ __ __ ___ __ __ TM
| _ \ |_ _| / ___| / _ \ | \ | | / _ \ | \/ | |_ _| \ \/ /
| |_) | | | | | | | | | | \| | | | | | | |\/| | | | \ /
| __/ | | ... |
triangle = """\
75
95 64
17 47 82
18 35 87 10
20 04 82 47 65
19 01 23 75 03 34
88 02 77 73 07 63 67
99 65 04 28 06 16 70 92
41 41 26 56 83 40 80 70 33
41 48 72 33 47 32 37 16 94 29
53 71 44 65 25 43 91 52 97 51 14
70 11 33 28 77 73 17 78 39 68 17 57
91 71 52 38 17 14 91 43 58 50 27 29 48
63 66 04 68 89 53 67 30 73 16 6... |
const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel appli... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Q2L Transformer class.
Most borrow from DETR except:
* remove self-attention by default.
Copy-paste from torch.nn.Transformer with modifications:
* positional encodings are passed in MHattention
* extra LN at the end of encoder is ... |
"""
ASGI config for MedIT_com project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SET... |
import extend from '@wisewe-form/utils/lib/extend';
import is, { hasProperty } from '@wisewe-form/utils/lib/type';
import mergeProps from '@wisewe-form/utils/lib/mergeprops';
export default function useEffect(Handler) {
extend(Handler.prototype, {
useProvider() {
const ps = this.fc.providers;
... |
"""
7. The lookup API
This demonstrates features of the database API.
"""
from django.db import models, DEFAULT_DB_ALIAS, connection
from django.conf import settings
class Article(models.Model):
headline = models.CharField(max_length=100)
pub_date = models.DateTimeField()
class Meta:
ordering = (... |
import React from 'react'
import { DropdownButton, Dropdown } from 'react-bootstrap'
const SearchBox = ({ searchItem, setSearchTerm }) => {
return (
<>
<div className="wrapper">
<DropdownButton id="dropdown-basic-button" title="Select District" className="dropdown">
... |
//===- llvm/InitializePasses.h - Initialize All Passes ----------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
/*
Copyright (C) 2019 Google Inc., authors, and contributors
Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
*/
import {getComponentVM} from '../../../../js_specs/spec_helpers';
import Component from '../instance-gca-diff';
describe('instance-gca-diff component', () => {
let viewMode... |
from phi.flow import *
from phi.physics.reaction_diffusion import *
physics_config.x_first()
SAMPLE_PATTERNS = {
'diagonal': {'du': 0.17, 'dv': 0.03, 'f': 0.06, 'k': 0.056},
'maze': {'du': 0.19, 'dv': 0.05, 'f': 0.06, 'k': 0.062},
'coral': {'du': 0.16, 'dv': 0.08, 'f': 0.06, 'k': 0.062},
'flood': {'du... |
# Copyright (C) 2020 Zurich Instruments
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
import numpy as np
class Waveform(object):
"""Implements a waveform for two channels.
The 'data' attribute holds the waveform samples with the pro... |
from ast import literal_eval
from os import environ
from asyncio import get_event_loop
from app.filesystem import Watchdog
from app.web.api import Api
def run() -> None:
"""Запуск проекта"""
filesystem_watchdog = Watchdog(literal_eval(environ.get('ARCHIVES_LIST')))
api_server = Api(host=environ.get('API... |
import requests
# server酱key
key = ''
# 账号
email = ''
# 密码
passwd = ''
# session
session = requests.session()
host = 'suying999.net'
# 登陆
def login():
url = 'https://{host}/auth/login'.format(host=host)
headers = {
'Accept': 'application/json, text/javascript, */*; q=0.01',
'Accept-Encoding':... |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: MIT-0
import boto3
import json
import time
import uuid
import sys
from boto3.dynamodb.types import TypeDeserializer
from decimal import Decimal as D
def lambda_handler(event, context):
print("event: {}".for... |
# To maximize python3/python2 compatibility
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
# Python 2,3 compatibility -new
try:
... |
var canvas;
var gl;
var leftDown = false;
var rightDown = false;
var lastMouseX = null;
var lastMouseY = null;
var mouseCoord = [];
var _pullCube = null;
var _time = null;
var _started = true;
var _firstUpdate = true;
var _supportsWebGL2 = false;
//
// start
//
// called when body loads
// sets everything up
//
f... |
module.exports = {
// 项目部署的基础路径
// 我们默认假设你的应用将会部署在域名的根部,
// 比如 https://www.my-app.com/
// 如果你的应用时部署在一个子路径下,
//那么你需要在这里
// 指定子路径。比如,如果你的应用部署在
// https://www.foobar.com/my-app/
// 那么将这个值改为 `/my-app/`
baseUrl: '/me2/',
// 将构建好的文件输出到哪里
outputDir: 'dist',
// 是否在保存的时候使用 `esl... |
import pickle
import os
import torch
import torch.optim as optim
from sklearn.model_selection import train_test_split
from net_ner import MyDataset, collate_fn, deal_eval, seqs2batch, dataset
from net_ner import Net
import pandas as pd
from pytorch_pretrained_bert import BertTokenizer, BertModel
import argparse
parser... |
#ifndef C0P_PARAM_POST_OBJECTS_SURFER__US_1O0__SURFTIMECONST_4O0__REORIENTATIONTIME_0O5_PZ_CHOICE_H
#define C0P_PARAM_POST_OBJECTS_SURFER__US_1O0__SURFTIMECONST_4O0__REORIENTATIONTIME_0O5_PZ_CHOICE_H
#pragma once
// choose your post processing
#include "core/post/objects/object/post/group/all/core.h"
#include "param/p... |
import datetime as dt
import re
import pytest
import pytz
import stix2
from ...exceptions import InvalidValueError
from .constants import FAKE_TIME, MALWARE_ID, MALWARE_KWARGS
EXPECTED_MALWARE = """{
"type": "malware",
"id": "malware--9c4638ec-f1de-4ddb-abf4-1b760417654e",
"created": "2016-05-12T08:17:2... |
import re
import os
from compose.cli.command import get_project
import compose.cli.command as cmd
from compose.cli.main import TopLevelCommand, perform_command
from compose.cli.utils import get_version_info
from compose.config.config import load
from compose.config.environment import Environment
from compose.const imp... |
import { isJSONArray } from "@aicacia/json";
import { none, Option, some } from "@aicacia/core";
import { Entity } from "./Entity";
import { Plugin } from "./Plugin";
import { ToFromJSONEventEmitter } from "./ToFromJSONEventEmitter";
export class Scene extends ToFromJSONEventEmitter {
constructor() {
super(... |
#!/usr/bin/env python3
import json
import sys
from opentree import OTCommandLineTool, process_ott_and_node_id_list_args
cli = OTCommandLineTool(usage='Display taxonomic information about the Most Recent Common Ancestor of a set of IDs',
common_args=("ott-ids", ))
OT, args = cli.parse_cli()
ott... |
#ifndef lint
static char sccsid[] = "@(#)circgen.c 3.1 (CWI) 85/07/30";
#endif lint
#include <stdio.h>
#include "pic.h"
#include "y.tab.h"
obj *circgen(type)
{
static float rad[2] = { HT2, WID2 };
static float rad2[2] = { HT2, HT2 };
static float x0, y0, x1, y1, x2, y2;
int i, at, t, invis, ddtype, with;
float x... |
"""
ASGI config for django_app project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SE... |
jest.dontMock('../TouchControls')
jest.dontMock('../../Navigator')
jest.dontMock('marked')
import React from 'react'
import ReactDOM from 'react-dom'
import TestUtils from 'react-addons-test-utils'
import { Subject } from 'rxjs'
const createNavigator = require('../../Navigator').default
const TouchControls... |
import logging
import pickle
import collections
logging.basicConfig(format='%(asctime)s : %(levelname)s :: %(message)s', level=logging.DEBUG)
logging.debug('started.')
input_file = './most_common.pickle'
with open(input_file, 'rb') as input_fp:
data = pickle.load(input_fp)
logging.debug('read preprocessed data f... |
// Base16 Atelier Savanna Light dark - simple terminal color setup
// Bram de Haan (http://atelierbramdehaan.nl)
static const char *colorname[] = {
/* Normal colors */
"#ecf4ee", /* 0: Base 00 - Black */
"#b16139", /* 1: Base 08 - Red */
"#489963", /* 2: Base 0B - Green */
"#a07e3b", /* 3: Base 0A - Ye... |
#!/usr/bin/env python
"""Configuration parameters for the server side subsystems."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from grr_response_core import version
from grr_response_core.lib import config_lib
from grr_response_core.lib import rdfva... |
//
// iHXIBBaseView.h
// iHakula
//
// Created by Wayde Sun on 2/21/13.
// Copyright (c) 2013 iHakula. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface iHXIBBaseView : UIView {
NSDictionary *dic;
}
@property (nonatomic, strong) NSDictionary *dic;
+ (id)viewFromNib: (NSDictionary *)dataDic;
+ (id)v... |
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_daq as daq
import dash_html_components as html
import dash_table
from pangtreebuild.serialization.json import PangenomeJSON
from dash_app.layout import links
"""--------------------------------FAQ-----------------------------------... |
goog.provide('os.parse.AsyncZipParser');
goog.require('os.parse.AsyncParser');
/**
* @abstract
* @extends {os.parse.AsyncParser<T>}
* @template T
* @constructor
*/
os.parse.AsyncZipParser = function() {
os.parse.AsyncZipParser.base(this, 'constructor');
/**
* @protected
* @type {!Array<!zip.Reader>}
... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
# This module is free software, and you may redistribute it and/or modify
# under the same terms as Python, so long as this copyright message and
# disclaimer are retained in their original form.
#
# IN NO EVENT SHA... |
import re
class String:
@classmethod
def lower(cls, string):
""" return lowered and strip string"""
return string.lower().strip()
@classmethod
def title(cls, string):
return string.lower().strip().title()
@classmethod
def filter(cls, string, pattern, pattern_two):
... |
# -*- coding:utf-8 -*-
# /usr/bin/env python
"""
Date: 2019/10/17 0:50
Desc: 英为财情-股票指数-全球股指与期货指数数据接口
https://cn.investing.com/indices/volatility-s-p-500-historical-data
"""
import re
import pandas as pd
import requests
from bs4 import BeautifulSoup
from akshare.index.cons import short_headers, long_headers
def _get... |
import smplx_kinect.exp.kp_processor
import smplx_kinect.exp.net
import smplx_kinect.exp.datasets
import smplx_kinect.exp.arg_parser
import smplx_kinect.exp.trainer
import smplx_kinect.exp.losses
|
var gain = 0.5;
var dB = Math.max(-192, 20 * Math.log10(gain));
[dB, dB];
|
"""
Specifies XRP as a currency, without a value. Normally, you will not use this
model as it does not specify an amount of XRP. In cases where you need to
specify an amount of XRP, you will use a string. However, for some book order
requests where currencies are specified without amounts, you may need to
specify the u... |
# iterator_protocol.py
print("""
The iterator protocol specifies two special methods to be implemented for any object to allow iteration
1. For any object to be iterated over, it must implement the __iter__ method which returns an iterator object.
Any object that returns an iterator is an iterable.
2. An iterator m... |
import './App.css'
import { useMemo, useState } from 'react'
import { Statistics } from './components/Statistics.js'
import { FeedbackOptions } from './components/FeedbackOptions.js'
import { Section } from './components/Section.js'
import { Notification } from './components/Notification.js'
export const App = () => {... |
from .lcgtruncated import LCGTruncated
class MicrosoftRand(LCGTruncated):
def get_info(self):
return self.PRNGInfo(name='Microsoft rand()',
s_name='microsoftrand',
type='Linear Congruential Generator',
seed_size=31,
... |
__version__ = '2.3.0'
# TODO: Check if these are still required
request_faq_category_identifier = 'aldryn_faq_current_category'
request_faq_question_identifier = 'aldryn_faq_current_question'
|
module.exports = {
env: {
production: {
plugins: ['transform-remove-console'],
},
},
plugins: [
['@babel/plugin-proposal-optional-chaining'],
[
'module-resolver',
{
alias: {
assets: './app/assets',
gate: './app/gate',
helpers: './app/helpers'... |
(self.webpackChunkgeonode_mapstore_client=self.webpackChunkgeonode_mapstore_client||[]).push([[7660],{83813:(e,t,r)=>{"use strict";r.d(t,{Z:()=>ne});var n=r(67294),o=r.n(n),a=r(72986),i=r.n(a),l=r(57588),c=r(82467),s=r(65539),u=r(5346),p=r(14293),d=r.n(p),f=r(71167),m=r.n(f),S=r(2576);const y=function(e){var t=e.childr... |
// Copyright (c) 2011-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef MB8COIN_QT_ASKPASSPHRASEDIALOG_H
#define MB8COIN_QT_ASKPASSPHRASEDIALOG_H
#include <QDialog>
class WalletModel;
na... |
# -*- coding: utf-8 -*-
import re
from datetime import datetime, timedelta
from unittest import mock
import pytest
from flexget.components.thetvdb.api_tvdb import (
TVDBEpisode,
TVDBRequest,
TVDBSearchResult,
find_series_id,
lookup_series,
mark_expired,
persist,
)
from flexget.manager impo... |
"""
This file is used to train the CRNN model using PyTorch
We add distillation procedure
Created by Kunhong Yu
Date: 2020/09/02
"""
import torch as t
import tqdm
from configs import Config
from utils import GetDataLoader
from model import CRNN_def, Distilled_CRNN_def
import matplotlib.pyplot as plt
from ... |
define({
_widgetLabel: 'Loend',
_widgetDescription: 'Vidin andmete kuvamiseks loendivaates.',
_action_filter_label: 'Filter',
_layout_REGULAR_label: 'Korrapärane',
_layout_HOVER_label: 'Liiguta kursorit',
_layout_SELECTED_label: 'Valitud',
applyTo: 'Kehtesta olek {status}',
listLoading: 'Laadimine',
p... |
from copy import deepcopy
from ding.entry import serial_pipeline, serial_pipeline_offline
from easydict import EasyDict
pong_cql_config = dict(
env=dict(
collector_env_num=1,
evaluator_env_num=8,
n_evaluator_episode=8,
stop_value=20,
env_id='PongNoFrameskip-v4',
fram... |
import unittest
from day3 import parse, part1, part2
class TestDay3(unittest.TestCase):
def test_part1(self):
wire1 = "R8,U5,L5,D3"
wire2 = "U7,R6,D4,L4"
self.assertEqual(part1(parse(wire1), parse(wire2)), 6)
wire1 = "R75,D30,R83,U83,L12,D49,R71,U7,L72"
wire2 = "U62,R66,U... |
from mongoengine import Document, StringField, EmbeddedDocument, EmbeddedDocumentField, ListField
from typing import List
class GeoJson(EmbeddedDocument):
type = StringField(required=True,
default='Point')
coordinates = ListField(required=True,
max_length=2)
... |
class Solution:
def smallerNumbersThanCurrent(self, nums: List[int]) -> List[int]:
maxn = max(nums)
cnt = [0] * (maxn + 1)
for val in nums:
cnt[val] += 1
pre = 0
for idx, val in enumerate(cnt):
cnt[idx] = pre
pre += val
return [cnt[... |
from PyQt5 import QtWidgets
from fenril.ui.docwidget import Ui_DocWidget
class DocWidget(QtWidgets.QWidget):
"""Composite QWidget for displaying a pdf document.
Attributes
----------
bibentry : dict
BibTeX entry, see bibtexparser docs for details.
"""
def __init__(self, bibentry, pa... |
#
# Copyright (c) 2008-2016 Citrix Systems, 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 l... |
from setuptools import setup
import os
data_files = []
for root, dirs, files in os.walk('share'):
root_files = [os.path.join(root, i) for i in files]
data_files.append((root, root_files))
setup_args = {
'name': 'voila-gridstack',
'version': '0.0.6',
'packages': [],
'data_files': data_files,
... |
"""
train
"""
import sys
import os
from mindspore.train.callback import ModelCheckpoint, Callback, LossMonitor, CheckpointConfig, _InternalCallbackParam, RunContext
from mindspore import Model, save_checkpoint, ParameterTuple
from mindspore import nn, Tensor
from mindspore import load_checkpoint, load_param_into_net
... |
/*
* Javacript for the Registration lost badges
*/
/* jshint browser: true */
/* jshint -W097 */
/* jshint esversion: 6 */
/* globals apiRequest, hideSpinner, confirmbox */
'use strict';
import { RegPage } from './modules/page.js';
import { RegTicket } from './modules/ticket.js';
class LostBadge extends RegTicket... |
# Copyright (c) 2021, NVIDIA CORPORATION. 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... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icekit_plugins_oembed_with_caption', '0002_auto_20160821_2140'),
]
operations = [
migrations.AddField(
model_nam... |
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{0:function(t,e,n){t.exports=n("zUnb")},zUnb:function(t,e,n){"use strict";function r(t){return"function"==typeof t}n.r(e);let s=!1;const o={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){const t=new Error;console.warn("DEPRECATED! RxJS was set t... |
import React from "react";
import "../Style.css";
//Bootstrap and jQuery libraries
import "bootstrap/dist/css/bootstrap.min.css";
import "jquery/dist/jquery.min.js";
import baseurl from "../../../services/apiconfig";
import { Link } from "react-router-dom";
import $ from "jquery";
import { ToastContainer, toast } from ... |
import tkinter as tk
import itertools as IT # avoiding double loops
import ConnectFour # the game API
class GameScreen(tk.Tk):
def __init__(self):
super().__init__()
self.iconbitmap(default='logo.ico')
self.title("Connect Four v1.0")
self._rows = 6
self._cols =... |
import unittest
from algorithms.collaborative_filtering.neighborhood.\
explicit_feedback.user_based import UserBasedNeighborhood
from evaluators.prequential.explicit_feedback.\
prequential_evaluator import PrequentialEvaluatorExplicit
class PrequentialEvaluatorExplicitTest(unittest.TestCase):
def test_eva... |
#-------------------------------------------------------------------------------
#
# Project: ngEO Browse Server <http://ngeo.eox.at>
# Authors: Fabian Schindler <fabian.schindler@eox.at>
# Stephan Meissl <stephan.meissl@eox.at>
#
#-------------------------------------------------------------------------------... |
"""
plot - Plot in two dimensions.
"""
from pygmt.clib import Session
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import (
build_arg_string,
data_kind,
deprecate_parameter,
fmt_docstring,
is_nonstr_iter,
kwargs_to_strings,
use_alias,
)
@fmt_docstring
@use_alias(
A="... |
'use strict'
const fs = require('fs')
module.exports = {
up: async (queryInterface, Sequelize) => {
/**
* Add seed commands here.
*
* Example:
* await queryInterface.bulkInsert('People', [{
* name: 'John Doe',
* isBetaMember: false
* }], {})
*/
module.exports.copyF... |
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double Pods_HHCategoryKit_ExampleVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_HHCategoryKit_E... |
//Console
var express = require('express'),
logger = require('morgan'),
path = require('path'),
bodyParser = require('body-parser'),
session = require('express-session'),
exphbs = require('express-handlebars'),
modules = require('./modules'),
curSession = null;
var app = express();
// view en... |
from sqlobject import col
from sqlobject.dbconnection import DBAPI
from sqlobject.dberrors import *
class ErrorMessage(str):
def __new__(cls, e, append_msg=''):
obj = str.__new__(cls, e[1] + append_msg)
obj.code = int(e[0])
obj.module = e.__module__
obj.exception = e.__class__.__nam... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from .._protos.public.modeldb.versioning import VersioningService_pb2 as _VersioningService
from .._internal_utils import _git_utils
from . import _code
class Git(_code._Code):
"""
Captures metadata about the git commit with the specified `branc... |
/**
* @author v.lugovksy
* created on 16.12.2015
*/
(function () {
'use strict';
angular.module('BlurAdmin.pages.dashboard')
.controller('DashboardCalendarCtrl', DashboardCalendarCtrl);
/** @ngInject */
function DashboardCalendarCtrl(baConfig) {
var dashboardColors = baConfig.colors.dashboard;
... |
import time
import unicornhathd
from PIL import Image, ImageDraw, ImageFont
NEUTRAL = tuple([50, 50, 200])
RED = tuple([255, 0, 0])
def init():
print('initializing..')
unicornhathd.clear()
unicornhathd.rotation(270)
unicornhathd.brightness(1.0)
scroll_text("Hola! Hola! Hola! Hola!", NEUTRAL)
u... |
"""Decorators
Recall the simple closure example we did which allowed us to maintain a count of ho9w many times a function was called:
def counter(fn):
count = 0
def inner(*args, **kwargs): # using *args. **kwargs means we can call any function fn with any combination of positional and keyword arguments
... |
/*
* This header is generated by classdump-dyld 1.5
* on Wednesday, April 28, 2021 at 9:10:12 PM Mountain Standard Time
* Operating System: Version 14.5 (Build 18L204)
* Image Source: /System/Library/Frameworks/Network.framework... |
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger
from os.path import realpath
import re
import struct
import subprocess
import sys
from ..base.constants im... |
from fixture.application import Application
from fixture.db import DBFixture
import pytest
import json
import os.path
import importlib
import jsonpickle
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.path.abspath(__fi... |
from asyncio import sleep
from pyiced import (
Align, container, IcedApp, Length, pick_list, PickListState,
Settings, text, WindowSettings,
)
class PickListExample(IcedApp):
class settings(Settings):
class window(WindowSettings):
size = (640, 320)
def __init__(self):
self... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import math
import torch
from torch.optim.optimizer import Optimizer as PT_Optimizer
from .optimizers import Optimizer
class AdaBelief(Optimizer, PT_Optimizer):
"""
`AdaBelief Optimizer, adapting stepsizes by the b... |
/*
* Copyright 2001-2014 Adrian Thurston <thurston@colm.net>
*
* 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, cop... |
import React, { useState, useEffect, Fragment } from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import AppBar from '@material-ui/core/AppBar';
import { NavLink } from 'react-router-dom';
import Toolbar from '@material-ui/core/Toolbar';
import SearchIcon from '@ma... |
from __future__ import print_function
from __future__ import absolute_import
# ============================================================================
# Copyright 2017 BRAIN Corporation. All rights reserved. This software is
# provided to you under BRAIN Corporation's Beta License Agreement and
# your use of the s... |
import numpy as np
'''
Arbitrary dynamics
x_{k+1} = map(x_k, p)
p: dict of parameters. For convenience, actions are also stored here.
'''
# map: x_k+1, failed = map
def p_map(x, p):
'''
Dynamics function of your system
Note that the control input is included in the parameter,
and needs to be unpacked... |
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include "FreeRTOS.h"
#if defined(configUSE_WAKELOCK_PMU) && (configUSE_WAKELOCK_PMU == 1)
#include "freertos_pmu.h"
#endif
#include "log_service.h"
#include "task.h"
#include "semphr.h"
#include "main.h"
//#include "wifi_util.h"
#include "atcmd_wif... |
// @flow
// NOTE: This file is GENERATED from json files in actions/json. Run 'yarn build-actions' to regenerate
/* eslint-disable no-unused-vars,prettier/prettier */
import * as I from 'immutable'
import * as RPCTypes from '../constants/types/rpc-gen'
import * as More from '../constants/types/more'
import * as TeamTy... |
import sys
from starkware.crypto.signature.signature import (
pedersen_hash, private_to_stark_key, private_key_to_ec_point_on_stark_curve, get_random_private_key, verify, inv_mod_curve_size, EC_GEN, ALPHA, FIELD_PRIME, EC_ORDER, sign)
from starkware.crypto.signature.math_utils import (
ECPoint, div_mod, ec_add, ec... |
import Logger from 'src/common/utils/logger';
import * as applicationConfig from 'config/application';
import { loggerMiddleware } from '../logger.middleware';
jest.mock('src/common/utils/logger');
jest.mock('config/application');
describe('logger.middleware', () => {
let mockInfo;
let mockNext;
beforeEach(() ... |
"""
This script is part of the pytest release process which is triggered by comments
in issues.
This script is started by the `prepare_release.yml` workflow, which is triggered by two comment
related events:
* https://help.github.com/en/actions/reference/events-that-trigger-workflows#issue-comment-event-issue_comment... |