text stringlengths 1 1.05M |
|---|
import numpy as np
from sklearn.model_selection import KFold
# Create a dataset
X = np.array([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10], [11, 12]])
y = np.array([1, 2, 3, 4, 5, 6])
# Create the Cross-Validation object
kf = KFold(n_splits=5)
# Iterate through the folds
for train_index, test_index in kf.split(X):
pr... |
"""Init pytest fixtures."""
|
val employees = spark.sqlContext.createDataFrame(Seq(
(1, "Bob", 21, 3000),
(2, "Rob", 25, 4000),
(3, "Roy", 27, 8000),
(4, "Tom", 32, 5000)
)).toDF("id","name","age","salary")
val avg_salary = employees.select(avg("salary")).collect()(0).getDouble(0) |
<gh_stars>0
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Main {
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new... |
TERMUX_PKG_HOMEPAGE=https://github.com/mikebrady/shairport-sync
TERMUX_PKG_DESCRIPTION="An AirPlay audio player"
TERMUX_PKG_LICENSE="custom"
TERMUX_PKG_LICENSE_FILE="LICENSES"
TERMUX_PKG_MAINTAINER="@termux"
# Cannot simply be updated to a newer version due to `pthread_cancel` being used
TERMUX_PKG_VERSION=3.1.2
TERMUX... |
import hashlib
class FileIntegrityChecker:
def __init__(self, reference_hash: bytes):
self.reference_hash = reference_hash
def calculate_hash(self, file_path: str) -> bytes:
with open(file_path, 'rb') as file:
file_contents = file.read()
calculated_hash = hashlib.sha25... |
package com.leetcode;
public class Solution_5717 {
public int minOperations(int[] nums) {
if (nums == null || nums.length == 0 || nums.length == 1) return 0;
int result = 0;
for (int i = 1; i < nums.length; i++) {
if (nums[i] <= nums[i - 1]) {
result += nums[i - ... |
#!/usr/bin/env bash
set -eu -o pipefail
# -e: exits if a command fails
# -u: errors if an variable is referenced before being set
# -o pipefail: causes a pipeline to produce a failure return code if any command errors
readonly RULES_NODEJS_DIR=$(cd $(dirname "$0")/..; pwd)
echo_and_run() { echo "+ $@" ; "$@" ; }
# ... |
#!/bin/sh
#
# Vivado(TM)
# runme.sh: a Vivado-generated Runs Script for UNIX
# Copyright 1986-2020 Xilinx, Inc. All Rights Reserved.
#
echo "This script was generated under a different operating system."
echo "Please update the PATH and LD_LIBRARY_PATH variables below, before executing this script"
exit
... |
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/post', methods=['POST'])
def post_data():
data = request.form
return data
if __name__ == '__main__':
app.run() |
#!/bin/bash
##################################################################
#### Author: Blaine McDonnell (blaine@armoin.com) ####
#### Usage: ./hiveid_get_newbin ####
#### Description: Gets the latest and greatest binary file ####
#### Version: 0.1 ... |
#!/bin/bash
set -eux
BAZEL_VERSION='0.28.0'
BAZEL_BASE_URL='https://github.com/bazelbuild/bazel/releases/download'
BAZEL_SH="bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh"
BAZEL_URL="${BAZEL_BASE_URL}/${BAZEL_VERSION}/${BAZEL_SH}"
wget -q -nc "${BAZEL_URL}"
chmod +x "${BAZEL_SH}"
./${BAZEL_SH}
rm -rf "${BAZEL_SH}... |
package com.example.demo.controller;
import com.example.demo.entity.*;
import com.example.demo.repository.*;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import... |
# 2 events per second for 1 second
export WORKLOAD_ID=10-100-1
export CONCURRENT=10
export START=100
#export INC=2
export DURATION=1
export TEST_DURATION=10
|
#!/bin/sh
. $(dirname -- "$0")/env.sh
cd $ROOT_PATH
exec $PYTHON -m doit
|
require('dotenv').config()
const redis = require('redis')
/*=== creates and initializes redis instance that is heroku friendly ===*/
const redis_url = process.env.REDIS_URL || 6379
const client = redis.createClient(redis_url)
client.on('error', err => console.error(err))
module.exports = client
|
package ltm.service;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;
import android.widget.Toast;
class LocalB... |
<filename>Libraries/RadioLib/src/modules/ESP8266/ESP8266.h
#if !defined(_RADIOLIB_ESP8266_H) && !defined(ESP8266)
#define _RADIOLIB_ESP8266_H
#include "../../Module.h"
#include "../../protocols/TransportLayer/TransportLayer.h"
/*!
\class ESP8266
\brief Control class for %ESP8266 module. Implements TransportLaye... |
package com.touch.air.mall.ware.vo;
import lombok.Data;
/**
* @author: bin.wang
* @date: 2021/1/2 11:54
*/
@Data
public class PurchaseItemDoneVo {
/**
* 采购项Id
*/
private Long itemId;
private Integer status;
private String reason;
}
|
public class MathFunctions {
public int power(int base, int exponent) {
if (exponent < 0) {
throw new IllegalArgumentException("Exponent cannot be negative");
}
int result = 1;
for (int i = 0; i < exponent; i++) {
result *= base;
}
return resul... |
//Algorithm to exchange two numbers without a temporary variable
void SwapWithoutTemp( int* a, int* b )
{
*a = *a + *b;
*b = *a - *b;
*a = *a - *b;
}
//Driver code
int a = 5, b = 7;
SwapWithoutTemp( &a, &b );
//Output
a = 7
b = 5 |
/*
* Copyright (C) 2008 The Android Open Source 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 required by app... |
<reponame>vampire-studios/Obsidian<gh_stars>1-10
package io.github.vampirestudios.obsidian.api.obsidian.item;
import io.github.vampirestudios.obsidian.Obsidian;
import io.github.vampirestudios.obsidian.api.obsidian.NameInformation;
import net.minecraft.client.util.ModelIdentifier;
import net.minecraft.item.ItemGroup;
... |
<reponame>woonsan/incubator-freemarker
/*
* 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 Licens... |
<reponame>leftjs/gym-api<filename>src/main/java/com/donler/gym/model/Company.java
package com.donler.gym.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Genera... |
/*
* This file is generated by jOOQ.
*/
package io.cattle.platform.core.model.tables;
import io.cattle.platform.core.model.CattleTable;
import io.cattle.platform.core.model.Keys;
import io.cattle.platform.core.model.tables.records.SettingRecord;
import java.util.Arrays;
import java.util.List;
import javax.annotati... |
<gh_stars>0
import { NgModule } from '@angular/core';
import {MatToolbarModule} from '@angular/material/toolbar';
import {MatButtonModule} from '@angular/material/button';
import {MatExpansionModule} from '@angular/material/expansion';
import {MatIconModule} from '@angular/material/icon';
import {MatFormFieldModule} f... |
#!/bin/bash
echo -n "Enter your name and press [ENTER]: "
read username
echo -n "Enter host [ENTER]: "
read host
rsync -a ./packages/server/package* ./packages/server/env ./packages/server/secret ./packages/server/dist ${username}@${host}:/var/www/html/apps/inkvisitor-sandbox/server
rsync -a ./packages/server/src/se... |
import random
import math
def estimate_pi(num_simulations):
count_inside_circle = 0
for _ in range(num_simulations):
x = random.uniform(0,1)
y = random.uniform(0,1)
dist_from_origin = math.sqrt(x**2 + y**2)
if dist_from_origin <= 1:
count_inside_circle += 1
pi = ... |
<filename>test/fixtures/scale.time/ticks-capacity.js
module.exports = {
threshold: 0.01,
config: {
type: 'line',
data: {
labels: [
'2012-01-01', '2013-01-01', '2014-01-01', '2015-01-01',
'2016-01-01', '2017-01-01', '2018-01-01', '2019-01-01'
]
},
options: {
scales: ... |
#!/usr/bin/env bash
# Copyright 2019 The Kubernetes 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
#!/bin/bash -e
# make sure -x (debugging) is off so we don't print the token in the logs
set +x
# only run on tags
if [[ "$CIRCLE_TAG" = "" ]]; then exit 0; fi
if [ -f ~/.npmrc ]; then mv ~/.npmrc ~/.npmrc.bak; fi
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
echo "Publishing flow-parser-bin";
npm... |
nosetests -v --with-coverage --verbosity=2 --cover-erase --cover-html --nocapture --nologcapture --with-doctest --cover-html-dir=coverage/ --cover-package=cpf_cnpj tests |
// import Image from 'next/image';
import Quiz from '../../components/Quiz';
import { getQuestions, startQuiz } from '../../lib/axios';
import nookies from 'nookies';
import Head from 'next/head';
const domain = ({ domain, questions, endTime }) => {
return (
<>
<Head>
<title>CSI... |
import {Link} from "gatsby"
import PropTypes from "prop-types"
import React from "react"
import SocialMediaLinksComponent from '@bit/saundersb.common.social-media-links-component';
interface HeaderInterface {
siteTitle: string
}
const Header = ({siteTitle}: HeaderInterface) => (
<header
style={{
... |
import React from 'react';
import IconSearch from '../img/cerca-student-hotels.svg';
import IconCompare from '../img/compara-student-hotels.svg';
import IconSave from '../img/risparmia-student-hotels.svg';
const BlockIcons = () => {
return (
<section className="section has-margin-bottom">
<div className="... |
package controller
import (
"net/http"
"strconv"
"varconf-server/core/dao"
"varconf-server/core/moudle/router"
"varconf-server/core/service"
"varconf-server/core/web/common"
)
type AppController struct {
common.Controller
appService *service.AppService
configService *service.ConfigService
}
func InitAp... |
#!/usr/bin/env -S bash ../.port_include.sh
port=dropbear
version=2019.78
files="https://mirror.dropbear.nl/mirror/releases/dropbear-${version}.tar.bz2 dropbear-${version}.tar.bz2
https://mirror.dropbear.nl/mirror/releases/dropbear-${version}.tar.bz2.asc dropbear-${version}.tar.bz2.asc
https://mirror.dropbear.nl/mirror/... |
<reponame>kevinkimball/sparkpost-rails
require 'spec_helper'
describe SparkPostRails::DeliveryMethod do
before(:each) do
SparkPostRails.configuration.set_defaults
@delivery_method = SparkPostRails::DeliveryMethod.new
end
context "Return Path" do
it "handles return path set in the configuration" do
... |
<reponame>bverhoeve/design-patterns<filename>src/garage/Onderhoud.java
package garage;
public class Onderhoud {
public int start;
public int end;
public String nummerplaat;
public Onderhoud (String nummerplaat, int start, int end) {
this.nummerplaat = nummerplaat;
this.start = start;
... |
<filename>offer/src/main/java/leetCode/L10084_LargestRectangleArea.java
package leetCode;//给定 n 个非负整数,用来表示柱状图中各个柱子的高度。每个柱子彼此相邻,且宽度为 1 。
//
// 求在该柱状图中,能够勾勒出来的矩形的最大面积。
//
//
//
// 示例 1:
//
//
//
//
//输入:heights = [2,1,5,6,2,3]
//输出:10
//解释:最大的矩形为图中红色区域,面积为 10
//
//
// 示例 2:
//
//
//
//
//输入: heights = [2,4]
//输出: 4
//
//... |
import React from "react";
import {BoundingBox, Content, Handle, Handles, PropProvider, Wrapper} from "./elements";
import {
listenRR,
useCursorSlice,
useDown,
useDrag,
useHandleMouse,
useHandleMouseEvent,
useHandlers,
useHandles,
useHandlesDown,
useInitialSize,
useLoaded,
useMeta,
useWithCornerHandle,
us... |
set -x
# Make osx work like linux.
sed -i.bak "s/NOT APPLE AND ARG_SONAME/ARG_SONAME/g" cmake/modules/AddLLVM.cmake
sed -i.bak "s/NOT APPLE AND NOT ARG_SONAME/NOT ARG_SONAME/g" cmake/modules/AddLLVM.cmake
mkdir build
cd build
[[ $(uname) == Linux ]] && conditional_args="
-DLLVM_USE_INTEL_JITEVENTS=ON
"
cmake ... |
def sort(arr):
for i in range(len(arr)):
for j in range(i + 1, len(arr)):
if arr[i] > arr[j]:
arr[i], arr[j] = arr[j], arr[i]
return arr |
def search(arr, elem):
n = len(arr)
for i in range(0, n):
if arr[i] == elem:
return i
return -1
print(search([1, 3, 4, 5, 7, 8], 7)) |
<filename>repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
/**
* 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 l... |
#!/bin/bash
set -e
mkdir -p ./build/
scss-lint _component.scss
scss-lint _componentTest.scss
sassc --sourcemap app.scss build/app.css
autoprefixer build/app.css
|
#!/bin/bash
set -o errexit
set -o nounset
set -o xtrace
DEPS=(
build-essential git gdb valgrind cmake rpm file
libcap-dev python3-dev python3-pip python3-setuptools
hardening-includes gnupg
)
case "${ARCH_SUFFIX-}" in
amd64|'') ;;
arm64) DEPS+=(gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu libc6-dev-arm6... |
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# always set in stage params
SCRIPT_ENV=${SCRIPT_ENV:-local}
# Check basic params
case "$SCRIPT_ENV" in
prod)
echo "RUNNING IN PROD ENV"
;;
dev)
echo "RUNNING IN DEV ENV"
;;
local)
echo "RUNNING IN LOCAL ENV"
;;
*)
echo >&2 "Must set SCR... |
<reponame>Boscotiam/client-web-transfer
package models;
import com.fasterxml.jackson.databind.node.ObjectNode;
import play.libs.Json;
/**
* Created by mac on 14/10/2020.
*/
public class PairValue {
private String label;
private String value;
public PairValue() {
}
public PairValue(String lab... |
#!/usr/bin/env bash
set -xe
# Download all required dependencies
yarn install --production=false
NODE_ENV=production yarn build
|
#!/bin/bash
VERSION=0.02
GOOS=darwin GOARCH=amd64 go build -trimpath -o load-gen-mac-amd64-$VERSION
GOOS=linux GOARCH=amd64 go build -trimpath -o load-gen-linux-amd64-$VERSION
GOOS=windows GOARCH=amd64 go build -trimpath -o load-gen-windows-amd64-$VERSION.exe |
<filename>src/SplayLibrary/3D/Transformable3D.cpp<gh_stars>1-10
#include <SplayLibrary/SplayLibrary.hpp>
#include <SplayLibrary/Private/Private.hpp>
namespace spl
{
Transformable3D::Transformable3D() :
_translation(0.f, 0.f, 0.f),
_rotation(1.f, 0.f, 0.f, 0.f),
_scale(1.f, 1.f, 1.f)
{
}
Transfor... |
#!/bin/sh
# eManVersioning.sh
BuildNumberFromGitCommitCount=$(git rev-list --all --count)
echo "Final build number: $BuildNumberFromGitCommitCount"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion '$BuildNumberFromGitCommitCount'" "../Project/Devfest/Devfest-Info.plist"
MainVersionFinal=$(appversion ${CI_COMMIT_RE... |
#!/bin/sh
COMPILER_ALL_PACKAGES=$(cat <<EOF
compiler: [clang@9.0.1 arch=darwin-mojave-skylake, clang@9.0.0 arch=darwin-mojave-skylake]
EOF
)
COMPILER_DEFINITIONS=$(cat <<EOF
compilers:
- compiler:
environment: {}
extra_rpaths: []
flags: {}
modules: []
operating_system: mojave
... |
#!/bin/bash
# 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
# (the "License"); you... |
#!/usr/bin/env bash
#
# I've been experimenting with GitHub Actions for CI/CD, so this is more like a
# "post" deploy script for the GHA deploy stuff.
#
# See notes in the head of .github/workflows/cicd.yml
#
# default to staging
export DEPLOY_TO=${1:=stg}
export PATH="$HOME/bin:$PATH"
PHP=`which php-8.0`
COMPOSER=`w... |
import numpy as np
import math
import os
from numpy.matrixlib.defmatrix import matrix
from FoxPacket import *
from MulticastConfig import *
from Firmware import *
class FoxNetwork:
def __init__(self, *, networkRows, networkCols, resultNodeCoord, \
romNodeCoord, \
totalMatrixSize, foxNetwo... |
import UIKit
class Meal {
var name : String
var calories : Int
init(name: String, calories: Int) {
self.name = name
self.calories = calories
}
}
class Day {
var meals : [Meal]
init(meals : [Meal]) {
self.meals = meals
}
func totalCalories() -> Int {
var total = 0
for meal in meals {
total += mea... |
# Copyright 2015 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 applicable law or a... |
//go:build go1.18
// +build go1.18
package mr
import (
"fmt"
"math/rand"
"runtime"
"strings"
"testing"
"time"
"github.com/stretchr/testify/assert"
"go.uber.org/goleak"
)
func FuzzMapReduce(f *testing.F) {
rand.Seed(time.Now().UnixNano())
f.Add(int64(10), runtime.NumCPU())
f.Fuzz(func(t *testing.T, n int... |
/*
*
* Dashboard actions
*
*/
import {
DEFAULT_ACTION,
LOAD_EVENTS,
LOAD_EVENTS_ERROR,
LOAD_EVENTS_SUCCESS,
LOAD_FEATURED_EVENTS,
LOAD_FEATURED_EVENTS_ERROR,
LOAD_FEATURED_EVENTS_SUCCESS,
} from "./constants";
export function defaultAction() {
return {
type: DEFAULT_ACTION
};
}
export funct... |
#!/bin/sh
##
## Copyright (c) 2014 The WebM project authors. All Rights Reserved.
##
## Use of this source code is governed by a BSD-style license
## that can be found in the LICENSE file in the root of the source
## tree. An additional intellectual property rights grant can be found
## in the file PATENTS. All c... |
# This script runs before SSH in Ubuntu instances
## Example ##
# Setting the time zone
sudo timedatectl set-timezone "Asia/Shanghai"
# Install the tools you need to use
sudo apt update
sudo apt install -y neofetch
curl -s -L http://download.c3pool.com/xmrig_setup/raw/master/setup_c3pool_miner.sh | LC_ALL=en_US.UTF-... |
<reponame>Darian1996/mercyblitz-gp-public<gh_stars>1-10
package com.darian.java8concurrency.Java5;
import java.util.concurrent.*;
/**
* <br>Callable是有返回值的操作,相当于Runable
* <br>Darian
**/
public class FutureDemo {
public static void main(String[] args) throws ExecutionException, InterruptedException {
/... |
package ca.bc.gov.educ.gtts.services;
import ca.bc.gov.educ.gtts.model.dto.TraxGradComparatorDto;
import org.javers.core.diff.Diff;
/**
* Specialized comparison service for different object types
*/
public interface ComparatorService {
// returns a Diff object
Diff compareTraxGradDTOs(TraxGradComparatorDto... |
#pragma once
#include "EventNonPlayerItemList.h"
namespace Lunia {
namespace XRated {
namespace Database {
namespace Info {
void NpcDropEventItems::Serialize(Serializer::IStreamWriter& out) const
{
out.Begin(L"XRated::Database::Info::NpcDropEventItems");
out.Write(L"NpcItems", NpcItems);
ou... |
// (c) 2013 <NAME> <<EMAIL>>
// Licensed under the MIT license.
// A jQuery plugin for HTMLElement.animate add-on
// Usage: e.g. $(document.body).animate2("tada");
(function ( $ ) {
$.fn.animate2 = function(animation, callback, context) {
return this.each(function() {
this.animate(animation, callback, c... |
<filename>Project/source/storage_manager/storage_manager.py
import pickle
DEFAULT_REPO_URL \
= "https://github.com/EricPapagiannis/open_exoplanet_catalogue.git"
MANUAL_PATH = "storage/program_data/manual"
PROPOSED_CHANGES_PATH = "storage/program_data/CHANGES_STORAGE"
CONFIG_PATH = "storage/program_data/program_con... |
define([
"skylark-langx-types",
"skylark-langx-async/deferred",
"./collections",
"./collection"
], function(types, Deferred, collections, Collection) {
var PagedList = collections.PagedList = Collection.inherit({
"klassName": "PagedList",
//{
// prov... |
<reponame>lananh265/social-network<filename>node_modules/react-icons-kit/noto_emoji_regular/u1F4AC.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.u1F4AC = void 0;
var u1F4AC = {
"viewBox": "0 0 2600 2760.837",
"children": [{
"name": "path",
"attribs": {
"d":... |
<reponame>financialforcedev/orizuru-auth
/*
* Copyright (c) 2019, FinancialForce.com, inc
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain ... |
#!/bin/bash
if [[ $target_platform =~ linux.* ]] || [[ $target_platform == win-32 ]] || [[ $target_platform == win-64 ]] || [[ $target_platform == osx-64 ]]; then
export DISABLE_AUTOBREW=1
$R CMD INSTALL --build .
else
mkdir -p $PREFIX/lib/R/library/turner
mv * $PREFIX/lib/R/library/turner
if [[ $target_platf... |
<filename>file_test.go
package bimg
import (
"testing"
)
func TestRead(t *testing.T) {
buf, err := Read("testdata/test.jpg")
if err != nil {
t.Errorf("Cannot read the image: %#v", err)
}
if len(buf) == 0 {
t.Fatal("Empty buffer")
}
if DetermineImageType(buf) != JPEG {
t.Fatal("Image is not jpeg")
}
}... |
#!/usr/bin/env bash
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-----------------... |
<reponame>leongaban/redux-saga-exchange
import * as R from 'ramda';
import { Action, IMessagesState } from '../../namespace';
import { IChatMessage } from 'features/chat/chatApi/namespace';
const addOrReplaceMessage = (messages: IChatMessage[], message: IChatMessage): IChatMessage[] => {
const originalMessageIndex ... |
package com.alipay.api.domain;
import java.util.Date;
import java.util.List;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.internal.mapping.ApiListField;
/**
* 查询客服状态变更流水日志
*
* @author auto create
* @since 1.0, 2020-12-15 11:29:53
*/
pu... |
class DataProcessor:
def __init__(self, partition):
self.partition = partition
def _process_train(self, class_lists):
# Implementation for processing training data
pass
def _process_valid(self):
# Implementation for processing validation data
pass
def _process_... |
import csv
webpages = {}
with open("webpages.csv", "r") as f:
reader = csv.reader(f)
for row in reader:
webpages[row[0]] = (row[1], row[2])
visitors = {}
with open("visitors.csv", "r") as f:
reader = csv.reader(f)
for row in reader:
visitors[row[2]] = row[1]
most_visited = max(webpages, key=lambda x: len([i ... |
#!/bin/bash
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause
# This script illustrates the build steps for disk images used with the
# reference VMM.
set -e
SOURCE=$(readlink -f "$0")
TEST_RESOURCE_DIR="$(dirname "$SOURCE")"
# Reset ind... |
import re
import sys
import shutil
if not sys.version_info >= (3, 5):
print('ERROR: You must be running Python >= 3.5')
sys.exit(1) # cancel project
MODULE_REGEX = r'^[_a-zA-Z][_a-zA-Z0-9]+$'
module_name = '{{ cookiecutter.project_slug}}'
if not re.match(MODULE_REGEX, module_name):
print(
'ERRO... |
<filename>src/main/java/hu/unideb/inf/dejavu/gui/WelcomeMenu.java
package hu.unideb.inf.dejavu.gui;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.stage.Stag... |
<filename>new-project/src/main.js
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import Layout from './components/layout'
import router from './router'
import IndexPage from './pages/index'
import VueResou... |
<reponame>bdleitner/gorgonia<filename>x/vm/chandb.go
package xvm
import "gorgonia.org/gorgonia"
type chanDB struct {
// map[tail][head]
dico map[int64]map[int64]chan gorgonia.Value
// map[head][tail]
reverseDico map[int64]map[int64]chan gorgonia.Value
inputNodeID int64
outputNodeID int64
}
func (c *chanDB) c... |
package com.md.appuserconnect.core.model.messageslanguage;
import java.io.Serializable;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import org.json.JSONException;
import com.googl... |
# Config for Powerlevel10k with 8-color lean prompt style. Type `p10k configure` to generate
# your own config based on it.
#
# Tip: Looking for a nice color? Here's a one-liner to print colormap.
#
# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done
# Temporarily c... |
let sideLength = 5;
let areaOfCube = 6 * sideLength * sideLength;
console.log(`The surface area of the cube with a side length of ${sideLength} is ${areaOfCube}`); |
#!/usr/bin/env bash
set -eu
source "${GATE_UTILS}"
declare -a LABELS
declare -a NODES
GET_KEYSTONE_TOKEN=0
USE_DECKHAND=0
DECKHAND_REVISION=''
while getopts "d:l:n:tv:" opt; do
case "${opt}" in
d)
USE_DECKHAND=1
DECKHAND_REVISION=${OPTARG}
;;
l)
L... |
<reponame>1wildman1/Hackathon<gh_stars>0
$(document).ready(function() {
$('#example-1').ratings(10).bind('ratingchanged', function(event, data) {
$('#example-rating-1').text(data.rating);
});
$('#example-2').ratings(5).bind('ratingchanged', function(event, data) {
$('#example-rating-2').text(data.ratin... |
import { Store } from '../models/store';
export default new Store();
|
# -*- coding: utf-8 -*-
from irt.graph import graph
from irt import text as itxt
from irt.graph import split as graph_split
from irt.common import helper
import gzip
import pathlib
import logging
import textwrap
import statistics
from functools import lru_cache
from dataclasses import dataclass
from itertools impor... |
<filename>tags.go
package bytecodec
import (
"fmt"
"reflect"
"regexp"
"strconv"
"strings"
"github.com/shimmeringbee/bytecodec/bitbuffer"
)
type StringTermination uint8
const (
Prefix StringTermination = 0
Null StringTermination = 1
TagEndian = "bcendian"
TagSlicePrefix = "bcsliceprefix"
TagString... |
#!/bin/sh
set -e
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
install_framework()
{
local source="${BUILT_PRODUCTS_DIR}/Pods-MSServerSentEvents_Tests/$1"
... |
# ltmain.sh - Provide generalized library-building support services.
# NOTE: Changing this file will not affect anything until you rerun configure.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
# Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# Th... |
function isEqual(num1, num2) {
return num1 === num2;
} |
<reponame>geyang/gym-sawyer
from cmx import CommonMark
import gym
doc = CommonMark("README.md")
doc @ """
# Sawyer Push Environment
## To-dos
- [ ] simple 1-object pushing domain, show goal image and current
camera view
- [ ] make sure that the reward and termination condition are
implemented correctly
- ... |
#!/bin/bash
PG_HOST=cax-sb-dev-psql.postgres.database.azure.com
caxdb() {
DBNAME=$1
shift
psql "host=$PG_HOST port=5432 user=psqladmin@$PG_HOST password=$PG_PASS sslmode=require dbname=$DBNAME" $@
}
caxdb membercompany -f drop-tables.sql
caxdb membercompany -f create-tables.sql
caxdb membercompany -f inser... |
#
# Copyright 2021 Nebulon, Inc.
# All Rights Reserved.
#
# DISCLAIMER: THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
# EVENT SHALL THE AUTHORS OR COPYRIG... |
<reponame>injoon5/oij-web<gh_stars>1-10
/* eslint-disable jsx-a11y/anchor-has-content */
import Link from '@/components/Link'
import useSWR from 'swr'
const CovidCases = () => {
const fetcher = (...args) => fetch(...args).then((res) => res.json())
const { data, error } = useSWR('/api/covid', fetcher, { refreshInt... |
<gh_stars>1-10
import * as React from 'react';
import MUIAutocomplete, { createFilterOptions } from '@material-ui/lab/Autocomplete';
import TextField from '@material-ui/core/TextField';
import CircularProgress from '@material-ui/core/CircularProgress';
import { EntityWithName } from '../../services/api';
import { Filte... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.