content
stringlengths
10
4.9M
<reponame>rouault/s100py<filename>tests/s111/s111_test.py from collections import namedtuple import pytest import os import datetime import numpy import h5py try: from osgeo import gdal except ModuleNotFoundError: import gdal from s100py import s111 path_to_current_file = os.path.realpath(__f...
<gh_stars>1-10 package graphql.extended.validation.constraints; import graphql.PublicApi; import graphql.extended.validation.constraints.standard.*; import graphql.schema.GraphQLArgument; import graphql.schema.GraphQLFieldDefinition; import graphql.schema.GraphQLFieldsContainer; import graphql.schema.idl.TypeDefinitio...
// Trim leading zeros from a String private static String TrimZeros(String buf) { int i = 0; String b; boolean is_neg; is_neg = false; if (buf.startsWith("-")) { i = 1; is_neg = true; } do { b = buf.substring(i, i + 1); ...
// ShipsInfos returns a ShipsInfos struct from the espionage report func (r EspionageReport) ShipsInfos() *ShipsInfos { if !r.HasFleetInformation { return nil } return &ShipsInfos{ LightFighter: i64(r.LightFighter), HeavyFighter: i64(r.HeavyFighter), Cruiser: i64(r.Cruiser), Battleship: i64(...
<gh_stars>0 /** * @author <NAME>. * @version 2021/03/16 */ /* Given a positive integer n, generate an n x n matrix filled with elements from 1 to n2 in spiral order.  Example 1: Input: n = 3 Output: [[1,2,3],[8,9,4],[7,6,5]] Example 2: Input: n = 1 Output: [[1]] ...
/* * The following methods are equivalents of CompletableFuture's run/supplyAsync methods. * Provided reactive supplier/runnable is executed repeatedly until it completes without blocking. * * These methods serve as a bridge from reactive computations to the async world of CompletableFuture, * which is why t...
The Combination Therapy of Self-Surrender Exercise and Distraction Against Osteoarthritis Pain Scale of Elderly In Coastal Area A combination therapy of resignation and distraction techniques builds on relaxation. For this reason, this study aims to provide a combination therapy of self-surrender training (LPD – latih...
/** * Class for accessing the CouchDB database for attachment objects * * @author: alex.borodin@evosoft.com */ public class AttachmentDatabaseHandler { private final DatabaseConnector db; private final AttachmentContentRepository attachmentContentRepository; private final AttachmentConnector attachmentC...
<filename>src/molten.py from util.objects import * from util.utils import * from util.mechanics import * from util.tools import * from tmcp import TMCPHandler, TMCPMessage, ActionType class Molten(MoltenAgent): def solo_strat(agent): ball_location = agent.ball.location ball_to_me = ball_location -...
Reasons for Beliefs in Understanding: Applications of Non-Monotonic Dependencies to Story Processing Many of the inferences and decisions which contribute to understanding involve fallible assumptions. When these assumptions are undermined, computational models of comprehension should respond rationally. This paper cr...
import { GuildMember } from 'discord.js'; import { NoTeamUserError, NoUserError } from '../../errors'; import { CTF, TeamServer } from '../../database/models'; import { logger } from '../../log'; const guildMemberAddEvent = async (member: GuildMember) => { // user joins Team Server // * if the user does have a c...
<reponame>boost-entropy-golang/zitadel package eventstore import ( "context" "net/http" "strings" "sync" "github.com/caos/logging" "golang.org/x/text/language" admin_view "github.com/caos/zitadel/internal/admin/repository/eventsourcing/view" "github.com/caos/zitadel/internal/config/systemdefaults" v1 "githu...
<filename>src/boards/repository/board.repository.ts import { User } from 'src/auth/entity/user.entity'; import { EntityRepository, Repository } from 'typeorm'; import { Board } from '../entity/board.entity'; import { BoardDTO } from '../dto/board-dto'; import { BoardStatus } from '../board-status.enum'; @EntityReposit...
// StatusCheck returns nil if it can successfully talk to the indexer node. It // returns a non-nil error otherwise. func StatusCheck(ctx context.Context, indexerClient *indexer.Client) error { for attempts := 1; attempts < 20; attempts++ { healthCheck, err := indexerClient.HealthCheck().Do(ctx) if err == nil { ...
// DisconnectAll disconnects all the way from me down the tree. func (n *Node) DisconnectAll() { n.FuncDownMeFirst(0, nil, func(k Ki, level int, d interface{}) bool { k.Disconnect() return true }) }
// x = total no. of combinations public List<List<Integer>> combinationSum(int[] candidates, int target) { Arrays.sort(candidates); List<List<Integer>> combinations = new ArrayList<>(); traverse(candidates, combinations, new ArrayList<>(), target, 0); return combinations; }
export default function filterKeys(data: Record<string, any>, allowedKeys: Array<string>) { return Object.keys(data) .filter(key => allowedKeys.includes(key)) .reduce((obj, key) => { obj[key] = data[key]; return obj; }, {} as Record<string, any>); }
<reponame>danielmichaels/shortlinks-go-backend package templates import ( "github.com/danielmichaels/shortlink-go/ui" "html/template" "io/fs" "path/filepath" "time" ) func humanDate(t time.Time) string { if t.IsZero() { return "" } return t.UTC().Format("02 Jan 2006 at 15:04") } var functions = template.Fu...
Investigating the relationship between psychological measures of the personality type D and Blood factors fluctuations among patients ready, before and after surgery Introduction: Apart from its type and extent surgery is a severe and stressful situation for patients. Among ready surgery patients, in addition to physi...
Cyclic nucleotides and prostaglandins (PGs) produced by the rabbit oviduct: effects of estrogen treatment. Levels of cyclic AMP and cyclic GMP have been measured in oviducts of rabbits killed 68 hr after injection of human chorionic gonadotrophin (HCG) to induce ovulation. cAMP and cGMP levels were higher in the isthm...
<gh_stars>0 import unittest from reinvent_scoring.scoring.score_transformations import TransformationFactory from reinvent_scoring.scoring.enums import ComponentSpecificParametersEnum from reinvent_scoring.scoring.enums import TransformationTypeEnum, TransformationParametersEnum from unittest_reinvent.scoring_tests.sc...
/****************************** RMX SDK ******************************\ * Copyright (c) 2007 <NAME>., All rights reserved. * * * * See license.txt for more information * * ...
#include <bits/stdc++.h> using namespace std; const int Nmax = 205; pair <int, int> a[Nmax]; bool point[Nmax]; bool cal(pair <int, int> a, pair <int, int> b) { if (a.first > a.second) swap(a.first, a.second); if (b.first > b.second) swap(b.first, b.second); return (a.first <= b.first && b.fir...
A Clinical Prediction Rule for Clinical Outcomes in Patients Undergoing Surgery for Degenerative Cervical Myelopathy: Analysis of an International AOSpine Prospective Multicenter Data Set of 743 Subjects 1Division of Neurosurgery and Spinal Program, Department of Surgery, Toronto Western Hospital, University of Toront...
/** * Print out changing source dependencies on a module. In multimodule applications it should be run * by activating a single module and its dependent modules. Dependency collection will ignore * project level snapshots (sub-modules) unless the user has explicitly installed them (by only * requiring dependencyCol...
// Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 #include <cassert> #include <fstream> #include <iostream> #include "Vibex_simple_system__Syms.h" #include "ibex_pcounts.h" #include "ibex_simple_system.h" #include "ver...
def create_forseti_project(deployment_name, properties): project_id = properties.get('id', generate_project_id(deployment_name)) project_name = properties.get('name', project_id) project = { 'type': 'project.py', 'name': project_id, 'properties': { 'name': project_name, ...
Federal numbers released quietly by the Trudeau government late last month are painting a bleak picture of Canada's financial future — one filled with decades of deficits. The report, published on the Finance Department website two days before Christmas, predicts that, barring any policy changes, the federal governmen...
import { Component } from 'angular2/core'; import { Keg } from './keg.model'; import { KegDisplayComponent } from './keg.component'; import { TappedPipe } from './tapped.pipe'; import { EmptyPipe } from './empty.pipe'; import { AddKegComponent } from './add-keg.component'; @Component({ selector: 'keg-list', inputs...
#include<bits/stdc++.h> using namespace std; int n,x[300],y[300]; vector<int> edges[1005]; bool visited[1005]; void dfs(int u){ visited[u]=1; for(int v: edges[u]) if(visited[v]==0) dfs(v); } int main() { cin>>n; int ans=0; memset(visited,0,sizeof(visited)); for(int i=0; ...
<gh_stars>10-100 import {App} from 'vue'; import MPickerView from './src'; import './style'; const Plugin = MPickerView; Plugin.install = (app: App) => { app.component('MPickerView', MPickerView); }; export default Plugin;
Straddling the Line: How Female Authors are Pushing the Boundaries of Gender Representation in Japanese Shonen Manga This paper will show the ways in which authors of shōnen (boys’) manga can offer representations of gender performance that depart notably and significantly from the conventional framework which charact...
<gh_stars>1-10 package net.minecraft.client.gui; import net.minecraft.client.*; import com.google.common.collect.*; import net.minecraft.entity.player.*; import net.minecraft.client.renderer.*; import java.util.*; import net.minecraft.util.*; import org.apache.logging.log4j.*; public class GuiNewChat extends Gui { ...
export async function getSource(name: string) { return fetch(name).then(res => res.text()); } export function getRenderingContext(canvas: HTMLCanvasElement) { const gl = canvas.getContext('webgl'); if (!gl) { alert('webGL is not supported'); return null; } gl.viewport(0, 0, gl.drawingBufferWidth, gl....
/** * Return an output that report a failure without throwing an exception. This failure is not a * partial success. */ @Override public StandardSyncOutput run(final JobRunConfig jobRunConfig, final IntegrationLauncherConfig sourceLauncherConfig, ...
/** * set property send.dummy-messages to false * in cases where we want to use the rest API only and not just keep sending dummy messages over and over * * otherwise, set send.dummy-messages to true or ignore setting it altogether * * @return */ @Bean @ConditionalOnProperty(name=...
<reponame>anees4ever/FFmpegAndroid package com.github.hiteshsondhi88.libffmpeg; import android.os.AsyncTask; import com.github.hiteshsondhi88.libffmpeg.utils.AssertionHelper; import com.github.hiteshsondhi88.libffmpeg.utils.StubInputStream; import com.github.hiteshsondhi88.libffmpeg.utils.StubOutputStream; import ja...
<reponame>ivanprokopets/Aplikacja_Webowa from flask import render_template from jwt import encode from uuid import uuid4 from flask import Flask from flask import session from flask import redirect from functools import wraps import json from authlib.flask.client import OAuth from flask import url_for from six.moves.u...
// Checks that if a cert is provisioned for one label, it doesn't affect // other labels. TEST_F(CertProvisionTest, WrongLabel) { SetupProvisionState(); EXPECT_CALL(key_store_, ReadProvisionStatus(kWrongLabel, _)) .WillRepeatedly(Return(OpResult())); EXPECT_CALL(key_store_, ReadProvisionStatus(kCertLabel, _...
from email import header from flask import Flask, render_template, redirect, request, session, flash import sqlite3 import pandas as pd conn = sqlite3.connect('./database/admin_auth.db') admin_auth_data = pd.read_sql_query('SELECT * FROM admin_auth;', conn) print(admin_auth_data) app = Flask(__name__) app.secret_key...
//////////////////////////////////////////////////////////////////////////// // Module : LevelGameDef.cpp // Created : 25.12.2002 // Modified : 25.12.2002 // Author : <NAME> // Description : Interface with Level Editor //////////////////////////////////////////////////////////////////////////// #include ...
Empirical relationship between electrical resistivity and geotechnical parameters: A case study of Federal University of Technology campus, Akure SW, Nigeria For several decades, geophysical prospecting method coupled with geotechnical analysis has become increasingly useful in evaluating the subsurface for both pre a...
<reponame>navis/hive /* * 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 (th...
/// Returns a unique reference to the output at this location, panicking if out of bounds. fn index_mut<'a>(&self, vec: &'a mut PuiVec<T, I>) -> &'a mut Self::Output { if self.contained_in(vec) { unsafe { self.get_unchecked_mut(vec) } } else { index_fail() } }
def bin_bblock (widths, counts, p0=0.05): widths = np.asarray (widths) counts = np.asarray (counts) ncells = widths.size origp0 = p0 if np.any (widths <= 0): raise ValueError ('bin widths must be positive') if widths.size != counts.size: raise ValueError ('widths and counts must ...
<gh_stars>1-10 package goetty import ( "testing" "time" ) var ( baseCode = &StringCodec{} serverAddr = "127.0.0.1:11111" decoder = NewIntLengthFieldBasedDecoder(baseCode) encoder = NewIntLengthFieldBasedEncoder(baseCode) ) func TestServerStart(t *testing.T) { server := NewServer(serverA...
// assertState is an example of a state assertion in a test func assertState(t *testing.T, i, j int) { if i != j { t.Fatalf("i %d, j %d", i, j) } }
import random import pygame import assets class Snake: class Body: def __init__(self, x, y, d, c, v, limx, limy, p=None, n=None): self.x = x self.y = y self.direction = d self.prev = p self.next = n self.color = c self.vel...
<filename>hackathon/PengXie/tip_signal/utilities.h #ifndef UTILITIES_H #define UTILITIES_H #endif // UTILITIES_H #include "v3d_interface.h" #include "my_surf_objs.h" #include "filter_dialog.h" #include "math.h" #include "v3d_basicdatatype.h" #include "ImgProcessor.h" #include "bits/stdc++.h" #include "iostream" #incl...
<filename>pkg/client/workq.go package client import ( "time" workq "github.com/iamduo/go-workq" uuid "github.com/satori/go.uuid" ) type Job struct { UUID string Name string } func AddJob(name string, payload []byte, ttr, ttl time.Duration) (*Job, error) { jobClient, _, _, err := GetAll() if err != nil { re...
/* Copyright (c) 2014, 2020, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is also distributed with certain software (including...
Fast training of multilayer perceptrons Training a multilayer perceptron by an error backpropagation algorithm is slow and uncertain. This paper describes a new approach which is much faster and certain than error backpropagation. The proposed approach is based on combined iterative and direct solution methods. In thi...
def rep_mul(self, row_replaced, other_row, k_rep, k_other): new_matrix = Matrix(*self.lists[:]) new_matrix.lists[row_replaced] = [x + y for x, y in zip(self.scale_row(row_replaced, k_rep).n_row(row_replaced), self.scale_row(other_row, k_oth...
#include<iostream> #include<cstdio> #include<vector> #include<algorithm> #include<stack> #include<map> #define maxm 500005 using namespace std; map<char, int> vowel; long long a[maxm], ca[maxm], b[maxm], cb[maxm]; long long qya(int i, long long j) { if(i > j)return 0; return (ca[j] - ca[i-1])...
The Occupy Wall Street movement made its way to the roads of Los Angeles Saturday as protesters marched on City Hall. The crowd gathered at around 10 a.m. at Pershing Square, then marched up Broadway to the north lawn of City Hall. The crowd gathered on the west steps of L.A. City Hall, until it surged and spilled in...
Giancarlo Stanton hit a homer completely out of AT&T Park during batting practice It had been a few days since he last homered, and rather than run the risk of the world forgetting his particular ability to transmit baseballs across vast distances of land, Giancarlo Stanton did this during batting practice ahead of Su...
#include<cstring> #include<cstdio> #include<string> #include<iostream> #include<cstdlib> #include<cmath> #include<algorithm> #include<vector> #include<queue> using namespace std; #define ll long long #define pf printf #define sf scanf #define Fill(a,b) memset(a,b,sizeof(a)) const int N = 1e5 + 6; struct ...
export const type: ReadonlyArray<any> = [ 'material', 'pattern', 'printing', 'detail', 'sizeAndNum', 'totalNum', 'price', 'total', 'address', 'seller', 'express', 'remark', 'sendTime', 'company' ]; export const chineseType: ReadonlyArray<any> = [ '面料', '纸样', '印花', '车衣', '尺码', '数量...
from sys import stdin from collections import defaultdict def get_hits(hp, mx_strike, ef_strike): if mx_strike >= hp: return (1) if ef_strike == 0: return -1 strike_hp = (hp - mx_strike) ans = strike_hp // ef_strike if strike_hp % ef_strike: ans += 1 return ans + 1 t = int...
#include <iostream> #include <sstream> /** * Macros for logging information, warnings, and errors. * * The intermediate stringstream reduces the chances of threads interfering with each other's output. */ #define LOG_CLASS "Global" #define LOG_INFO(x) { std::stringstream strm; strm << "I (" LOG_CLASS ") : " <<...
/** * This is a utility class that provides the cryptographic operations we * might want to do on text strings. Used mainly by Encryptor instances. */ public class Crypto { private static final String TAG = Crypto.class.getSimpleName(); private static final String CIPHER_ALGORITHM = "AES/CBC/PKCS5Padding"; ...
<gh_stars>0 export const addLove = (userId: string, loveLevel: number) => window.Repository.setLove(userId, calculateLove(userId, loveLevel)); export const removeLove = (userId: string, loveLevel: number) => window.Repository.setLove(userId, calculateHate(userId, loveLevel)); export const getLove = (userId: strin...
/** * The Tokenizer class suggests a methods to break a text into tokens using * occurrences of a pattern as delimiters. * There are two ways to obtain a text tokenizer for some pattern:<pre> * Pattern p=new Pattern("\\s+"); //any number of space characters * String text="blah blah blah"; * //by factory method *...
/** * @brief Decode a bsvt_remote_control_turret_2 message into a struct * * @param msg The message to decode * @param bsvt_remote_control_turret_2 C-struct to decode the message contents into */ static inline void mavlink_msg_bsvt_remote_control_turret_2_decode(const mavlink_message_t* msg, mavlink_bsvt_remote_co...
/** Renders the item with hotbar animations. * OpenGL side-effects: disables depth and item ligthing. */ public static void renderHotbarItem(Rect bounds, ItemStack stack, float partialTicks) { if(stack.isEmpty()) return; float animationTicks = stack.getAnimationsToGo() - partialTicks; ...
/// Removes members from the group /// /// Members are removed by providing the index of their leaf in the tree. /// /// If successful, it returns a tuple of [`MlsMessageOut`] and an optional [`Welcome`]. /// The [Welcome] is [Some] when the queue of pending proposals contained add proposals /// /// Returns an error if...
#coding: utf-8 arr = raw_input() num = arr.split() sum = 0 ar = [] for x in num: ar.append(int(x)) sum += int(x) maxx = 0 dic = {} for x in ar: dic[x] = 0 for x in ar: dic[x]+=1 maxx = 0 for x in ar: if dic[x] == 2: maxx = max(x*2,maxx) elif dic[x] >=3: maxx = ...
package design import ( "bufio" "bytes" "encoding/json" "fmt" "io/ioutil" "os" "path/filepath" "strings" "testing" "github.com/ghodss/yaml" "github.com/stretchr/testify/require" "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" "k8s.i...
import Criterion.Main import qualified Data.Reflection as Old import qualified Data.NewReflection as New old :: [Int] -> [Int] old = map (\x -> Old.reify x Old.reflect) new :: [Int] -> [Int] new = map (\x -> New.reify x New.reflect) main :: IO () main = defaultMain [ bench "old" $ nf old [1..100000] , bench...
<reponame>splhack/OpenCue # Copyright Contributors to the OpenCue Project # # 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 req...
<reponame>1690296356/jdk /* * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as ...
/** * Comfortable object to create {@link LabelsPlugin#ID} plugin LABEL options by a builder. * * @author Andrea "Stock" Stocchero * */ public final class LabelBuilder { // options builder instance // parent of this builder private LabelsOptionsBuilder builder; // plugin label options instance pr...
/// Part 1 /// Finds the initial velocity that causes the proab to reach the highest y position /// and still eventually be within the target area after any step fn find_best_velocity(target: &(Range<i32>, Range<i32>)) -> Option<((i32, i32), i32)> { (0..100) .flat_map(|x| (-100..300).map(move |y| (x, y))) ...
import React, { useState, useEffect } from "react"; import { Card, Button, Image, Spinner } from "react-bootstrap"; import { useSelector, useDispatch, RootStateOrAny } from "react-redux"; import { useHistory } from "react-router-dom"; import { productsDataActions } from "../store/slices/productsData"; import { MdKeybo...
/** * Releases the resources of created by this instance. */ public void releaseResources() { if (classPool != null) { for (ClassPath cp : classPaths) classPool.removeClassPath(cp); classPaths.clear(); } }
/** * SQL ALTER DATABASE command: Changes an attribute of the current database. * * @author Luca Garulli (l.garulli--(at)--orientdb.com) */ @SuppressWarnings("unchecked") public class OCommandExecutorSQLOptimizeDatabase extends OCommandExecutorSQLAbstract implements OCommandDistributedReplicateRequest { publi...
import { Pipe, PipeTransform } from '@angular/core'; import { FirebaseService } from './firebase.service'; /** * Take a firebase key and do another lookup * Returns an observable of the object referred to by the key * * example template expression: * {{ (community | fireJoin:'/communities/' | async)?.name }} */...
<reponame>pinguet62/vue-feature-flipping import {createRouter, createWebHistory, Router} from 'vue-router' import FeatureFlipping, {setEnabledFeatures} from '../src' import {mount} from "@vue/test-utils"; // TODO https://github.com/vuejs/vue-router-next/issues/454 describe.skip('guard', () => { let router: Router ...
<reponame>Arc-blroth/Hammeregg //! Hammeregg's "backend" code, which handles //! setting up the computer the backend runs //! on for remote access. #![feature(try_blocks)] #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] pub mod input; pub mod key; pub mod net; pub mod pion; pub mod stream; pub mod ...
package kaaes.spotify.webapi.android.models; public class SnapshotId { public String snapshot_id; }
/// Run the stack. This should be called AFTER registering listener of the ChainWatchInterface, /// so they are called as the stack catches up with the blockchain /// * peers - connect to these peers at startup (might be empty) /// * min_connections - keep connections with at least this number of peers. Peers will be r...
#include<stdio.h> #include<math.h> long long int fact(long long int n) { long long int i,val=1; for(i=2;i<=n;i++) val*=i; return val; } long long int factorial(long long int a, long long int b) { return fact(a)/(fact(b)*fact(a-b)); } int main() { long long int c,plusrec=...
package cmd import ( "github.com/bavix/dius/internal/du" "github.com/spf13/cobra" "os" ) var rootCmd = &cobra.Command{ Use: "dius [PATH]", Short: "Fast calculation of folder/file sizes. Alternative `du -h -d 1`", Long: `The command is a replacement for the "du" command for huge volumes. Speed is achieved usin...
/** * Perform sync of plugin data with EC2 Spot Fleet state. * * @return current state */ public FleetStateStats update() { fine("start cloud %s", this); FleetStateStats currentState = EC2Fleets.get(fleet).getState( getAwsCredentialsId(), region, endpoint, getFleet())...
/// Find the end of an unquoted string in an SQL array. /** Assumes UTF-8 or an ASCII-superset single-byte encoding. */ const char *scan_unquoted_string(const char begin[]) { assert(*begin != '\''); assert(*begin != '"'); const char *p; for (p = begin; *p != ',' && *p != ';' && *p != '}'; p++) ...
def add_queue(project, length, type="normal", profile=None): return Queue.objects.create( length=length, project=project, profile=profile, type=type )
/** * Initialize the Server instance. * * @param props The configuration properties for the server. * * @throws IllegalStateException Already initialized. * @throws Exception Failed to initialize. */ public void init(final Properties props) throws IllegalStateException,...
def learn(self, experiences, GAMMA): states, actions, rewards, next_states, dones = experiences targets = self.target_network(next_states).detach().max(1)[0] targets = rewards + (GAMMA * targets * (1-dones)) chosen_actions = self.learning_network(states).gather(1, actions) loss =...
def load_model(savedir, compile = False): args = Args.load(savedir = savedir) model = keras.models.load_model( "%s/model.h5" % (savedir), compile = compile ) return (args, model)
<filename>src/components/FileIcon/InkFileIcon.tsx<gh_stars>0 import React from 'react' export const InkFileIcon = ({ className }: { className?: string }): React.ReactElement => { return ( <svg xmlns='http://www.w3.org/2000/svg' width='17.56mm' height='21.07mm' viewBox='0 0 49.77 59.72' className={className}> ...
// Bootstrap creates the first Region. The Stores should be in the Cluster before // bootstrap. func (c *Cluster) Bootstrap(regionID uint64, storeIDs, peerIDs []uint64, leaderPeerID uint64) { c.Lock() defer c.Unlock() if len(storeIDs) != len(peerIDs) { panic("len(storeIDs) != len(peerIDs)") } c.regions[regionID]...
/** * Wrap an unweighted aggregation as a weighted one (disregarding all weights) * * @author Soren A. Davidsen <sorend@gmail.com> */ public class AsWeightedAggregation implements WeightedAggregation { public static AsWeightedAggregation asWeighted(Aggregation inner) { return new AsWeightedAggregation(...
<reponame>jglrxavpok/SBM package org.jglr.sbm.sampler; public enum Sampling { /** * Only known at runtime, not compile time */ KNOWN_AT_RUNTIME, WITH_SAMPLER, /** * Used for storage images */ NO_SAMPLER }
def receiver(self): while True: data = self.serial.read(size=1) rx_byte = ord(data[0]) if random() < self.error_rate: if random() < 0.5: print "Dropping RX on wire" + '0x{:02x}'.format(rx_byte) else: new_...
http://tvtropes.org/pmwiki/pmwiki.php/Main/ViralMarketing This entry is trivia, which is cool and all, but not a trope. On a work, it goes on the Trivia tab. Cracked, " , " 5 Common Anti-Internet Arguments (That Are Statistically BS) "When done right, the Internet can break down that barrier between the creators and ...
def hideTitleBar(self): self.label.hide() self.labelHidden = True if 'center' in self.allowedAreas: self.allowedAreas.remove('center') self.updateStyle()
“Drive My Google Car” “Ticket to ‘Hamilton’ ” “ 👩 😍 U, 👍 👍 👍 ” “She’s Leaving Home to Go Backpacking for a Semester” “In My Wife!” “Do You Want to Know a Secret? Click Here” “I Am the Wall Street Lobbyist” “While My Video Slowly Buffers” “Honestly? Honey Don’t” “And Your Bird Can Oppa Gangnam Style” “Fly...
use crate::syntax::*; use crate::*; #[derive(Clone)] pub struct ModuleCell { pub tree: Arc<Tree>, pub source: Arc<Source>, pub diagnostics: Vec<Diagnostic>, } impl ModuleCell { pub fn new(source: Arc<Source>) -> ModuleCell { let (tree, diagnostics) = Parser::new(source.clone()).parse(); ...
def process_command(self, event) -> None: command = event.command LOGGER.info("RemoveCommands._process_command: %s", json.dumps(command)) { "set_grid": True } Then we would call self.set_grid(True) for name, args in command.items(): try: method =...
def _validate_credentials(self): if self.pushover.api_key is not None: self._validate_pushover() if self.pushbullet.token is not None: self._validate_pushbullet()