text stringlengths 3 1.05M |
|---|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAttachment = exports.search = exports.queryMore = exports.query = exports.del = exports.update = exports.upsert = exports.retrieve = exports.create = exports.describeLayout = exports.describe = exports.metadata = exports.describeGlo... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import csv
from pathlib import Path
import zipfile
from functools import reduce
from multiprocessing import cpu_count
f... |
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
'use strict';
const Platform = require('react-native/Libraries/Utilities/Platform');
const React = ... |
import {assert, each} from 'zrender/src/core/util';
import { __DEV__ } from '../config';
/**
* @param {Object} define
* @return See the return of `createTask`.
*/
export function createTask(define, context) {
return new Task(define, context);
}
/**
* @constructor
* @param {Object} define
* @param {Function}... |
# 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 may not u... |
/* SPDX-License-Identifier: GPL-2.0 */
/*
* pci.h
*
* PCI defines and function prototypes
* Copyright 1994, Drew Eckhardt
* Copyright 1997--1999 Martin Mares <mj@ucw.cz>
*
* For more information, please consult the following manuals (look at
* http://www.pcisig.com/ for how to get them):
*
* PCI BIOS Specific... |
# -*- coding: utf-8 -*-
'''
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
tests.integration.shell.syndic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'''
# Import python libs
from __future__ import absolute_import
import logging
# Import Salt Testing libs
from tests.support.case import ShellCase
from tests.support.... |
import { deep } from "@theme-ui/presets"
import nightOwl from "@theme-ui/prism/presets/night-owl.json"
export default {
...deep, // Gives you the entire preset
colors: {
...deep.colors,
primary: "#ffa7c4",
secondary: "#cc859c",
background: "#172836",
},
styles: {
...deep.styles,
code: {... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot initialization. """
import os
from sys import version_info
from logging import basicConfig, getLogger, IN... |
# Categorisation of job data from the job title
__author__ = "Rajesh"
import pandas as pd
import csv
csv_file = open('MetroBaltimoreRetail.csv')
csv_data = csv.reader(csv_file)
next(csv_data,None)
jobTitle = []
jobOrg = []
jobDate = []
jobLoc = []
jobDesc = []
dList = []
for row in csv_data:
... |
var dbLayer = require('../../dbLayer.js');
/* INTERFACE /users/delete/phone
POST
{id : 2}
RETERNS
{error:'database',message:err}
{success:'don'}
{error:'noEffected'}
{error:'empty',field:'id'}
*/
var main = function(req,res,next){
if(req.body.id == undefined){
res.json({error:'empty',fiel... |
import commonJS from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import typescript from 'rollup-plugin-typescript2';
import * as path from 'path';
import {terser} from 'rollup-plugin-terser';
import externals from 'rollup-plugin-node-externals';
import {string} from 'rollup-... |
export const ReconciliationOutline = {
name: 'reconciliation',
theme: 'outline',
icon: '<svg viewBox="64 64 896 896" focusable="false"><path d="M676 565c-50.8 0-92 41.2-92 92s41.2 92 92 92 92-41.2 92-92-41.2-92-92-92zm0 126c-18.8 0-34-15.2-34-34s15.2-34 34-34 34 15.2 34 34-15.2 34-34 34zm204-523H668c0-30.9-... |
import click
import json
import os
import requests
import sys
import jwt
import time, sys
from prettytable import PrettyTable
from mysocketctl.ssh import SystemSSH, Paramiko
api_url = "https://api.mysocket.io/"
token_file = os.path.expanduser(os.path.join("~", ".mysocketio_token"))
# For debug
debug = False
if "MY... |
'use strict';
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { t... |
import { origins } from "reactive-data-source";
import { baseConfig } from "../setup";
// AUTHENTICATION SESSION
export const authSession = new origins.LocalStorage("authentication");
authSession.addCustomFilter({
refreshToken: () => "refreshToken"
});
authSession.addCustomFilter({
apiKey: () => "apiKey"
});
... |
/** When your routing table is too long, you can split it into small modules **/
import Layout from '@/layout'
const bannerMan = {
path: '/bannerMan',
component: Layout,
redirect: '/bannerMan/index',
name: 'bannerMan',
alwaysShow: true, // 将始终显示根菜单
meta: {
title: 'banner管理',
icon: 'banner'
},
... |
/* eslint-disable */
// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.
const awsmobile = {
aws_project_region: "us-west-2",
aws_cognito_identity_pool_id:
"us-west-2:d600e8b6-a8e3-4a84-810f-1ef352e732ac",
aws_cognito_region: "us-west-2",
aws_user_pools_id:... |
#!/usr/bin/env python
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
(function(global) {
// Helpers to load classes which throws if the class isn't found. This
// helps spot refactoring bugs early!
const Class = Java.type('java.lang.Class');
const getClassName = path => path.substring(path.lastIndexOf('.') + 1)
function getClass(path) {
const clazz = Java.... |
#!/usr/bin/env python
'''
test_brozzling.py - XXX explain
Copyright (C) 2016-2018 Internet Archive
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
U... |
#!/usr/bin/env python
"""
_relvalgen_
Scenario supporting RelVal GEN production
"""
import os
import sys
from Configuration.DataProcessing.Scenario import *
import FWCore.ParameterSet.Config as cms
class relvalgen(Scenario):
def __init__(self):
Scenario.__init__(self)
"""
_relvalgen_
Imple... |
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2016 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_AMOUNT_H
#define BITCOIN_AMOUNT_H
#include "serialize.h"
#inclu... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2018 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consi... |
//
// FCModelDatabaseQueue.h
//
// Created by Marco Arment on 3/12/14.
// Copyright (c) 2014 Marco Arment. See included LICENSE file.
//
#import <Foundation/Foundation.h>
#ifdef COCOAPODS
#import <fmdb/FMDatabase.h>
#else
#import "FMDatabase.h"
#endif
// This serves the same role as FMDB's FMDatabaseQueue for FCM... |
/*
* Copyright (c) 1991-2016 Kawahara Lab., Kyoto University
* Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology
* Copyright (c) 2005-2016 Julius project team, Nagoya Institute of Technology
* All rights reserved
*/
#include <sent/stddefs.h>
#include <sent/ngram2.h>
// output of an ... |
import { Recognizer } from './recognizer'
var swipeRecognizer = {
events: ['swipe', 'swipeleft', 'swiperight', 'swipeup', 'swipedown'],
getAngle: function(x, y) {
return (Math.atan2(y, x) * 180) / Math.PI
},
getDirection: function(x, y) {
if (Math.abs(x) >= Math.abs(y)) {
return x < 0 ? 'left' : ... |
# (C) Copyright 1996- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernment... |
#ifndef __KSTDIO__
#define __KSTDIO__
#include <stdarg.h>
extern int kernel_log(const char* fmt, ...);
extern int printf(const char* fmt, ...);
extern int snprintf(char* str, size_t n, const char* fmt, ...);
extern int vsnprintf(char *str, size_t size, const char *format, va_list ap) ;
extern void vga_init()... |
/**
****************************************************************************************
*
* @file attm.c
*
* @brief Attribute Manager implementation.
*
* Copyright (C) RivieraWaves 2009-2016
*
*
****************************************************************************************
*/
/**
***********... |
peso = float(input('Digite aqui o seu peso - '))
altura = float(input('Digite aqui sua altura - '))
print()
imc = peso / altura ** 2
print()
if imc < 18.5:
print('Abaixo do peso com IMC de {:.2f}.'.format(imc))
elif 18.5 <= imc <= 25:
print('Peso Ideal com IMC de {:.2f}.'.format(imc))
elif 25 < imc <= 30:
... |
const _ = require('lodash/fp')
const pgp = require('pg-promise')()
const db = require('../db')
const E = require('../error')
const socket = require('../socket-client')
const logger = require('../logger')
const helper = require('./cash-out-helper')
const cashOutActions = require('./cash-out-actions')
const cashOutLow ... |
var ResourcesPage = (function () {
function ResourcesPage() {
this.LINKS = {
TEMPLATES: [
{ title: "Official Stencil Starter Project", url: "https://github.com/ionic-team/stencil-starter" },
{ title: "Stencil Boilerplate with Server Side Rendering", url: "https://... |
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
/* QLogic qed NIC Driver
* Copyright (c) 2015-2017 QLogic Corporation
* Copyright (c) 2019-2020 Marvell International Ltd.
*/
#include <linux/types.h>
#include <linux/bitops.h>
#include <linux/dma-mapping.h>
#include <linux/errno.h>
#include <linux/kernel.... |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
# MIT License
#
# Copyright (c) 2021 MiscellaneousStuff
#
# 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, including without limitation the rights
# to use, copy, modify... |
const { expect } = require("chai")
const { tokenize, Comma, IntegerLiteral } = require("./custom_patterns")
const tokenMatcher = require("chevrotain").tokenMatcher
describe("The Chevrotain Lexer ability to use custom pattern implementations.", () => {
it("Can Lex a simple input using a Custom Integer Literal RegE... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
# The entire source code is OSSRPL except 'whois' which is MPL
# License: MPL and OSSRPL
""" Userbot module for getiing... |
import * as React from 'react';
import renderer from 'react-test-renderer';
import FAB from '../FAB/FAB';
it('renders normal FAB', () => {
const tree = renderer.create(<FAB onPress={() => {}} icon="plus" />).toJSON();
expect(tree).toMatchSnapshot();
});
it('renders small FAB', () => {
const tree = renderer
... |
/* eslint no-console: 0 */
'use strict';
const utils = require('./utils');
const testDir = utils.prepareJetpackTestDir();
const toCopyDir = testDir.dir('to-copy');
let timer;
let jetpackTime;
let nativeTime;
const test = (testConfig) => {
console.log('');
return utils.prepareFiles(toCopyDir, testConfig)
.the... |
/**
* @fileoverview マップ
*/
import { HORIZONTAL_UNIT, VERTICAL_UNIT } from '../common/config'
import { Unit } from '../class/Unit'
/**
* マップクラス
* @class
*/
export class Map {
/**
* コンストラクタ
* @constructor
* @param {Phaser.Scene} scene マップを追加するシーン
*/
constructor ({ scene, mapDate, prefix, depth }) {
... |
#!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sampleapp.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Ar... |
/************************************************************************************
* arch/arm/src/kinetis/chip/kinetis_k40memorymap.h
*
* Copyright (C) 2011, 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or ... |
/*
* Amazon FreeRTOS V1.1.4
* Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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, i... |
# -*- coding: utf-8 -*-
import pytest
from gis_notebooks.skeleton import fib
__author__ = "BuffBob"
__copyright__ = "BuffBob"
__license__ = "mit"
def test_fib():
assert fib(1) == 1
assert fib(2) == 1
assert fib(7) == 13
with pytest.raises(AssertionError):
fib(-10)
|
from exasol_sagemaker_extension.deployment.deploy_create_statements import \
DeployCreateStatements
from tests.integration_tests.utils.parameters import db_params
DB_SCHEMA = "TEST_DEPLOY_SCHEMA"
AUTOPILOT_TRAINING_LUA_SCRIPT_NAME = \
"SME_TRAIN_WITH_SAGEMAKER_AUTOPILOT"
AUTOPILOT_TRAINING_UDF_NAME = \
"SM... |
import os
import numpy as np
import torch
import torchvision
import torchvision.utils as vutils
import conf
from classes import Generator
if len(os.listdir('src/models/checkpoints/finished')) > 0:
pass
else:
print("Sorry, there are no finished models.")
exit(0)
generator = Generator()
finished_mode... |
import json
from stix_shifter_utils.modules.base.stix_transmission.base_query_connector \
import BaseQueryConnector
from stix_shifter_utils.utils.error_response import ErrorResponder
from stix_shifter_utils.utils import logger
from requests.exceptions import ConnectionError
class BadRequestQueryError(Exception):
... |
# -*- coding: utf-8 -*-
import io
import re
import demjson
import pandas as pd
from zvt.api.data_type import Region, Provider, EntityType
from zvt.api.quote import china_stock_code_to_id
from zvt.domain import EtfStock, BlockCategory, Etf
from zvt.contract.recorder import Recorder
from zvt.contract.api import df_to_d... |
/**
* @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
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/gulp-tasks/cldr/extract.js
(function(global) {
global... |
"""
This module contains deprecation messages and bits of code used elsewhere in the codebase
that is planned to be removed in the next pytest release.
Keeping it in a central location makes it easy to track what is deprecated and should
be removed when the time comes.
"""
from __future__ import absolute_import, divis... |
"""Support for Z-Wave cover devices."""
from __future__ import annotations
import logging
from typing import Any
from zwave_js_server.client import Client as ZwaveClient
from zwave_js_server.const import BarrierState
from zwave_js_server.model.value import Value as ZwaveValue
from homeassistant.components.cover impo... |
"use strict";
exports.__esModule = true;
exports.m1_a1 = 10;
var m1_c1 = /** @class */ (function () {
function m1_c1() {
}
return m1_c1;
}());
exports.m1_c1 = m1_c1;
exports.m1_instance1 = new m1_c1();
function m1_f1() {
return exports.m1_instance1;
}
exports.m1_f1 = m1_f1;
//# sourceMappi... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _fs = require("fs");
var _lruCache = _interopRequireDefault(require("next/dist/compiled/lru-cache"));
var _path = _interopRequireDefault(require("path"));
var _constants = require("../shared/lib/constants");
var _normalizePagePath = re... |
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $Workfile: $
// $Date: $
//
//-----------------------------------------------------------------------------
// $Log: $
//
// $NoKeywords: $
//========================================================... |
/**
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you 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.o... |
const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'release'),
filename: 'accurate-math.js'
},
devServer: {
contentBase: path.join(__dirname, "./"),
compress: true,
port: 9000
}
}; |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("@styled-icons/fa-brands/Hooli"), exports);
|
"""
Defines the ForwardSimulator calculator class
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government... |
# -*- coding: UTF-8 -*-
#
# This module has been adapted from aglyph.compat.ipyetree
#
# MIT license
# Copyright (c) 2006-2016 Matthew Zipay <mattz@ninthtest.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... |
/* tslint:disable */
/**
* @file Source code generated by gulp-ps-code.
* @version 1.1
*/
export var PowerShellScripts;
(function (PowerShellScripts) {
'use strict';
var module = 'Microsoft.SME.Shell';
PowerShellScripts.Get_ClusterInventory = {
module: module,
command: 'Get-ClusterInvento... |
declare module "hjson" {
declare export interface DeserializeOptions {
/**
* keep white space and comments. This is useful if
* you want to edit an hjson file and save it while preserving comments (default false)
*/
keepWsc?: boolean;
}
declare export interface SerializeOptions {
/**
... |
// var mongoose = require('mongoose');
var db = require('../config/connection');
const { Blog, Collector, Coupon, Interest, PodOptions, Product } = require('../models/index');
const collectorSeeds = [
{
first_name: "Damien",
last_name: "Luzzo",
email: "damien@damien.com",
password:... |
from __future__ import print_function, division
from math import log as _log
from .sympify import _sympify
from .cache import cacheit
from .singleton import S
from .expr import Expr
from .evalf import PrecisionExhausted
from .function import (_coeff_isneg, expand_complex, expand_multinomial,
expand_mul)
from .log... |
const Simulation = require('./simulation');
const Discord = require('discord.js');
require('dotenv').config();
const client = new Discord.Client();
let sim = Simulation.init();
const states = {
READY: 'READY',
SHOOT: 'SHOOT',
HOLD: 'HOLD',
};
let state = states.READY;
client.on('ready', () => {
console.log(`Log... |
# -*- coding: utf-8 -*-
from .context import RecurrenceRelationParser
from .RecurrenceTestSuite import RecurrenceTestSuite
import unittest
class NonHomogeneousTestSuite(RecurrenceTestSuite):
"""Test cases for non homogeneous recurrence relations"""
def test_simple_twice_theorem6(self):
recurrence =... |
# -*- coding: utf-8 -*-
"""
clidye
"""
import datetime
import logging
from logging.handlers import RotatingFileHandler
# Our formatters
from . import formatters
__version__ = '0.0.1'
__all__ = ['formatters', 'handlers', 'utils']
__title__ = 'clidye'
__author__ = 'Gilbert Montague'
__description__ = 'Another Python L... |
import auth0 from 'auth0-js';
import history from './history';
export default class Auth {
// Please use your own credentials here
auth0 = new auth0.WebAuth({
domain: 'divyanshu.auth0.com',
clientID: 'TbAhr53KMkfkFc5SOpPeGja6VfKfqNSa',
redirectUri: process.env.NODE_ENV === 'development' ? 'http://loca... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 27 08:49:25 2017
Multiprocessing execution
@author: laci
"""
import multiprocessing as mp
import time
import math
import sparse_methods as m
import sparse_move as sm
import sparse_contract as sc
import graph
import divide as d
def start_calc(fm, f... |
const express = require('express');
const app = express();
function main() {
process.chdir('/storage/sd');
app.use(express.static('www'));
app.listen(9090, function() {
console.log('Example app listening on port 9090!');
});
}
window.main = main; |
import {replaceMetadataCertificateLinkTexts} from "./modules/EngineBlockMainPage";
import {initConsentPage} from "./modules/ConsentPage";
import {IdpList} from "./modules/IdpList";
import {IdpPicker} from "./modules/IdpPicker";
import {UnconnectedIdpPicker} from "./modules/UnconnectedIdpPicker";
import {PreviousSelecti... |
var searchData=
[
['bitfield',['bitField',['../union_c_c_bsv_axi_ace_const__t.html#a5c2d079e3d447bf0c7d25d754bede2c4',1,'CCBsvAxiAceConst_t::bitField()'],['../union_c_c_bsv_axim_cache_params__t.html#a650c19c59420c2146ac4b5c5375377c5',1,'CCBsvAximCacheParams_t::bitField()']]],
['bootimagesverifier_5fapi_2eh',['booti... |
/*
YUI 3.16.0 (build 76f0e08)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("series-line-stacked",function(e,t){e.StackedLineSeries=e.Base.create("stackedLineSeries",e.LineSeries,[e.StackingUtil],{setAreaData:function(){e.StackedLineSeries.sup... |
/**
* Courtesy:
* https://github.com/mui-org/material-ui/tree/master/docs/src/pages/page-layout-examples/dashboard
*/
const drawerWidth = 260
const appStyles = theme => ({
root: {
display: 'flex',
flexGrow: 1,
},
// toolbar: {
// paddingRight: 24, // keep right padding when drawer closed
// },... |
const { Command } = require('discord.js-commando');
const { RichEmbed } = require('discord.js');
const randomPuppy = require('random-puppy');
const errors = require('../../assets/json/errors');
module.exports = class PantsuCommand extends Command {
constructor(client) {
super(client, {
... |
import pytest
from bacpy.utils import SequenceView
# ============
# SequenceView
# ============
# Sequence methods
# ----------------
def test_sequence_view_contains():
sequence = SequenceView([1, 2, 3])
assert 1 in sequence
assert 4 not in sequence
def test_sequence_view_len():
sequence = Sequ... |
'use strict';
import angular from 'angular';
import {
UtilService
} from './util.service';
export default angular.module('dMApp.util', [])
.factory('Util', UtilService)
.name;
|
import pytest
from pandas_to_sql.testing.utils.asserters import assert_
from pandas_to_sql.conventions import flatten_grouped_dataframe
def test_groupby_mean():
df2 = pytest.df1.groupby('random_int').random_float.mean()
assert_(flatten_grouped_dataframe(df2))
def test_groupby_sum():
df2 = pytest.df1.gro... |
#!/bin/python
# -*- coding: utf-8 -*-
from __future__ import division
import os
import base64
from hashlib import sha256
"""
subject: Experimental Fragments Processing (Experiment A)
description: A Dispersal Algorithm used in splitting and stitching msg fragments. This is a snippet for ANNNet.
author: Bryan Angelo P... |
var _ = require('lodash');
var ngApp = require('ngApp');
module.exports = ngApp.directive('fileInput', function () {
return {
restrict: 'EC',
scope: {
onFileInputChangeCallback: '=?onChange',
addTrigger: '=?',
removeTrigger: '=?',
inputLimit: '@'
... |
import sys
def do_reduce(word, values):
return word, sum(values)
kv = dict()
for key, value in map(lambda x: x.split("\t"), (line for line in sys.stdin)):
if key not in kv:
kv[key] = int(value)
else:
kv[key] += int(value)
for key, value in kv.items():
print(f"{key}\t{value}")
|
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import os
import time
from enum import Enum
import paramiko
import logging
import subprocess
import getpass
from contextlib import contextmanager
import infra.path
import json
import uuid
import ctypes
import signal
fr... |
import sys
from django.conf import settings as django_settings
from django.core.exceptions import ImproperlyConfigured
from django.test import override_settings
import pytest
from metroid.config import Settings
def test_metro_is_not_in_settings_exception():
"""
Deletes Metro from settings, and checks if th... |
#include <string.h>
#include <stdint.h>
#include <limits.h>
#define SS (sizeof(size_t))
#define ALIGN (sizeof(size_t)-1)
#define ONES ((size_t)-1/UCHAR_MAX)
#define HIGHS (ONES * (UCHAR_MAX/2+1))
#define HASZERO(x) ((x)-ONES & ~(x) & HIGHS)
void *memchr(const void *src, int c, size_t n)
{
const unsigned char *s = sr... |
# coding: utf-8
from unittest import TestCase
import pytest
from stellar_base import utils
from stellar_base.stellarxdr import StellarXDR_pack as Xdr
from stellar_base.utils import is_valid_address, is_valid_secret_key
class TestUtils(TestCase):
account = 'GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 OpenStack Foundation
#
# 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/LICE... |
import Item from '../../../../Item';
import Scroller from '../../../../Scroller';
import {FixedPopupPanels, Panel, Header} from '../../../../FixedPopupPanels';
import {withConfig, withProps} from './utils';
const stamp = (howMany, fn) => (new Array(howMany)).fill().map(fn);
// Wrapping the real component so `scaleTo... |
// Copyright 2018-present 650 Industries. All rights reserved.
#import <Foundation/Foundation.h>
#import <UserNotifications/UserNotifications.h>
@protocol ABI35_0_0UMUserNotificationCenterProxyInterface <NSObject>
- (void)getNotificationSettingsWithCompletionHandler:(nonnull void(^)(UNNotificationSettings *__nonnull... |
/**
* @license
* Copyright 2017 The FOAM 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-2.0
*
* Unless ... |
import ast
import os
import re
from setuptools import setup, find_packages
# Cannot use "from cloudbridge import get_version" because that would try to
# import the six package which may not be installed yet.
reg = re.compile(r'__version__\s*=\s*(.+)')
with open(os.path.join('cloudbridge', '__init__.py')) as f:
fo... |
# Copyright 2020 Michael Still
from functools import partial
from uuid import uuid4
from shakenfist import baseobject
from shakenfist.baseobject import (
DatabaseBackedObject as dbo,
DatabaseBackedObjectIterator as dbo_iter)
from shakenfist import db
from shakenfist import etcd
from shakenfist import exceptio... |
import re
import pandas as pd
from textblob import Word
import numpy as np
from sklearn.model_selection import train_test_split
from bs4 import BeautifulSoup
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.utils.np_utils import to_categorical
fr... |
'use strict';
const Constants = require('./constants');
const Redux = require('redux');
const initialState = {
loading: false,
success: false,
validation: {
error: undefined,
hasError: {},
help: {}
}
};
const reducer = (state = initialState, action) => {
if (action.type ==... |
from typing import Dict, List, Tuple
import numpy
import torch
import torch.nn.functional as F
from allennlp.common.util import START_SYMBOL, END_SYMBOL
from allennlp.data.vocabulary import Vocabulary
from allennlp.models.model import Model
from allennlp.modules import TextFieldEmbedder, Seq2SeqEncoder
from allennlp.m... |
'use strict';
/**
* Copyright (c) 2013-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.
... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _RadiusUprightOutlined = _interopRequireDefault(require("@ant-design/icons-svg/lib/asn/RadiusUprightOutlined"));
var _AntdIcon = _interopRequireDefault(... |
import validator from 'email-validator'
import path from 'path'
const exclude = function(path) {
if (path.indexOf('index.js') === -1) {
return path
}
return false
}
const checkLocation = function(obj) {
expect(validator.validate(obj.email)).toEqual(true)
expect(validator.validate(obj.receivingEmail)).to... |
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
/*--------------... |
from realbrowserlocusts import HeadlessChromeLocust
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from locust import TaskSet, task
class LocustUserBehavior(TaskSet):
def open_locust_homepage(self):
self.client.get("http://locust.io/")
... |
# -*- coding: utf-8 -*-
#
# texar documentation build configuration file, created by
# sphinx-quickstart on Mon Sep 4 21:15:05 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... |