text stringlengths 3 1.05M |
|---|
Object.defineProperty(exports,"__esModule",{value:true});exports.routeConfig=exports.historyMiddlewares=undefined;exports.
createResolver=createResolver;var _queryMiddleware=require('farce/lib/queryMiddleware');var _queryMiddleware2=_interopRequireDefault(_queryMiddleware);var _makeRouteConfig=require('f... |
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2020 Facebook */
#include "bpf_iter.h"
#include "bpf_tracing_net.h"
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>
#include <bpf/bpf_endian.h>
char _license[] SEC("license") = "GPL";
#define IPV6_SEQ_DGRAM_HEADER \
" sl " \
"local_address ... |
/********************************************************************************/
/* */
/* TPM 2.0 Attestation - Common Client / Server Utilities */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: commonutils.c 888 2016-12-28 16:35:37Z kgoldman ... |
# -*- coding: utf-8 -*-
"""
BE Modified version - Sep 2019 ARRB Group
Map-matching of GPS traces using PostgreSQL and pgrouting
See Millard-Ball, Adam; Hampshire, Robert and Weinberger, Rachel,
"Map-matching poor-quality GPS data in urban environments:
The pgMapMatch package."
"""
import logging
import time
... |
from django.urls import path
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from . import views
from . import api_views
from django.views.generic import TemplateView
urlpatterns = [
path('', views.HomePageView.as_view(), name='home'),
path('ngo-volunteer/', views.NgoVolunt... |
export default function (s) {
s = s.replace(/(^\s*)|(\s*$)/gi, ''); // exclude start and end white-space
s = s.replace(/[ ]{2,}/gi, ' '); // 2 or more space to 1
s = s.replace(/\n /gi, '\n'); // exclude newline with a start spacing
s = s.replace(/\n+/gi, '\n');
return s.length;
} |
(function($) {
$.extend({tablesorter: new
function() {
var parsers = [], widgets = [];
this.defaults = {cssHeader: "header", cssAsc: "headerSortUp", cssDesc: "headerSortDown", cssChildRow: "expand-child", sortInitialOrder: "asc", sortMultiSortKey: "shiftKey",... |
/*
* This header is generated by classdump-dyld 1.0
* on Sunday, September 27, 2020 at 11:54:46 AM Mountain Standard Time
* Operating System: Version 14.0 (Build 18A373)
* Image Source: /System/Library/PrivateFrameworks/NanoMediaRemote.framework/NanoMediaRemote
* classdump-dyld is licensed under GPLv3, Copyright © 2013... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Post.filtering_result'
db.add_column('feedjack_post', 'filtering_result',
... |
number = int(input())
if number % 2 == 0:
print('even')
else:
print('odd') |
from setuptools import setup
setup(
name="playtex",
version="0.1.1",
description="Render Python objects in LaTeX documents",
license="MIT",
author="Ben Burrill",
author_email="bburrill98+playtex@gmail.com",
url="https://github.com/benburrill/playtex",
packages=["playtex", "playtex.rende... |
export const testClonabilityOfAudioWorkletNodeOptions = (audioWorkletNodeOptions) => {
const { port1 } = new MessageChannel();
try {
// This will throw an error if the audioWorkletNodeOptions are not clonable.
port1.postMessage(audioWorkletNodeOptions);
}
finally {
port1.close();... |
import numpy as np
from sklearn.cluster import MiniBatchKMeans
from sklearn import metrics
import pandas as pd
import itertools as itt
import altair as alt
from collections import Counter
import polars as pl
def spectral_clustering(A, max_clusters=10):
#calculate the Graph Laplacian manually
D = np.diag(np.s... |
amis.define('docs/renderers/Form/Url.md', function(require, exports, module, define) {
module.exports = {
"html": "<h3><a class=\"anchor\" name=\"url\" href=\"#url\" aria-hidden=\"true\"><svg aria-hidden=\"true\" class=\"octicon octicon-link\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><pat... |
# Malaya Natural Language Toolkit
#
# Copyright (C) 2019 Malaya Project
# Licensed under the MIT License
# Author: huseinzol05 <husein.zol05@gmail.com>
# URL: <https://malaya.readthedocs.io/>
# For license information, see https://github.com/huseinzol05/Malaya/blob/master/LICENSE
from . import en_ms
from . import ms_e... |
from flask import Flask, render_template, session, request, redirect
from APIManager import API
app = Flask(__name__)
# Secret key
app.secret_key = 'asdfs'
# Config
app.config['configDB'] = {
'host': '127.0.0.1',
'user': 'filmUser',
'password': 'filmuserpasswd',
'database': 'FilmDB'
}
'''Home url... |
#include <stdio.h>
#include <stdlib.h>
int main()
{
int secretNumber = 7;
int guess;
int guessCount = 0;
int guessLimit = 3;
int outOfGuesses = 0;
while (guess != secretNumber && outOfGuesses== 0){
if (guessCount < guessLimit){
printf ("Enter a guess :");... |
# USAGE
# python webcam.py --webcam 1 --cm 2.0
# import the necessary packages
from scipy.spatial import distance as dist
from imutils import perspective
from imutils import contours
import numpy as np
import argparse
import imutils
import cv2
def midpoint(ptA, ptB):
return ((ptA[0] + ptB[0]) * 0.5, (ptA[1] + ptB[1]... |
'use strict';
const $check = require('check-types');
const $json = require('@synatic/json-magic');
const cloneDeep = require('clone-deep');
class ParameterParser {
static parse(obj, parameters, options) {
if (!parameters) return obj;
if (!obj) return obj;
if (!options) options = {};
... |
/** 滚动方向
*
*
* @export
*/
export const SCROLL_DIRECTION = {
SCROLL_TOP: 'scrollTop',
SCROLL_LEFT: 'scrollLeft',
};
|
from brainrender import DEFAULT_NEURITE_RADIUS
from morphapi.morphology.morphology import Neuron
from vtkplotter import merge
def get_neuron_actors_with_morphapi(swcfile=None, neuron=None, neurite_radius=None):
if swcfile is None and neuron is None:
raise ValueError('No input passed')
if swcfile is not None:
... |
/**
* Created by JiaHao on 10/11/15.
*/
var async = require('async');
var chai = require('chai');
var assert = chai.assert;
var url = require('url');
var validUrl = require('valid-url');
var Revenant = require('./../lib/Revenant');
var constants = require('./constants');
describe('Browser Navigation', function () ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated by generateDS.py version 2.38.6.
# Python 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
#
# Command line options:
# ('--no-namespace-defs', '')
# ('--no-dates', '')
# ('--member-specs', 'list')
# ('--use-getter-setter', 'none')
# ('-f', '')
#... |
"""Unit tests for the testplan.testing.multitest.result module."""
import collections
import mock
import pytest
from testplan.testing.multitest import result as result_mod
from testplan.testing.multitest.suite import testcase, testsuite
from testplan.testing.multitest import MultiTest
from testplan.common.utils impor... |
//---------------------------------------------------------------------------
// Greenplum Database
// Copyright (C) 2009 Greenplum, Inc.
//
// @filename:
// CPhysicalTableScan.h
//
// @doc:
// Table scan operator
//---------------------------------------------------------------------------
#ifndef GPOPT_CPhysicalTab... |
from django import forms
from .models import SubscriptionUser
class SubscriptionUserSignUpForm(forms.ModelForm):
class Meta:
model = SubscriptionUser
fields = ['email']
def clean_email(self):
email = self.clean_data.get('email')
return email
|
"""
This file offers the methods to automatically retrieve the graph Klebsiella oxytoca.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein ass... |
const httpServer = require('../http/server');
const werelogs = require('werelogs');
const errors = require('../../errors');
const ZenkoMetrics = require('../../metrics/ZenkoMetrics');
const { sendSuccess, sendError } = require('./Utils');
function checkStub(log) { // eslint-disable-line
return true;
}
class Healt... |
"""
Implements the Generalized R-CNN framework
"""
import warnings
from collections import OrderedDict
from typing import Tuple, List, Dict, Optional, Union
import torch
from torch import nn, Tensor
from ...utils import _log_api_usage_once
class GeneralizedRCNN(nn.Module):
"""
Main class for Generalized R-... |
"""
SQL Alchemy Testing
Aircraft report defined as a record from the mode-s BEAST feed
Each report is sent to Kafka for ingestion into Postgres/PostGIS and a Storm Spout
"""
import json
import logging
import os
import time
import shutil
# TODO: Refactor the DB connection into a param, so there's not need to import... |
import 'bootstrap-tagsinput/examples/lib/typeahead.js/dist/typeahead.bundle'
import 'bootstrap-tagsinput/dist/bootstrap-tagsinput.min'
import { Faq } from '../../Modules/Faq/Js/Faq'
import { Location } from '../../Modules/Location/Js/Location'
import { Profiles } from '../../Modules/Profiles/Js/Profiles'
import { Sear... |
/*
* Copyright 2012 Red Hat Inc.
* Parts based on xf86-video-ast
* Copyright (c) 2005 ASPEED Technology Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, incl... |
import pdf_to_json as p2j
import json
url = "file:data/multilingual/Latn.AMR/Sun-ExtA_16/udhr_Latn.AMR_Sun-ExtA_16.pdf"
lConverter = p2j.pdf_to_json.pdf_to_json_converter()
lConverter.mImageHashOnly = True
lDict = lConverter.convert(url)
print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
|
#! /usr/bin/env python3
"""
CLI for the representer for the Python track on Exercism.io.
"""
from argparse import ArgumentParser, ArgumentTypeError
import representer
def _slug(arg):
try:
return representer.utils.slug(arg)
except ValueError as err:
raise ArgumentTypeError(str(err))
def _dir... |
const express = require("express")
const app = express()
const PORT = 3000 || process.env.PORT
const url = "mongodb+srv://admin:I@mgreat7@elefaddb.riaeu.mongodb.net/myFirstDatabase?retryWrites=true&w=majority"
const mongoose = require("mongoose")
const product = require("./model/product")
const bodyParser = require("bo... |
import React from 'react';
class OfferOtherWords extends React.Component{
render(){
let word = this.props.dictionary[this.props.showKey];
return(
<div>
<h3>Zvol správnou variantu</h3>
{word.meaningCZ}
</div>
)
}
}
export default OfferO... |
/**
* @file template.c
* @author langery
* @version 0.1
* @date 2022-01-06
*
* @copyright Copyright (c) 2022
*
* 将华氏法转为摄氏法
* 公式: c = 5/9(f - 32)
*
*/
#include <stdio.h>
int main() {
float f,c;
f = 64.0;
c = (5.0/9)*(f-32);
printf("f = %f \nc = %f \n", f, c);
return 0;
} |
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @provides... |
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... |
import os
import pathlib
import random
import shutil
import string
import time
import pytest
from fastapi.testclient import TestClient
from jina.enums import RemoteWorkspaceState
from jina.excepts import NoAvailablePortError
from jina.executors.metas import get_default_metas
@pytest.fixture(scope='function')
def ra... |
#include <stdio.h> /* puts */
#include <stdlib.h> /* calloc */
#include "dict.h"
#define IC_DICT_DEFAULT_SIZE 32
#if !defined(__has_warning) || __has_warning("-Wunused-parameter")
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* allocate and init a new ic_dict
*
* returns pointer on success
* retur... |
const LINE = document.getElementById('lineChart');
var sentiment = [];
var scores = [];
$.getJSON("./js/apple.json", function(json) {
$.each(json, function(k, v) {
sentiment.push(v.sentiment);
scores.push(v.score);
});
var radarChart = new Chart(LINE, {
type: 'line',
data: data = {
labels:... |
import { combineReducers } from 'redux';
import auth from './auth/reducers';
import user from './user/reducers';
import data from './data/reducers';
export default combineReducers({
data,
user,
auth,
});
|
version https://git-lfs.github.com/spec/v1
oid sha256:d77c54e7197a9bef0e43aca47279c0b8c9c6628cba7460809ed8b9b25c2f954b
size 939
|
#include <Python.h>
#ifdef _WIN32
# include <Windows.h>
#endif
void *
PyMem_RawMalloc(size_t size)
{
/*
* Limit ourselves to PY_SSIZE_T_MAX bytes to prevent security holes.
* Most python internals blindly use a signed Py_ssize_t to track
* things without checking for overflows or negatives.
... |
"""Decorators
Recall the simple closure example we did which allowed us to maintain a count of ho9w many times a function was called:
def counter(fn):
count = 0
def inner(*args, **kwargs): # using *args. **kwargs means we can call any function fn with any combination of positional and keyword arguments
... |
#!/usr/bin/env python
import os, sys
import subprocess
from math import ceil
my_dir = os.path.dirname(os.path.realpath(__file__))
os.chdir(my_dir)
caffe_bin = 'bin/caffe.bin'
img_size_bin = 'bin/get_image_size'
template = 'model/deploy.tpl.prototxt'
# =========================================================
def d... |
import yt
# Create a time-series object.
sim = yt.simulation("enzo_tiny_cosmology/32Mpc_32.enzo", "Enzo")
sim.get_time_series(redshifts=[5, 4, 3, 2, 1, 0])
# Lists to hold profiles, labels, and plot specifications.
profiles = []
labels = []
plot_specs = []
# Loop over each dataset in the time-series.
for ds in sim:
... |
# Copyright 2017 Intel Corporation
#
# 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 agreed to in wri... |
# Copyright 2021 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 applicable law or agreed to in writing, ... |
from say_hello import say_hello
say_hello() |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'portfolio_crud.settings')
try:
from django.core.management import execute_from_command_line
exce... |
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(d... |
#ifndef lint
static char sccsid[] = "@(#)setbrk.c 4.2 08/11/83";
#endif
#
/*
* UNIX shell
*
* S. R. Bourne
* Bell Telephone Laboratories
*
*/
#include "defs.h"
setbrk(incr)
{
REG BYTPTR a=sbrk(incr);
brkend=a+incr;
return(a);
}
|
/*
*
* arch/arm/mach-u300/include/mach/u300-regs.h
*
*
* Copyright (C) 2006-2009 ST-Ericsson AB
* License terms: GNU General Public License (GPL) version 2
* Basic register address definitions in physical memory and
* some block definitions for core devices like the timer.
* Author: Linus Walleij <linus.wallei... |
from tensorflow.keras import backend as K
import tensorflow as tf
import numpy as np
import tensorflow.keras as keras
from functools import partial
from tensorflow.keras.losses import mse
from src.data.Dataset import get_metadata_maybe, ensure_dir
def max_volume_loss(min_probability=0.8,):
"""
Create a callabl... |
test = {
'name': 'matchmaker',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
sqlite> SELECT * FROM matchmaker LIMIT 10;
dog|Everytime We Touch|blue|green
dog|Everytime We Touch|blue|blue
dog|Everytime We Touch|blue|blue
dog|The M... |
import { createStore, applyMiddleware, combineReducers, compose } from 'redux'
import {
routerReducer,
createRouterMiddleware,
initialRouterState,
} from 'connected-next-router'
import configure from './config'
// Reducers
import loadingReducer, {
initialState as defaultLoading,
} from './reducers/loadingRe... |
/**
* @author mrdoob / http://mrdoob.com/
*/
var Stats = function () {
var mode = 0;
var container = document.createElement( 'div' );
container.style.cssText = 'position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000';
container.addEventListener( 'click', function ( event ) {
event.preventDefau... |
"""This contains all server-related forms used by the Shepherd application."""
# Django & Other 3rd Party Libraries
from crispy_forms.bootstrap import Alert, TabHolder
from crispy_forms.helper import FormHelper
from crispy_forms.layout import (
HTML,
Button,
ButtonHolder,
Column,
Div,
Field,
... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = require("fs");
const ts = require("typescript");
class Alias {
constructor(left, right) {
this.left = left;
this.right = right;
}
toString() {
return `
left: ${this.left}
right: ${th... |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
from __future__ import print_function
import os
from os.path import jo... |
n1 = float(input("digite a nota 1 do aluno: "))
n2 = float(input("digite a nota 2 do aluno: "))
m = (n1 + n2) / 2
print("\n")
print("a media do aluno entre {} e {} é igual a {}" .format (n1, n2, m))
print("\n")
print("A média entre {:.1f} e {:.1f} é igual a {:.1f}" . format (n1, n2, m)) |
'use strict';
const fs = require('fs');
const { SMTPServer } = require('smtp-server');
const { simpleParser } = require('mailparser');
const IPAccessControl = require('@hyperingenuity/ip-access-control');
function SMTP (skyfall, options) {
const id = skyfall.utils.id();
let port = 25;
let host = '0.0.0.0';
l... |
import isArrayLike from './is-array-like.js'
import isSet from './is-set.js'
import each from './each.js'
function getIterableBigSize(iterable) {
if (isArrayLike(iterable)) {
return BigInt(iterable.length)
}
if (isSet(iterable)) {
return BigInt(iterable.size)
}
let size = BigInt(0)
each(iterable... |
// Copyright 2010 the V8 project authors. 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 the above copyright
// notice, this list of ... |
import React, { Component } from 'react';
import $ from 'jquery';
import injectTapEventPlugin from 'react-tap-event-plugin';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import {
AppBar,
TextField,
CircularProgress,
RaisedButton,
Divider,
} from 'material-ui';
import {
Table,
TableB... |
# Helper functions to transform between text<->labels
# Source: https://github.com/rizkiarm/LipNet/blob/master/lipnet/lipreading/helpers.py
from typing import List
def text_to_labels(text: str) -> List[chr]:
ret = []
for char in text:
if "a" <= char <= "z":
ret.append(ord(char) - ord("a"))... |
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a90fc0c2"],{"93dc":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-container"},[n("div",{staticClass:"filter-container"},[n("el-input",{staticClass:"filter-item",staticSt... |
/**
* This is a pseudo-3D self-running animation, featuring ...
*
* - a busy bee flying left and right, composed only of the simplest of primitives,
* - fresh animated swaying grass with depth cueing,
* - pretty flowers because everybody loves flowers,
* - a camera moving in all directions (left, ... |
import React, { PureComponent } from 'react';
import { connect } from 'dva';
import { Layout } from 'antd';
import { routerRedux, Switch } from 'dva/router';
import pathToRegexp from 'path-to-regexp';
import $$ from 'cmn-utils';
import cx from 'classnames';
import PropTypes from 'prop-types';
import { routerLinks } fr... |
/*****************************************************************************
* CVS File Information :
* $RCSfile$
* Author: patmiller $
* Date: 2007/06/11 14:12:51 $
* Revision: 1.2 $
****************************************************************************/
/*************************************... |
/*
* https://github.com/phollome/grunt-list-files
*
* Copyright (c) 2016 Peter Holló
* Licensed under the MIT license.
*/
'use strict';
module.exports = function deepMerge(target, src) {
var array = Array.isArray(src);
var dst = array && [] || {};
if (array) {
target = target || [];
dst = dst.conc... |
/*
* vue config
* */
const fs = require('fs-extra')
module.exports = {
publicPath: '/',
devServer: {
port: 8020,
overlay: {
warnings: false,
errors: true
},
https: true,
key: fs.readFileSync('./cert/key.pem'),
cert: fs.readFileSync('./cert/... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-20 20:34
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('query', '0004_auto_20161020_1940'),
]
operations = [
migrations.AlterModelOptions(
... |
describe('Test operator', function () {
it('select with operator - != (for string)', function (done) {
con.select({
from: 'Customers',
where: {
country: {
'!=': 'Mexico'
}
}
}).then(function (results) {
... |
import datetime as dt
import unittest
from ..utils import add_domain_to_url_description
from ..utils import feria_name
from ..utils import get_movable_feast_names_and_dates
from ..utils import liturgical_year
from ..utils import liturgical_year_end
from ..utils import liturgical_year_start
class TestLiturgicalYearSt... |
// buffer to array of (0,1) flags
module.exports.flags_to_array = function(n, size) {
var flags = []
for (var i = 0; i < size; i++) {
if ((n & (1 << i)) > 0)
flags.push(1)
else
flags.push(0)
}
return flags
}
module.exports.read_mac = function(buffer, pos) {
var bytes = []
for (var i = 0... |
import {
ACTION_SUCCESS,
SET_MESSAGE,
} from './types';
import UserService from '../services/user.service';
const commonFn = (p, dispatch) => p.then(
(response) => {
dispatch({
type: ACTION_SUCCESS,
payload: '/home'
});
console.log(response && ((response.data && respons... |
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG9zaXRpb24tc3RyYXRlZ3kuanMiLCJzb3VyY2VS... |
//
// Created by Diana Kudaiberdieva
//
#ifndef RED_O_LATOR_INSTR_INFO_H
#define RED_O_LATOR_INSTR_INFO_H
#include <unordered_map>
#include <cassert>
enum InstrKey {
// SMEM
/**
* Syntax: S_ATOMIC_ADD SDATA, SBASE(2), OFFSET
* Operation:
* UINT32* VM = (UINT32*)((SMEM + (OFFSET & ~3))
* ... |
import styled from 'styled-components'
import media from '../../styleguide/media'
export const Container = styled.div`
text-align: left;
padding: 80px;
padding-top: 40px;
${media.phone`
text-align: center;
padding: 25px 10px 5px 10px;
a {
text-align: center;
}
`}
`
export const BaseF... |
#!/usr/bin/env python3
from pelita.layout import parse_layout
from pelita.game import run_game
from pelita.player import stopping_player
LAYOUT="""
##################################
#... # .# # # 3#
# ## # # ### # # #####1#
#. # # # . # ## #
#.# # . # . # #####... |
import uuid from "uuid";
import * as dynamoDbLib from "./libs/dynamodb-lib";
import { success, failure } from "./libs/response-lib";
export async function main(event, context) {
const data = JSON.parse(event.body);
const params = {
TableName: "weeks",
Item: {
userId: event.requestContext.identity.cog... |
# encoding: utf-8
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from functools import partial
from collections import OrderedDict
from config import config
from resnet import get_resnet50
class SimpleRB(nn.Module):
def __init__(self, in_channel, norm_layer, bn_momentum):
... |
from typing import *
class Solution:
def findMin(self, nums: List[int]) -> int:
left, right = 0, len(nums) - 1
while left < right:
mid = (left + right) // 2
if nums[mid] < nums[right]:
right = mid
else:
left = mid + 1
retur... |
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certain so... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sst_project.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that ... |
def mergeSort(arr):
if len(arr) >1:
mid = len(arr)//2 # Finding the mid of the array
L = arr[:mid] # Dividing the array elements
R = arr[mid:] # into 2 halves
mergeSort(L) # Sorting the first half
mergeSort(R) # Sorting the second half
i = j = k = 0
# Copy data to temp arrays L[] and R[]
w... |
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative ... |
from __future__ import unicode_literals
from ..classes import WorkflowAction
from ..models import Workflow
from .literals import (
TEST_WORKFLOW_INITIAL_STATE_LABEL, TEST_WORKFLOW_INITIAL_STATE_COMPLETION,
TEST_WORKFLOW_INSTANCE_LOG_ENTRY_COMMENT, TEST_WORKFLOW_INTERNAL_NAME,
TEST_WORKFLOW_LABEL, TEST_WOR... |
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "testrunnerswitcher.h"
#include "iothubclient_common_e2e.h"
#include "iothubtransportmqtt_websockets.h"
static TEST_MUTEX_HANDLE g_dllByDll;
BEGIN_TEST_SUITE... |
import os
from constants import RESTRICTED_USERNAMES
try:
set = set
except:
from sets import Set
set = Set
class Restricted:
def __init__(self, prefs):
self.filename = os.path.join(prefs['WORK_DIR'], RESTRICTED_USERNAMES)
self.__data = set()
self.load_restricted()
... |
/* eslint-disable promise/param-names */
import {
AUTH_REQUEST,
AUTH_ERROR,
AUTH_SUCCESS,
AUTH_LOGOUT
} from '../actions/auth'
import { USER_REQUEST } from '../actions/user'
const axios = require('axios')
const $http = axios.create({
baseURL: 'http://localhost:3000'
})
const state = {
token... |
import unittest
import csv
from datetime import datetime, timezone
from crawling_gocd.outputs import OutputCsv
from crawling_gocd.calculate_domain import GlobalTimeRange
import tests.unit.test_fixture as fixture
class OutputCsvTest(unittest.TestCase):
def setUp(self):
self.outputCsv = OutputCsv()
s... |
from bluetooth import *
import threading
def background():
while True:
nearby_devices = discover_devices(lookup_names = True)
print "found %d devices" % len(nearby_devices)
for name, addr in nearby_devices:
print " %s - %s" % (addr, name)
if name == "7... |
/**
* 用户列表Action
*/
import * as types from '../constants/userListTypes';
import Global from "../../../utils/Global";
import FetchUtil from "../../../utils/FetchUtil";
import {dispatch} from "../../base/tcom/tcomb";
import {indexOfArray} from "../../base/tcom/tcomb-form-native/lib/util";
/**
* 分页查询用户
*/
export func... |
import numpy as np
class GridMap:
'''
Mapping of variables from ranges defined by min-max and scale to a
0-1 unit hypercube.
'''
def __init__(self, variables):
self.cardinality = 0
# Count the total number of dimensions and roll into new format.
for variable in variables... |
def add_example(a, b):
return a + b
|
"""
Module contains tools for processing files into DataFrames or other objects
"""
from __future__ import print_function
from pandas.compat import range, lrange, StringIO, lzip, zip, string_types, map
from pandas import compat
import re
import csv
import warnings
import numpy as np
from pandas.core.index import Inde... |