content stringlengths 10 4.9M |
|---|
/*
*
* Copyright (c) 2021 Project CHIP Authors
* 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... |
def ydim(self) -> int:
if (sdims := self.spatial_dims) is not None:
return self._xx.dims.index(sdims[0])
raise ValueError("Can't locate spatial dimensions") |
<filename>src/server/components/personnel/relations/personnel-work-exp.model.ts
import {
Table, Column, Model, PrimaryKey, Unique, AutoIncrement, ForeignKey, BelongsTo,
NotEmpty
} from 'sequelize-typescript';
import Personnel from "../personnel.model";
import {IPersonnel} from "../personnel.interface";
import IWork... |
package com.lcg.multijetty;
import org.eclipse.jetty.server.*;
import org.eclipse.jetty.util.BlockingArrayQueue;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.eclipse.jetty.util.thread.ThreadPool;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.Sprin... |
As Toronto Maple Leafs management continues to reshape its struggling roster, they locked up another quality offensive prospect Thursday by signing forward Andreas Johnson.
The diminutive dangler joins a promising stable of Swedish prospects in the Leafs system including William Nylander, Petter Granberg and Viktor Lo... |
def nest_fields(df: pd.DataFrame, grouping: str, new_column: str) -> pd.DataFrame:
return (df.groupby(grouping)
.apply(lambda row: row.replace({np.nan: None}).to_dict('records'))
.reset_index()
.rename(columns={0: new_column})) |
package com.mangal.demoserver.Common;
import com.mangal.demoserver.Model.Request;
import com.mangal.demoserver.Model.User;
public class Common {
public static User cureentUser;
public static final String UPDATE ="Update";
public static final String DELETE ="Delete";
public static final int PICK_IMAGE... |
<reponame>matthewvanderson/MagicBot
import os
import coc
from dotenv import load_dotenv
load_dotenv()
COC_EMAIL = os.getenv("COC_EMAIL")
COC_PASSWORD = os.getenv("COC_PASSWORD")
DB_LOGIN = os.getenv("DB_LOGIN")
LINK_API_USER = os.getenv("LINK_API_USER")
LINK_API_PW = os.getenv("LINK_API_PW")
from disnake import util... |
<filename>src/components/Activities/Activity1/index.tsx
import React from 'react';
import '../../styles/Activity1.scss';
import Game1EndScreen from '../../../assets/activity1/game1-endscreen.svg';
import ComputerSvg from '../../../assets/activity1/search-highlighted-computer.svg';
import Carousel from '../../shared/... |
<gh_stars>1-10
package com.aspose.barcode.examples.TwoD_barcodes.utility_features;
import java.awt.Font;
import java.io.IOException;
import com.aspose.barcode.BarCodeImageFormat;
import com.aspose.barcode.generation.CodeLocation;
import com.aspose.barcode.examples.Utils;
import com.aspose.barcode.generation.BarcodeGe... |
Synthesis, DNA binding, and cleaving properties of an ellipticine-salen.copper conjugate.
The synthesis of a DNA-cutting agent that conjugates an ellipticine chromophore and a copper complex of bis(salicylidene)ethylenediamine, referred to as a salen, is reported. The presence of the salen.Cu complex allows cleavage o... |
def _file_to_dict(self):
parameters = {}
try:
for line in self._autosave_file_lines():
try:
p, v = line.split(self.autosave_separator, 1)
parameters[p] = v.strip()
except ValueError:
print_and_log("Va... |
<reponame>kiranmaragoni/parental-control
{-# LANGUAGE OverloadedStrings #-}
module Lib where
import Checking
import CliOpts
import Config
import Control.Concurrent
import Control.Monad
import StateLogger
import System.Directory
import System.Environment
import System.FilePath
import System.IO
import System.Process
imp... |
/**
* \headerfile Stopwatch.h
*
* \brief simple timing of function calls.
*
* Mimics the behavior of tic/toc of Matlab and throws an error if toc() is called without starting a timer before.
*
* Example:
* Stopwatch::tic(); starts timer A
*
* Stopwatch::tic(); starts timer B
* method1();
* double ti... |
<filename>pipeline_cortical_thickness.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from dependencies import FILEDIR, ROOTDIR
from utils import CreateTemplate
from utils import AtroposSegmentation
from utils.HelperFunctions import Output, FileOperations, Imaging
if __name__ == "__main__":
try:
... |
def wrap_description(description, column_width):
d_lines = textwrap.wrap(description, column_width)
if len(d_lines) < 9:
d_lines += [""] * (9 - len(d_lines))
return d_lines |
<gh_stars>1-10
#pragma once
#include "BasicTypes.h"
#include "BoxTypes.h"
namespace formulae{ namespace node {
hlist_t makeChar(style_t st, family_t fam, charCode_t ch);
std::tuple<NodeRef, dist_t, bool>
makeNucChar(style_t st, bool isOp, family_t fam, charCode_t ch);}} |
<filename>wp-content/themes/portfolio/react-src/src/sections/Footer/index.tsx
import React from 'react'
import {inject, observer} from 'mobx-react'
import {Container, Row, Col} from 'react-bootstrap';
import {SocialMediaStore} from '../../stores/SocialMedia'
import SocialMediaButton from '../../components/Misc/SocialM... |
#pragma once
#include "il2cpp.h"
bool FieldFader__get_IsBusy (FieldFader_o* __this, const MethodInfo* method_info);
void FieldFader__OnUpdate (FieldFader_o* __this, float deltaTime, const MethodInfo* method_info);
void FieldFader__FadeOut (FieldFader_o* __this, int32_t type, float time, const MethodInfo* method_info)... |
<reponame>FreakStar03/MedAlthea
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_addMedical(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(900, 850)
self.widget = QtWidgets.QWidget(Dialog)
self.widget.setGeometry(QtCore.QRect(0, 0, 900, 850))
... |
# Copyright 2019 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 ... |
.
Traditional Chinese medicine(TCM) is a complex system with multiple chemical compositions. The most significant character of TCM is that the chemical compositions interact with each other by multi-target synergism to treat diseases. Previous reports mainly focused on the investigation of single signaling pathway det... |
Pharmacological actions and underlying mechanisms of Catechin: A review.
BACKGROUND
Catechin is a phytochemical and is a major component of our daily use beverages, which has shown great potential in improving general health and fighting against several medical conditions. Clinical studies have confirmed its effective... |
<gh_stars>0
package claire.sample;
public class SungJuckV6DT0 extends SungJuckV6V0 {
public SungJuckV6DT0() {
}
public SungJuckV6DT0(String name, int kor, int eng, int mat) {
// SungJuckV6V0의 생성자 호출
super(name, kor, eng, mat);
}
}
|
<filename>app/src/main/java/com/example/quizgame/QuizSession.java
package com.example.quizgame;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.a... |
<gh_stars>1-10
#include "WebServerSTPlus.h"
const char legalChars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890/.-_~";
/***********************************************************************************//**
* @brief WebServerSTPlus() Initializer
* Once the WebServer is initialezed network communications are active
... |
package com.gb.billsharing.service;
import com.gb.billsharing.model.Expense;
import com.gb.billsharing.model.User;
public class NotificationServiceImpl implements NotificationService {
@Override
public void notifyUser(User user, Expense expense) {
System.out.println("Notified");
}
}
|
Initial experience of robotic single port plus one (SP + 1) distal pancreatectomy using the da Vinci SP system: A report of three cases with video.
Introduction
With the advances of laparoscopic techniques, many efforts to reduce the number of the trocar site in abdominal surgery has been made. However, laparoscopic s... |
<reponame>trillaura/hugepages-afpacket<filename>src/utils/perf.c
#include "perf.h"
unsigned long long rdclock(void)
{
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
}
static void update_stats(struct stats *stats, uint64_t val)
{
double delta;
stats->n++;... |
<reponame>jjhenkel/dockerizeme
import tensorflow as tf
from tensorflow.python.framework import ops
from tensorflow.python.ops import gen_nn_ops
@ops.RegisterGradient("GuidedRelu")
def _GuidedReluGrad(op, grad):
return tf.select(0. < grad, gen_nn_ops._relu_grad(grad, op.outputs[0]), tf.zeros(grad.get_shape()))
if ... |
def MACD(close ,fastperiod=26 , slowperiod=12 , signalperiod=9 ):
slow = close.ewm(span=slowperiod, adjust=False).mean()
fast = close.ewm(span=fastperiod, adjust=False).mean()
macd = fast - slow
macdsignal = macd.ewm(span=signalperiod , adjust=False).mean()
return macd , macdsignal |
Any good news should be savored by the Eagles these days, and Philadelphia got a much needed boost after an MRI exam Monday revealed that defensive end Trent Cole's calf injury is not as severe as originally feared, NFL Network's Albert Breer reported.
Citing a league source, Breer reported Cole suffered a Grade 2 cal... |
WASHINGTON (CNN) -- One of the main stumbling blocks to talk with Iran has been the condition that Iran suspends its uranium enrichment. Now, the Obama administration may take that option off the table, at least for now.
This is from an Iranian nuclear plant in the central province of Isfahan on April 9.
The United S... |
<filename>LPsolver_v1.5/glpk/patches_global.h
#ifndef _PATCHES_GLOBAL_H
#define _PATCHES_GLOBAL_H
#include "postgres.h"
#include "lib/stringinfo.h"
#define free(ptr) pfree(ptr)
#define malloc(size) palloc0(size)
#define realloc(ptr,size) realloc(ptr,size)
// Renaming of types/functions
#define bool pg_glpk_bool
#d... |
/** Deinitializes ES objects created during test execution */
void MultisampleTextureFunctionalTestsBlittingToMultisampledFBOIsForbiddenTest::deinit()
{
const glw::Functions& gl = m_context.getRenderContext().getFunctions();
if (fbo_draw_id != 0)
{
gl.deleteFramebuffers(1, &fbo_draw_id);
fbo_draw_id = 0;
}
if ... |
/*
* 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 ... |
const MAX_VEC_SIZE: usize = 4;
#[derive(Debug, Clone, PartialEq)]
pub struct VecIter<T: Copy> {
items: [T; MAX_VEC_SIZE],
end: usize,
pos: usize,
}
impl<T: Copy> VecIter<T> {
#[inline]
pub(crate) fn new(items: [T; MAX_VEC_SIZE], num_items: usize) -> Self {
debug_assert!(num_items <= MAX_VE... |
/**
* Mapper implementation using Jackson. TODO: Configure Mapper via a
* tm-mapper-defaults.json file under resources/config/.
*
* For recursive dependencies check @JsonFilter : http://www.theotherian.com/2014/02/jackson-mixins-and-modules-external-classes.html
*
* NOTE: getters and setters are used when... |
// SPDX-License-Identifier: MIT
//
// Copyright (c) 2021 <NAME>
#include <assert.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <umod/umodpack.h>
#include "instruments.h"
#include "song.h"
#include "patterns.h"
int save_pack(const char *path)
{
int ret = -1;
FILE *f = fopen(path, "w... |
<filename>components/table/techInfoTable/ITechInfoTableProps.ts
import { Image } from '@prisma/client';
interface ITechInfoTableProps {
image: Image;
exposure: string | null;
}
export default ITechInfoTableProps;
|
def findPolicySet(self, policySetIdReference, common):
policySet = self.policySetMap.get(policySetIdReference, None)
if policySet is None:
policySet = self._findPolicyFromReference(policySetIdReference,
common)
policySet = self.po... |
<reponame>StarForger/neb-mc-rcon
package cmd
var (
BuildVersion string = ""
) |
<filename>gk2-lab2/vertexTypes.cpp<gh_stars>0
#include "vertexTypes.h"
using namespace DirectX;
using namespace mini;
const D3D11_INPUT_ELEMENT_DESC VertexPositionColor::Layout[2] = {
{ "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, offsetof(VertexPositionColor, position), 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR... |
import gzip
from lxml import etree
from tqdm import tqdm
import faiss
import json
import numpy as np
import rltk
from itertools import islice
from sklearn.metrics import ndcg_score
import time
"""
A scrpit contains some functions to help make predictions
"""
############################################ for CSKG node... |
/*
* Copyright (C) 2020 Graylog, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Server Side Public License, version 1,
* as published by MongoDB, Inc.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; withou... |
Newton polygon stratification of the Torelli locus in PEL-type Shimura varieties
We study the intersection of the Torelli locus with the Newton polygon stratification of the modulo $p$ reduction of certain PEL-type Shimura varieties. We develop a clutching method to show that the intersection of the Torelli locus with... |
// This function initializes the decoder for reading a new image.
static WORD init_exp( WORD size )
{
curr_size = size + 1;
top_slot = 1 << curr_size;
clear = 1 << size;
ending = clear + 1;
slot = newcodes= ending + 1;
navail_bytes = 0;
nbits_left = 0;
retur... |
def average_by_events(epochs, method='mean'):
picks_dict = {'picks': ['eeg', 'misc']} \
if isinstance(epochs, Epochs) else {}
evokeds = []
for event_type in epochs.event_id.keys():
evoked = epochs[event_type].average(**picks_dict, method=method)
evoked.comment = event_type
ev... |
def process(cls, input_payload):
alerts = []
payload = copy(input_payload)
rules = [rule_attrs for rule_attrs in cls.__rules.values()
if rule_attrs.logs is None or payload.log_source in rule_attrs.logs]
if not rules:
LOGGER.debug('No rules to process for %s',... |
// BucketService tests all the service functions.
func BucketService(
init func(BucketFields, *testing.T) (influxdb.BucketService, string, func()),
t *testing.T,
opts ...BucketSvcOpts) {
tests := []struct {
name string
fn bucketServiceF
}{
{
name: "CreateBucket",
fn: CreateBucket,
},
{
name:... |
def do__dir_triggers(self, arg, opts):
self.do__dir_(arg, opts, 'triggers', self._str_trigger) |
/**HEADER********************************************************************
*
* Copyright (c) 2008-2015 Freescale Semiconductor;
* All Rights Reserved
*
* Copyright (c) 1989-2008 ARC International;
* All Rights Reserved
*
***************************************************************************
*
* THIS SOFTWARE IS... |
<filename>jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/xml/NodeTypeWriter.java<gh_stars>1-10
/*
* 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 copyrig... |
Medical professional involvement in smartphone ‘apps’ in dermatology
antagonist production, activation of blockade of death receptor Fas (CD95), modulation of dendritic cell properties, increased expression and signalling through the inhibitory Fc receptor, Fc-c RIIB and enhanced steroid sensitivity. In our case, the ... |
Effect of seeding date, plant density, moisture availability and soil nitrogen fertility on maize kernel breakage susceptibility
The objectives of this study were to evaluate seeding date, plant density, moisture availability, and soil N fertility effects on maize (Zea mays L.) kernel breakage susceptibility. Three hy... |
def disable_all_buttons(self):
for child in self.control_frame.winfo_children():
child.config(state='disabled')
child.unbind("<ButtonPress-1>")
child.unbind("<ButtonRelease-1>")
self.stop_button.config(state='normal')
for child in self.target_frame.winfo_child... |
/*
* pgxc_separate_quals
* Separate the quals into shippable and unshippable quals. Return the shippable
* quals as return value and unshippable quals as local_quals
*/
static List *
pgxc_separate_quals(List *quals, List **unshippabl_quals, bool has_aggs)
{
ListCell *l;
List *shippabl_quals = NIL;
bool tmp_has... |
<filename>src/ev3dev/sensors/index.ts
export * from './ColorSensor'
export * from './GyroSensor'
export * from './I2CSensor'
export * from './InfraredSensor'
export * from './LightSensor'
export * from './Sensor'
export * from './SoundSensor'
export * from './TouchSensor'
export * from './UltrasonicSensor'
|
// ToFile saves an elk object to a file
func ToFile(elk *Elk, filePath string) error {
dataBytes, err := yaml.Marshal(elk)
if err != nil {
return err
}
file, err := os.OpenFile(
filePath,
os.O_WRONLY|os.O_TRUNC|os.O_CREATE,
0666)
if err != nil {
return err
}
defer file.Close()
_, err = file.Write(data... |
// skip skips test based on it and/or t
func (o *Kb) skip() bool {
if o.ItMin >= 0 {
if o.it < o.ItMin {
if o.Verb {
io.Pf(". . . skipping because it < ItMin\n")
}
return true
}
}
if o.ItMax >= 0 {
if o.it > o.ItMax {
if o.Verb {
io.Pf(". . . skipping because it > ItMax\n")
}
return ... |
import {Inject, Injectable} from "@angular/core";
import {TdDialogService} from "@covalent/core/dialogs";
import "rxjs/add/operator/share";
import {Observable} from "rxjs/Observable";
import {Subject} from "rxjs/Subject";
import {Subscription} from "rxjs/Subscription";
import {KyloNotification, NotificationService} fr... |
package com.code.controller;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.UUID;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.time.DateFormatU... |
package vp.metagram.utils;
import android.content.Context;
import android.database.MatrixCursor;
import java.io.File;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.Locale;
import vp.tools.io.iDBExport;
import vp.tools.io.iDBMetagram;
import static vp.metagram.general.fu... |
// DefaultRates returns the default rate set of the limiter. The only reason to
// Provide this method is to facilitate testing.
func (tl *TokenLimiter) DefaultRates() *RateSet {
defaultRates := NewRateSet()
for _, r := range tl.defaultRates.m {
defaultRates.Add(r.period, r.average, r.burst)
}
return defaultRates... |
def defaultEventHandler(
bot,
groupId,
creatorId,
user,
text,
dbAction,
handledByExtension,
event
):
return |
package action;
public class Hex
{
// Converts a string of hex digits into a byte array of those digits
static public byte[] toByteArr(String no)
{
byte[] number = new byte[no.length()/2];
int i;
for (i=0; i<no.length(); i+=2)
{
int j = Integer.parseInt(no.substring(i,i+2), 1... |
This book is written for those who are in sympathy with the spirit in which it is written. This is not, I believe, the spirit of the main current of European and American civilization. The spirit of this civilization makes itself manifest in the industry, architecture and music of our time, in its fascism and socialism... |
/**
* A No-op implementation of the {@link Instrumentation} interface that extracts all {@link ClassFileTransformer transformers} installed
* onto the instance and appends the agent jar to the bootstrap class path.
*/
public class TransformerExtractor implements Instrumentation {
@Delegate(excludes = Transformer... |
<reponame>SemihGursoy96dus/ArtificialPBs
package com.artificial.cachereader.meta;
import com.artificial.cachereader.datastream.Stream;
import com.artificial.cachereader.fs.CacheSource;
public class OSRSReferenceTable extends ReferenceTable {
public OSRSReferenceTable(final CacheSource cache, final int id) {
... |
/* Returns a fortune cookie fortune to the player */
public class FranklinCommandExecutor implements CommandExecutor {
private TrollMachine plugin;
private Logger logger = null;
private List<UUID> allowedUsers = new ArrayList<UUID>();
public FranklinCommandExecutor(TrollMachine plugin) {
this.p... |
/**
* Utility class for the P4Runtime driver.
*/
final class P4RuntimeDriverUtils {
private static final String DEVICE_ID_PARAM = "device_id=";
private static final Logger log = LoggerFactory.getLogger(P4RuntimeDriverUtils.class);
private P4RuntimeDriverUtils() {
// Hide constructor.
}
... |
def bilinear_interpolation_of_patch_registration():
print("Beginning bilinear_interpolation_of_patch_registration...")
root = "../data/"
reg1 = cv2.cvtColor(cv2.imread(root + "NG1_1.jpg"), code=cv2.COLOR_BGRA2RGBA)
reg2 = cv2.cvtColor(cv2.imread(root + "OK1_1.jpg"), code=cv2.COLOR_BGRA2RGBA)
h, _ = ... |
<gh_stars>1-10
export function dieOnError() {
process.on("unhandledRejection", (reason, error) => {
console.error(reason, error)
process.exit(1)
})
process.on("uncaughtException", error => {
console.error(error)
process.exit(1)
})
}
|
Transporter-Mediated Drug–Drug Interactions with Oral Antidiabetic Drugs
Uptake transporters (e.g., members of the SLC superfamily of solute carriers) and export proteins (e.g., members of the ABC transporter superfamily) are important determinants for the pharmacokinetics of drugs. Alterations of drug transport due t... |
// C function void glVertexAttrib1f ( GLuint indx, GLfloat x )
public static void glVertexAttrib1f(
int indx,
float x
) {
checkWebGLContext();
/**
* @j2sNative
* android.opengl.GLES20.prototype.mContext.vertexAttrib1f(indx, x);
*/{}
} |
/*==========================================================================
SeqAn - The Library for Sequence Analysis
http://www.seqan.de
============================================================================
Copyright (C) 2007
This library is free software... |
def _getActiveThread(self,uid):
if uid in self.testThreads:
testingThread = self.testThreads.get(uid)
if testingThread and not testingThread.isAlive():
self.testThreads[uid] = None
testingThread = None
return testingThread |
/************************************************************************/
/* */
/* l i s p _ X e x i t */
/* */
/* Turn off the X window we've been using for display. */
/* */
/************************************************************************/
void lisp_Xexit(DspInterface dsp)
{
#i... |
<filename>src/test/internal/hardhat-network/provider/node.ts<gh_stars>0
import { Block } from "@ethereumjs/block";
import Common from "@ethereumjs/common";
import { TxData, TypedTransaction } from "@ethereumjs/tx";
import VM from "@ethereumjs/vm";
import { AfterBlockEvent, RunBlockOpts } from "@ethereumjs/vm/dist/runBl... |
<reponame>swashcap/mtrx<filename>src/components/text/Caption.tsx<gh_stars>0
import React from 'react';
import { styled } from '@linaria/react';
import { TextColor } from '../../types';
export interface CaptionProps extends React.HTMLAttributes<HTMLSpanElement> {
bold?: boolean;
color?: TextColor;
}
export const ... |
/*
* Copyright 2020 <NAME>. (http://www.onehippo.com)
*
* 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 applicabl... |
import {Component, Input, OnDestroy, OnInit} from '@angular/core';
import { SearchImageService } from '../service-module/ajaxCallService/search-image.service';
import {Image} from '../image';
import { SearchBooksService } from '../service-module/ajaxCallService/search-books.service';
import { Book } from '../book';
@C... |
// handleRegistered handles the registered websocket event
func (ws *websocket) handleRegistered(c *astiws.Client, eventName string, payload json.RawMessage) error {
ws.processQueue()
ws.m.Lock()
ws.isConnected = true
ws.m.Unlock()
astilog.Info("astibrain: brain has connected to bob")
return nil
} |
<reponame>Gerguevara/passportTesting
import {MigrationInterface, QueryRunner} from "typeorm";
export class creatingRelationsBtwUserCustomers1641153971721 implements MigrationInterface {
name = 'creatingRelationsBtwUserCustomers1641153971721'
public async up(queryRunner: QueryRunner): Promise<void> {
a... |
def load_wav_to_torch(wav_file, sample_rate):
data, sr = librosa.load(wav_file, sample_rate)
if len(data.shape) != 1:
raise ValueError( f"the audio ({wav_file}) is not single channel." )
return torch.FloatTensor(data).unsqueeze(0), sr |
/**
* This implementation is motivated from several ideas to get a compact sparse set.
* When using a a bucket of BitSet, problems
* - smaller sizes of BitSet are not useful, since null references are themselves 64/32 bit references.
* - larger sizes of BitSet for truly sparse integers, has overhead... |
// New is the constructor of combined
func New(beaconChains ...beaconchain.BeaconChain) beaconchain.BeaconChain {
return &combined{
beaconChains: beaconChains,
}
} |
<filename>src/models/get_universe_types_type_id_ok.rs
/*
* EVE Swagger Interface
*
* An OpenAPI for EVE Online
*
* OpenAPI spec version: 1.3.8
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
/// GetUniverseTypesTypeIdOk : 200 ok object
#[allow(unused_imports)]
use serde_json::Value;
... |
<filename>realworld/infra/src/main/java/com/msjc/realworld/infra/dmr/readservice/TagReadService.java
package com.msjc.realworld.infra.dmr.readservice;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TagReadService {
List<String> all();
}
|
/*
*----------------------------------------------------------------------
*
* printString --
*
* Dump the string representation of an object to stdout. This
* function is purely for debugging purposes.
*
* Results:
* None.
*
* Side effects:
* None.
*
*-----------------------------------------------------... |
def with_masked_annotations(self, annot_types, mask_char=None, shadow=False):
masked_seqs = []
for seq in self.seqs:
masked_seqs += [seq._masked_annotations(annot_types, mask_char, shadow)]
new = self.__class__(data=masked_seqs, info=self.info, name=self.name)
return new |
<gh_stars>1-10
module AOC.Day01 where
import AOC.Common.Prelude
import Data.List
import Data.Maybe
type Input = [Int]
parser :: Parser Input
parser = many integer
one :: Input -> Int
one xs =
fromMaybe 0
. fmap (\(a, b) -> a * b)
. find (\(a, b) -> a + b == 2020)
$ (,) <$> xs <*> xs
two :: Input -> Int
... |
<reponame>bonniech3n/merou
from selenium.webdriver.support.select import Select
from itests.pages.base import BaseModal, BasePage
class ServiceAccountViewPage(BasePage):
def click_disable_button(self):
button = self.find_element_by_class_name("disable-service-account")
button.click()
def cli... |
#pragma version(1)
#pragma rs java_package_name(cn.louispeng.imagefilter.renderscript)
// 参数化边缘检测效果
#include "Clamp.rsh"
#include "YUV.rsh"
typedef float3 (*PF) (int32_t, int32_t);
// set from the java SDK level
rs_allocation gIn;
rs_allocation gOut;
rs_script gScript;
int32_t gDoGrayConversion = 1;
int32_t gDoInve... |
class Classical:
"""
Written by: Asheka
This class contains methods for time series forecasting with arima model,
where the parameters (p,d,q) need to input manually.
"""
def __init__(self, frame):
self.frame = frame
self._order = 0, 0, 0
def get_get_timeseries(... |
<gh_stars>0
import React from 'react'
import {IndexBar} from 'antd-mobile'
export default () => {
const getRandomList = (min: number, max: number): string[] => {
return new Array(Math.floor(Math.random() * (max - min) + min)).fill('')
}
const ItemList = (() => {
const charCodeOfA = 'A'.charCodeAt(0)
... |
/**
* set the saveButton and the loadSaveButton
*/
private void prepareSaveButtons(){
saveButton = new CustomButton(50, 550,WR,HR,"saveButton.png", (byte) 1);
saveButton.overlay.addEventHandler(MouseEvent.MOUSE_CLICKED, e->{
String name = CompleteFieldBox.display("Enter a file na... |
<gh_stars>1-10
#!/bin/env
# -*- coding: utf-8 -*-
"""
This hello-world python module illustrates how to include data files in
an ISPy package. The file `package_data' simply contains a list of
filenames and/or patterns to be included.
This module implements the function `hello' that forwards the contents
of `hello.tx... |
/**
* Protocol which prints out the real size of a message. Don't use this layer in
* a production stack since the costs are high (just for debugging).
*
* @author Bela Ban June 13 2001
*/
public class SIZE extends Protocol {
protected final List<Address> members=new ArrayList<>();
@Property protected boo... |
#include <algorithm>
#include <iostream>
#include <cstring>
#include <vector>
#include <parallel/algorithm>
#include <pam/pam.h>
#include <pam/get_time.h>
timer init_tm, build_tm, total_tm, aug_tm, sort_tm, reserve_tm, outmost_tm, globle_tm, g_tm;
double early;
template<typename c_type, typename w_type>
struct RangeQ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.