text
stringlengths
1
1.05M
def is_palindrome(input_string): reversed_string = input_string[::-1] return reversed_string == input_string
/******************************************************************************** ** Form generated from reading UI file 'LoginDlg.ui' ** ** Created by: Qt User Interface Compiler version 5.6.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ******************************************...
python3 ../../../main_pretrain.py \ --dataset $1 \ --encoder resnet18 \ --data_dir ./datasets \ --max_epochs 1000 \ --gpus 0 \ --precision 16 \ --optimizer sgd \ --lars \ --grad_clip_lars \ --eta_lars 0.02 \ --scheduler warmup_cosine \ --lr 0.6 \ --min_lr 0.0006 \ ...
#!/bin/sh ENDPOINT=${1:-http://localhost:8080} KEY=${2:-demo-key} curl -H "Authorization: Key ${KEY}" "${ENDPOINT}/webhooks/pingdom?message=%7B%22check%22%3A%20%22803318%22%2C%20%22checkname%22%3A%20%22Alerta%20API%22%2C%20%22host%22%3A%20%22api.alerta.io%22%2C%20%22action%22%3A%20%22notify_of_close%22%2C%20%22incide...
#!/bin/bash version=$(git describe --tags --always --dirty 2>/dev/null) if [ ! -e ".git" ] || [ -z $version ] then version=$(grep "^VERSION=" makefile_include.mk | sed "s/.*=//") fi echo "Testing version:" $version #grep "VERSION=" makefile | perl -e "@a = split('=', <>); print @a[1];"` # get uname echo "uname="`u...
<reponame>oueya1479/OpenOLAT /** * <a href="http://www.openolat.org"> * OpenOLAT - Online Learning and Training</a><br> * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at the ...
describe('Authentication tests - read access user', () => { it('Cannot see unauthorized elements when not logged in', () => { cy.visit('/'); cy.getTestElement('authInfo').should('not.exist'); cy.getTestElement('lineSearch').should('not.exist'); }); it('Can log in with HSL ID', () =>...
import React from 'react'; import { StyleSheet, View, Text, FlatList } from 'react-native'; import { SafeAreaView } from 'react-native-safe-area-context'; import CollectionOverView from './CollectionComponent'; const CategoriesComponent=({navigation})=>{ return( <View> <SafeAreaView> <FlatList ...
class Restaurant { let name: String let address: String let cuisine: String let numTables: Int init(name: String, address: String, cuisine: String, numTables: Int) { self.name = name self.address = address self.cuisine = cuisine self.numTables = numTables } }
<reponame>Delicode/astra<filename>src/plugins/orbbec_hand/hnd_segmentation.hpp // This file is part of the Orbbec Astra SDK [https://orbbec3d.com] // Copyright (c) 2015 Orbbec 3D // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // ...
python3 train.py --name w --checkpoints_dir ./checkpoints --batchSize 1 --loadSize 256 --fineSize 128 --label_nc 0 --dataroot datasets/w/ --nThreads 8 --no_instance --save_latest_freq 200 --save_epoch_freq 10 --continue_train --which_epoch 200 --netG local
#!/bin/bash input="codes.txt" regex="(cleave-phone)\.([a-z\-]+)\.js" while IFS= read -r line do if [[ "$line" =~ $regex ]] then code="${BASH_REMATCH[2]}" cat PhoneFieldFormatterClassTemplate.txt | sed s/#codeuc#/${code^^}/g | sed s/#codelc#/$code/g > "src/main/java/org/vaadin/textfieldformatter/pho...
<filename>js_events/migrations/0002_auto_20190213_0944.py<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.11.18 on 2019-02-13 09:44 from __future__ import unicode_literals from django.db import migrations import sortedm2m.fields class Migration(migrations.Migration): dependencies = [ ('js_eve...
#!/bin/bash -e testScriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd ${testScriptDir} source ../util.sh createDgossVolumes # Add test file to user config map createInitConfigContainer createPreRunConfigMapFile createCassandraBootstrapContainer #createAndCheckCassandraContainer #comment to go quicke...
#!/bin/bash # exit with nonzero exit code if anything fails set -e ! grep -r --include "*.spec.*" "\.only" src
package com.ruoyi.project.system.hisZytf.controller; import java.util.List; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springfram...
//========== function DendImageTest() { $('.gimg').each( function (indx, element) { var src = $(element).attr('src'); console.log(src); SendImageToServer(src); }); } function SendImageToServer(imagefile, id, id_data) { var ft = new FileTr...
<gh_stars>0 /* * node-android-automate v1.0.0 * https://github.com/pete-rai/node-android-automate * * Copyright 2021 <NAME> * Released under the MIT license * https://github.com/pete-rai/node-android-automate/blob/main/LICENSE * * Released with the karmaware tag * https://pete-rai.github.io/karmaware * * Web...
package main import ( "github.com/gin-gonic/gin" "net/http" ) func main() { router := gin.Default() router.GET("/", func(c *gin.Context) { msg := "Hello, Welcome Gin World!" c.JSON(http.StatusOK, msg) }) err := router.Run(":9000") if err != nil { panic(err) } }
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })...
<gh_stars>0 /* * Copyright (c) 2020 The Khronos Group Inc. * Copyright (c) 2020 Valve Corporation * Copyright (c) 2020 LunarG, 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 * ...
function isValidEmail(email) { const regEx = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return regEx.test(String(email).toLowerCase()); }
<gh_stars>0 package file import ( "fmt" "sort" "testing" ) var source = map[string]map[string]string{ "mini": { "shareholder": "shareholder", "KeyPerson": "KeyPerson", "company_base_info": "entbaseInfo", "branch": "branch", "alter": "alter", ...
<reponame>hiteshsahu/Hassium-WordPress-Theme //Global Variables var app = angular.module('HitMan',['ngRoute', 'ngAnimate']); app.controller('AssassinControler', function($scope, $rootScope) { //Variables $scope.orderList = "name"; $scope.skill_require = ""; $scope.coreSkill = appData.CORE_SKILLS; $sco...
<gh_stars>10-100 import { CircularProgress, createStyles, makeStyles } from "@material-ui/core"; import clsx from "clsx"; const useStyles = makeStyles(() => createStyles({ root: { height: "100%", width: "100%", display: "flex", alignItems: "center", justifyContent: "center", }, ...
#!/usr/bin/env bash # Copyright 2016 Vimal Manohar # 2016 Yiming Wang # 2016 Johns Hopkins University (author: Daniel Povey) # Apache 2.0 # This script demonstrates how to re-segment training data selecting only the # "good" audio that matches the transcripts. # The basic idea is to decode with...
<reponame>rovedit/Fort-Candle #pragma once #include "types/Light.hh" #include "types/Material.hh" #include "types/Particle.hh" #include "types/Properties.hh" #include "types/Structure.hh" #include "types/Unit.hh" #include "types/Nature.hh" #include "types/Audio.hh"
<reponame>theBoyMo/RadioPlayer<filename>app/src/main/java/com/oandmdigital/radioplayer/common/LoggingFragment.java package com.oandmdigital.radioplayer.common; import android.content.Context; import android.content.res.Configuration; import android.os.Bundle; import android.support.annotation.Nullable; import android...
import java.util.Arrays; import java.util.List; public class PermissionChecker { // Method to check if the user has the required permission public boolean checkPermission(String userRole, String requiredPermission) { // Assume a method to retrieve user's permissions based on role List<String> u...
<filename>trustconnector/src/main/java/libs/trustconnector/scdp/util/ByteArray.java package libs.trustconnector.scdp.util; import libs.trustconnector.scdp.util.tlv.bertlv.*; import libs.trustconnector.scdp.util.tlv.*; import libs.trustconnector.scdp.util.tlv.LV; import libs.trustconnector.scdp.util.tlv.bertlv.BERLVBu...
<reponame>JLLeitschuh/Symfony-2-Eclipse-Plugin /******************************************************************************* * This file is part of the Symfony eclipse plugin. * * (c) <NAME> <<EMAIL>> * * For the full copyright and license information, please view the LICENSE * file that was distributed with...
<reponame>yuri-zubov/paycall-sms module PayCallSms class IncomingMessageParser attr_reader :logger # Create new sms sender with given +gateway+ def initialize(options={}) @options = options @logger = Logging.logger[self.class] end # params will look something like the following: ...
// // Created by ooooo on 2020/1/3. // #ifndef CPP_0637_SOLUTION1_H #define CPP_0637_SOLUTION1_H #include "TreeNode.h" #include <queue> #include <vector> class Solution { public: vector<double> averageOfLevels(TreeNode *root) { if (!root) return {}; vector<double> res; queue<TreeNode *> q;...
./docker_cmd.sh \ python -m unittest discover -v -f -p "*test.py" -s swords/ -t .
# # Copyright (c) 1999, 2013, 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 # published by the Free Softwar...
<filename>_data/blogposts.js const fetch = require("node-fetch"); // function to get blogposts async function getAllBlogposts() { // max number of records to fetch per query const recordsPerQuery = 100; // number of records to skip (start at 0) let recordsToSkip = 0; let makeNewQuery = true; ...
<reponame>hoangmirs/go-scraper package test_helpers import ( "github.com/hoangmirs/go-scraper/conf" "github.com/hoangmirs/go-scraper/database" "github.com/beego/beego/v2/core/logs" "github.com/gocraft/work" ) func GetWorkerClient() *work.Client { return work.NewClient(conf.GetString("workerNamespace"), database...
if test ! $(which node -v) then sudo n latest fi if test ! $(which spoof) then sudo npm install spoof -g fi
/* * Backoff.java * * Created on November 19, 2006, 5:43 PM * * From "Multiprocessor Synchronization and Concurrent Data Structures", * by <NAME> and <NAME>. * Copyright 2006 Elsevier Inc. All rights reserved. */ package tamp.ch07.Spin.spin; import java.util.Random; /** * Adaptive exponential backoff class....
#!/bin/bash if [[ $# -lt 2 || $(echo "$@" | grep " -h") ]]; then echo "Usage: export-production-database.sh <database name> <database dump file>" exit fi database=$1 databaseDumpFile=$2 dir=$(mktemp -p . -d data-dump-XXXX); docker-compose -f docker/Compose.prod.yml run -v "$PWD/$dir":/data -w /data --rm ali...
function generatePaginationHTML(totalResources, currentPage) { const totalPages = Math.ceil(totalResources / 10); // Assuming 10 resources per page let paginationHTML = '<td colspan="5" align="center">'; if (currentPage > 1) { paginationHTML += '<a href="?page=1">&lt;&lt;</a>'; // Link to first page pagi...
package com.asadmshah.moviegur.models; import com.asadmshah.moviegur.models.tmdb.MovieResponse; import com.asadmshah.moviegur.utils.TestResourceLoader; import com.bluelinelabs.logansquare.LoganSquare; import org.junit.Test; import java.io.InputStream; import static org.junit.Assert.assertEquals; public class Movie...
import h5py import os import unittest import xml.etree.ElementTree as et from afqmctools.utils.qmcpack_utils import write_xml_input class TestXMLWrite(unittest.TestCase): def test_write(self): options = { "execute": { "nWalkers": 10, "blocks": 1000, ...
#!/bin/bash # Copyright 2018 Google Inc. 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...
#!/usr/bin/env bash dotnet $CONDA_PREFIX/lib/dotnet/tools/PSMStatistics/ProteomIQon.PSMStatistics.dll "$@"
import { SERVICE_LIST_REQUEST, SERVICE_LIST_SUCCESS, SERVICE_LIST_FAIL, SERVICE_DETAILS_REQUEST, SERVICE_DETAILS_SUCCESS, SERVICE_DETAILS_FAIL , SERVICE_SAVE_REQUEST, SERVICE_SAVE_SUCCESS, SERVICE_SAVE_FAIL, SERVICE_DELETE_REQUEST, SERVICE_DELETE_SUCCESS, SERVICE_DEL...
#!/bin/bash # # Script for container to install rocksdb for production use and not for testing # as docker build would slow down testing apt-get -y update \ && apt-get install -y --no-install-recommends wget make build-essential checkinstall libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev git \ &...
#!/bin/bash if test -z "${SCF_INSTANCE_ID}" ; then # This is not running on CAASP; this is not needed exit 0 fi if test -z "${KUBE_COMPONENT_INDEX}" ; then printf "Your CAASP is broken; no index was specified\n" >&2 exit 1 fi if test "${DIEGO_CELL_SUBNET}" == "${DIEGO_CELL_SUBNET%.0.0/16}" ; then ...
#!/usr/bin/env bats load helpers BATS_TESTS_DIR=test/bats/tests/gcp WAIT_TIME=60 SLEEP_TIME=1 NAMESPACE=default PROVIDER_NAMESPACE=kube-system PROVIDER_YAML=https://raw.githubusercontent.com/GoogleCloudPlatform/secrets-store-csi-driver-provider-gcp/main/deploy/provider-gcp-plugin.yaml BASE64_FLAGS="-w 0" export RESO...
#!/bin/bash # Copyright 2018 Johns Hopkins University (Jesus Villalba) # Apache 2.0. # cmd=run.pl thr_ahc=0.9 if [ -f path.sh ]; then . ./path.sh; fi . parse_options.sh || exit 1; set -e if [ $# -ne 6 ]; then echo "Usage: $0 <ndx> <enroll-file> <ref-vector-file> <enr-vector-file> <test-vector-file> <output-score...
rm -rf ./demo/project/.cache
#!/bin/bash TEMP=$(php-config --prefix) echo $TEMP if [ "$(uname -s)" = 'Linux' ]; then PHP_PREFIX=$(php-config --prefix) PHP_SAPIS=$(php-config --php-sapis) echo $PHP_PREFIX echo $PHP_SAPIS fi
if [ "$DEBUG" = "1" ]; then # cmdline.txt install -m 644 $PIP_BOOT_DIR/cmdline-debug.txt "${ROOTFS_DIR}/boot/bank_a/cmdline.txt" # Network config sudo install -m 600 -o root -g root files/wpa_supplicant.conf "${ROOTFS_DIR}/etc/wpa_supplicant/wpa_supplicant.conf" # Updater config sudo install -m 644 -o root -g r...
#!/bin/bash set -e . ./config.sh for PROJECT in $PROJECTS; do (cd $PROJECT && $MAKE clean) done rm -rf sysroot rm -rf isodir rm -rf myos.iso
#pragma once #include <PlayFabServerSdk/PlayFabError.h> #include <PlayFabServerSdk/PlayFabMatchmakerDataModels.h> #include <AzCore/EBus/EBus.h> namespace PlayFabServerSdk { class PlayFabServer_MatchmakerRequests : public AZ::EBusTraits { public: static const AZ::EBusHandlerPolicy Handler...
class BankAccount: def __init__(self, account_number, account_holder, balance): self.account_number = account_number self.account_holder = account_holder self.balance = balance def deposit(self, amount): self.balance += amount def withdraw(self, amount): if self.bal...
const binToDec = (binary) => { let decimal = 0; let power = 0; for (let i = binary.length - 1; i >= 0; i--) { const bit = binary[i]; decimal += bit * (2 ** power); power += 1; } return decimal; }; console.log(binToDec('1101')); // 13
const occurences = (arr) => { const obj = {}; arr.forEach(str => { if (obj[str]) { obj[str] += 1; } else { obj[str] = 1; } }); return obj; };
package com.google.developers.event; /** * Created by frren on 2015-09-10. */ public interface RegisterFormResponseSpreadsheet extends SpreadsheetFacts { String QR_CODE_COLUMN = "QR code"; String CHECK_IN_COLUMN = "Check-in"; String CLIENT_IP_COLUMN = "Client IP"; }
cd /home/ubuntu/codes/backend/saleor source /home/ubuntu/codes/backend/venv/bin/activate export ALLOWED_HOSTS=3.6.136.178 export ALLOWED_CLIENT_HOSTS=3.6.136.178 export DEBUG=True export SECRET_KEY=123456 export INTERNAL_IPS=127.0.0.1,3.6.136.178, export API_URI=http://3.6.136.178:8000/graphql/ export APP_MOUNT_URI=/da...
# ----------------------------------- # Script that builds Dart app and pushes it to gh-pages. # # Set following variables: # ----------------------------------- build_folder='example' github_repo='git@github.com:marcojakob/dart-event-bus.git' # ----------------------------------- # Build. # --------------------------...
<reponame>apdavison/hbp-validation-framework import axios from "axios"; import { baseUrl, querySizeLimit } from "./globals"; const buildQuery = (filterDict) => { let q = ""; for (var key in filterDict) { for (var value of filterDict[key]) { q += `&${key}=${value}`; } } retur...
<reponame>fmmajd/gopostgres<gh_stars>0 package gopostgres import ( "github.com/jackc/pgx/v4" "testing" ) func TestInitDB(t *testing.T) { InitDB("test", "user", "pass", "localhost", nil, pgx.LogLevelDebug) if DB.connection == nil { t.Error("database could not be initialized correctly") } }
#!/bin/bash echo "================================================================================" echo "MonPoly's violations of (x1 <- MAX x1; x2 (ONCE[1,1] (P0(y1,x1,x2) )))" echo "================================================================================" monpoly -sig bug.sig -formula bug.mfotl -log bug.log...
import React, {Component} from 'react'; import {StyleSheet, View, Text, ActivityIndicator} from 'react-native'; import Deck from './Deck'; export default class App extends Component { state = { decks: [], cards: [], isLoading: true, }; componentDidMount() { // get decks from API, set state fetch(https://mya...
import click from observatory.api.server.openapi_renderer import OpenApiRenderer @click.group() def cli(): """The Observatory API command line tool. COMMAND: the commands to run include:\n - generate-open-api: generate an OpenAPI specification for the Observatory API.\n """ pass @cli.comman...
#!/bin/bash function docker_tag_exists() { EXISTS=$(curl -s https://hub.docker.com/v2/repositories/$1/tags/?page_size=10000 | jq -r "[.results | .[] | .name == \"$2\"] | any") test $EXISTS = true } if docker_tag_exists svenruppert/maven-3.3.9-openjdk 1.10.0; then echo skip building, image already existing...
<reponame>snowcrystall/gitaly_emg package fstype const unknownFS = "unknown" // FileSystem will return the type of filesystem being used at the passed path func FileSystem(path string) string { return detectFileSystem(path) }
curl \ -s \ -X POST \ -H "authorization: Bearer $GITHUB_TOKEN" \ -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/repos/$OWNER/$REPO/labels \ -d "{\"name\":\"$NAME\"}"
<reponame>stungkit/cadence-web<gh_stars>100-1000 // polyfills for web browser to node import 'babel-polyfill'; import AbortController from 'node-abort-controller'; import atob from 'atob'; import { injectMomentDurationFormat, jsonTryParse } from '~helpers'; import { enableFetchMocks } from 'jest-fetch-mock'; import { m...
module Upcastable class UpcastedObject def self.define_delegate_method(m) define_method(m) do |*args, &block| @object.send(m, *args, &block) end end def initialize(object, ancestor, base = object.class) unless base <= ancestor raise ArgumentError, "#{ancestor} is not an ...
#!/bin/bash PROJECTNAME=$1 # Change to the script's working directory no matter from where the script was called (except if there are symlinks used) # Solution from: http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd...
#!/bin/sh red="\033[0;31m" yellow="\033[1;33m" green="\033[1;32m" reset="\033[0m" read -a changed_files <<< $(git diff --cached --name-only --raw) # check if there're any JS related files in commit runTests=false for file in "${changed_files[@]}" do extension="${file##*.}" case $extension in js | coffee | jsx...
<reponame>aminmeyghani/javascript-for-beginners var taskBaseP = { pName: 'taskBaseP', getName() { return this.name; } }; var taskP = Object.create(taskBaseP); Object.assign(taskP, { // task related stuff. More specific. pName: 'taskP', setDone() { this.isDone = true; }, reset() { this.isDo...
package io.opensphere.core.util.swing.wizard.model; import java.awt.Component; /** The model for the panels displayed for each wizard step. */ @FunctionalInterface public interface WizardPanelModel { /** * Get the wizard panel for a given step. * * @param stepTitle The title for the step...
package router import ( "github.com/drone/drone/server/handler" "github.com/drone/drone/server/middleware" "github.com/zenazn/goji/web" ) func New() *web.Mux { mux := web.New() mux.Get("/api/logins", handler.GetLoginList) mux.Get("/api/auth/:host", handler.GetLogin) mux.Post("/api/auth/:host", handler.GetLog...
<reponame>danieldiamond/gitlab-analytics<gh_stars>1-10 #!/usr/bin/env python3 import logging import sys from os import environ as env from typing import Dict, List from fire import Fire from snowflake.sqlalchemy import URL from sqlalchemy import create_engine # Set logging defaults logging.basicConfig(stream=sys.std...
/** * Created by hfutlj on 2018/5/9. * 中级处理者,教导主任,能批准7天以内的假期 * 上级为校长 */ public class Dean extends AbstractManager { @Override public void handle(int i) { if (i <= 7) { System.out.println("我是教导主任,我批准你" + i + "天假"); } else { sendNext(i); } } }
<reponame>systembugtj/android-lockpattern<gh_stars>0 /* * Copyright 2012 <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...
#!/bin/sh docker build -t rmpestano/jenkins-living-documentation ../docker
#!/usr/bin/env bash set -e if [[ $1 = "--ci" ]]; then echo "Launch script finished" else trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT fi SERVER_VERSION="10.1.3.Final" SERVER_HOME=server/infinispan-server-$SERVER_VERSION CLUSTER_SIZE_MAIN="$SERVER_HOME/bin/cli.sh -c localhost:11322 -f batch " ZIP_ROO...
#!/bin/bash docker run -d -p 5000:5000 -v /home/vysakh/Accubits/INTEL/Accelerated-Face-Reidentification-and-Emotion-Recognition/docker_fetch:/tmp/image emotyx
<reponame>github-clonner/chef-patissier<filename>packages/recipe-web/gulpfile.js const chef = require('@dameblanche/core'); const config = { 'root': { 'src': './src', 'dest': './public' }, 'browsersync': { }, // Grouped by what can run in parallel 'tasks': [ ['clean'], ...
<reponame>slaufer/Prebid.js<filename>test/spec/modules/pubgeniusBidAdapter_spec.js import { expect } from 'chai'; import { spec } from 'modules/pubgeniusBidAdapter.js'; import { deepClone, parseQueryStringParameters } from 'src/utils.js'; import { config } from 'src/config.js'; import { server } from 'test/mocks/xhr.j...
#!/usr/bin/env node var tele = require("./index.js"); var fs = require("fs"); var path = require("path-extra"); var argv = require("optimist") .default("port", 42424) .default("bridge", true) .boolean("v").describe("v", "verbose") .boolean("nolan").describe("nolan", "disable lan usage") .argv; if(argv.v) te...
from flask import Flask, session app = Flask(name) app.config['SECRET_KEY'] = 'secret key here' @app.route('/protected') def protected(): if 'username' in session: return 'You are logged in as ' + session['username'] return 'You are not logged in' @app.route('/login', methods=['POST']) def login(): session['use...
package note_test import ( "fmt" "io/ioutil" "os" "path/filepath" "testing" "time" "github.com/elgopher/noteo/date" "github.com/elgopher/noteo/note" "github.com/elgopher/noteo/tag" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestNew(t *testing.T) { t.Run("should retu...
/* * Check if assets are loaded * -------------------------- * * assetLoaded * * @param assets [HTML element] * @param return [promise] * * assetsLoaded * * @param assets [array] of [HTML elements] * @param done callback [function] when finished loading */ const assetLoaded = ( asset ) => { let type = ...
<gh_stars>0 package io.github.achacha.decimated.deadcode; import java.time.Instant; /** * Data available when trigger is executed */ public interface TriggerAccessPoint { /** * Location of the execution * @return String with full package, class and line number */ String getLocation(); /...
#!/usr/bin/python from sys import argv import hashlib import ntpath files = argv def sha256_checksum(filename, block_size=65536): sha256 = hashlib.sha256() with open(filename, 'rb') as f: for block in iter(lambda: f.read(block_size), b''): sha256.update(block) return sha256.hexdigest(...
<gh_stars>1-10 """ This module provides a SUO-KIF ontology files parser. Possible usage: >>> from kifparser import KIFParser >>> p = KIFParser() >>> largest = None >>> # io should be a file-like object open for reading >>> for obj in p.parse(io): >>> if largest is None: >>> largest = obj >>> conti...
#!/bin/bash WORKDIR=`dirname $0` cd $WORKDIR ./getDnbTitel.sh ./split.sh ./convert.sh ./createDnbIndex.sh ./json2es.sh
import numpy as np from sklearn.linear_model import LinearRegression # Create an instance of the linear regression model regression_model = LinearRegression() # Fit the model to the given data set regression_model.fit(X, y) # Make predictions using the model predictions = regression_model.predict(X)
#!/usr/bin/env bash set -e set -u set -o pipefail # ------------------------------------------------------------------------------------------------- # PUBLIC FUNCTIONS # ------------------------------------------------------------------------------------------------- ### ### Check if source and destination file ex...
#!/bin/sh set -e set -x . /opt/flask-ioc-lookup/env/bin/activate project_dir=${project_dir-"/opt/flask-ioc-lookup/"} # gunicorn settings workers=${workers-1} worker_class=${worker_class-sync} worker_threads=${worker_threads-1} worker_timeout=${worker_timeout-30} # Need to tell Gunicorn to trust the X-Forwarded-* hea...
<gh_stars>1-10 const Action = require('../JobAction').AbstractJobAction const Parliaments = require('@parameter').Parliament.Number const TfIdfClassification = require('@model').TfIdfClassification class ClassificationResultAdapterAction extends Action { constructor (params) { super() this.params = params ...
'use strict'; //dependencies var path = require('path'); var nock = require('nock'); var faker = require('faker'); var expect = require('chai').expect; var Transport = require(path.join(__dirname, '..', '..')); var multi = require(path.join(__dirname, 'fixtures', 'send_multi_multiple_destination_response.json'))...
#!/usr/bin/env bash # Copyright (c) 2020 gyselroth GmbH # Licensed under the MIT License - https://opensource.org/licenses/MIT VALGRIND_LOG="test/tmp/mem-leak.log" # shellcheck disable=SC2034 VALGRIND="valgrind -v --leak-check=full\ --log-file=${VALGRIND_LOG}" # shellcheck disable=SC2034 VALGRIND_ERR_PATTERN="ERRO...
#include <stdio.h> // Linear search function int linear_search(int n, int A[], int key) { int i; // Traverse the array for (i = 0; i < n; i++) { // If element is found return its position if (A[i] == key) return i; } // Element not found return -1; } int main() ...
from django import forms class ProfileForm(forms.Form): name = forms.CharField(max_length = 100) picture = forms.ImageField()