text stringlengths 3 1.05M |
|---|
/************************************************************************
Copyright 2017-2019 eBay 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
https://www.apache.org/licenses/LICENSE-2... |
'use strict';
/* globals
generateInputCompilerHelper: false,
defaultModelOptions: false
*/
describe('ngModelOptions', function() {
describe('defaultModelOptions', function() {
it('should provide default values', function() {
expect(defaultModelOptions.getOption('updateOn')).toEqual('');
exp... |
import FWCore.ParameterSet.Config as cms
# This config was generated automatically using generate2021Geometry.py
# If you notice a mistake, please update the generating script, not just this config
XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource",
geomXMLFiles = cms.vstring(
'Geometry/CM... |
from __future__ import absolute_import
import logging
import struct
from . import base
try:
base.sched.subprocess.check_call(("ovs-ofctl", "-V"), stdout=base.sched.subprocess.PIPE)
except OSError:
raise RuntimeError("ovs-ofctl not found in PATH")
def rule2ofp(*rules, **kwargs):
version = kwargs.pop("version", 4)
... |
"""Unit tests for the vector space of lower triangular matrices."""
import random
import geomstats.backend as gs
from geomstats.geometry.lower_triangular_matrices import LowerTriangularMatrices
from tests.conftest import Parametrizer
from tests.data_generation import _VectorSpaceTestData
from tests.geometry_test_cases... |
const debug = require('debug')('extractor');
debug.log = console.log.bind(console);
const Navigator = require('./Navigator');
const path = require("path");
const MetaLogoStrategy = require('./extractors/meta-logo/MetaLogoStrategy');
const StyleColorsStrategy = require('./extractors/style-colors/StyleColorsStrategy')... |
import hashlib
import os
import shutil
from yozuch.utils import makedirs, path_from_url
from yozuch.generators import Generator
from yozuch.entries import Entry
def md5hash(path):
with open(path, 'rb') as f:
return hashlib.md5(f.read()).hexdigest()
class AssetEntry(Entry):
def __init__(self, url, a... |
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
... |
print("""You enter a dark room with two doors.
Do you go through door #1 or door #2?""")
door = input("> ")
if door == "1":
print("There's a giant bear here eating a cheese cake.")
print("What do you do?")
print("1. Take the cake.")
print("2. Scream at the bear.")
bear = input("> ")
if bear == "1":
print("The bear eats... |
# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import salt libs
import integration
class PillarModuleTest(integration.ModuleCase):
'''
Validate the pillar module
'''
def test_data(self):
'''
pillar.data
'''
gr... |
import evdev
import requests
import json
import datetime
import yaml
def main():
config = load_config()
dev = evdev.InputDevice(config['device_path'])
output_line('Initialized - Capturing device: ' + str(dev))
for event in dev.read_loop():
if event.type == evdev.ecodes.EV_KEY:
output_line(event)
... |
// -*- mode: objective-c -*-
@import Cocoa;
@interface DevicesController : NSObject
- (void)setup;
@end
|
/**
* Prints formatted console msg if string, otherwise dumps object
* @param data {String | Object} Output to be dumped
* @param force {Boolean} Log output even if CONFIG.debug.bridge
*/
export function log(data, force = false) {
if (CONFIG.debug.bridge || force) {
// eslint-disable-next-line no-cons... |
import copy
import numpy as np
from collections import OrderedDict
from tfbldr.datasets import notes_to_midi
from tfbldr.datasets import midi_to_notes
from tfbldr.datasets import save_image_array
d = np.load("music_data_jos_1d.npz")
all_notes = copy.deepcopy(d['functional_notes'])
all_scalenotes = copy.deepcopy(d['sc... |
/**
* Copyright 2021 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
* ... |
import ast
import copy
import astor
from taichi.lang import impl
from taichi.lang.ast.symbol_resolver import ASTResolver
from taichi.lang.ast_builder_utils import *
from taichi.lang.exception import TaichiSyntaxError
from taichi.lang.expr_builder import build_expr, build_exprs
from taichi.lang.util import to_taichi_ty... |
# Copyright 2016 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... |
import argparse
parser = argparse.ArgumentParser(prog='subset_gwas.py', description='''
Subset GWAS file so that it only contains SNPs in
SNP map
''')
parser.add_argument('--gwas', help='''
Input GWAS file name (assume tsv.gz).
''')
parser.add_argument('--snp-map', help='''
The SNP map generated in ../... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) "Neo4j"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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
#... |
"""smiley.
Usage:
cvrminer.smiley all-cvrs [options]
cvrminer.smiley build-sqlite-database [options]
cvrminer.smiley query [options] [<query>]
cvrminer.smiley url-to-smiley-id [options] <url>
Options:
-h --help Help message.
--oe=<encoding> Output encoding [default: utf-8].
-o --output=<fi... |
import numpy as np
import pytest
from napari.components import ViewerModel
from napari._qt.qt_viewer import QtViewer
from napari.tests.util import (
add_layer_by_type,
check_viewer_functioning,
layer_test_data,
)
def test_qt_viewer(qtbot):
"""Test instantiating viewer."""
viewer = ViewerModel()
... |
# -*- coding: utf-8 -*-
"""ThreatConnect Batch Import Module"""
import json
class Tag(object):
"""ThreatConnect Batch Tag Object"""
# TODO: enable when support for py2 is dropped.
# __slots__ = ['_tag_data', '_valid']
def __init__(self, name, formatter=None):
"""Initialize Class Properties.
... |
import { getVersionIdResHeader } from '../api/apiUtils/object/versioning';
/**
* Pulls data from saved object metadata to send in response
* @param {object} objectMD - object's metadata
* @param {object} corsHeaders - if cors headers exist, use as basis for adding
* other response headers
* @param {object} versio... |
import IncidentTypeApi from "@/incident_type/api"
import { getField, updateField } from "vuex-map-fields"
import { debounce } from "lodash"
const getDefaultSelectedState = () => {
return {
id: null,
slug: null,
name: null,
description: null,
visibility: null,
commander_service: null,
tem... |
require("dotenv").config()
const { CONTENTFUL_SPACE_ID, CONTENTFUL_ACCESS_TOKEN } = process.env
if (!CONTENTFUL_SPACE_ID || !CONTENTFUL_ACCESS_TOKEN) {
throw new Error(
"Contentful spaceId and the access token need to be provided."
)
}
module.exports = {
siteMetadata: {
menu: [
{ name: "Home", to... |
Vue.use(VueTables.TodoTable);
new Vue({
el: "#app",
delimiters: ['${', '}'],
data: {
columns: ['id', 'title', 'status', 'updated', 'url'],
data: project,
options: {
headings: {
id: '#',
title: 'Title',
description: 'Description',
url: 'Edit'
},
sortab... |
from datetime import datetime, timedelta
from urllib.parse import unquote
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import numpy as np
def get_image(plt):
from ui import Image
from io import BytesIO
data = BytesIO()
plt.savefig(data)
data = data.getvalue()
plt.close()
return Image.... |
#!/usr/bin/env python3
"""Exports vCenter objects and imports them into Netbox via Python3"""
import asyncio
import atexit
from socket import gaierror
from datetime import date, datetime
from urllib.parse import quote_plus
from ipaddress import ip_network
import argparse
import aiodns
import requests
from pyVim.connec... |
# Copyright 2014 The Oppia 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 applicable ... |
from flask import Blueprint, render_template, url_for, request, g
from sfa_dash.api_interface import (users, observations, forecasts,
cdf_forecasts, cdf_forecast_groups)
from sfa_dash.blueprints.aggregates import AggregatesView, AggregateView
from sfa_dash.blueprints.dash import Da... |
import styled from 'styled-components';
export const SectionTitle = styled.h2`
color: #4e4e4e;
font-size: 2.5rem;
flex: auto;
line-height: 1.3;
margin: 2rem 0 3rem;
width: 100%;
text-align: center;
@media (min-width: 768px) {
margin: 2rem 0 6rem;
}
@media (max-width: 768px) {
margin: 4rem 0... |
/*
* Backpack - Skyscanner's Design System
*
* Copyright 2016-2021 Skyscanner Ltd
*
* 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
*
... |
//
// Copyright (c) 2020 Wolfgang Christl
// Licensed under Apache License, Version 2.0 - https://opensource.org/licenses/Apache-2.0
#include <lvgl/src/lv_core/lv_style.h>
#include <lvgl/src/lv_core/lv_obj.h>
#include <lvgl/src/lv_objx/lv_label.h>
#include <lvgl/lvgl.h>
#include <custom_themes/lv_theme_rep_panel_dark.... |
from __future__ import print_function, division
from itertools import product
from sympy.core.sympify import _sympify, sympify
from sympy.core.basic import Basic
from sympy.core.singleton import Singleton, S
from sympy.core.evalf import EvalfMixin
from sympy.core.numbers import Float
from sympy.core.compatibility imp... |
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
// import Routes from './Routes'
import reportWebVitals from './reportWebVitals';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
// If you want to ... |
import Vue from 'vue';
import Vuex from 'vuex';
import affiliate from './modules/affiliate.js';
Vue.use(Vuex);
export default new Vuex.Store({
// syntax: import store ...
state:{},
getters:{},
mutations:{},
actions:{},
modules: {
affiliate
}
}); // END STORE
|
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
module.exports = function getCase(base) {
return async (caseId, mainCallback) => {
try {
let record = await base('Cases').find(caseId)
let people = await Promise.all(record.get("People").map(p => (
base("People").find(p)
)))
record.fields["People"] = people.map(p => p.fields)
... |
from django.contrib.auth import authenticate, login, logout
from rest_framework import permissions, status
from rest_framework.views import APIView
from rest_framework.viewsets import ModelViewSet, ReadOnlyModelViewSet
from rest_framework.response import Response
from .models import Company, User, WorkPeriod, WorkShif... |
# coding: utf-8
from fontTools.misc.py23 import *
from fontTools.misc.testTools import getXML, parseXML, FakeFont
from fontTools.misc.textTools import deHexStr, hexStr
from fontTools.misc.xmlWriter import XMLWriter
from fontTools.ttLib.tables.otBase import OTTableReader, OTTableWriter
import fontTools.ttLib.tables.otTa... |
import path from 'path';
import webpack from 'webpack';
export default {
devtool: 'cheap-module-eval-source-map',
entry: [
'webpack-hot-middleware/client',
'./examples/index',
],
output: {
path: path.join(__dirname, 'examples', 'build'),
filename: 'examples_bundle.js',
publicPath: '/static/... |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... |
'use strict';
const memory = require('../memory.js');
const move = (point, x, y) => {
point.x += x;
point.y += y;
};
module.exports = async (name, x, y) => {
const shape = memory.get(name);
if (!shape) return 'Shape is not found';
for (const key in shape) {
const point = shape[key];
move(point, x, ... |
import json
def json_fixture(path):
json_string = open(f"./tests/fixtures/{path}").read()
json_dict = json.loads(json_string)
json_string_with_formatting_removed = json.dumps(json_dict)
return json_string_with_formatting_removed
def string_fixture(path):
return open(f"./tests/fixtures/{path}").re... |
from celery.decorators import periodic_task
from celery.schedules import crontab
from ldap3 import Server, Connection, ALL, NTLM, ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES
from ldap3.core.exceptions import LDAPCursorError
from sidgro.users.models.user import User
from sidgro._event.repository.actionPlan_repository... |
let moment = require('moment');
module.exports = {
/**
*
* @api {post} /v1/course/like/:class/:content Like
* @apiDescription Like the content
* @apiName like
* @apiGroup Course
* @apiVersion 1.0.0
* @apiPermission domainparse
*
*/
like: async (req,res)=>{
... |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... |
# DomirScire
def run_timing():
number_of_runs=0
total_time=0
while True:
one_run = input("Enter 10Km run time: ")
if not one_run:
break
number_of_runs += 1
total_time += float(one_run)
average_time = total_time / number_of_runs
print(f"Average of {average... |
import styleguide from "@times-components-native/styleguide";
import { StyleSheet, Dimensions } from "react-native";
const { colours, fontFactory, spacing, fonts } = styleguide();
const { width } = Dimensions.get("screen");
const isNarrowScreenDevice = width < 600;
export const calculateViewBox = ({ height, width })... |
/**
* @license
* Copyright 2016 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 requir... |
import React, { Component } from 'react';
import { connect } from 'react-redux';
class LoginContainer extends Component {
render() {
return <div>Login</div>;
}
}
const mapStateToProps = state => {
return {};
};
export default connect(mapStateToProps, {})(LoginContainer);
|
const express = require('express');
const path = require('path');
const bodyParser = require('body-parser');
const cors = require('cors');
const passport = require('passport');
const mongoose = require('mongoose');
const config = require('./config/database');
// Connect To Database
mongoose.connect(config.database);
... |
const cache = require('./cache');
/**
* This module extracts handlebars-jest relevant parts of a jest config
*
* @param {Object} jestConfig - a complete jest config object
* @returns {Object} handlebarsJestConfig - an object holding handlebars-jest specific configuration
*/
module.exports = function getHandlebars... |
#include <stdbool.h>
#include <stdio.h>
#include <math.h>
#include <inttypes.h>
// Check little or big endian
// Linux (32- or 64-bit) is probably little endian
bool endian(void)
{
// https://stackoverflow.com/questions/12791864/c-program-to-check-little-vs-big-endian
volatile uint32_t i=0x01234567;
// ret... |
from decimal import Decimal
from django.conf import settings
from documents.models import Document
class Cart(object):
def __init__(self, request):
self.session = request.session
cart = self.session.get(settings.CART_SESSION_SLUG)
if not cart:
cart = self.session[settings.CART... |
/**样式翻译合并
* 开发*/
var gulp = require('gulp'),
less = require('gulp-less'),//less解码
autoprefixer = require('gulp-autoprefixer'),//css兼容性
concatDir = require('gulp-concat-dir'),//按文件夹合并
concat = require("gulp-concat"),//文件合并
connect = require('gulp-connect'),//服务器
rename = require("gulp-ren... |
//
// AllNightModeDetailViewController.h
// Intelligentlamp
//
// Created by L on 16/9/27.
// Copyright © 2016年 L. All rights reserved.
//夜间模式灯光设置页面
#import "RootViewController.h"
@class AllBulbModel;
@interface AllNightModeDetailViewController : RootViewController
@property (nonatomic ,strong) AllBulbModel *lam... |
#!/usr/bin/env python
# Copyright (c) 2013-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.
from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore... |
/*
* Copyright 2011-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/lice... |
var lruCache = require('lru-cache')
let api
if (process.__API__) {
api = process.__API__
} else {
api = process.__API__ = {
api: 'https://cnodejs.org/api/v1/',
port: 8080,
timeout: 30000,
cached: lruCache({
max: 1000,
maxAge: 1000 * 60 * 15
}),
... |
import Task from "../models/Task.js";
const listar_task = async (req, res) => {
const tasks = await Task.findAll();
res.json({
tasks
});
};
const crear_task = async (req, res) => {
const {
tittle,
description
} = req.body;
const task = await Task.create({
tittle... |
//// [inheritanceMemberPropertyOverridingAccessor.ts]
class a {
private __x: () => string;
get x() {
return this.__x;
}
set x(aValue: () => string) {
this.__x = aValue;
}
}
class b extends a {
x: () => string;
}
//// [inheritanceMemberPropertyOverridingAccessor.js]
var __ex... |
/*
Copyright (c) 2004-2016, The JS Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
//>>built
define("dojo/NodeList-dom",["./_base/kernel","./query","./_base/array","./_base/lang","./dom-class","./dom-construct... |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base... |
"""
OpenAPI definition
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from gooddata_met... |
import { createApp, ref } from 'vue';
import { AgGridVue } from '@ag-grid-community/vue3';
import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-model';
import "@ag-grid-community/core/dist/styles/ag-grid.css";
import "@ag-grid-community/core/dist/styles/ag-theme-alpine.css";
import MedalCellRend... |
from django.urls import path
from . import views, views_auth, views_defs, views_recipe, views_social
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [path('', views.home, name='NA_WebApp-home'),
path('errorpage', views.error, name='NA_WebApp-error'),
... |
# ******************************************************************************
# Copyright 2018-2020 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.apa... |
import aiohttp
import traceback
from dutymanager.files.dicts import default_data
from module.utils import logger
from vkbottle.user import User as Bot
DEFAULT_WAIT: int = 25
class User(Bot):
async def run(self, wait: int = DEFAULT_WAIT):
self.__wait = wait
logger.info("Polling will be started. I... |
from bigflow.commons import public
from . import interactive, dataset_configuration, job
from .interactive import INLINE_COMPONENT_DATASET_ALIAS
__all__ = [
'component',
'add_label',
'sensor',
'INLINE_COMPONENT_DATASET_ALIAS',
'DatasetConfig',
'Job'
]
@public(class_alias=True)
class DatasetC... |
from pollination_dsl.alias import InputAlias
from queenbee.io.common import IOAliasHandler
"""Alias for inputs that expect a simulation parameter .json file as the recipe input."""
energy_simulation_parameter_input = [
InputAlias.any(
name='sim_par',
description='A SimulationParameter object that ... |
import os
import numpy as np
import pandas as pd
from sklearn.datasets import load_iris
from sklearn.tree import DecisionTreeClassifier
from commonmodels2.stages.pipeline import Pipeline
from commonmodels2.models.model import SklearnModel
from commonmodels2.stages.load_data import DataFrameLoaderStage
from commonmode... |
import matplotlib.pyplot as plt
import json
d1 = json.load(open('data_50.json', 'r'))
d2 = json.load(open('data_100.json', 'r'))
d3 = json.load(open('data_500.json', 'r'))
d4 = json.load(open('data_1000.json', 'r'))
d5 = json.load(open('data_5000.json', 'r'))
l = [d1, d2, d3, d4, d5]
# Visited
xAxis = [ 50, 100, 500... |
// Copyright (c) 2019, Solutions Paralint inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or wit... |
/* eslint-disable */
import React from 'react';
import clsx from 'clsx';
import PropTypes from 'prop-types';
import {
Avatar,
Card,
CardContent,
Grid,
Typography,
makeStyles,
colors
} from '@material-ui/core';
import Book from '@material-ui/icons/Book';
import { AvTimer } from '@material-ui/icons';
const... |
# -*- coding: utf-8 -*-
import numpy as np
import pygimli as pg
class HarmFunctor(object):
""""""
def __init__(self, A, coeff, xmin, xSpan):
self.A_ = A
self.coeff_ = coeff
self.xmin_ = xmin
self.xSpan_ = xSpan
def __call__(self, x):
nc = len(self.coeff_) / 2
... |
from annoying.decorators import render_to
from django.shortcuts import redirect, get_object_or_404
from ..models import Entry
@render_to('entries/entry.html')
def entry(request, kind, id, slug=None):
entry = get_object_or_404(Entry, pk=id)
if request.path != entry.url:
return redirect(entry.url, perma... |
/* ===========================================================
* bootstrap-datepicker.js v1.3.0
* http://twitter.github.com/bootstrap/javascript.html#datepicker
* ===========================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "Lic... |
/* -----------------------------------------------------------------------------
*
* Copyright : (c) Edward Kmett 2014, (c) Sven Panne 2013
* License : BSD3
*
* Maintainer : Edward Kmett <ekmett@gmail.com>
* Stability : stable
* Portability : portable
*
* C support for "Graphics.GL.Raw.Proc"
* -... |
//===-- TemplateBase.h - Core classes for C++ templates ---------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
/*
* 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 ... |
__author__ = 'bmustafa'
import numpy as np
import warnings
import matplotlib.pyplot as plt
from skimage.segmentation import random_walker
def rw_segment(image, seeds, threshold=0.95, beta=90, bg_label=-1, return_bg_label = False, debug=False):
# Uses scikit-image's implementation of Leo Grady's Random Walker algor... |
'use strict'
console.log('---- if ----')
var int = 0
if (int === 0) {
console.log('here!!')
}
if (int == 0) {
} else {
console.log('really not')
}
if (int) {
console.log('really not')
} else {
console.log('here!!')
}
console.log('\n\n---- while ----')
while (int < 10) {
console.log(int)
int+... |
import cv2
import os
import random
from maps_utils import checkInObstacle, Node
# Degrees of freedom for the robot
# A 2 d.o.f robot can move in +x -x +y -y
# This can be developed further by getting a formula
# for finding a relation between the d.o.f and the directions,
# as well as between the d.o.f and the cost it... |
module.exports = {
entry: [
'./src/index.js'
],
output: {
path: __dirname,
publicPath: '/',
filename: 'bundle.js'
},
module: {
loaders: [{
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['react', 'es2015', 'stage-1']
}
}]
},
resolve: {
... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# 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.
import copy
import os
from typing import Type, Callable, List, Optional, Dict
import yaml... |
# -*- coding: utf-8 -*-
# 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, softw... |
# Copyright (c) 2010-2012 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/LICENSE-2.0
#
# Unless required by applicable law or agree... |
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/athena/Athena_EXPORTS.h>
#include <aws/athena/model/ResultSet.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
template<typename RESUL... |
var qpg6100_2_c_h_i_p_platform_config_8h =
[
[ "ASN1_CONFIG_ERROR_MAX", "qpg6100_2_c_h_i_p_platform_config_8h.html#af272e272fa202559e508daaa392d1a5a", null ],
[ "ASN1_CONFIG_ERROR_MIN", "qpg6100_2_c_h_i_p_platform_config_8h.html#ab3a57b99cbf7688721ba11532757f159", null ],
[ "ASN1_CONFIG_ERROR_TYPE", "qpg610... |
import os
import shutil
from inspect import cleandoc
from pytest import fixture
from python2latex import TexEnvironment, Document, Section, Subsection
@fixture
def default_doc():
return Document('Default')
class TestDocument:
def setup(self):
pass
def test_set_margins(self, default_doc):
... |
/**
* Copyright 2017, Google, 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 agreed to i... |
import re
def escape_string(string):
return re.escape(string)
def distinct(seen, new_list):
temp_seen = seen
result_list = []
for nl in new_list:
if not nl['name'] in temp_seen:
result_list.append(nl)
temp_seen += nl['name'] + ";"
return (temp_seen, result_list) |
import colors from 'vuetify/es5/util/colors'
import fr from 'vuetify/es5/locale/fr'
export default {
ssr: true,
// Global page headers (https://go.nuxtjs.dev/config-head)
head: {
titleTemplate: 'PlanningIUT',
title: 'PlanningIUT',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content:... |
/*jslint browser:true plusplus:true */
/*global require:true */
function runTests() {
'use strict';
function setText(el, str) {
if (typeof el.innerText === 'string') {
el.innerText = str;
} else {
el.textContent = str;
}
}
function reportSuc... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-02-18 14:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0010_auto_20180218_1431'),
]
operations = [
migrations.AlterField(... |
/**
*
* ResetPasswordForm
*
*/
import React from 'react';
import { browserHistory } from 'react-router';
import inViewport from 'in-viewport';
import { Field, reduxForm, change } from 'redux-form';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import ReCAPTCHA from 'react-... |
import pandas as pd
import os
from cycifsuite.plate_based_analysis import per_well_analysis
expr_data = pd.read_csv(
'example_input/sample_exprdata.csv', index_col=0)
metadata = pd.read_csv(
'example_input/sample_metadata.csv', index_col=0)
if not os.path.exists('example_output'):
os.makedirs('example_outp... |
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity 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 lat... |
"""
Robot object.
Python implementation by: Luis Fernando Lara Tobar and Peter Corke.
Based on original Robotics Toolbox for Matlab code by Peter Corke.
Permission to use and copy is granted provided that acknowledgement of
the authors is made.
@author: Luis Fernando Lara Tobar and Peter Corke
"""
from numpy import ... |