content stringlengths 10 4.9M |
|---|
def join(cls, argv):
i, n = 0, len(argv)
if i < n and argv[i].startswith("@"):
if " " in argv[i]:
raise ValueError("Argument %d contains spaces: %r" % (i, argv[i]))
i += 1
if i < n and " " in argv[i]:
raise ValueError("Argument %d contains spac... |
// Nothing to change here.
//
// This is kind of an antipattern for errors, but it simplifies tings for this
// example program.
impl Debug for Error {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.to_string())
}
} |
/**
* Test header extension code for generic TSV processing
*
* @author <a href="mailto:manuel.holtgrewe@bihealth.de">Manuel Holtgrewe</a>
*/
public class GenericTSVHeaderExtenderDbnsfpTest extends GenericTSVAnnotationDriverWithDbnsfpBaseTest {
@Test
public void test() throws JannovarVarDBException {
VCFHeader... |
/**
* Will return a sampled outcome state by calling the {@link #getTransitionProbabilities(State, GroundedAction)} method and randomly drawing a state
* according to its distribution
* @param s a source state
* @param ga the action taken in the source state
* @return a sampled outcome state
*/
protected St... |
package io.lucci.springwalkthrough.todoapi.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan(basePackages={
"io.lucci.springwalkthrough.todoapi.service",
"io.lucci.springwalkthrough.todoapi.service.adapter"... |
/**
* @return an array of adjacent letter pairs contained in the input string
*/
private String[] letterPairs(String str) {
try {
int numPairs = str.length() - 1;
String[] pairs = new String[numPairs];
for (int i = 0; i < numPairs; i++) {
pairs[i] = ... |
/**
* Utility methods related to AbstractGithubListener
*/
import {AbstractGithubListener} from "./abstract-github-listener"
import {GithubIssuesListener} from "./github-issues-listener"
import {GithubHomeListener} from "./github-home-listener";
import {GithubCommentListener} from "./github-comment-listener";
import ... |
/*
* meta_DeriveKey
*
* This function is a bit gross because of PKCS#11 kludges that pass extra
* object handles in some mechanism parameters. It probably needs to be
* broken up into more managable pieces.
*/
CK_RV
meta_DeriveKey(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism,
CK_OBJECT_HANDLE hBase... |
<filename>service/src/main/java/bio/terra/workspace/service/spendprofile/SpendProfileService.java<gh_stars>1-10
package bio.terra.workspace.service.spendprofile;
import bio.terra.workspace.app.configuration.external.SpendProfileConfiguration;
import bio.terra.workspace.service.iam.AuthenticatedUserRequest;
import bio.... |
package org.qfox.jestful.client.aio;
import java.io.IOException;
import java.nio.channels.AsynchronousSocketChannel;
public class Jdk1_9AioOptions extends Jdk1_7AioOptions implements AioOptions {
private Boolean so_reuseport;
protected Jdk1_9AioOptions() {
}
public static Jdk1_9AioOptions create() {... |
/**
* Base class and API for all the maps.
*
* @author Lee Rhodes
* @author Alexander Saydakov
* @author Kevin Lang
*/
abstract class Map {
private static final String LS = System.getProperty("line.separator");
static final long SEED = 1234567890L;
static final int SIX_BIT_MASK = 0X3F; // 6 bits
static ... |
//Takes a pugi::xml_node at the data level (map.layer.data), the tileMap
//(used only to get the map metadata like image size and map size), and
//the vector you want to populate with the CSV data. tileArray should already
//be sized appropriately (use resize(tileMap.getMapCols() * tileMap.getMapRows())
//or staticTile... |
/*
* Find the pvo_entry associated with the given virtual address and pmap.
* If no mapping is found, the function returns NULL. Otherwise:
*
* For user pmaps, if pteidx_p is non-NULL and the PTE for the mapping
* is resident, the index of the PTE in pmap_pteg_table is written
* to *pteidx_p.
*
* For kernel pma... |
Design parameters and uncertainty bound estimation functions for adaptive-robust control of robot manipulators
In this paper, a parameter and uncertainty bound estimation functions for adaptive-robust control of robot manipulators are developed. A Lyapunov function is defined and parameters and uncertainty bound estim... |
AP Images
David Moyes has always worn the look of a dead man walking, whether at Preston North End in his first job or at Old Trafford in his most high profile. The hollow eyes, thousand-yard stare and pinched mouth are expressions of someone who has accepted his profession is volatile. It is possible these days he lo... |
When Tim Minchin – actor, comedian, confirmed atheist – decided to take his comedy to America's Bible belt, we were concerned he might be burnt at the stake. Here, he describes what happened next…
The hire car guy at the airport in Phoenix, Arizona, tells us there are no "standard" cars left, then suggests that for an... |
/**
* Simple implementation of {@link HttpClient} uses short connections (create
* and close channel for each request).
*
* @since 1.0
*
* @author MJ Fang
*
* @see AbstractHttpClient
* @see DefaultHttpClient
*/
public class SimpleHttpClient extends AbstractHttpClient {
private static final... |
<filename>Quest17-F/server/routes/graphql.ts
import express from 'express';
import { graphqlHTTP } from 'express-graphql';
import { buildSchema } from 'graphql';
import jwt from 'jsonwebtoken';
import * as storage from '../model/sequelize.js';
const schema = buildSchema(`
type Query {
info: info
file(name: S... |
package slogo.util;
import javafx.geometry.Point2D;
/**
* Class that holds information about the path that the turtle moved through and the turtle's orientation
*
* @author <NAME>
*/
public class Movement {
private Point2D startPosition;
private Point2D endPosition;
private double orientation;
pu... |
from typing import NamedTuple, Dict, Tuple, Iterable, Generator
import csv
class Vector(NamedTuple):
name: str
values: Tuple
def transpose(records: Iterable[Dict], key_field: str = None) -> Generator[Vector]:
"""
Given a collection of dictionaries with the same keys, i.e. a collection of records,
... |
<filename>code/scripts/augmenting_exp.py
import torch
#
torch.multiprocessing.set_sharing_strategy('file_system')
import pandas as pd
import numpy as np
import sys
import os
import pickle
import argparse
# local imports
import train_model
import experiment_routines as experiments
# can add different
from dataset im... |
package http
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"io/fs"
"io/ioutil"
"mime"
"net"
"net/http"
"net/http/pprof"
"net/textproto"
"net/url"
"os"
"regexp"
"strings"
"time"
"github.com/NYTimes/gziphandler"
"github.com/hashicorp/errwrap"
"github.com/hashicorp/go-cleanhttp"
"g... |
Registration is extended until January 14th, giving you two more weeks to get your team together and get ready for an awesome year culiminating at Dreamhack Austin! Please read this article as it will contain all the information you need to know:
READ THE RULES!
Before you sign up, make sure you have read and underst... |
/**
*
* @author Matias Martinez
* @param <T>
*
* @param <T>
*/
public class DiffResult<T, R> extends AnalysisResult<T> {
/**
* Filename
*/
Map<String, R> diffOfFiles = null;
public DiffResult(T analyzed, Map<String, R> diffOfFiles) {
super(analyzed);
this.diffOfFiles = diffOfFiles;
}
public Map<S... |
// Makes sure we detect an error if the ZeroingEstimator gets sent a NaN.
TEST_F(PotAndAbsoluteEncoderZeroingTest,
TestPotAndAbsoluteEncoderZeroingWithNaN) {
PotAndAbsoluteEncoderZeroingConstants constants{
kSampleSize, 1, 0.3, 0.1, kMovingBufferSize, kIndexErrorFraction};
PotAndAbsoluteEncoderZeroingE... |
<reponame>riseup12/-nestjs-<filename>dist/posts/posts.controller.d.ts<gh_stars>0
import { Post as PostSchema } from './post.model';
import { ModelType } from '@typegoose/typegoose/lib/types';
export declare class PostsController {
private readonly model;
constructor(model: ModelType<PostSchema>);
}
|
<gh_stars>10-100
package com.android.utility;
import android.os.Bundle;
/**
* Created by pawan on 28/2/17.
*/
public interface FBLoginInterface {
/**
* this function is execute after fbLogin successful.
* @param facebookBundle - facebookBundle contains (profile_pic, idFacebook, first_name, last_name,... |
// Parse the output returned by google_nvme_id and extract the serial number
func parseNvmeSerial(output string) (string, error) {
substrings := nvmeRegex.FindStringSubmatch(output)
if substrings == nil {
return "", fmt.Errorf("google_nvme_id output cannot be parsed: %q", output)
}
return substrings[1], nil
} |
Every year, the U.S. Census Bureau releases its latest data on cities and population growth. The reaction is always the same: News outlets look at the numbers showing which places gained and which ones shed residents, and use them as instant proxies for a decline, a boom or a turnaround in cities all over the country.
... |
<filename>test/Main.hs
{-# LANGUAGE CPP, OverloadedStrings, ImplicitParams, MultiWayIf, LambdaCase, RecordWildCards, ViewPatterns #-}
module Main where
import Control.Exception.Safe
import Control.Monad
import Data.IORef
import FSNotify.Test.EventTests
import FSNotify.Test.Util
import Prelude hiding (FilePath)
import... |
<reponame>mrh419/MyFirstProject
package com.lineargs.watchnext.utils.dbutils;
import android.content.ContentValues;
import com.lineargs.watchnext.data.DataContract;
import com.lineargs.watchnext.utils.MovieUtils;
import com.lineargs.watchnext.utils.retrofit.videos.Videos;
import com.lineargs.watchnext.utils.retrofit.... |
def obfuscation_setting_type(self) -> pulumi.Input['BotObfuscationSettingObfuscationSettingType']:
return pulumi.get(self, "obfuscation_setting_type") |
<reponame>jagriti295/Automatic-Code-Complexity-Prediction<filename>CodeDataset/309.java
// JAVA Code for Newman-Conway Sequence
import
java.util.*;
class
GFG {
// Function to find the n-th element
static
int
sequence(
int
n)
{
// Declare array to store sequence
int
f[] =
new
int
[n +
1
];
f[
0
] =
0... |
Donald Trump drew a red line for Special Counsel Robert Mueller when it came to looking at Trump’s financial records. But if there’s a red line out there, Mueller doesn’t see it.
The former FBI director leading the probe into the Trump campaign’s possible ties to Russia is taking a page from the playbook federal prose... |
package errors
import (
"fmt"
"errors"
)
// UnexpectedMethodErr Handle unexpected method
func UnexpectedMethodErr(wrong string, right string) (err error){
errStr := fmt.Sprintf("Expeceted %s method but found %s", right, wrong)
err = errors.New(errStr)
return
} |
Playing outside could make kids more spiritual
Children who spend significant time outdoors could have a stronger sense of self-fulfillment and purpose than those who don’t, according to new Michigan State University research linking children’s experiences in nature with how they define spirituality.
In the study, pu... |
/**
* Handles click on button use actual value - checks actual value and if it is OK, change card record and close this dialog
*/
@FXML
private void handleClickButtonUseActualValue() {
changedTextFieldActualValue = true;
if (checkActualDateTime()) {
if (card.isJulianDayDateVal... |
<reponame>ngobrel/ngobrel-go-core
package Key
import (
"crypto/sha512"
"encoding/hex"
"fmt"
"testing"
"crypto/rand"
)
func TestGenerate(t *testing.T) {
var x, _ = Generate(rand.Reader)
if x == nil ||
len(x.PublicKey) == 0 ||
len(x.PrivateKey) == 0 {
t.Error("Key was not generated");
}
... |
/*
* Copyright (c) 2008-2020, Hazelcast, 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 ... |
/**
* Converts a ReferenceNetwork to a Network without any stations populated.
* @param n the reference network
* @return a Network
*/
public static Network withoutStations(ReferenceNetwork n) {
Objects.requireNonNull(n);
return Network.from(n.getVersionId(), n.getName(), n.getOrganization(),
... |
def testMotion( com ):
robot = Husky( com )
robot.cmdSpeed = (1000, 1000)
for i in xrange(100):
robot.update()
if robot.enc:
break
assert robot.enc
startEnc = robot.enc[1]
for i in xrange(1000):
robot.update()
if robot.enc and robot.enc[1]-startEnc > 250:
break
robot.cmdSpeed =... |
<gh_stars>1-10
//! The `punch-clock` crate is a lightweight tool for tracking time.
//!
//! This library exposes an API for performing all the same tasks as through the command-line
//! interface (e.g. punching in or out, checking time tracking status, counting totals).
mod event;
mod period;
pub mod sheet;
pub use e... |
/**
* Set the current frame to the index supplied.
* Turn off animation
* This ignores any frames the user may have turned off
*
* @param index index into the animation set
*/
public void gotoIndex(int index) {
if (anime != null) {
setRunning(false);
anime... |
<filename>src/pages/viewlolly.tsx<gh_stars>0
import { useQuery, gql } from '@apollo/client';
import React from 'react'
import LollyTemplate from '../components/LollyTemplate';
const GetLolly_by_path = gql`
query getLolly($path: String!) {
getLolly(path: $path) {
c1
c2
c3... |
The effect of talker age and gender on speech perception of pediatric cochlear implant users
Most clinically-employed speech materials for testing hearing impaired individuals are recordings made by adult male talkers. The author examined the possible effect of talker age and gender on the speech perception of childre... |
/* get a line from stdin, and display a prompt if interactive */
static char*
gp_get_string(char * buffer, size_t len, const char * prompt)
{
# if defined(READLINE) || defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDITLINE)
if (interactive)
return rlgets(buffer, len, prompt);
else
return fgets_ipc(buffer, len)... |
US whistleblowing legislation gets little media attention
May 15, 2009 by intelNews
By IAN ALLEN | intelNews.org |
Unlike American news outlets, the US intelligence community is paying a lot of attention right now to HR 1507, known as the 2009 Whistleblower Protection Enhancement Act. The act is currently making the... |
/**
* 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... |
Ethnic variations in platelet aggregation-comparison between saudi arabs, westerners (europeans and americans), asians and africans.
SUMMARY. Platelet aggregation responses to adenosine diphosphate, adrenaline, collagen, arachidonic acid and ristocetin were measured in healthy subjects, predominantly blood donors resi... |
def RemoveGroundConductorSize(self,grdConductorSize):
pass |
// Used to simulate clock on an Arduino device.
class FakeClock {
public:
unsigned long Tick() { return millis_++; }
private:
unsigned long millis_ = 0;
} |
export * from "./JustifyContentSpaceEvenlySampleStyled";
export * from "./JustifyContentSpaceAroundSampleStyled";
|
<filename>plotlog/main.py
#!/usr/bin/env python
import sys
import argparse
from os.path import isfile
from plotlog.datacut import DataCut
from plotlog.drawgraph import DrawGraph
from plotlog.setting import Setting
from plotlog.selectlog import SelectLog
def main():
args = arg_parser()
st = Setting(args.sett... |
@Test public void atomikosSanityCheck() throws Exception {
this.context=new AnnotationConfigApplicationContext(JtaProperties.class,AtomikosJtaConfiguration.class);
this.context.getBean(AtomikosProperties.class);
this.context.getBean(UserTransactionService.class);
this.context.getBean(UserTransactionManager.clas... |
Story highlights A group supporting the Affordable Care Act will run ads pressuring lawmakers not to gut Obamacare
The ads will begin airing Friday and run through next week in several states
(CNN) When Republican lawmakers turn on their TVs next week, some will see constituents pleading with them: Don't take away ou... |
.
In a prospective study we found 112 patients out of 9549 who had been given 3.5% plasma protein solution during the preceding year but no other blood derivatives and who had not received any immunosuppressive treatment. 68 patients agreed to be tested for sensitisation to 3.5% plasma protein solution. An intracutane... |
/**
* Creates Groovy breakpoints.
*/
public class GroovyBreakpointFactory {
private GroovyBreakpointFactory() {}
public static LineBreakpoint create(String url, int lineNumber) {
LineBreakpoint groovyBreakpoint = LineBreakpoint.create(url, lineNumber);
groovyBreakpoint.setStratum("Groovy");... |
def evaluate_pertubation(data_val, prediction, per_column, pertubation, indicator='pre', column_cluster=None):
ground_truth = data_val[data_val.obs[pertubation] != indicator].copy()
summary = {'all_genes': Metrics.get_square_pearson(ground_truth, prediction)}
if per_column is not None:
groups = data... |
/**
* A simple persister which stores things in memory.
*
* @author mmm2a
*
* @param <InformationType>
*/
public class InMemoryPersister<InformationType> implements InformationPersister<InformationType>
{
private Map<InformationEndpoint, InformationResult<InformationType>> _storage =
new HashMap<InformationE... |
package sync
import (
qlang "github.com/topxeq/qlang/spec"
"sync"
)
// -----------------------------------------------------------------------------
func newMutex() *sync.Mutex {
return new(sync.Mutex)
}
func newRWMutex() *sync.RWMutex {
return new(sync.RWMutex)
}
func newWaitGroup() *sync.WaitGroup {
return ... |
package maybe
/*
module Maybe exposing (Maybe(Just,Nothing), andThen, map, withDefault, oneOf)
{-| This library fills a bunch of important niches in Elm. A `Maybe` can help
you with optional arguments, error handling, and records with optional fields.
# Definition
@docs Maybe
# Common Helpers
@docs map, withDefaul... |
<gh_stars>0
import { Collection } from "discord.js";
export type BattleDataType = {
winner: string;
players: Collection<string, BattlePlayerData>;
};
export type BattlePlayerData = {
username: string;
current_pokemon: BattlePokemonData;
score: number;
pokemons: Collection<string, BattlePokemonData>;
}
export... |
# **HOW THEY WERE FOUND
by Matt Bell**
# **TABLE OF CONTENTS**
* * *
The Cartographer's Girl
The Receiving Tower
His Last Great Gift
Her Ennead
Hold On To Your Vacuum
Dredge
Ten Scenes From A Movie Called Mercy
Wolf Parts
Mantodea
The Leftover
[A Certain Number of Bedrooms,
A Certain Number of Baths]... |
// initialize configuration using all available methods
int unifyfs_config_init(unifyfs_cfg_t* cfg,
int argc, char** argv,
int nopt, unifyfs_cfg_option* options)
{
int rc;
char *syscfg = NULL;
if (cfg == NULL)
return EINVAL;
memset((void*)cfg, 0, s... |
<reponame>naufalfmm/project-iot
package repository
import (
"github.com/labstack/echo/v4"
"github.com/naufalfmm/project-iot/model/dao"
nodeDTO "github.com/naufalfmm/project-iot/model/dto/node"
"github.com/naufalfmm/project-iot/resource"
)
type (
Repository interface {
GetByToken(ctx echo.Context, token string)... |
Data Analysis Time Series For Forecasting The Greenhouse Effect
The greenhouse effect is a term used to describe the earth having a greenhouse effect where the sun's heat is trapped by the earth's atmosphere. This study aims to model the greenhouse effect and then predict the greenhouse effect in the coming period usi... |
def can_add_session(self, session):
ipaddr = session.peer_ip_address()
if ipaddr in self.banned_ips:
return False, f'IP {ipaddr} is banned'
if ipaddr and self.ip_session_totals[ipaddr] >= self._get_ipaddr_limit(ipaddr):
is_local_or_tor = bool(self.is_localhost(ipaddr) or ... |
#pragma once
#include <gnuradio/msg_accepter.h>
#include <gnuradio/sync_block.h>
#include <pmt/pmt.h>
class TriggerEdgeF : public virtual gr::sync_block {
public:
typedef boost::shared_ptr<TriggerEdgeF> sptr;
static sptr make(float thresh, int length, int lookback, int guard)
{
return gnuradio::g... |
/**
*
* @author Arthur Sadykov
*/
public abstract class Dialect {
public static Dialect get(String name) {
switch (name) {
case ConstantDataManager.STANDARD_SQL_DIALECT_NAME: {
return new StandardSQLDialect();
}
case ConstantDataManager.COUCHBASE_N... |
/**
* Created by Q-ays.
* 11-30-2017 10:06
*/
public class CustomException extends RuntimeException{
private ReturnCodeEnum rc;
public CustomException(ReturnCodeEnum rc) {
super();
this.rc = rc;
}
public ReturnCodeEnum getRc() {
return rc;
}
public void setRc(Retur... |
<reponame>linminglu/Fgame
package player
import (
"fgame/fgame/core/heartbeat"
lingtongcommon "fgame/fgame/game/lingtong/common"
"fgame/fgame/game/player"
playertypes "fgame/fgame/game/player/types"
propertycommon "fgame/fgame/game/property/common"
)
//玩家灵童管理器
type PlayerLingTongDataManager struct {
p player.Pl... |
package com.wedfrend.baselibrary.refreshView;
import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.widget.TextView;
import com.wedfrend.baselibrary.R;
import com.wedfrend.baselibrary.refreshView.gifanimation.GifView;
/**
* author:wedfrend
* email:<EMAIL>
* create:20... |
/**
* Encapsulates the Menu Resource
* Created by freddyrodriguez on 18/5/16.
* @author freddyrodriguez
* @author jsanca
*/
@Path("/v1/menu")
public class MenuResource implements Serializable {
private final LayoutAPI layoutAPI;
private final UserAPI userAPI;
private final WebResource webResource;
private fin... |
<gh_stars>1-10
package com.github.bingoohuang.mtcp.pool;
import com.github.bingoohuang.mtcp.LightConfig;
import com.github.bingoohuang.mtcp.LightDataSource;
import com.github.bingoohuang.mtcp.util.UtilityElf;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.concurrent.Scheduled... |
import numpy as np
import cv2
import os
class ImageSlicer(object):
def __init__(self, source, size, strides=[None, None], BATCH=True, PADDING=True):
"""
:param source: the images_dir path
:param size: the size of the slicer image
:param strides: strides must smaller than the size... |
from .job import Job
from .job_history import JobHistory
from .job_pem import JobPermission
API_NAME = 'jobs'
|
package brightbox_test
import (
"github.com/brightbox/gobrightbox"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"net/http/httptest"
"testing"
)
func TestDatabaseServers(t *testing.T) {
handler := APIMock{
T: t,
ExpectMethod: "GET",
ExpectURL: "/1.0/database_serv... |
import './styles.scss';
import markPhoto from '../../assets/images/mark.png';
import billPhoto from '../../assets/images/bill.png'
export function Main() {
return (
<main className="main-page">
<div className="main-content">
<h2 id="about">Sobre o evento</h2>
... |
<gh_stars>1-10
//! 累乗剰余
pub fn modpow(base: i64, exp: i64, n: i64) -> i64 {
let (mut base, mut exp, n) = (base as u128, exp, n as u128);
assert!(
exp >= 0,
"negative exponent cannot be used in modular exponentiation"
);
if exp == 0 {
return 1;
}
let mut res = 1;
ba... |
<gh_stars>1-10
import {HttpHandler, ParsedUri} from "@http4t/core/contract";
import * as handlers from "@http4t/core/handlers";
import {HttpHandlerFn} from "@http4t/core/handlers";
import {Server} from "@http4t/core/server";
import {Uri} from "@http4t/core/uri";
import * as node from 'http';
import {ListenOptions} from... |
def _emit_group_efrocache_lines(targets: list[Target]) -> list[str]:
out: list[str] = []
if not targets:
return out
all_dsts = set()
for target in targets:
if ' ' in target.dst:
raise CleanError('FIXME: need to account for spaces in filename'
f' "... |
/**
* A MessageMismatchHandler cares about incoming error telegrams on a defined error
* channel with name {@value MessageMismatchHandler#ERROR_CHANNEL_ID}.
*
* @author Heiko Scherrer
*/
@MessageEndpoint("mismatchServiceActivator")
public class MessageMismatchHandler {
private static final String ERROR_CHANNE... |
<filename>backend/app/controllers/routes.py
import os
from requests.api import request
from app import app
import requests
from flask import render_template,request
chave_api = os.environ['API_KEY']
url_db = 'https://api.themoviedb.org/3'
@app.route("/",methods=['GET','POST'])
def index():
# chave_api = Adicinar... |
<gh_stars>0
export class DataWithRanking <T>{
data: T[];
paginator : IPaginator
}
export interface IPaginator{
total: number;
currentPage: number;
perpage: number;
lastPage: number;
} |
// Parsed parses the payload which is sent to us from Rasa Open Source upon a request to execute a custom action.
// It returns the parsed payload or an error in case the json -> struct conversion failed.
func Parsed(requestBody io.Reader) (CustomActionRequest, error) {
var parsedRequest CustomActionRequest
parsedReq... |
def positionToLineColumn(position, text):
lines = str(text).split('\n')
counter = 0
line_number = 1
column_number = 0
for line in lines:
new_counter = counter + len(line)
if new_counter > position:
column_number = position - counter
break
else:
counter += len(line) + 1
line... |
An eyewitness at the beach in the Somali capital, Mogadishu, has been telling the BBC Somali service how the attack began earlier this evening.
Ali Bashir Abdullahi Abdi, who is the director of the private radio station Mustakball, says he was socialising with colleagues after work on the beach.
He has slightly diffe... |
Around three weeks ago, Missouri House Speaker Steven Tilley (R) announced his resignation as both speaker and a member of the house. Tilley was term-limited and would have to leave in January regardless, but his resignation months before the end of the legislative lesson left many wondering.Ai??”My decision to resign ... |
/**
* Creates an {@code WHERE} set for JOOQ queries.
*
* @param criteria Body to be parsed on.
* @return Required parameters to be added on.
*/
private static Collection<Condition> criteriaOf(
final @lombok.NonNull Body<?> criteria) {
return criteria.toMap().entrySet().stream().map(e -> DSL.con... |
/*
* Copyright 2015 Nokia Solutions and Networks
* Licensed under the Apache License, Version 2.0,
* see license.txt file for details.
*/
package org.robotframework.ide.eclipse.main.plugin.tableeditor.keywords;
import org.robotframework.ide.eclipse.main.plugin.model.RobotKeywordCall;
import org.robotframework.id... |
t = int(input())
for i in range(t):
n = int(input())
dop = list(map(int, input().split()))
mas = []
mas.append([dop[0], 1])
for j in range(1, n):
if mas[-1][0] == dop[j]:
mas[-1][1] += 1
else:
mas.append([dop[j], 1])
g = mas[0][1]
m = len(mas)
k = n // 2
kol = g
s = 0
b = 0
for j ... |
def read_jsonl(
paths: Union[Union[Path, str], list[Union[Path, str]]],
text_key: str = "text",
id_key: Optional[str] = None,
max_doc_size: Optional[int] = None,
encoding: str = "utf-8",
) -> Iterator[tuple[str, str]]:
if isinstance(paths, (Path, str)):
paths = [paths]
for path in pa... |
<gh_stars>0
import { IAuthRepository } from "../../interfaces/IAuthRepository"
import { ILangRepository } from "../../interfaces/ILangRepository"
import { ILocationService } from "../../interfaces/ILocationService"
import { Modules } from "../../interfaces/IModule"
import { ITasksRepository } from "../../interfaces/ITa... |
# coding=utf-8
from __future__ import unicode_literals, absolute_import
from django.core.management.base import BaseCommand, CommandError
from filer.models import Folder
from filertools.filertools.models import OrderedFile
class Command(BaseCommand):
help = 'Fixes ordering for specified folder or for whole tree... |
def update_text(self, matched: str, unmatched: str) -> None:
if (config.cache['hints.uppercase'] and
self._context.hint_mode in ['letter', 'word']):
matched = html.escape(matched.upper())
unmatched = html.escape(unmatched.upper())
else:
matched = html.... |
def plotINVSummary(seisFile, expDC, invLYRFile, invDC, oneD=True, origLYRFile=None, fmin=2, fmax=100,
vmin=50, vmax=1500, dv=0.1, dx=1.5, X1=9, vBounds=None, zBounds=None, save=False, fs=None):
t, s = loadModelDAT(seisFile)
DC_exp = loadTheorDC(expDC, asDict=True, dictKey='Experimental DC')
if isinstance(invDC, di... |
import aws from 'aws-sdk';
import { promises as fs } from 'fs';
import path from 'path';
import config from './webpack.config';
const region = process.argv[2] || 'us-east-1';
const ses = new aws.SES({ apiVersion: '2010-12-01', region });
const syncTemplate = async (src: string): Promise<void> => {
const template =... |
package com.mgatelabs.swftools.support.swf.objects;
public class FTextGlyph {
/*
TextGlyphIndex UB [nGlyphBits] Glyph index into current font
TextGlyphAdvance SB [nAdvanceBits] X advance value for glyph
*/
private int myGlyphIndex;
private int myGlyphAdvance;
public FTextGlyph(in... |
/**
* Comparator that will allow sorting a list of modules on their priority.
*/
public class ModuleNeededComparator implements Comparator<ModuleNeeded> {
/**
* 1) The modules are going to be sorted by their module name.<br>
* 2) The modules with a bundle name are going to be prioritize compared to the... |
import { Subscription } from './subscription';
import {
clone,
isFunction
} from '@colonise/utilities';
import type {
PartialObserver,
Subscribable,
Unsubscribable
} from 'rxjs';
/**
* The public API of a Subject.
*/
export interface SubjectApi<TValue> {
/**
* The current value.
*/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.