content stringlengths 10 4.9M |
|---|
<reponame>animekita/selvbetjening<gh_stars>0
# coding=UTF-8
from django.shortcuts import render
from django.template import Context, Template
from selvbetjening.core.events.options.dynamic_selections import SCOPE, dynamic_selections
from selvbetjening.core.events.models import Attend
def generic_event_status(reques... |
// ReconcileKind implements Interface.ReconcileKind.
func (r *Reconciler) ReconcileKind(ctx context.Context, binding *servicebindingv1alpha3.ServiceBinding) reconciler.Event {
logger := logging.FromContext(ctx)
if binding.GetDeletionTimestamp() != nil {
return nil
}
now := r.now()
binding.Status.InitializeCondit... |
/**
* Request Mapping for handling adding a new Program entry in the admin table
* @param model Model to add attributes and update view
* @param requestWrapper The wrapper object that holds a program and courseList
* @return The request wrapper and a valid http status
*/
@RequestMapping(value="... |
"That's not to say we are continuing... and will continue to think about what's the best way to architect the app and whether it makes sense to do a separate app for some of the components that are in there or all of the components that are in there. But right now, we think we've designed iTunes and you'll see we've go... |
def from_dict(data, ctx):
data = data.copy()
if data.get('clientExtensions') is not None:
data['clientExtensions'] = \
ctx.transaction.ClientExtensions.from_dict(
data['clientExtensions'], ctx
)
if data.get('units') is not None:
... |
/**
* Get a query result from the query cache.
*/
@SuppressWarnings("unchecked")
public BeanCollection<T> queryCacheGet(Object id) {
if (queryCache == null) {
return null;
} else {
return (BeanCollection<T>) queryCache.get(id);
}
} |
/**
* Helper to create instance of FileWriter for writing CSV.
*
* @param pFile File or null
* @param fileName String
* @param method String
* @return FileWriter instance
*
* @throws MergeCsvException If there is any error at File I/O level
* @throws IllegalArgumentException If given fileName is null... |
import "./style.css";
import React, { useEffect, useState } from "react";
import { ProductDisplay } from "../../components/ProductDisplay";
import { Carousel } from "../../components/Carousel";
import { Link } from "react-router-dom";
import { fetchDiscountedProducts } from "../../utils/productFunctions";
export const... |
Rep. Adam Kinzinger, R-Ill., said he was surprised at the "hysteria" over President Donald Trump's "fire and fury" rhetoric against North Korea.
"This is how North Korea talks, so why not give it a shot to say, 'You talk about fire and fury, you say you are going to bury the United States in fire and fury? Hey, we got... |
<reponame>InBinaryWorld/Fakturomat
package pl.fakturomat.database.models;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
@DatabaseTable(tableName = "SELLER")
public class Seller implements BaseModel {
@DatabaseField(columnName = "SELLER_ID", generatedId = true, canBeNull ... |
// AddPeer is used to add a new peer into the cluster. This must be
// run on the leader or it will fail.
func (r *Raft) AddPeer(peer string) Future {
logFuture := &logFuture{
log: Log{
Type: LogAddPeer,
peer: peer,
},
}
logFuture.init()
select {
case r.applyCh <- logFuture:
return logFuture
case <-r.... |
use anyhow::{bail, Result};
use pueue_lib::network::message::*;
use pueue_lib::settings::Shared;
use pueue_lib::state::GroupStatus;
use pueue_lib::task::*;
use crate::helper::*;
async fn create_edited_task(shared: &Shared) -> Result<EditResponseMessage> {
// Add a task
assert_success(fixtures::add_task(share... |
import { CaseSetup } from '../../../../../test_runners/models'
const s: CaseSetup = {
description: '4. Create product type with lenum attribute for error test update product type',
requestData: {
payload: {
name: 'product type for update error test',
key: 'product-type-for-update-error-test',
... |
//declare module 'react-reveal/Fade';
//declare module 'react-reveal/Zoom';
declare module 'react-scroll';
|
/**CFile****************************************************************
FileName [abcHieCec.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Network and node package.]
Synopsis [Hierarchical CEC manager.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Da... |
Prenatally diagnosed human caudal appendage: a case report.
BACKGROUND
The caudal appendage, or human tail, is a rare congenital anomaly that arises from the lumbosacrococcygeal region.
CASE
A pregnant woman was referred after ultrasound revealed a possible neural tube defect. A sonogram in our unit revealed a poste... |
// An fopen() for native symbol files taking into account the
// destination directory given.
//
// The out_writen table keeps track of files written, and unlike
// out_visited this is not cleared after writing physical before
// writing electrical.
//
bool
xic_out::fopen_tof(const char *name, const char *mode)
{
o... |
Silchar, Feb. 16: Mizo National Front (MNF), the principal Opposition party in Mizoram, has called a 12-hour bandh on February 25 to protest against "fiscal mismanagement" by the ruling Congress.
MNF vice-president Tawnluia said in Aizawl today that "fiscal impropriety and the occasional profligacy in spending budgeta... |
import { BaseUI } from './BaseUI';
import { Tip } from './Objects/Tip';
const {ccclass, property} = cc._decorator;
@ccclass
export class TipUI extends BaseUI {
protected static className = 'TipUI';
@property(cc.Prefab)
private tipPrefab: cc.Prefab = null;
private tipPool: Tip[] = [];
public sho... |
// Move the lift down. This method is used by teleop only.
public void moveDown(double power_val,
double time) {
moveToPositionAppliedFlag_ = false;
final int enc_cnt_at_bottom_position = Position.LIFT_BOTTOM_POSITION.getValue();
setEncoderCountForTargetPosition(enc_cnt_... |
/*!
* @brief Este es el menu que contiene los puntajes cuenta con los botones
* muestra en la pantalla los puntajes de los 3 distintos tableros.
*/
public class MenuPuntajes extends JFrame {
private final int ANCHO = 660;
private final int LARGO = 600;
private JButton volver,salir;
private boolean compu... |
<filename>packages/babel-parser/test/fixtures/typescript/interface/property-named-public/input.ts
interface I {
public: number;
}
|
/**
* Set and update the storage configuration
*
* @param configuration
*/
public static void updateConfiguration(SimpleStorageConfiguration configuration) {
if (mInstance == null) {
throw new RuntimeException("First instantiate the Storage and then you can update the configuration");
}
mSimpleStorage... |
/**
* Generates, loads, compiles, links, and validates a new shader program as
* well as an underlying vertex and fragment shader. The shader sources are
* assumed to be in the given path, with the same name, ending in .vert and
* .frag, respectively.
*
* @param path The directory and nam... |
/**
* Provide a GUI element to collect the output destination for a resource.
*
* The returned control is a {@link Group}, with the text supplied
* by {@code groupName}.
*
* @param container window context for the UI
*/
public Composite createControl(Composite container) {
output = new Group(... |
Motorist dies in fiery Bay Bridge crash
A woman died on the Bay Bridge early today in a fiery crash with a recycling truck, briefly shutting down eastbound traffic on the lower deck, authorities said.
The crash happened when the woman, driving a Volvo at high speed, ran into the back of a recycling truck in the eastb... |
def join(self, channel, password=None):
chan = ChannelBase(channel, self.cfg.name)
if password:
chan.data.key = password.strip()
chan.save()
result = Irc.join(self, channel, chan.data.key)
if result != 1:
return result
got = False
if no... |
<gh_stars>0
package yelm.io.raccoon.loader.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class PrimarySettingsClass {
@SerializedName("Username")
@Expose
private String username;
@SerializedName("UserType")
@Expose
private String... |
class volatile_storage:
""" Initialized once per sublime instance. """
def __init__(self):
print("textsync: Initializing Volatile Storage")
self.highlights = {}
self.file_settings = {}
self.log = Log()
self.settings = Settings()
self.threads = se... |
import { Action } from '@ngrx/store';
import { HttpErrorResponse } from '@angular/common/http';
import { CreatePet, Pet, QueryParamsPets } from './pets.model';
import { Update } from '@ngrx/entity/src/models';
export enum PetActionTypes {
RETRIEVE_PETS = '[PET] RETRIEVE PETS',
RETRIEVE_PETS_SUCCESS = '[PET] RETRIE... |
// import chalk from 'chalk'
import { pullCommand } from './pull'
describe('The pull command should', () => {
const consoleSpy = jest.spyOn(console, 'log').mockImplementation()
beforeEach(() => {
consoleSpy.mockReset()
})
test('have tests', async () => {
await pullCommand({
argv: { type: 'conten... |
<reponame>BrynjarGeir/Kattis
#include <iostream>
#include <set>
using namespace std;
int main() {
int A, B;
set<int> first, second;
cin >> A >> B;
while(A != 1) {
if(A % 2 == 0) A /= 2;
else A = 3 * A + 1;
first.insert(A);
}
while(B != 1) {
if(B % 2 == 0) B /=... |
<reponame>SuddenGunter/identifo
package mock
import (
"fmt"
"html/template"
"github.com/madappgang/identifo/model"
)
type emailService struct{}
// NewEmailService creates new email service mock.
func NewEmailService() model.EmailService {
return &emailService{}
}
// SendMessage returns nil error.
func (es emai... |
/**
* @author Florin Bogdan Balint
*
*/
public class ContractDAOImpl extends BasicDAOImpl<com.nagoya.model.dbo.contract.ContractDBO> implements ContractDAO {
private Session session;
public ContractDAOImpl(Session session) {
super(session);
this.session = session;
}
@Override
p... |
package com.acme.payments.api.mapper;
import com.acme.payments.api.models.db.TransactionEntity;
import com.acme.payments.lib.Transaction;
public class TransactionMapper {
public static Transaction toTransaction(TransactionEntity entity) {
if (entity == null) return null;
Transaction transaction... |
/*
* Flush the packet to disk, and reset the accumulator
*/
static void flush_char(struct aap *a)
{
if( a->a_count > 0 ) {
fputc(a->a_count, a->g_outfile );
fwrite(a->accum, (size_t) 1, (size_t) a->a_count, a->g_outfile );
a->a_count = 0;
}
} |
Who is Learning From Whom? A Study of Households Forming Expectations in the US and UK
The present paper outlines a theoretical model of agent-based learning. An agent ‘anchors’ his subjective expectations (or forecasts) to another agent’s subjective expectations. The former believes the latter has a better informatio... |
Challenges of model reduction in modern power grid with wind generation
This paper presents the challenges of model order reduction of modern power grids with inverter-interfaced wind generation. To that end, a widely used model reduction technique called Balanced Truncation (BT) is compared with a relatively new mome... |
/// Returns true if the given type is a signed integer or vector of signed
/// integer type.
bool isSintOrVecOfSintType(QualType type) {
if (isEnumType(type))
return true;
QualType elemType = {};
return (isScalarType(type, &elemType) || isVectorType(type, &elemType)) &&
elemType->isSignedIntegerType(... |
Formation of a strategy for tour promotion in the Arctic
The article discusses the features of the formation of a tourism promotion strategy in the Arctic. In the course of the research, special attention is paid to highlighting the strengths and weaknesses of a tourist destination, its opportunities and threats. It w... |
/*
* MIT License
* 数据库辅助函数
* Copyright (c) 2021 朱纯树
*/
package database
import (
"github.com/zhuchunshu/FecApi-Api/app/Models/Database"
"github.com/zhuchunshu/FecApi-Api/app/server/database"
)
func GetSwitch(name string)bool{
db := database.DBConn
var count int64
var AdminSwitch Database.AdminSwitch
db.Mod... |
class OpTest
{
public:
int j;
OpTest(int i) : j(i) { }
OpTest() : j(0) { }
~OpTest() { }
// Binary method
OpTest operator -(const OpTest& b) const
{
return OpTest(j - b.j);
}
// Binary method
OpTest operator /(int b) const
{
return OpTest(j - b);
}
// Unary method
OpTest operator -()
{
retur... |
// Copyright (c) 2017-2022, Mudit<NAME>. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include "Constants.hpp"
#include <hal/key_input/RawKey.hpp>
#include <MessageType.hpp>
#include <system/Common.hpp>
#include <Service/Message.hpp>
#include <Service/Service... |
def _promote_dtype_typevars(dtype_tv):
result = {}
for tv in dtype_tv:
result[tv] = reduce(promotion.promote_dtypes, dtype_tv[tv])
return result |
def createRegistrySchema(registry):
class_schema_list = []
for class_type, class_obj in registry.classes().items():
obj_schema = convertToJsonSchema(class_obj.schema())
obj_schema["properties"]["registry_type"] = {"enum": [class_type]}
class_schema_list.append(obj_schema)
return {
... |
/* --------------- LoRaWAN join and send data commands --------------- */
ATEerror_t AT_Join(const char *param)
{
if (LmHandlerJoinStatus() == LORAMAC_HANDLER_SET)
{
#ifndef PRINT_RELEASE
AT_PRINTF("You have already joined\r\n");
#else
AT_PRINTF("j2\r\n");
#endif
return AT_OK;
}
switch (param[0])
{... |
/*
This file is part of solidity.
solidity is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
solidity is distributed in the hope that i... |
<reponame>AkioAlex0817/Funkiverse<filename>src/routes/index.tsx
import React from 'react';
import { Switch, useLocation } from 'react-router-dom';
import { TransitionGroup, CSSTransition } from 'react-transition-group'
import Home from '../pages/Home';
import AppRoute from "~/routes/route";
import Welcome from "~/page... |
/**
* Class utils.
*
* @author Kenan Klisura
*/
public final class ClassUtils {
private static final String TAB = "\t";
private static final String NEWLINE = "\n";
private static final String CLASS =
"${packageDeclaration}"
+ NEWLINE
+ "import javax.annotation.Generated;"
... |
<reponame>kimmkumsook/gvisor
// Copyright 2018 Google LLC
//
// 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... |
#include <stdio.h>
int v[51];
int main(){
int n, i, aux, f, cn, s, s2;
s=s2=0;
scanf("%d", &n);
cn=n/2;
for(i=0; i<cn; i++)
scanf("%d", &v[i]);
f=0;
while(f==0){
f=1;
for(i=0; i<cn-1; i++)
if(v[i]>v[i+1]){
aux=v[i];
v[i]=v[i+1];
... |
module Plugin where
import GhcPlugins
plugin :: Plugin
plugin = defaultPlugin
|
/*-------------------------------------------------------------------------------*/
/* 44444 44444 0000000000 11111 222222222222222 */
/* 4:::4 4:::4 0::000000::0 1:::::1 2:::::::::::::::22 */
/* 4:::4 4:::4 0::0 0::0 1::::::1 2::::::2... |
// sendEmailVerifyCode send a email verify code
func (s *Server) sendEmailVerifyCode(ctx *gin.Context) {
req := new(SendEmailVerifyCodeRequest)
if err := ctx.BindJSON(req); err != nil || req.Email == "" {
ctx.JSON(422, fail(paramError, nil))
return
}
if !emailRegexp.MatchString(req.Email) {
ctx.JSON(422, fail... |
<gh_stars>0
#[doc = "Reader of register TIMER_CFG[%s]"]
pub type R = crate::R<u32, super::TIMER_CFG>;
#[doc = "Writer for register TIMER_CFG[%s]"]
pub type W = crate::W<u32, super::TIMER_CFG>;
#[doc = "Register TIMER_CFG[%s]
`reset()`'s with value 0"]
impl crate::ResetValue for super::TIMER_CFG {
type Type = u32;
... |
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_net_CookieLogging_... |
<filename>include/stlsoft/conversion/union_cast.hpp
/* /////////////////////////////////////////////////////////////////////////
* File: stlsoft/conversion/union_cast.hpp (originally MLTypCnv.h, ::SynesisStd)
*
* Purpose: A powerful cast operator that limits the danger of
* reinterpret_cast,... |
/**
* Swagger root
*
* @author: helyho
* Voovan Framework.
* WebSite: https://github.com/helyho/Voovan
* Licence: Apache v2 License
*/
public class Swagger {
public static Comparator<String> STRING_COMPARATOR = new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
... |
t=int(input())
for i in range(t):
X = input()
for E in range(len(X)):
u = X[E]
if u == ' ':
n = int(X[0:E])
m = int(X[E + 1:-1] + X[-1])
k=(n*m)%2
R=(n*m)//2+k
print(R) |
Testing an Alternative Method for Estimating the Length of Fungal Hyphae Using Photomicrography and Image Processing
This study aimed to develop and test an unbiased and rapid methodology to estimate the length of external arbuscular mycorrhizal fungal (AMF) hyphae in soil. The traditional visual gridline intersection... |
package structs
// An XIVDBCharacterSearch struct represents the response of a search for a Character
type XIVDBCharacterSearch struct {
Characters struct {
Results []struct {
Name string `json:"name"`
Server string `json:"server"`
Icon string `json:"icon"`
LastUpdated string... |
/** @type {import('electron').IpcRenderer} */
/** @ts-ignore */
const ipcRenderer = window.electron.ipcRenderer;
export {
ipcRenderer,
}
|
Enhanced Solar‐to‐Hydrogen Generation with Broadband Epsilon‐Near‐Zero Nanostructured Photocatalysts
The direct conversion of solar energy into fuels or feedstock is an attractive approach to address increasing demand of renewable energy sources. Photocatalytic systems relying on the direct photoexcitation of metals h... |
########
#
# Given the host name and optionally the serverclass name, this method parses relevant data form the ops_config host file
# and associated hostclass file.
#
#######
import urllib2
import yaml
import os
import argparse
urlConfigHost = "http://config/host"
if __name__ == "__main__":
parse = ar... |
After 150 years in the same hands, the landmark Soul Pattinson heritage building in Pitt Street Mall is to be sold with a value of more than $100 million.
It is the fourth-last privately owned property along the strip, which houses one of the longest-running chemists in the country. No decision has been made regarding... |
package observable_pattern_2;
import java.util.Observable;
import java.util.Observer;
public class FirstNewsReader implements Observer {
@Override
public void update(Observable o, Object arg) {
// TODO Auto-generated method stub
System.out.println("FirstNewsReader got The news:"+(String)arg);
}... |
def jit(restype=None, argtypes=None, backend='ast', target='cpu', nopython=False,
_llvm_module=None, _llvm_ee=None, **kws):
kws.update(llvm_module=_llvm_module, llvm_ee=_llvm_ee,
nopython=nopython, backend=backend)
if isinstance(restype, type):
cls = restype
return jit_ext... |
Microcomputer Activities for Gifted Elementary Children: Alternatives to Programming
• The idea of using computers in the education of gifted and talented students is not a new one, but only in the last few years has the cost of computer equipment fallen low enough to make this possibility a real one for a large numbe... |
package net.gopine.util;
import com.mojang.authlib.Agent;
import com.mojang.authlib.AuthenticationService;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.UserAuthentication;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
import com.mojang.util.UUIDTypeAdapter;
import net.minecraf... |
package com.goit.popov.restaurant.dao;
import ch.qos.logback.classic.Logger;
import com.goit.popov.restaurant.model.Employee;
import com.goit.popov.restaurant.model.Position;
import com.goit.popov.restaurant.model.Role;
import org.hibernate.SessionFactory;
import org.junit.After;
import org.junit.Before;
import org.ju... |
// AddFreeze adds a freeze amount to a holding.
func AddFreeze(h *state.Holding, txid *bitcoin.Hash32, amount uint64,
timeout protocol.Timestamp, now protocol.Timestamp) error {
_, exists := h.HoldingStatuses[*txid]
if exists {
return ErrDuplicateEntry
}
h.PendingBalance += amount
h.UpdatedAt = now
hs := state... |
import { GeoFilter } from "../filter/geoFilter";
import { GeoFilterItem } from "../filter/geoFilterItem";
import { GeoZoomFilter } from "../filter/geoZoomFilter";
import { GeoStringAttributeFilter } from "../filter/geoStringAttributeFilter";
import { GeoRegexFilter } from "../filter/geoRegexFilter";
import { GeoNumberA... |
// Exec probes a container's health by executing a command.
func (o ContainerizedWorkloadSpecContainersLivenessProbePtrOutput) Exec() ContainerizedWorkloadSpecContainersLivenessProbeExecPtrOutput {
return o.ApplyT(func(v *ContainerizedWorkloadSpecContainersLivenessProbe) *ContainerizedWorkloadSpecContainersLivenessPro... |
# -*- coding: utf-8 -*-
# This file is generated from API metadata for NI-ModInst version 255.0.0d4
enums = {
}
|
/**
* Loads a skript file from the given lines
*
* @param name the name of the Skript
* @param lines the lines to load (will be cloned - won't be modified)
* @return the skript file
* @since 0.1.0
*/
@NotNull
@Contract(pure = true)
public static FileSkript load(@NotNull String... |
// ExtractSentences return the most important sentences of text
func ExtractSentences(text string, count int) []string {
r := regexp.MustCompile(`[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)+|(\.\.+)|(\x60.*\x60)|(".*")|('.*')`)
rep := r.FindAllString(text, -1)
for i := range rep {
temp := strings.ReplaceAll(rep[i], "...", "~~~~~... |
According to The New York Times, America’s war on drugs has entered a new phase: It’s so successful that the CIA is planning to send retired military personnel and private contractors to Mexico to bring the battle to the doorstep of the organized crime cartels. Well, that’s not quite the story. The decision to deploy m... |
def add(isamAppliance, reverseproxy_id, junction_point, server_hostname, server_port, junction_type="tcp",
virtual_hostname=None, server_dn=None, query_contents=None, stateful_junction=None, case_sensitive_url=None,
windows_style_url=None, https_port=None, http_port=None, proxy_hostname=None, proxy_port... |
#ifndef TESTRESULT_H
#define TESTRESULT_H
#include <cstdlib>
#include <string>
#include <json/json.h>
using namespace std;
class PermutationTestResult {
public:
int iteration;
double excursion = -1.0;
double numDirectionalRuns = -1.0;
double lenDirectionalRuns = -1.0;
double numIncreasesDec... |
<filename>webapp/src/test/java/rocks/metaldetector/service/user/events/UserDeletionEventListenerTest.java
package rocks.metaldetector.service.user.events;
import org.assertj.core.api.WithAssertions;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayNam... |
def _plot_cluster_representatives(self, clusters, dataframe,
representative_structures,
path):
from pele_platform.analysis import Plotter
metrics = self._data_handler.get_metrics()
plotter = Plotter(dataframe)
if... |
async def create_server(self, server_id, prefix):
sql = """ INSERT INTO server(server_id,prefix)
VALUES(?,?) """
try:
return await self.db.sql_update(sql, (server_id, prefix))
except IntegrityError:
return 0 |
<gh_stars>10-100
package common
import (
"context"
gc "github.com/cloud-barista/cb-tumblebug/src/api/grpc/common"
"github.com/cloud-barista/cb-tumblebug/src/api/grpc/logger"
pb "github.com/cloud-barista/cb-tumblebug/src/api/grpc/protobuf/cbtumblebug"
"github.com/cloud-barista/cb-tumblebug/src/core/common"
)
//... |
// Generate random One-time Passcode (OTP)
func GenerateOTP() (string, error) {
buffer := make([]byte, 6)
_, err := rand.Read(buffer)
if err != nil {
return "", err
}
for i := 0; i < 6; i++ {
buffer[i] = "1234567890"[int(buffer[i])%10]
}
return string(buffer), nil
} |
<filename>vendor/github.com/hashicorp/packer/builder/docker/ecr_login.go
package docker
import (
"encoding/base64"
"fmt"
"log"
"regexp"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds"
"github.com/aws/aws-sdk-go/aws... |
def login_context(self, email, is_super_admin=False):
self.login(email, is_super_admin=is_super_admin)
try:
yield self.get_user_id_from_email(email)
finally:
self.logout() |
/**
* Distributes/updates the provisioner node's the application key and returns the updated Application Key.
*
* <p>
* This will only work if the NetworkKey bound to this ApplicationKey is in Phase 1 of the Key Refresh Procedure. Therefore the NetworkKey
* must be updated first before updating... |
/**
* Evaluates the current input
* @return True if the input is accepted
* @throws IOException
*/
public boolean evaluateEntry() throws IOException {
TuringMachineTransition transition;
setCurrentState(getStartingState());
do {
transition = getNextTransitionToApply();
if (transitio... |
def soft_mask(self, soft_mask_radius = None):
assert soft_mask_radius is not None
assert not self.is_soft_mask()
from cctbx.maptbx.segment_and_split_map import smooth_mask_data
if self._crystal_symmetry.space_group_number() != 1:
from cctbx import crystal
crystal_symmetry = crystal.symmetr... |
class TagsManager:
"""Interface/service object shared by controllers for interacting with tags."""
def update(self, trans: ProvidesUserContext, payload: ItemTagsPayload) -> None:
"""Apply a new set of tags to an item; previous tags are deleted."""
tag_handler = trans.app.tag_handler
new... |
<reponame>DEV-MUGLES/local-sqs
declare module 'object-to-xml';
|
/*
* Copyright 2020 ThoughtWorks, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeFamilies #-}
import Codec.Picture.Bitmap
import Codec.Picture.Types
import ... |
/// Perform an insertion sort to sort the given vector in place.
fn insertion_sort<T>(vec : &mut Vec<T>) where T: Ord + Copy {
let len = vec.len();
for mut i in 1..len {
let key = vec[i];
let mut index = i - 1;
while index > 0 && vec[index] > key {
vec[index + 1] = vec[index]... |
def coordstr_1D(da_ct):
das = []
seldicts = gen_seldicts(da_ct)
for seldict in seldicts:
ct = da_ct.sel(seldict).item()
coordstr = ''
for dim in seldict:
coordstr = coordstr + dim + str(seldict[dim]) + '_'
coordstr = coordstr[0:-1]
das.append(xr.DataAr... |
<filename>data_preprocess/method_separator_in_python/src/preprocess.py
from mongodb import MongoDb
from java_line_remover.find_removable_lines import *
from java_line_remover.find_removable_blocks import *
from java_line_remover.line_remover_main import *
from bson.son import SON
import pprint
import bson
class PrePro... |
High Court Asked To Limit Military Funeral Protests
Enlarge this image toggle caption Alex Brandon/AP Alex Brandon/AP
Editor's Note: This story contains language that is not appropriate for children and that some readers may find objectionable.
The U.S. Supreme Court takes up a case of high emotion and high principl... |
// ==========================================================================
//
// class frame_snapshot
//
//! in-memory write-through frame buffer that can be written to a .bmp file
//
//! A frame_bsnapshot remembers the writes to the underlying frame
//! in an in-memmory buffer. The write_to_bsmp_file method writes
... |
//
// Notify rpc server to stop listening to incoming rpc calls
//
void SystemConfiguratorProxyDisconnect()
{
TRACE("SystemConfiguratorProxyDisconnect");
RpcServerUnregisterIf(SystemConfiguratorProxyInterface_v1_0_s_ifspec, nullptr, 0);
RpcEpUnregister(SystemConfiguratorProxyInterface_v1_0_s_ifspec, Binding... |
#include <doctest/doctest.h>
#include "list.h"
#include "verify.h"
// 21. Merge Two Sorted Lists
class Solution {
public:
ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {
ListNode dummy;
auto current = &dummy;
while (l1 && l2) {
if (l1->val <= l2->val) {
current->next = l1;
c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.