text stringlengths 3 1.05M |
|---|
const { CaseExternalIncomplete } = require('./CaseExternalIncomplete');
const { ContactFactory } = require('../contacts/ContactFactory');
describe('CaseExternalIncomplete entity', () => {
describe('isValid', () => {
it('assigns a new irsNoticeDate if one is not passed in', () => {
const caseExternalIncompl... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "band"
app_title = "Band"
app_publisher = "Ahmad Ragheb"
app_description = "Band website"
app_icon = "red"
app_color = "red"
app_email = "ahmedragheb75@gmail.com"
app_license = "MIT"
# Includes in <head... |
import os
import django_heroku
import dj_database_url
from decouple import config,Csv
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
MODE=config("MODE", default="dev")
SECRET_KEY = config('SECRET_KEY')
DEBUG = config('DE... |
/*
* Author: CM
* Custom CM rules for Modernizr.
*/
(function() {
Modernizr.addTest('inputinfixed', function() {
return !navigator.userAgent.match(/(iPad|iPhone|iPod)/i);
});
Modernizr.addTest('webvr', function() {
return 'getVRDisplays' in navigator;
});
/*
* test based on THREE.js method, see... |
#ifndef LEXER_H
#define LEXER_H
#include <fstream>
#include <iomanip>
#include <set>
#include <vector>
#include "Token.h"
class Lexer {
public:
Lexer();
void feed(string line);
void clearResult();
vector<vector<Token> > getResult();
private:
const static set<string> KEY_WORDS;
const static se... |
#include <stdio.h>
#include "tokenizer.h"
#include "value.h"
#include "linkedlist.h"
#include "parser.h"
#include "talloc.h"
int main()
{
Value *tokensList = tokenize();
Value *parseTree = parse(tokensList);
printTree(parseTree);
printf("\n");
tfree();
return 0;
}
|
#!/usr/bin/env python3.4
"""
Simple doctest:
>>> fizzbuzz("sample.txt")
1 2 F 4 B F 7 8 F B
1 F 3 F 5 F B F 9 F 11 F 13 FB 15
"""
def fizzbuzz(filename):
with open(filename) as file:
for line in file:
print(*fizzline(*[int(x) for x in line.split()]))
"""Takes 3 numbers, x, y and, and prints o... |
var path = require("path");
/**
* GET /login/sessionCookieRedirect?checkAccountSetupComplete=true&token=20111h0ZlxjZM6hdu56L3U2VQSojaXPTA6uZViUr5wIOT7Ik22ZirK_&redirectUrl=http://127.0.0.1:7777/oauth2/v1/authorize/redirect?okta_key=ONHYUjtp7FHAP358vNnHFgbRFNVpCEruGRtdiffwbdA
*
* host: rain.okta1.com:1802
* connect... |
# +
import bq
from defaults import DEFAULT_DATASETS
import render
COMBINED = DEFAULT_DATASETS.latest.combined
DEID = DEFAULT_DATASETS.latest.deid
print("""COMBINED = {COMBINED}
DEID = {DEID}""".format(COMBINED=COMBINED, DEID=DEID))
# -
# ## Row counts in combined `_mapping*` and deid `*_ext` tables
ROW_COUNTS_QUERY ... |
/*
* This script represents an operator over Gearman protocol.
* {@see http://gearman.org/protocol}
*
* (C) 2013 Vaclav Sykora
* Apache License, Version 2.0, http://www.apache.org/licenses/
*
*/
var winston = require('winston'),
util = require('util');
// various constants used in protocol
var constan... |
import { pluginFactory } from '../utils/plugins'; // Component group plugins
import { AlertPlugin } from './alert';
import { BadgePlugin } from './badge';
import { BreadcrumbPlugin } from './breadcrumb';
import { ButtonPlugin } from './button';
import { ButtonGroupPlugin } from './button-group';
import { ButtonToolbar... |
# 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... |
/**
* Copyright © CM.com. All rights reserved.
* See LICENSE.txt for license details.
*/
define([
'uiComponent',
'jquery'
], function (
Component,
$
) {
'use strict';
return Component.extend({
mainContainerSelector: null,
/**
* Initialization of component
*... |
# Copyright 2018 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... |
/*!
* remark (http://getbootstrapadmin.com/remark)
* Copyright 2017 amazingsurge
* Licensed under the Themeforest Standard Licenses
*/
(function(document, window, $) {
'use strict';
var Site = window.Site;
$(document).ready(function($) {
Site.run();
var $example = $('#exampleTransition');
$(do... |
30 mtime=1639777085.394355983
30 atime=1639777086.327355983
30 ctime=1639777127.553355983
|
# -*- coding: utf-8 -*-
"""Test for tmuxp configuration import, inlining, expanding and export."""
from __future__ import absolute_import, unicode_literals
import os
import pytest
import kaptan
from tmuxp import config, exc
from . import example_dir
from .fixtures import config as fixtures
TMUXP_DIR = os.path.jo... |
def latinnum(x):
x=int(x)
if x<=0:
raise ValueError("Value must be greater than zero to produce an equivalent latin string")
lx=""
while x>25:
lx+=chr(ord('A')+int(x/25))
x%=25
lx+=chr(ord('A')+x)
return lx |
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{2:function(e,t,n){e.exports=n("hN/g")},PDX0:function(e,t){(function(t){e.exports=t}).call(this,{})},"hN/g":function(e,t,n){"use strict";n.r(t);var r,o=n("mrSG");r=function(){!function(e){var t=e.performance;function n(e){t&&t.mark&&t.mark(e)}function r(e,n){t&&t.... |
const binary_search = require('./binary_search')
const binary_search_recursive = require('./binary_search_recursive')
// 测试组数
let testCnt = 100
// 最大数组长度
const MAX_ARR_LENGTH = 50
// 最大元素大小
const MAX_ARR_ITEM = 9999
/**
* 生成不重复的随机数组
* @return {number[]}
*/
const generateDistinctRandArr = () => {
let rands = [... |
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "MMUIViewController.h"
#import "EmoticonBoughtListMgrExt.h"
#import "EmoticonStoreCellDelegate.h"
#import "EmoticonStoreMgrExt.h"
#import "EmotionCollectionFooterViewDelega... |
const http = require('http');
const port = 8080;
const startServer = () => {
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World!');
}).listen(port);
}
module.exports = {
start: startServer,
port
}
|
import React from "react";
import { Modal, Button } from "react-bootstrap";
class EndGame extends React.Component {
render() {
return (
<div>
{" "}
<Modal.Header closeButton className="rules-header">
<Modal.Title id="rules-dashboard-title" className="rules-header">
... |
"""
Anonymizes and uploads DNS and flow data to cloud.
"""
import time
import datetime
import threading
import utils
import requests
import json
import server_config
from host_state import HostState
UPLOAD_INTERVAL = 5
class DataUploader(object):
def __init__(self, host_state):
assert isinstance(host... |
from ray.rllib.utils.framework import try_import_tf
tf1, tf, tfv = try_import_tf()
class RelativeMultiHeadAttention(tf.keras.layers.Layer if tf else object):
"""A RelativeMultiHeadAttention layer as described in [3].
Uses segment level recurrence with state reuse.
"""
def __init__(self,
... |
import React from "react";
import Tile from "../Tile.js";
import withNeon from "../../src/index.js";
import ParticlesToon from "../../src/effects/ParticlesToon.js";
class ParticlesTile extends React.Component {
render(){
return (
<Tile bgIm="https://source.unsplash.com/random?a" />
)
}
};
const part... |
# coding=utf-8
import logging
import re
from .rest_client import AtlassianRestAPI
log = logging.getLogger(__name__)
class Jira(AtlassianRestAPI):
def reindex_status(self):
return self.get('rest/api/2/reindex')
def reindex(self, comments=True, change_history=True, worklogs=True):
"""
... |
var assert = require("assert");
CONST = require("../js/common/constants.js");
var obj = require("../js/common/gameStats.js");
describe('Game stats', function() {
describe('batman', function () {
it('total should return 0 when no values set', function () {
assert.equal(obj.batman.total, '0');
... |
import { createMuiTheme } from '@material-ui/core/styles'
const theme = createMuiTheme({
typography: {
useNextVariants: true,
},
palette: {
primary: {
light: '#bee3b1',
main: '#86b376',
dark: '#4f7841',
contrastText: '#d5f1f5',
},
secondary: {
light: '#e39b... |
# Copyright (c) OpenMMLab. All rights reserved.
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule, ModuleList
class ConvUpsample(BaseModule):
"""ConvUpsample performs 2x upsampling after Conv.
There are several `ConvModule` layers. In the first few layers, ups... |
# Copyright (c) 2021 PaddlePaddle 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 appli... |
from argparse import ArgumentParser
from elasticsearch import Elasticsearch
import os
import yaml
import getpass
from escat.utils import get_nested_config_values
def get_config_from_file(cluster_name: str, config_file: str):
with open(config_file, 'r') as _config_file:
config: dict = yaml.safe_load(_conf... |
#pragma once
#include "backend.h"
#include <util/generic/ptr.h>
#include <functional>
class TThreadedLogBackend: public TLogBackend {
public:
TThreadedLogBackend(TLogBackend* slave);
TThreadedLogBackend(TLogBackend* slave, size_t queuelen, std::function<void()> queueOverflowCallback = {});
~TThreadedLog... |
import { resetReviewForm } from './reviewForm'
import { getConcerts } from '../concerts/concerts'
// synchronous actions
export const setReviews = reviews => {
return {
type: "SET_REVIEWS",
reviews
}
}
export const setUserReviews = reviews => {
return {
type: "SET_USER_REVIEWS",
reviews
}
}
... |
/*------------------------------------------------------------------------
* filename - _isnan.c
*
* function(s)
*
* _isnan - double version
*
* These functions return non-zero if the value passed in is +-NAN, else 0.
* More specifically, the non-zero return value = _FPCLASS_SNAN if the NAN
* is of the s... |
/*
* This header is generated by classdump-dyld 1.0
* on Sunday, September 27, 2020 at 11:51:39 AM Mountain Standard Time
* Operating System: Version 14.0 (Build 18A373)
* Image Source: /System/Library/PrivateFrameworks/Transparency.framework/Transparency
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 ... |
from typing import Tuple
from hypothesis import given
from symba.base import Expression
from ground.base import Context
from ground.hints import Multisegment
from tests.utils import (reverse_multisegment,
reverse_multisegment_coordinates)
from . import strategies
@given(strategies.contexts_... |
from collections import OrderedDict
from typing import Set, List, Optional, Union
from irrd.conf import PASSWORD_HASH_DUMMY_VALUE
from irrd.utils.pgp import get_gpg_instance
from .config import PASSWORD_HASHERS
from .fields import (RPSLTextField, RPSLIPv4PrefixField, RPSLIPv4PrefixesField, RPSLIPv6PrefixField,
... |
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... |
#!/usr/bin/env python
#
# Read in a text file, run CoreNLP to get features (pos, lemma, NER),
# and convert it to JSRE's data ("examples") format.
# Interactively solicity labels from the user.
# Note: see below for how to select whether 'elements' or 'minerals'
# will be used to generate the candidate relation pairs
... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2020 The Raven Core developers
# Copyright (c) 2021 The Bagi Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Tes... |
import tensorflow as tf
import numpy as np
from collections import Counter
from tqdm import tqdm
import tableprint as tp
import re
from .args import *
from .util import *
from .text_util import *
from .input import *
def eager_to_str(v):
return bytes_to_string(np.array(v))
def extend_args(parser):
parser.add_arg... |
from pathlib import Path
import numpy as np
class Tree:
def __init__(self, root) -> None:
'''注意,root 下面不能存在子目录'''
self.root = Path(root)
self.special_suffix = ['.DNG', '.CR2']
@property
def full_names(self):
'''全部文件名称'''
return {name.as_posix()
for ... |
const crypto = require('crypto')
const path = require('path')
const util = require('util')
const {ipcRenderer} = require('electron')
const _ = require('underscore-plus')
const {deprecate} = require('grim')
const {CompositeDisposable, Disposable, Emitter} = require('event-kit')
const fs = require('fs-plus')
const {mapS... |
// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef MESSAGE_READER_H
#define MESSAGE_READ... |
"""Checkout-related utility functions."""
from typing import TYPE_CHECKING, Iterable, List, Optional, Tuple, Union, cast
import graphene
from django.core.exceptions import ValidationError
from django.utils import timezone
from prices import Money
from ..account.models import User
from ..core.exceptions import Product... |
document.getElementById('go').onclick = function() {
var html = atob(ENCODED_HTML_TO_REPLACE).replace(
/MONACO_BASE_URL/g,
document.getElementById('monaco-base-url').value
);
console.log(html);
window.document.write(html);
};
// Note: HTML taken from https://github.com/Microsoft/monaco-editor-samples/b... |
# Copyright 2013 by Michiel de Hoon. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Implementation of frequency (count) matrices, position-weight matrices,
and position-speci... |
import asyncio
import logging
import struct
from ipaddress import IPv4Address
from .node import Node, NodeHeap
log = logging.getLogger(__name__) # pylint: disable=invalid-name
# pylint: disable=too-few-public-methods
class SpiderCrawl:
"""
Crawl the network and look for given 160-bit keys.
"""
def... |
import pytest
from logic4e import *
from utils4e import expr_handle_infix_ops, count, Symbol
definite_clauses_KB = PropDefiniteKB()
for clause in ['(B & F)==>E', '(A & E & F)==>G', '(B & C)==>F', '(A & B)==>D', '(E & F)==>H', '(H & I)==>J', 'A', 'B', 'C']:
definite_clauses_KB.tell(expr(clause))
def te... |
# -*- coding: utf-8 -*-
# @Time : 2018/7/28 下午3:52
# @Author : yidxue
|
#pragma once
#include <chrono>
namespace psched {
struct TaskStats {
using TimePoint = std::chrono::steady_clock::time_point;
TimePoint arrival_time; // time point when the task is marked as 'ready' (queued)
TimePoint start_time; // time point when the task is about to execute (dequeued)
TimePoint end_time... |
class ConfigRetrieval {
constructor() {}
get includeExtension() {
return atom.config.get('autocomplete-modules.includeExtension');
}
get vendors() {
return atom.config.get('autocomplete-modules.vendors');
}
get webpack() {
return atom.config.get('autocomplete-modules.webpack');
}
get webp... |
/*
* arch/arm/plat-omap/include/mach/serial.h
*
* Copyright (C) 2009 Texas Instruments
* Added OMAP4 support- Santosh Shilimkar <santosh.shilimkar@ti.com>
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FIT... |
/*
* This header is generated by classdump-dyld 1.0
* on Sunday, September 27, 2020 at 11:41:21 AM Mountain Standard Time
* Operating System: Version 14.0 (Build 18A373)
* Image Source: /System/Library/PrivateFrameworks/UIAccessibility.framework/UIAccessibility
* classdump-dyld is licensed under GPLv3, Copyright © 2013... |
/*
* This header is generated by classdump-dyld 1.5
* on Tuesday, November 10, 2020 at 10:12:27 PM Mountain Standard Time
* Operating System: Version 14.2 (Build 18K57)
* Image Source: /System/Library/PrivateFrameworks/AccountsD... |
var assert = require("assert");
var Kraken = require("../kraken");
var BellmanFord = require("../../src/algorithms/bellman-ford");
suite("algorithms", function() {
suite("bellman-ford", function() {
test("basics", function() {
var graph = Kraken()
.add("a")
.add("b")
.add("c")
... |
from clikit.io import ConsoleIO as BaseConsoleIO
from .io_mixin import IOMixin
class ConsoleIO(IOMixin, BaseConsoleIO):
"""
A wrapper around CliKit's ConsoleIO.
"""
def __init__(self, *args, **kwargs):
super(ConsoleIO, self).__init__(*args, **kwargs)
|
import buildLine from './buildLine';
import { SHAPES } from '../../../const';
import { hex2rgb } from '../../../utils';
/**
* Builds a circle to draw
*
* Ignored from docs since it is not directly exposed.
*
* @ignore
* @private
* @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object to draw
* @pa... |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "ur_gazebo"
PROJECT_SPACE_DIR = "/home... |
import numpy as np
from secml.array import CArray
from secml.ml import CNormalizerDNN
from .alexnet import alexnet
def attach_alexnet(clf):
"""Attach AlexNet (as a preprocessor) to input CClassifier.
The output of `classifier:4` layer is used as input for the classifier.
"""
clf.preprocess = CNor... |
#pragma once
#include "core/AppItems/mvTypeBases.h"
#include "mvAppItem.h"
namespace Marvel {
class mvStyleWindow : public mvBaseWindowAppitem
{
MV_APPITEM_TYPE(mvAppItemType::StyleWindow, "add_style_window")
public:
mvStyleWindow(const std::string& name)
: mvBaseWindowAppitem(name)
{
m_descriptio... |
# -*- encoding: utf-8 -*-
from mmpy_bot.utils import allowed_users
from mmpy_bot.bot import respond_to
import sys
import os
sys.path.append(os.getcwd()) # enable importing driver_settings
from tests.behavior_tests.bots import driver_settings
@respond_to('^allowed_driver$')
@allowed_users(driver_settings.BOT_NAME)
... |
import React, { Component } from "react";
import axios from "axios";
import Map from "./maps";
import Devices from "./deviceList";
export default class devicePage extends Component {
state = {
devices: [],
coordinates: [],
page: 0,
token: ""
};
onClickHandler = id => {
console.log(id);
t... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
@pytest.mark.functional
class TestGroupAPI(object):
def test_leave_group(self, app, group, group_member_with_token):
"""Test a request to leave a group through the API."""
group_member, token = group_member_with_toke... |
# -*- coding: utf-8 -*-
# Copyright 2015, 2016 OpenMarket 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
#
# Unless required by applica... |
(window.webpackJsonp=window.webpackJsonp||[]).push([[38],{230:function(a,e,o){"use strict";o.r(e);var r=o(0),t=Object(r.a)({},function(){var a=this,e=a.$createElement,o=a._self._c||e;return o("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[o("h1",{attrs:{id:"carregar-modelo"}},[a._v("Carregar Modelo")... |
import rasterstats as rs
import pandas as pd
vector = "/path/to/some/vector.geojson"
raster = "/sciclone/aiddata10/REU/some/raster.tif"
output = "/path/to/results.csv"
stats = rs.zonal_stats(vector, raster, stats="mean", geojson_out=True)
# to csv
x = [i['properties'] for i in stats]
out = pd.DataFrame(x)... |
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
import numpy as np
from .Model import Model
from numpy.random import RandomState
torch.manual_seed(123)
if torch.cuda.is_available():
torch.cuda.manua... |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Tencent is pleased to support the open source community by making behaviac available.
//
// Copyright (C) 2015 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clau... |
// //c语言
// int a = 123;
// //js 语言
// var a = 123
// var b = "123"
// var c = function apple(){
// console.log('apple');
// }
// let d = 456
// let e = "456"
// let f = function orange(){
// console.log("orange");
// }
// function lemon(){
// console.log("lemon")
// }
// lemon()
// let le = fun... |
/**
* author Christopher Blum
* - based on the idea of Remy Sharp, http://remysharp.com/2009/01/26/element-in-view-event-plugin/
* - forked from http://github.com/zuk/jquery.inview/
*/
(function ($) {
var inviewObjects = {}, viewportSize, viewportOffset,
d = document, w = window, documentElement = d.docume... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] in ('publish', 'release'):
raise Exception('this is a test app, do not release it!')
readme = 'A simple test application to test djactasauth'
s... |
import React, { PropTypes } from 'react';
class NavHeader extends React.Component {
handleBack(){
this.context.router.goBack();
}
render () {
return(
<div className="nav-header">
<p onClick={this.handleBack.bind(this)}>
<span className="glyphicon glyphicon-arrow-left" aria-hidden="true">back</span>... |
from django.urls import path
from django.conf.urls.static import static
from django.conf import settings
from . import views
app_name = 'djangoapp'
urlpatterns = [
# route is a string contains a URL pattern
# view refers to the view function
# name the URL
# path for about view
path(route='about',... |
import unittest
from datetime import datetime
from ocdb.core.models import Dataset, ISSUE_TYPE_ERROR, ISSUE_TYPE_WARNING
from ocdb.core.val._meta_field_compare_rule import MetaFieldCompareRule
from tests.core.val._mock_library import MockLibrary
class MetaFieldCompareRuleTest(unittest.TestCase):
def setUp(self)... |
/*
* Copyright 2010-2012 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "lice... |
"""Test module for the overall module."""
|
import re
import mlflow_extend
def test_version_exists() -> None:
assert hasattr(mlflow_extend, "__version__")
def test_version_format_is_valid() -> None:
assert re.search(r"^\d+\.\d+\.\d+$", mlflow_extend.__version__) is not None
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Project: Create a Proxy Class
#
# In this assignment, create a proxy class (one is started for you
# below). You should be able to initialize the proxy object with any
# object. Any attributes called on the proxy object should be forwarded
# to the target object. As e... |
'use strict';
const deepCompare = (actual, expect) => actual === expect || Object.is(actual, expect) || (Object(actual) === actual && Object(expect) === expect) && (Array.isArray(actual) && Array.isArray(expect) && actual.length === expect.length && expect.every((expect, index) => deepCompare(actual[index], expect)) |... |
"""Commands part of Websocket API."""
import voluptuous as vol
from homeassistant.auth.permissions.const import POLICY_READ
from homeassistant.const import MATCH_ALL, EVENT_TIME_CHANGED, EVENT_STATE_CHANGED
from homeassistant.core import callback, DOMAIN as HASS_DOMAIN
from homeassistant.exceptions import Unauthorized... |
import logging
from config.configuration import Configuration
from geocodio import GeocodioClient
from geocodio.exceptions import GeocodioAuthError, GeocodioDataError, GeocodioServerError, GeocodioError
_LOGGER = logging.getLogger('mme')
class Geocoding:
_geocodio_client = None
def initialize_geocodio(config... |
// Copyright 2007 The Closure Library 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 requ... |
'use strict';
var fetch = require('../lib/index.js');
var wd = require('webdriver-client')({
platformName: 'desktop',
browserName: 'chrome'
});
describe('core testsuite', function() {
this.timeout(5 * 60 * 1000);
const driver = wd.initPromiseChain();
before(() => {
return driver
.initDriver()
... |
"""
Django settings for udemy project.
Generated by 'django-admin startproject' using Django 2.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
impo... |
#!/usr/bin/env python3
from tutorial import Calculator
from tutorial.ttypes import InvalidOperation, Operation
from shared.ttypes import SharedStruct
class CalculatorHandler:
def __init__(self):
self.log = {}
def ping(self):
print('ping()')
def add(self, n1, n2):
print('add(%d,%... |
from urlparse import urlsplit, urlunsplit
from storages.backends.s3boto import S3BotoStorage
class ProtocolRelativeS3BotoStorage(S3BotoStorage):
"""Extends S3BotoStorage to return protocol-relative URLs
See: http://paulirish.com/2010/the-protocol-relative-url/
"""
def url(self, name):
"""Mod... |
import React from "react";
import { graphql, useStaticQuery } from "gatsby";
import styled from "styled-components";
// Components
import { FaFacebookF, FaLinkedinIn, FaTwitter } from "react-icons/fa";
const q = graphql`
query {
site {
siteMetadata {
social {
twitter
linkedin
... |
export function finalController($scope, $rootScope, scopePayload, AnimationService){
$scope.$parent.payload = scopePayload;
AnimationService.animate(scopePayload.template);
$scope.$parent.segueControl ='ready';
// Maybe we use it for the final slide
}
finalController.$inject = ['$scope', '$rootScope',... |
""" Code for loading data. """
import numpy as np
import os
import random
import tensorflow as tf
from tensorflow.python.platform import flags
from utils import get_images
FLAGS = flags.FLAGS
class DataGenerator(object):
"""
Data Generator capable of generating batches of sinusoid or Omniglot data.
A "cl... |
import _pt from "prop-types";
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
import React from 'react';
export default function withIcon(name) {
return W... |
# Copyright 2018 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... |
angular.module('adminGeoresourcesManagement').component('adminGeoresourcesManagement', {
templateUrl : "components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.template.html",
controller : ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', 'kommonitorDataGridHelperService',... |
define(['text!packages/tpl/list.html','app','swal'],
function (template,app,swal) {
'use strict';
return Backbone.View.extend({
tagName:'tr',
events:{
"click .delete-token":"deleteToken",
"click .edit-token":"updateToken"
},
initialize: function () {
this.template = _.template... |
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import os
import unittest
import numpy as np
from pymatgen.core.sites import PeriodicSite
from pymatgen.core.structure import Molecule, Structure
from pymatgen.io.cif import CifParser
from pymatgen.io.vasp.inputs import Pos... |
"""
Django settings for url_shortener project.
Generated by 'django-admin startproject' using Django 3.0.8.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import ... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.homepage, name='homepage'),
url(r'add/$', views.add_entry, name='add_entry'),
url(r'detail/(?P<case_id>[0-9]+)$', views.detail, name='detail_entry'),
url(r'advancedSearch/$', views.advanced_search, name='advanced_sea... |
import os
import yaml
import rosbag
import decimal
def check_topic_bag(topic, bags):
if topic:
for bag in bags:
assert topic in bag.get_type_and_topic_info().topics, (
"topic: {} is not recorded in {}".format(topic, bag._filename))
return True
return False
def l... |
# -*- coding: utf-8 -*-
# @Time : 2020-05-20 10:25
# @Author : Shupeng
import copy
import torch.nn as nn
def clone(module, N):
"Produce N identical layers"
return nn.ModuleList([copy.deepcopy(module) for _ in range(N)])
|