text
stringlengths
1
1.05M
<filename>src/utils.js<gh_stars>0 import { connect, Contract, keyStores, WalletConnection } from 'near-api-js' import getConfig from './config' const nearConfig = getConfig('testnet') //const nearConfig = getConfig(process.env.NODE_ENV || 'development') console.log(nearConfig) // Initialize contract & set global var...
#!/bin/bash python3 app.py export GIT_SSH_COMMAND="ssh -i `pwd`/.ssh/id_rsa" cp ${HOME}/growlab/app/html/* ${HOME}/growlab/docs/ git add .. git commit -s -m "Update images at `date`" git pull origin master --rebase git push origin master
#!/usr/bin/env bats @test "git binary found in PATH" { run which git [ "$status" -eq 0 ] }
import threading _SparseOperationKitEmbeddingLayerStoreKey = "SparseOperationKitEmbeddingLayerStore" class _EmbeddingLayerStore(threading.local): def __init__(self): super(_EmbeddingLayerStore, self).__init__() self._embedding_layer_container = dict() def _create_embedding(self, name, constru...
<gh_stars>0 package org.hiro; import org.hiro.character.Player; import org.hiro.input.InputDevice; import org.hiro.input.KeyboardDevice; import org.hiro.map.Dungeon; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class Game { private static final Game i...
# Copyright 2016 OCLC # # 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, software # ...
<filename>pkg/library/service.go package library import ( "fmt" "github.com/liampulles/banger/pkg/file" ) type Service interface { PipeAllTracks() ([]Track, error) } type ServiceImpl struct { rootPath string } var _ Service = &ServiceImpl{} func NewService(rootPath string) *ServiceImpl { return &ServiceImpl{...
<reponame>ritaswc/wechat_app_template function setOnShowScene(t) { getApp().onShowData || (getApp().onShowData = {}), getApp().onShowData.scene = t; } Page({ data: { list: "" }, onLoad: function(t) { getApp().page.onLoad(this, t); var e = this; e.setData({ my...
#!/bin/sh set -e set -u set -o pipefail function on_error { echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" } trap 'on_error $LINENO' ERR if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy # frameworks to, so exit 0 (signalling the...
#!/bin/sh set -e set -u set -o pipefail if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy # frameworks to, so exit 0 (signalling the script phase was successful). exit 0 fi echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_P...
#!/bin/bash # # runs benchmark and reports time to convergence # to use the script: # run_and_time_multi.sh set -x source ./config_${DGXSYSTEM}.sh #source ./config_2xDSS8440x8A100-PCIE-40GB.sh #echo "DGXSYSTEM=${DGXSYSTEM}" # start timing start=$(date +%s) start_fmt=$(date +%Y-%m-%d\ %r) echo "STARTING TIMING RUN A...
#!/bin/bash ./bin/pong
package Algorithms.Other /** * Created by MikBac on 04.09.2020 */ object MatrixTransposition { def transposition(matrix: Array[Array[Int]]): Array[Array[Int]] = { var ans: Array[Array[Int]] = Array.fill(matrix(0).length) { Array.fill(matrix.length) { 0 } } for (i <- matrix(0).indic...
/*********************************************************************************************************************** * OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved. * * Redistribution and use in source and binary forms, with or without m...
import React, { useState } from 'react'; const CharacterCounter = () => { const [text, setText] = useState(''); return ( <div> <input type="text" onChange={e => setText(e.target.value)} /> <p>Number of characters: {text.length}</p> </div> ); }; export default CharacterCounter;
#!/bin/bash # setup all Dependencies sudo apt-get update sudo apt-get upgrade -y sudo apt-get install -y build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3 libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libboost-...
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" matrix_size = len(alphabet) col, row = 0, 0 matrix = [[0 for col in range(matrix_size)] for row in range(matrix_size)] for char in alphabet: matrix[row][col] = char col +=1 if(col == matrix_size): col = 0 row += 1 for row in range(matr...
SELECT product, MAX(units_sold) FROM sales_table GROUP BY product;
<reponame>linc01n/rapi_doc # encoding: utf-8 require 'method_doc' require 'doc_parser' module RapiDoc # ResourceDoc holds the information a resource contains. It parses the class header and also the # method documentation, which will be contained in MethodDoc. class ResourceDoc attr_reader :name, :reso...
/home/fractal/protobuf/src/protoc --cpp_out=. user.proto
#!/bin/bash # ch6/ebpf_stacktrace_eg/runit.sh # *************************************************************** # * This program is part of the source code released for the book # * "Linux Kernel Programming" # * (c) Author: Kaiwan N Billimoria # * Publisher: Packt # * GitHub repository: # * https://github.com/Pa...
#!/bin/bash sbt -java-home /opt/zing/zing-jdk11 -no-colors -Dsbt.supershell=false -Dmacro.settings=print-codecs clean 'jsoniter-scala-benchmark/jmh:run -p size=128 -prof gc -rf json -rff zingjdk11.json .*' 2>&1 | tee zingjdk11.txt sbt -java-home /usr/lib/jvm/graalvm-ee-19 -no-colors -Dsbt.supershell=false -Dmacro.setti...
<gh_stars>0 import { GetterTree } from 'vuex'; import { RootState } from './types'; const suffix = '.json'; const prefix = './covid-19-gr-'; const getters: GetterTree<RootState, any> = { files(state: RootState): string[] { const results: string[] = []; for (const file in state.data) { results.push...
var vows = require('vows'), assert = require('assert'), dissoc = require('../src/dissoc'); vows.describe('dissoc()').addBatch({ 'Dissociating': { topic: function() { return { foo: 1, bar: 'baz' }; }, 'a property results in a new object where all other properties are th...
<reponame>minyong-jeong/hello-algorithm import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); for (int i = 0; i < n; i++) { int total = scan.nextInt(); int[] score = new int[total]; int ...
#!/bin/bash # # Copyright 2019 The TCMalloc 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
CURRENT_DIR=`pwd` export MODEL_DIR=$CURRENT_DIR/pretrained_models/bert-base export DATA_DIR=$CURRENT_DIR/dataset export OUTPUR_DIR=$CURRENT_DIR/outputs export TASK_NAME=epidemic # ------------------ save every epoch -------------- python task_triple_similarity_epidemic.py \ --model_type=bert \ --model_path=$MODEL_...
// Define a generic interface for the entity types interface Entity<T> { T getType(); } // Define the Single entity class class Single<T> implements Entity<T> { private T type; public Single(T type) { this.type = type; } public T getType() { return type; } } // Define the Mul...
// Define the Storage trait pub trait Storage { fn get(&self, key: &str) -> Option<String>; fn set(&mut self, key: &str, value: &str) -> Result<(), String>; } // Implement the Storage trait for in-memory hash map storage pub struct HashMapStorage { data: std::collections::HashMap<String, String>, } impl H...
import "typings-global"; export import browserify = require("./gulpbrowser.browserify");
<gh_stars>0 package com.yin.springboot.user.center.server; import java.util.List; import com.yin.springboot.user.center.domain.TbUserRole; public interface TbUserRoleService { int updateBatch(List<TbUserRole> list); int batchInsert(List<TbUserRole> list); int insertOrUpdate(TbUserRole record); in...
#!/bin/bash set -e set -o pipefail umask 0002 #### SET THE STAGE SCRATCH_DIR=/scratch/BWA_Reseq_low_051_100_on_A_2020-03-16--07-41-41_91_temp$$ GSTORE_DIR=/srv/gstore/projects INPUT_DATASET=/srv/gstore/projects/p1634/BWA_Reseq_low_051_100_on_A_2020-03-16--07-41-41/input_dataset.tsv LAST_JOB=FALSE echo "Job runs on `h...
#!/bin/bash # system-stats/system-stats-1.sh 3.75.189 2018-08-12_21:26:10_CDT https://github.com/BradleyA/pi-display uadmin three-rpi3b.cptx86.com 3.74 # sync to standard script design changes # system-stats/system-stats-1.sh 2.8.47 2018-02-28_12:46:40_CST https://github.com/BradleyA/pi-display uadmin...
<reponame>nepoche/webb.js<filename>packages/api-providers/src/utils/relayer-utils.ts // Copyright 2022 @nepoche/ // SPDX-License-Identifier: Apache-2.0 import { InternalChainId } from '../chains/index.js'; export function relayerSubstrateNameToChainId (name: string): InternalChainId { switch (name) { case 'loca...
# The script must be sourced by install_MLiy.sh # Copyright 2017 MLiy Contributors # 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...
import { Firewall } from "./firewall"; import { Snapshot } from "./snapshot"; export class Qemu { firewall: Firewall; snapshot: Snapshot; getStatus(node, qemu) get(node, qemu) del(node, qemu) getStatusCurrent(node, qemu) start(node, qemu) stop(node, qemu) reset(node, qemu) shutd...
import {url} from "../util/utils" import {parseContentType} from "./contentType" import {Enhancer, ZealotPayload, ZReponse} from "../types" import {createIterator} from "./iterator" import {createStream} from "./stream" import {createError} from "../util/error" import {createPushableIterator} from "./pushable_iterator"...
<reponame>dragondjf/QMarkdowner #!/usr/bin/env python # -*- coding: utf-8 -*- import socket import pkg import logging logger = logging.getLogger(__name__) def deal_pkg(dc_ip, raw, ver=2): header, body = pkg.unpack(raw, ver) back = {} if header.cmd == pkg.GET_SAMPLING_CTRL_RSP: back = body.apply_t...
sudo apt-get update sudo apt-get install -y nginx sudo apt-get install -y default-jdk sudo apt-get install -y maven sudo ufw allow 'Nginx Full' sudo ufw --force enable sudo systemctl reload nginx curl https://www.shiftleft.io/download/sl-latest-linux-x64.tar.gz > /tmp/sl.tar.gz && sudo tar -C /usr/local/bin -xzf /tmp/s...
#!/bin/bash SERVICE_ACCOUNT=$1 PROJECT_ID=$2 KEY_NAME=$SERVICE_ACCOUNT-key.json gcloud iam service-accounts create $SERVICE_ACCOUNT gcloud projects add-iam-policy-binding $PROJECT_ID \ --member "serviceAccount:$SERVICE_ACCOUNT@$PROJECT_ID.iam.gserviceaccount.com" --role "roles/owner" gcloud iam service-accounts k...
def mean_absolute_difference(list1, list2): differences = [] for i, e in enumerate(list1): differences.append(abs(list1[i] - list2[i])) return sum(differences) / len(differences)
import React, { useEffect, useState } from 'react'; import PropTypes from 'prop-types'; import { makeStyles } from '@material-ui/core/styles'; import { connect } from 'react-redux'; import { addComment } from 'actions/post'; import { getCurrentProfile } from 'actions/profile'; import GridContainer from 'components/Gri...
SELECT COUNT(*) FROM Articles WHERE Tags LIKE '%music%' OR Tags LIKE '%gaming%'
<gh_stars>0 package com.profiling.ui; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import com.profiling.model.StackTraceNode; public class TreeReportBuilder { private static final String TITLE = "Application Stack"; private static final String HTML_FILENAME = "tree-stack.html...
import {createStore, combineReducers, applyMiddleware} from 'redux' import thunkMiddleware from 'redux-thunk' import {composeWithDevTools} from 'redux-devtools-extension' import {default as userState} from './user' import {default as transState} from './transactions' const reducer = combineReducers({userState, transSt...
// Define the Reddit post class class RedditPost { var media: Media var mediaEmbed: MediaEmbed var userReports: [Any] var secureMedia: Any? var reportReasons: [Any] var modReports: [Any] var secureMediaEmbed: Any? // Initialize the properties from a JSON dictionary init(json: [S...
#!/bin/bash export ANDROID_NDK=/home/usr/android-ndk-r16b cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \ -DANDROID_ABI="arm64-v8a" \ -DANDROID_PLATFORM=android-21 \ -DANDROID_STL=c++_shared \ -DTENGINE_DIR=/home/usr/tengine \ -DOpenCV_DIR=/home/usr/opencv/sdk/...
from django import forms from django.core.exceptions import ValidationError from cyder.models import Ctnr from cyder.cydns.address_record.models import AddressRecord from cyder.cydns.view.models import View from cyder.cydns.forms import DNSForm from cyder.cydns.nameserver.models import Nameserver from cyder.cydhcp.int...
<filename>examples/timeout/main.go package main import ( "fmt" "gitlab.com/jonas.jasas/condchan" "sync" "time" ) func main() { fmt.Println("Timeout example") cc := condchan.New(&sync.Mutex{}) timeoutChan := time.After(time.Second) cc.L.Lock() // Passing func that gets channel c that signals when // Signal ...
#include "PluginProcessor.h" static constexpr float twopi = 6.2831853f; MDATestToneAudioProcessor::MDATestToneAudioProcessor() : AudioProcessor(BusesProperties() .withInput ("Input", juce::AudioChannelSet::stereo(), true) .withOutput("Output", juce::AudioChannelSet::ste...
<gh_stars>0 module SVGAbstract class Transformation def initialize @transforms = [] end def to_s @transforms.join(' ') end #Meta-program the transformation methods transformations = [:rotate, :translate, :scale, :matrix, :skewX, :skewY] transformations.each do |t| define_method(t) do |*t_a...
<reponame>TJHello/BillingEasy package com.tjhello.lib.billing.base.anno; import androidx.annotation.StringDef; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Doc...
createcertificatesForOrg1() { echo echo "Enroll the CA admin" echo mkdir -p crypto-config-ca/peerOrganizations/org1.example.com/ export FABRIC_CA_CLIENT_HOME=${PWD}/crypto-config-ca/peerOrganizations/org1.example.com/ fabric-ca-client enroll -u https://admin:adminpw@localhost:7054 --caname ca.org1.exam...
#!/bin/bash . ./build_config.sh # Retrieve the AMI id for Amazon Linux ami_id=$(ec2-describe-images -o amazon --region us-west-1 -F "architecture=x86_64" -F "block-device-mapping.volume-type=gp2" -F "image-type=machine" -F "root-device-type=ebs" -F "virtualization-type=hvm" -F "name=amzn-ami-hvm-2015.03.0*" | grep "...
#!/bin/bash ### # bootstrap.sh # # configuration variables ### USE_APACHE=true # PHP stuff USE_PHP=true USE_COMPOSER=true COMPOSER_AUTO=false USE_PHPUNIT=true # Database stuff USE_MYSQL=true USE_PHPMYADMIN=true DB_HOST=localhost DB_NAME=projectdb DB_USER=root DB_PASSWD=root MYSQL_IMPORT=true #Git stuff USE_GIT=tru...
#### #Copyright (c) Facebook, Inc. and its affiliates. # #This source code is licensed under the MIT license found in the #LICENSE file in the root directory of this source tree. # #!/usr/bin/env bash # Goal : # - Select the datset for minimality experiments. Test when bob not using joint. experiment="QminimalityDat...
'use strict'; // Dependencies require('dotenv').config(); const express = require('express'); const cors = require('cors'); const pg = require('pg'); // Modules const Location = require('./modules/locations'); const Weather = require('./modules/weather'); const Yelp = require('./modules/yelp'); const Event = require(...
<filename>src/actions/Types.js export const SET_ALERTS = 'SET_ALERTS' export const PUSH_ALERT = 'PUSH_ALERT' export const REMOVE_ALERT = 'REMOVE_ALERT' export const SET_NICKNAME = 'SET_NICKNAME'
<reponame>nathaniel83/loopback-connector-firebase<filename>index.js /** * Created with JetBrains WebStorm. * User: kamol * Date: 3/19/15 * Time: 2:30 PM * To change this template use File | Settings | File Templates. */ module.exports = require('./lib/index');
cur_dir=$(cd "$(dirname "$0")"; pwd) parent_dir=$(dirname $(pwd)) cd ${parent_dir}/deps/libressl/ ./build.sh
#!/usr/bin/env bash set -ex HOME=/home/vagrant # Create working dir & set permissions mkdir -p /code chown -R vagrant:vagrant /code # Install Node.js (v6) and common global libs curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - apt-get install -y nodejs npm install -g mocha \ istanbul \ babel-cli \ ...
<filename>packages/react-form/tests/testHelpers.tsx import { ReactElement } from 'react'; import renderer from 'react-test-renderer'; import { Field, TextType, TextAreaType, SelectType, CheckType, NumberType, } from '../src/utils/fieldTypes'; export const matchSnapshot = (component: ReactElement): void => ...
<filename>sources/include/nx/nx/headers.hpp #ifndef __NX_HEADERS_H__ #define __NX_HEADERS_H__ #include <string> #include <nx/config.h> #include <nx/attributes.hpp> namespace nx { const std::string Content_Type = "Content-Type"; const std::string content_type = "content-type"; const std::string Content_Length = "Con...
<reponame>kampka/gsctl package login import ( "fmt" "github.com/fatih/color" "github.com/giantswarm/gscliauth/config" "github.com/giantswarm/microerror" "github.com/giantswarm/gsctl/client" ) // loginGiantSwarm executes the authentication logic. // If the user was logged in before, a logout is performed first....
#!/bin/bash nvoptix_dir="$(dirname "$(readlink -fm "$0")")/lib64/wine" wine='wine64' if [ ! -f "$nvoptix_dir/x86_64-unix/nvoptix.dll.so" ]; then echo "nvoptix.dll.so not found in $nvoptix_dir/x86_64-unix" >&2 exit 1 fi winever=$($wine --version | grep wine) if [ -z "$winever" ]; then echo "$wine: Not a ...
# Import necessary modules from django.contrib import admin from .models import YourModel # Define the custom display function class YourModelAdmin(admin.ModelAdmin): list_display = ( "uuid", "url", "display_current_retries", "last_try", "comment", "status", ) ...
import { Component, Inject, OnInit } from '@angular/core'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MiscellanousService } from '../../services/miscellanous.service'; import { AngularFirestore } from '@angular/fire/firestore'; import { AngularFireStorage } from '@angular/fire/st...
package io.smallrye.mutiny.operators; import static io.smallrye.mutiny.helpers.ParameterValidation.MAPPER_RETURNED_NULL; import static io.smallrye.mutiny.helpers.ParameterValidation.nonNull; import java.util.function.Function; import java.util.function.Predicate; import org.reactivestreams.Publisher; import org.reac...
#ifndef STRF_DETAIL_PRINTERS_TUPLE_HPP #define STRF_DETAIL_PRINTERS_TUPLE_HPP // Copyright (C) (See commit logs on github.com/robhz786/strf) // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include <strf/pr...
#!/bin/bash set -e DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" source ${DIR}/../../scripts/utils.sh JIRA_URL=${JIRA_URL:-$1} JIRA_USERNAME=${JIRA_USERNAME:-$2} JIRA_API_TOKEN=${JIRA_API_TOKEN:-$3} if [ -z "$JIRA_URL" ] then logerror "JIRA_URL is not set. Export it as environment variable ...
<reponame>skylark-integration/skylark-browserfs define([ "skylark-langx-ns", '../libs/process', '../libs/buffers', './node_fs', '../libs/path', '../generic/emscripten_fs', './backends', './util', './api_error', '../generic/setImmediate' ], function (skylark,process,buffers, fs, p...
<filename>src/distinct.ts import Sequence, {createSequence} from "./Sequence"; class DistinctIterator<T> implements Iterator<T> { private set: Set<T> = new Set(); constructor(private readonly iterator: Iterator<T>) { } next(value?: any): IteratorResult<T> { for (let item = this.iterator.next(...
#!/usr/bin/env bash # CannabisKash Multi-installer # a one line clone-and-compile for cannabiskashgold: # # ` $ curl -sL "https://raw.githubusercontent.com/chronickash/cannabiskash/master/scripts/multi_installer.sh" | bash # # Supports Ubuntu 16.04 LTS, OSX 10.10+ # Supports building project from current directory...
<reponame>MaartenBaert/ssr-packages /* Copyright (c) 2012-2017 <NAME> <<EMAIL>> This file is part of SimpleScreenRecorder. SimpleScreenRecorder is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of...
import { ICellRendererComp } from '../rendering/cellRenderers/iCellRenderer'; import { AgPromise } from './promise'; import { loadTemplate } from './dom'; import { camelCaseToHyphen } from './string'; import { iterateObject } from './object'; /** @deprecated */ export function getNameOfClass(theClass: any) { const...
dotnet new mauilib -o ./src/CommunityToolkit/Xamarin.CommunityToolkit.MauiCompat -n Xamarin.CommunityToolkit.MauiCompat dotnet new mauilib -o ./src/Markup/Xamarin.CommunityToolkit.Markup.MauiCompat -n Xamarin.CommunityToolkit.Markup.MauiCompat dotnet new sln -o ./src/CommunityToolkit/ -n Xamarin.CommunityToolkit.MauiC...
#!/bin/bash dataset=histopathology data_dir=$HOME/data/sip sampling_steps=40 sampler=mscorrect-3 save_dir=$HOME/results/$sampler/$dataset-s-$sampling_steps if [ ! -e $save_dir ]; then mkdir -p $save_dir fi export CUDA_VISIBLE_DEVICES=3 python -m SIP.debm.experiment.main_categorical_ebm \ --data_dir $data_...
import sys def create_dynamic_class(name, attributes, python_version): if python_version == 2: name = str(name) # Convert name to byte string for Python 2 return type(name, (), attributes) # Test the function attributes = {'name': 'John', 'age': 30} new_class = create_dynamic_class('Person', attribut...
package prjTabDez; public class TabDez { public static void main(String[] args) { int t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, i; i = 1; while (i <= 10) { t1 = 1 * i; System.out.println(t1); t2 = 2 * i; System.out.println(t2); t3 = 3 * i; System.out.println...
module Logic module Package class PackageLocationBuilder # TODO: better error handling def self.call(package_location_template, server_dir, package_hash) package_location_template .gsub('{server_dir}', server_dir) .gsub('{package_name}', package_hash.fetch('Package')) ...
<gh_stars>100-1000 def proc2(proxy, name) proxy.process(name){ pid_file "#{name}.pid2" } end
public static int binarySearch(int[] arr, int key) { int low = 0; int high = arr.length - 1; while (low <= high) { int mid = (low + high) / 2; if (arr[mid] == key) { return mid; } else if (arr[mid] < key) { low = mid + 1; } else { high = ...
class Library: def __init__(self): self.books = {} def add_book(self, book_title): if book_title not in self.books: self.books[book_title] = "available" else: print(f"{book_title} already exists in the library.") def remove_book(self, book_title): if...
import time import torch from collections import OrderedDict class Timer(object): def __init__(self, cuda_sync=False): self.timer = OrderedDict() self.cuda_sync = cuda_sync self.startTimer() def startTimer(self): self.iter_start = time.time() self.disp_start = time.time...
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/512+512+512-old/7-model --tokenizer_name model-configs/1536-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/512+512+512-old/7-512+512+512-ST-first-256 --do_eval --per_devi...
package apk import ( "context" "strings" "testing" "github.com/stretchr/testify/assert" "github.com/aquasecurity/trivy/pkg/fanal/analyzer" aos "github.com/aquasecurity/trivy/pkg/fanal/analyzer/os" "github.com/aquasecurity/trivy/pkg/fanal/types" ) func Test_apkRepoAnalyzer_Analyze(t *testing.T) { tests := []...
node --max-http-header-size=1000000 app.js
<reponame>thitranthanh/Achilles<gh_stars>1-10 /* * Copyright (C) 2012-2014 <NAME> * * 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 * ...
/* * Tencent is pleased to support the open source community by making IoT Hub available. * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. * Licensed under the MIT License (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the L...
#include <bits/stdc++.h> #include <stdio.h> int main() { int t; scanf("%d", &t); for(int i = 0; i < t; i++) { int n; scanf("%d", &n); int arr[n], brr[100000] = {0}, crr[100000] = {0}, max = -1; vector<int> arr[n]; for(int j = 0; j < n; j++) brr[j] = j; ...
import React from "react"; import ReactDOM from "react-dom"; import Webhooks from "./webhooks"; import axios from 'axios'; class Settings extends React.Component { constructor (props) { super(props) } render () { return <div className="menu-item-settings"> <Webhooks/> </div> } } function ...
/** * @author <NAME> */ import { SortOrder } from '../data/sort.data'; export interface CompareObjectValueOptions { by: string; order?: SortOrder; } export interface SortArrayOptions { data: any[]; by?: string; order?: SortOrder; } export interface SortMapOptions { by?: string; data: Map<any, any>; ...
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 出租车司机车辆信息 * * @author auto create * @since 1.0, 2021-09-09 09:44:44 */ public class DriverCarInfo extends AlipayObject { private static final long serialVersionUID = 4186937624...
import { JsonInterface as __type___parent_tests_JsonInterface } from "../../../__type__/parent/tests/JsonInterface" function validateJSON(jsonData) { // Assuming the interface definition is imported as __type___parent_tests_JsonInterface // Perform validation logic using the imported interface // Return tr...
<reponame>EIDSS/EIDSS-Legacy package com.bv.eidss.model; import java.text.Format; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Locale; import java.util.UUID; import com.bv.eidss.DateHelpers; import com.bv.eidss.data.Eidss...
#!/usr/bin/env bash # Source in common metadata functions script_dir="$(dirname "${BASH_SOURCE[0]}")" # shellcheck source=metadata/templates/common.sh source "$script_dir/templates/common.sh" if ! command -v bzr > /dev/null; then exit "$DETECTION_NOT_AVAILABLE" fi exit "$DETECTION_SUCCESS" # vim: syntax=sh cc=8...
#!/usr/bin/env bash # # Format the source code. # Usage string function usage() { scriptname=$(basename "$0") echo "$scriptname - source formatting utility" echo "usage: $scriptname [options]" echo " options:" echo " -v, --verbose Produce verbose output" echo " -h, --help Displa...
<gh_stars>1000+ import { reaction, autorun, isObservable, configure } from "mobx" import { types, getSnapshot, applySnapshot, onPatch, applyPatch, unprotect, detach, resolveIdentifier, getRoot, cast, SnapshotOut, IAnyModelType, Instance, SnapshotOrInstance, is...
<filename>tests/unit/utils/warnings_test.py # -*- coding: utf-8 -*- ''' :codeauthor: :email:`<NAME> (<EMAIL>)` :copyright: © 2013 by the SaltStack Team, see AUTHORS for more details :license: Apache 2.0, see LICENSE for more details. tests.unit.utils.warnings_test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...
const MetroColors = Object.freeze({ "1호선": "#0D3692", "2호선": "#33A23D", "3호선": "#FE5B10", "4호선": "#32A1C8", "5호선": "#8B50A4", "6호선": "#C55C1D", "7호선": "#54640D", "8호선": "#F51361", "9호선": "#AA9872" }); class Random { static generate() { return d3.randomUniform()(); } ...