Skip to content

Instantly share code, notes, and snippets.

View GuillaumeLeclerc's full-sized avatar
🤡

Guillaume Leclerc GuillaumeLeclerc

🤡
  • Cambridge, MA, USA
View GitHub Profile
from typing import Any
from pytorch_lightning.utilities.fetching import AbstractDataFetcher
from pytorch_lightning.utilities.model_helpers import is_overridden
from pytorch_lightning.utilities.signature_utils import is_param_in_hook_signature
def on_run_start(self, data_fetcher: AbstractDataFetcher, **kwargs: Any) -> None:
self.trainer.logger_connector.on_epoch_start()
self.trainer.call_hook("on_epoch_start")
self.trainer.call_hook("on_train_epoch_start")
<?php $nbPlayer = 4;
$nbDice = 6;
$scores = array_fill(0, $nbPlayer, $nbDice);
$return = "\n";
for($round = 1; count(array_filter($scores, function($score) { return $score == 0 ;})) == 0; $round++) {
echo $return,"Round ",$round,$return,$return;
$dices = array_map(function($score) {
return array_map(function($i) {
return mt_rand(0,6);
}, array_fill(0, $score, 0));
bool fixed_is_directory(std::string path) {
boost::system::error_code errorCode;
bool result = boost::filesystem::is_directory(path, errorCode);
if (errorCode.value() == 2) {//not found
return false;
} else if (errorCode.value() != 0) {
//this second call will fire the correct exception
boost::filesystem::is_directory(path);
} else {
return result;
bool fixed_is_directory(std::string path) {
boost::system::error_code errorCode;
bool result = boost::filesystem::is_directory(path, errorCode);
if (errorCode.value() != 0) {
//this second call will fire the correct exception
boost::filesystem::is_directory(path);
} else {
return result;
}
}
var async = require("async");
var cheerio = require("cheerio");
var request = require("request");
var uri = require("uri-js");
var _ = require("lodash");
var fs = require("fs");
var done = {};
var toSave = [ "image", "application", "audio", "video" ];
var toParse = [ "text/html" ];
var output = "./out.data";