text stringlengths 3 1.05M |
|---|
# noqa: D100
import numpy as np
def max_index(X):
"""Return the index of the maximum in a numpy array.
Parameters
----------
X : ndarray of shape (n_samples, n_features)
The input array.
Returns
-------
i : int
The row index of the maximum.
j : int
The column ... |
#!/usr/bin/env python
import unittest, re
from unittest import TestCase
from plasTeX.TeX import TeX
from plasTeX import Macro
class Verbatim(TestCase):
def testVerbatim(self):
intext = 'line one\nline two'
input = 'hi \\begin{verbatim}\n%s\n\\end{verbatim} bye' % intext
s = TeX()
... |
var _c_l_2_non_linear_filter_8cpp =
[
[ "CLNonLinearFilterFixture", "_c_l_2_non_linear_filter_8cpp.xhtml#a4f51783dfb1dc97681b4a518f62ea892", null ],
[ "DATA_TEST_CASE", "_c_l_2_non_linear_filter_8cpp.xhtml#af47ccf8173fbf22b22f0649949789046", null ],
[ "FIXTURE_DATA_TEST_CASE", "_c_l_2_non_linear_filter_8cpp... |
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
/* $Header: ranlib.h,v 2.3 90/10/25 11:18:34 ceriel Exp $ */
#ifndef __RANLIB_H_INCLUDED
#define __RANLIB_H_INCLUDED
#ifndef SYMDEF
# define SYMDEF "__.SY... |
import logging
import time
from subprocess import run
import pytest
from seldon_e2e_utils import (
API_AMBASSADOR,
API_ISTIO_GATEWAY,
assert_model,
assert_model_during_op,
get_pod_name_for_sdep,
initial_rest_request,
rest_request_ambassador,
retry_run,
to_resources_path,
wait_f... |
Drop.prototype.watchWindow = function() {
$(window).on('resize scroll', () => {
this.tick();
});
return this;
};
Drop.prototype.watchDrag = function() {
$(this.data.anchor).on('drag dragstart dragstop', () => {
this.tick();
});
return this;
}; |
# Copyright 2017 The TensorFlow 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 required by applica... |
/**
* Created by macbook on 17/5/2.
*/
|
// Copyright 2010 Google Inc. All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable... |
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"say_hello": "00_core.ipynb",
"HelloSayer": "00_core.ipynb"}
modules = ["core.py"]
doc_url = "https://Rakeshsuku.github.io/my_nbdev_tutorial/"
git_url = "https://github.com/Rakeshsuku/my_nbdev_tut... |
/*
* Variables, Data Types, and Typing
*/
let wordData = "Word List";
console.log(wordData);
let subTotal = 100;
let tax = subTotal * 0.07;
let totalWithTax = tax + subTotal;
let obj = {
key1: "value 1",
key2: 3,
boolean: true,
obj2: {
obj2key1: "value of inner object",
},
};
console.log(obj.obj2... |
#!/usr/bin/env python
# encoding: utf-8
"""
@version: ??
@author: liangliangyy
@license: MIT Licence
@contact: liangliangyy@gmail.com
@site: https://www.lylinux.net/
@software: PyCharm
@file: commonapi.py
@time: 2017/9/2 上午1:43
"""
import requests
import json
import logging
logger = logging.getLogger(__name__)
cl... |
# Copyright 2010-2014, Google Inc.
# 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 conditions and ... |
var express = require('express');
var router = express.Router();
const Instatouch = require('instatouch');
router.get('/', function (req, res, next) {
res.send('respond with a resource');
});
router.post('/', function (req, res, next) {
let options = {
endCursor: epochToId(dateToEpoch(new Date(req.body.toYear... |
"""
Goal: Delegate requests to the `/api` path to the appropriate controller
@authors:
Andrei Sura <sura.andrei@gmail.com>
"""
import collections
from binascii import unhexlify
from flask import request
from flask_login import login_required
from flask_login import current_user
from olass import utils
from olass.... |
#ifndef __FL_VALUATOR_C__
#define __FL_VALUATOR_C__
#ifdef __cplusplus
// always include the FL/*.H headers before local headers
// Fl_Valuator is included transitively and needed for
// the callback mechanism included below to work.
#include "FL/Fl.H"
#include "FL/Fl_Valuator.H"
#include "Fl_CallbackC.h"
EXPORT {
cl... |
// @flow
import React, { Component } from 'react'
import { Platform, Text, TouchableWithoutFeedback, View } from 'react-native'
import { type LoginUserInfo } from '../../../common/actions/PreviousUsersActions.js'
import s from '../../../common/locales/strings.js'
import DeleteUserConnector from '../../../native/conne... |
import { makeExecutableSchema, addErrorLoggingToSchema } from 'graphql-tools'
import { PubSub } from 'graphql-subscriptions'
import log from '../../log'
import schema from './schema_def.graphqls'
export const pubsub = new PubSub();
const resolvers = {
Query: {
count(ignored1, ignored2, context) {
return ... |
var about_btn = document.querySelector('#info_icon');
var about_modal = document.querySelector('#about_modal');
var close_modal_btn = document.querySelector('#close_modal_btn');
var mySwiper = null;
var storyObj = null;
var language = null;
var audioElement = null;
var audio_is_playing = false;
////////... |
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/util/internal/testdata/timestamp_duration.proto
#ifndef PROTOBUF_google_2fprotobuf_2futil_2finternal_2ftestdata_2ftimestamp_5fduration_2eproto__INCLUDED
#define PROTOBUF_google_2fprotobuf_2futil_2finternal_2ftestdata_2ftimestamp_5fd... |
/*
* This header is generated by classdump-dyld 1.5
* on Friday, April 30, 2021 at 11:37:01 AM Mountain Standard Time
* Operating System: Version 13.5.1 (Build 17F80)
* Image Source: /System/Library/PrivateFrameworks/MediaRemote... |
var ex__get__object__truth__vector_8c =
[
[ "ex_get_object_truth_vector", "ex__get__object__truth__vector_8c.html#a1591cc35b01b6546f9367b4420be6862", null ]
]; |
"""
pyTransient_problem
"""
# =============================================================================
# Imports
# =============================================================================
import warnings
import os
import numpy as np
from collections import OrderedDict
import time
from .base import TACSProble... |
/*
This Software is provided under the Zope Public License (ZPL) Version 2.1.
Copyright (c) 2009, 2010 by the mingw-w64 project
See the AUTHORS file for the list of contributors to the mingw-w64 project.
This license has been certified as open source. It has also been designated
as GPL compatible by the Free So... |
import os
from ....utils import in_temporary_directory
from ....utils import assert_files_exist
from ....utils import catkin_success
from ....utils import redirected_stdio
from ....workspace_assertions import assert_workspace_initialized
from ....workspace_assertions import assert_no_warnings
TEST_DIR = os.path.dir... |
/*
* TOPPERS ATK2
* Toyohashi Open Platform for Embedded Real-Time Systems
* Automotive Kernel Version 2
*
* Copyright (C) 2011-2015 by Center for Embedded Computing Systems
* Graduate School of Information Science, Nagoya Univ., JAPAN
* Copyright (C) 2011-2015 by FUJI SOFT INCORPORATED... |
class Solution:
def arrayStringsAreEqual(self, word1: List[str], word2: List[str]) -> bool:
return ''.join(word1) == ''.join(word2)
|
/**
* @license
* Copyright (c) 2018 amCharts (Antanas Marcelionis, Martynas Majeris)
*
* This sofware is provided under multiple licenses. Please see below for
* links to appropriate usage.
*
* Free amCharts linkware license. Details and conditions:
* https://github.com/amcharts/amcharts4/blob/master/LICENSE
*... |
/*
american fuzzy lop - LD_PRELOAD for fuzzing argv in binaries
------------------------------------------------------------
Copyright 2019 Kjell Braden <afflux@pentabarf.de>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.... |
import sys
import time
import rospy
import rosutils
import numpy as np
from scipy.spatial.transform import Rotation
if len(sys.argv) > 1:
master_uri = sys.argv[1]
else:
master_uri = "http://localhost:11311"
node = rosutils.RosNode("exploration_stack", master_uri, wait_time=1.5)
node.stopSimulation()
rospy.sle... |
# Copyright (c) 2014 The Bitcoin Core developers
# Copyright (c) 2014-2015 The Dash developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#
# Add python-bitcoinrpc to module sea... |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/fishing/bait/base/shared_bait_base.iff"
result.attribute_template_i... |
import setuptools
setuptools.setup(
name="SimpleCalc-CodeJack", # Replace with your own username
version="0.0.1",
author="CodeJack",
author_email="chandanrajsingh19@gmail.com",
description="Calculator in PyQt5",
long_description="A simple calculator made using PyQt5",
long_description_cont... |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... |
import statistics
from rest_framework import serializers
from foundation.models import TimeSeriesDatum, Sensor
class DashboardSerializer(serializers.BaseSerializer):
def get_values(self, sensor_name, instrument):
sensor = Sensor.objects.get(
name=sensor_name,
instrument=instrume... |
from distutils.core import setup
from setuptools import find_packages
version = '0.2.1.dev0'
CLASSIFIERS = [
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Topic :: Software Development',
]
install_requir... |
import '@brightspace-ui/core/components/button/button-subtle.js';
import '@brightspace-ui/core/components/colors/colors.js';
import './d2l-note';
/**
* Import LitElement base class, html helper function,
* and TypeScript decorators
**/
import { html, LitElement } from 'lit-element';
import { bodyStandardStyles } f... |
const assert = require('assert');
const { Buffer } = require('buffer');
const algosdk = require('../index');
const group = require('../src/group');
describe('Sign', () => {
/* eslint-disable no-console */
const originalLogFunction = console.log;
let logs;
beforeEach(() => {
logs = '';
// Mock console... |
import os
from setuptools import setup, find_packages
def get_long_description():
this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
return long_description
def parse_requirements(... |
import logging
from pathlib import Path
import random
from odfuzz.restrictions import RestrictionsGroup
from odfuzz.entities import DirectBuilder
from odfuzz.fuzzer import SingleQueryable
logger = logging.getLogger("testDirectBuilder")
logger.setLevel(logging.CRITICAL)
#logger is needed not for the test but as part o... |
#!/usr/bin/env node
'use strict';
const program = require('commander');
const colors = require('colors');
const GasTest = require('../lib/gas-test');
const util = require('../lib/util');
program
.option('-o, --output <path>', 'path to result file')
.option('-s, --settings <path>', 'path to settins for test', './g... |
/*
* Copyright (C) 2021 by Intel Corporation
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES O... |
import functools
import caproto as ca
import trio
from trio import socket
from ..server import AsyncLibraryLayer
from ..server.common import (VirtualCircuit as _VirtualCircuit,
Context as _Context, LoopExit,
DisconnectedCircuit)
from .util import open_memory_c... |
/**
* --- Day 9: Smoke Basin ---
These caves seem to be lava tubes. Parts are even still volcanically active; small hydrothermal vents release smoke into the caves that slowly settles like rain.
If you can model how the smoke flows through the caves, you might be able to avoid it and be that much safer. The submarine... |
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.ex... |
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sstream>
#include <arpa/inet.h>
#include <string>
#include "data_def.h"
class NetworkTool {
public:
static NetworkTool* get_instance() {
... |
import logging
import os
log_level = getattr(logging, os.getenv('LOG_LEVEL', 'DEBUG'))
fmt = '%(asctime)s %(name)-12s %(levelname)-8s %(message)s'
logging.basicConfig(level=log_level, format=fmt)
def make_logger(file_path='NO_FILE'):
file_name = file_path.split("/")[-1]
return logging.getLogger(file_name)
|
# -*- coding: utf-8 -*-
# Author: Florian Mayer <florian.mayer@bitsrc.org>
""" Offer a callable object that dispatches based on arbitrary conditions
and function signature. That means, whenever it is called, it finds the
registered methods that match the input's signature and then checks for
user-defined conditions an... |
import os
from tqdm import tqdm
import numpy as np
import pandas as pd
import torch
import networkx as nx
from torch_geometric.data import Data, InMemoryDataset
import torch_geometric.transforms as T
from rdkit import Chem, RDConfig
from rdkit.Chem import ChemicalFeatures
from utils import Complete, angle, area_trian... |
# coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
(function(angular, _){
"use strict";
/**
* @ngdoc module
*
* @name mfl.setup.controllers.documents
*
* @description
* Contains all the controllers used for county setup
*/
angular.module("mfl.setup.controllers.documents", ["mfl.setup.api"])
/**
* @ngdoc controll... |
// Copyright 2009 the Sputnik authors. All rights reserved.
/**
* No matter how control leaves the embedded 'Statement',
* the scope chain is always restored to its former state
*
* @path ch12/12.10/S12.10_A3.4_T1.js
* @description Using "with" statement within iteration statement, leading to normal completion
*... |
# Django settings for powwow project.
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Angel Ramboi', 'angel.ramboi@gmail.com'),
)
MANAGERS = ADMINS
APP_URL = '' # the apps absolute url
CONFLUENCE_USER = ''
CONFLUENCE_PASS = ''
CONFLUENCE_API = ''
JIRA_URL = '' # api base uri
JIRA_API = '%s/api/2.0.alpha1' %... |
import Link from 'next/link';
import Code from './code';
import withFrame from './frame';
const CLI = () => (
<Code lang="none">
<span className="hljs-keyword">▲</span>
{' ~/my-site '}
<span className="hljs-keyword">yarn build</span>
{`
yarn run v1.9.4
warning package.json: No license field
$ next b... |
/* printk() - kernel printf() Author: Kees J. Bot
* 15 Jan 1994
*/
#define nil 0
#include <stdarg.h>
#include <limits.h>
#define isdigit(c) ((unsigned) ((c) - '0') < (unsigned) 10)
#if !__STDC__
/* Classic C stuff, ignore. */
void putk();
void printk(fmt) char *fmt;
#else
/* Printk() uses putk() to print... |
from . import acmg
from . import allele
from . import allelereport
from . import alleleassessment
from . import analysis
from . import annotationjob
from . import attachment
from . import broadcast
from . import config
from . import customannotation
from . import geneassessment
from . import overview
from . import refe... |
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=8 sts=4 et sw=4 tw=99:
* 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/. */
... |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_GFX_CANVAS_H_
#define UI_GFX_CANVAS_H_
#include <vector>
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/... |
/* Assemble all pages for export */
export HomePage from "./HomePage/HomePage";
export LoginPage from "./LoginPage/LoginPage";
export SignUpPage from "./SignUpPage/SignUpPage";
export SignUpCompletedPage from "./SignUpCompetedFormPage/SignUpCompletedFormPage"; |
"""NCEAverage, serve as contrast
"""
import math
import torch
from torch import nn
from alias_multinomial import AliasMethod
class NCEAverage(nn.Module):
def __init__(self, input_size, output_size, K, T=0.07, momentum=0.5):
"""
Args:
input_size: n_features
output_size: n_sa... |
//
// INActivateCarSignalIntentResponse.h
// Intents
//
// Copyright © 2016 Apple Inc. All rights reserved.
//
#import <Intents/INIntentResponse.h>
#import <Intents/INCarSignalOptions.h>
typedef NS_ENUM(NSInteger, INActivateCarSignalIntentResponseCode) {
INActivateCarSignalIntentResponseCodeUnspecified = 0,
... |
/*
* This header is generated by classdump-dyld 1.5
* on Wednesday, April 28, 2021 at 9:11:47 PM Mountain Standard Time
* Operating System: Version 14.5 (Build 18L204)
* Image Source: /System/Library/PrivateFrameworks/MediaFound... |
# Authors: Stephane Gaiffas <stephane.gaiffas@gmail.com>
# License: BSD 3 clause
import numpy as np
import pytest
def approx(v, abs=1e-15):
return pytest.approx(v, abs)
def parameter_test_with_min(
class_tested,
parameter,
valid_val,
invalid_type_val,
invalid_val,
min_value=None,
mi... |
const mongoose = require('mongoose');
const Todo = mongoose.Schema({
name:{
type: String,
unique: false
},
description: {
type: String,
unique: false
},
postedBy:{
type: mongoose.Schema.Types.ObjectId,
ref: 'User',
required: true
}
});
mo... |
from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from ccdemo.users.forms import UserChangeForm, UserCreationForm
User = get_user_model()
@admin.register(User)
class UserAdmin(auth_admin.UserAdmin):
form = UserChangeForm
add_... |
import json
import re
import mechanize
from unidecode import unidecode
from urllib2 import quote
br = mechanize.Browser()
def send_query(query):
try:
return br.open(query)
except:
#print "Error: Cannot execute query = "+query
return 0
### MAIN
print "########### Geotravel ###########"
... |
webpackJsonp([1],{"+29q":function(t,e,r){t.exports=r.p+"img/ill1.d0aa45c.svg"},"+h1q":function(t,e){},"026T":function(t,e){t.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246... |
/**
* @module Schemas/Core/Uniform
* @desc Export the ThreeJs Uniform Model and Schema for Mongoose.
* @author [Tristan Valcke]{@link https://github.com/Itee}
* @license [BSD-3-Clause]{@link https://opensource.org/licenses/BSD-3-Clause}
*/
|
/* filter_sse2_intrinsics.c - SSE2 optimized filter functions
*
* Copyright (c) 2016-2017 Glenn Randers-Pehrson
* Written by Mike Klein and Matt Sarett
* Derived from arm/filter_neon_intrinsics.c
*
* Last changed in libpng 1.6.31 [(PENDING RELEASE)]
*
* This code is released under the libpng license.
* For co... |
# coding: utf-8
# # Behavioral Cloning
#
# ### Project 3 of Udacity's Self-Driving Car Engineer Nanodegree program
#
# This is the third project of the nanodegree in which you have to train a self-driving car to adapt to a human's driving style using a convolutional neural network which has to predict the steering ... |
'''
This module contains the execution context objects that are internal to the system.
Not every property on these should be exposed to random Jane or Joe dagster user
so we have a different layer of objects that encode the explicit public API
in the user_context module
'''
from collections import namedtuple
from dag... |
/**
@file md.h
@brief based on TRS-80 Virtual Disk Kit v1.7 for Windows by Miguel Dutra
Linux port VDK-80-Linux done by Mike Gore, 2016
@par Tools to Read and Write files inside common TRS-80 emulator images
@par Copyright © 2016 Miguel Dutra, GPL License
@par You are free to use this code under the terms... |
# Code listing #5
def fetch_url(url, ntries=3, timeout=30):
""" Fetch a given url and return its contents.
@params
url - The URL to be fetched.
ntries - The maximum number of retries.
timeout - Timout per call in seconds.
@returns
O... |
from tf_keras_1.finetune.imports import *
from system.imports import *
from tf_keras_1.finetune.level_14_master_main import prototype_master
class prototype(prototype_master):
'''
Main class for Mxnet Backend
Args:
verbose (int): Set verbosity levels
0 - Print Nothing
... |
"""
Does the following:
1. Generates and saves random secret keys for django and database access in
env.example
ansible/host_vars/{{cookiecutter.production_host_name}}
A portion of this code was adopted from Django's standard crypto functions and
utilities, specifically:
https://github.com/django/django/blob/master... |
import logging
import os
import subprocess
import time
import json
import yaml
from jinja2 import Environment, select_autoescape, PackageLoader
__author__ = 'Sumit_Nagal@intuit.com'
logger = logging.getLogger(__name__)
class Helper(object):
####################################
# Function definitions ... |
/*
* This header is generated by classdump-dyld 1.5
* on Wednesday, October 27, 2021 at 3:23:07 PM Mountain Standard Time
* Operating System: Version 13.5.1 (Build 17F80)
* Image Source: /System/Library/PrivateFrameworks/WatchLi... |
import pool from "./../../system/pooling.js";
import * as event from "./../../system/event.js";
import { viewport } from "./../../game.js";
import collision from "./../../physics/collision.js";
import Body from "./../../physics/body.js";
import TMXOrthogonalRenderer from "./renderer/TMXOrthogonalRenderer.js";
import TM... |
require('dotenv').config()
const fetch = require('node-fetch')
const log = require('./logger')
const { CARD_CONTRACT, OPENSEA_SLUG } = require('./constants')
const OPENSEA_URL = 'https://opensea.io/assets'
const OPENSEA_API = 'https://api.opensea.io/api/v1'
const API_LIMIT = 15
const { OPENSEA_API_KEY } = process.en... |
import { createElement, PureComponent } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { deburrUpper } from 'utils/strings';
import groupBy from 'lodash/groupBy';
import remove from 'lodash/remove';
import Component from './component';
const mapStateToProps = (
{ mod... |
import Config from '../configs/api';
import request from 'request-promise';
import queryString from 'querystring';
function getData(pathElements, parameters) {
parameters = parameters || {};
var path = 'https://global.api.pvp.net/api/lol/' + pathElements.join('/');
// jscs:disable
parameters.api_key = Config.... |
# Copyright: See the LICENSE file.
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
db = SQLAlchemy(app)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80)... |
from .cart import Cart
#instantiate the cart using the request object and make it available to other templates as variable names 'cart'
#makes the current car object available to all templates with cart as name
#next setting.py to add context:processors
#than base.html add django template to html
def cart_context(reque... |
# Copyright (C) 2017 MongoDB Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3,
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARR... |
function spiralTraverse(array) {
const spiralSort = [];
let startRow = 0,
endRow = array.length -1;
let startCol = 0,
endCol = array[0].length -1;
while(startRow <= endRow && startCol <= endCol) {
for (let col = startCol; col <= endCol; col++) {
spiralSort.push(array[startRo... |
const m = require("mithril");
module.exports = m(
".icon",
m.trust(
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bold"><path d="M6 4h8a4 4 0 0 1 4 4 4 4... |
// ymaps.ready(init);
//
// function init() {
// var myMap = new ymaps.Map("map", {
// center: [47.222104, 39.720179],
// zoom: 10
// });
//
// // myMap.balloon.open(myMap.getCenter(), {
// // contentHeader: "Однажды",
// // contentBody: "В студенную зимнюю пору"
// // });... |
# -*- coding: utf-8 -*-
#
# skiboot documentation build configuration file, created by
# sphinx-quickstart on Mon Jul 25 15:23:23 2016.
#
# 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.
#
# A... |
//===--- ASTContext.h - AST Context Object ----------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... |
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var crypto = _interopDefault(require('crypto'));
var max = 10000000000000; // biggest 10^n integer that can still fit 2^53 w... |
import unittest
import json
from mock import patch
from mock import Mock
import sys
from django.conf.urls import url
from django.conf import settings
from django.test import RequestFactory
from django.test import SimpleTestCase
from django.test import override_settings
from django.test import modify_settings
from djan... |
APPCFG = {
//
// UI
//
// Enable embed mode: disable header on desktop
// Can also be set through url parameter ?embed
EMBED: false,
// Header Logo
HEADER_LOGO_URL: "resources/logo.png",
HEADER_LOGO_TARGET: "http://www.gbs.co.nz/",
// Header top right link
HEADER_LINK_TEXT: "A GBS Story Map... |
import torch
from torchvision import transforms
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
from utils.utils import *
import json
import numpy as np
import os
from tool.darknet2pytorch import *
from infer import infer
from tqdm import tqdm
from skimage import measure
def fgsm_attack(image, epsilo... |
# Karolina Szafran-Belzowska, 2019-03-16
# collatz.py
# Adapted from https://stackoverflow.com/questions/33508034/making-a-collatz-program-automate-the-boring-stuff?answertab=active#tab-top
def collatzSequence(number):
if (number % 2 == 0): # if it's even
number = number // 2
else: # if... |
this["polylang-pro"] =
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 506:
/***/ ((module) => {
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
module.... |
describe("chorus.views.SchemaListSidebar", function() {
beforeEach(function() {
this.view = new chorus.views.SchemaListSidebar();
});
it("does not show an info section", function () {
expect(this.view.$('.info')).not.toExist();
});
});
|
from ajenti.api import *
from ajenti.plugins import *
info = PluginInfo(
title='Database Commons',
icon='table',
dependencies=[
PluginDependency('main'),
PluginDependency('services'),
],
)
def init():
import api
|
import ActivityExecution from './ActivityExecution';
import BpmnIO from '../io/BpmnIO';
import {brokerSafeId, getUniqueId} from '../shared';
import {ActivityApi} from '../Api';
import {ActivityBroker} from '../EventBroker';
import {Formatter} from '../MessageFormatter';
import {cloneContent, cloneParent, cloneMessage} ... |
"""Add movie table and movie_genre
Revision ID: d11d5359e4ca
Revises:
Create Date: 2020-09-27 23:20:58.300881
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd11d5359e4ca'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### ... |
/**
* 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... |