text stringlengths 3 1.05M |
|---|
# coding:utf-8
# 利用 Handler 来构建 Opener
# 打开网站是提供身份验证的例子
from urllib.request import HTTPPasswordMgrWithDefaultRealm, HTTPBasicAuthHandler, build_opener
from urllib.error import URLError
username = 'username'
password = 'password'
url = 'http://localhost:5000/'
p = HTTPPasswordMgrWithDefaultRealm()
p.add_password(None,... |
#Basic imports
from ctypes import *
#Phidget specific imports
from Phidgets.PhidgetException import PhidgetErrorCodes, PhidgetException
from Phidgets.Events.Events import AttachEventArgs, DetachEventArgs, ErrorEventArgs, InputChangeEventArgs, OutputChangeEventArgs, SensorChangeEventArgs
from Phidgets.Devices.Inter... |
"""
import bpy
from math import *
from .config import *
from . import globals
from . import utils
def blend_mode_update(self, context):
print("blend mode update!", self, context)
class ObjectProps (bpy.types.PropertyGroup):
items = [
("POSITIVE", "Positive", "Simple arithmetic add"),
("NEGATIVE", "Nega... |
import React from 'react';
import { Link } from 'react-router-dom';
import cn from 'classnames';
import PropTypes from 'prop-types';
import styles from './styles.module.scss';
import Icon from '../../Icon';
const Breadcrumb = ({ children, link, active }) => (
<Link
className={cn({
[styles.Breadcrumb]: !ac... |
# 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... |
import moment from 'moment'
export default {
time: function (timestamp) {
return moment.unix(timestamp / 1000).fromNow()
},
secondToMinuteSecond: function (time) {
function strPadLeft (string, pad, length) {
return (new Array(length + 1).join(pad) + string).slice(-length)
}
let minutes =... |
/*!
* AngularJS Material Design
* https://github.com/angular/material
* @license MIT
* v1.1.4
*/
goog.provide('ngmaterial.components.progressLinear');
goog.require('ngmaterial.core');
/**
* @ngdoc module
* @name material.components.progressLinear
* @description Linear Progress module!
*/
MdProgressLinearDirect... |
"""
Django migrations for responsive_wrapper app
This package does not contain South migrations. South migrations can be found
in the ``south_migrations`` package.
"""
SOUTH_ERROR_MESSAGE = """\n
For South support, customize the SOUTH_MIGRATION_MODULES setting like so:
SOUTH_MIGRATION_MODULES = {
'respo... |
'use strict';
const Schema = use('Schema');
class PermissionUserTableSchema extends Schema {
up() {
this.create('permission_user_team', table => {
table.increments();
table
.integer('permission_id')
.unsigned()
.index();
table
.foreign('permission_id')
.... |
// Copyright (c) 2011-2018 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_QT_COINCONTROLTREEWIDGET_H
#define BITCOIN_QT_COINCONTROLTREEWIDGET_H
#include <QKeyEvent>
#include <QTreeWi... |
import os
heroku_path = os.getenv('CHROME_WEBDRIVER_PATH')
chrome_binary_heroku_path = os.getenv('GOOGLE_CHROME_SHIM')
drop_box_token = os.getenv('DROP_BOX_TOKEN')
time_to_keep_alive = os.getenv('KEEP_ALIVE_SECONDS') |
"""A deployer class to deploy a template on Azure"""
import os.path
import json
from haikunator import Haikunator
from azure.common.credentials import ServicePrincipalCredentials
from azure.mgmt.resource import ResourceManagementClient
from azure.mgmt.resource.resources.models import DeploymentMode
class Deployer(obje... |
import h3
import math
import asyncio
import src.utils.google as google
from config.h3.h3_config import POI_RESOLUTION
from quart import abort, Blueprint, jsonify, request
from src.utils.array_utils import get_nested_value
search = Blueprint('search', __name__)
@search.route('/search', methods=['GET'])
async def sea... |
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For the complete reference:
// http://docs.ckedi... |
$(function() {
'use strict';
// Open on load
$('#open-on-load input').powerTip({ placement: 'ne' }).powerTip('show');
// Click toggle
$('#click-toggle input').powerTip({
openEvents: [ 'click' ],
closeEvents: [ 'click' ],
placement: 'e'
});
// Self-disabling button
$('#disable-button input').on('click',... |
def printr():
print("\nLista")
num = 1
for dict in sm:
for p,q in dict.items():
print(str(num) + ". " + p + " , Cantidad: " + str(q) )
num += 1
if __name__ == "__main__":
print("Lista del Super")
sm = []
item = {}
archivo = open("super.txt... |
from datetime import datetime
from itertools import product
import numpy as np
import pytest
from xarray import DataArray, Dataset, combine_by_coords, combine_nested, concat
from xarray.core import dtypes
from xarray.core.combine import (
_check_shape_tile_ids,
_combine_all_along_first_dim,
_combine_nd,
... |
# Generated by Django 2.2.3 on 2019-09-18 00:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('student', '0003_remove_student_status'),
]
operations = [
migrations.AddField(
model_name='student',
name='homework'... |
const router = require("express").Router();
const booksControllers = require("../controllers/booksControllers");
router.route("/")
.post(booksControllers.create)
.put(booksControllers.save)
.get(booksControllers.findAll);
router.route("/:id")
.get(booksControllers.findById)
.delete(booksControllers.remove);... |
module.exports = function () {
return {
getNow: function () {
return this.now || this.getDate();
},
setNow: function (now) {
this.now = now;
},
getDate: function () {
return new Date();
}
};
}; |
from malaya.supervised import softmax
from malaya.path import PATH_SENTIMENT, S3_PATH_SENTIMENT
from herpetologist import check_type
label = ['negative', 'positive']
_availability = {
'bert': ['425.6 MB', 'accuracy: 0.993'],
'tiny-bert': ['57.4 MB', 'accuracy: 0.987'],
'albert': ['48.6 MB', 'accuracy: 0.9... |
var file_frame;jQuery(document).ready(function($){$(".image-uploader .button-upload").on("click",function(e){e.preventDefault();var t=$(this).data("inputid"),a=$("#"+t),i=$("#"+$(this).data("imageid")),l=$("#"+t+"_remove-button");return file_frame?(file_frame.open(),!1):(file_frame=wp.media.frames.file_frame=wp.media({... |
import unittest
from nodes import *
from interpreter import Interpreter
from values import Number
class TestInterpreter(unittest.TestCase):
def test_numbers(self):
value = Interpreter().visit(NumberNode(51.2))
self.assertEqual(value, Number(51.2))
def test_single_operations(self):
result = Interpreter().visi... |
import cv2
import numpy as np
import tensorflow as tf
from anchors import Anchors, build_anchors
def decode(prediction, threshold):
# Seprate classifications and boxes transformations.
regression = prediction[:, :4]
scores = tf.sigmoid(prediction[:, 5])
# Decode the detection result.
anchors = b... |
import frames from './frames';
export default {
trigger(eventName, payload) {
const jailEl = document.getElementById('gtm-jail');
if (jailEl) {
if (payload) {
this.set(payload);
}
frames.postMessage(jailEl.contentWindow, 'event.gtm', {
event: eventName,
});
}
},... |
# !/usr/bin/env python
# -*- coding:utf-8 -*-
# author: jeremy.zhang(szujeremy@gmail.com, Shenzhen University, China)
def recursive_find_python_class(folder, trainer_name, current_module):
pass
|
/*
* Copyright (c) 2020, the SegueBaseOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/HTML/HTMLElement.h>
namespace Web::HTML {
class HTMLDivElement final : public HTMLElement {
public:
using WrapperType = Bindings::HTMLDivElementWrapper;
HTMLDivElement(DOM::Do... |
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])... |
/*
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*/
#ifndef MCA_PMI_BASE_H
#define MCA_PMI_BASE_H
#include "opal_config.h"
#include "opal/types.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/mca_base_framework.... |
/* eslint-env mocha */
/* eslint-disable func-names, prefer-arrow-callback */
import mainContent from '../../pageobjects/main-content.page';
import sideNav from '../../pageobjects/side-nav.page';
import Global from '../../pageobjects/global';
//test data imports
import {username, email, password} from '../../data/use... |
# -*- coding:utf-8 -*-
import unittest
import mock
from libs.mixins.views import SuccessURLAliasViewMixin
class SuccessURLAliasViewMixinTestCase(unittest.TestCase):
@mock.patch('libs.mixins.views.reverse')
def test_get_success_url_should_call_reverse_with_sucess_url_alias(self,
reverse):
... |
'''
Created on May 23, 2012
@author: Jason Huang
'''
N = 8
def bin2gray(n):
return n ^ (n >> 1)
def gray2bin(n):
i = 1 << (N - 2)
while(i > 0):
n = (n ^ (n >> 1)) & i | (n & ~i)
i >>= 1
return n
def printGray(n):
'''
Print a range of gray code... |
(function(root,factory){if(typeof define==="function"&&define.amd){define(["ember"],function(Ember){return factory(Ember)})}else if(typeof exports==="object"){module.exports=factory(require("ember"))}else{root.DatePickerControlsComponent=factory(Ember)}})(this,function(Ember){var DatePickerControlsComponent=Ember.Compo... |
# %%
# Add link-specific attributes to MOVES final output
# Ehsan Moradi, Ph.D. Candidate
# %%
# Load required libraries
import pandas as pd
import numpy as np
from os import walk
# %%
# Load data from Excel to a pandas dataframe
def load_from_Excel(directory, input_file):
input_path = directory + input_file
... |
function switchOFF(){
// alert("Inside Connect");
let options = {optionalServices: ['0000fff0-0000-1000-8000-00805f9b34fb']};
options.acceptAllDevices = true;
var value = new Uint8Array([0x0F, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF]);
return navigator.bluetooth.requestDevice(options)
... |
import sys
from unittest import TestSuite, TextTestRunner
from django.conf import settings
if not settings._target: settings.configure()
def geo_suite():
"""
Builds a test suite for the GIS package. This is not named
`suite` so it will not interfere with the Django test suite (since
spatial database ... |
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.dialog.add("anchor",function(c){function e(b,a){return b.createFakeElement(b.document.createElement("a",{attributes:a}),"cke_anchor","anchor")}re... |
var _ = require('lodash');
var config = {
dev: 'development',
test: 'testing',
prod: 'production',
port: process.env.PORT || 3000,
// 10 days in minutes
expireTime: 24 * 60 * 10,
secrets: {
jwt: process.env.JWT || 'gumball'
}
};
process.env.NODE_ENV = process.env.NODE_ENV || config.dev;
config.env... |
//
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "OWSStorage.h"
#import <YapDatabase/YapDatabaseViewTransaction.h>
NS_ASSUME_NONNULL_BEGIN
extern NSString *const TSInboxGroup;
extern NSString *const TSArchiveGroup;
extern NSString *const TSUnreadIncomingMessagesGroup;
extern NSString *... |
module.exports = {
defaultTitle: 'Mohamed Ehab',
logo: 'https://portfolio.smakosh.com/favicon/favicon-512.png',
author: 'Mohamed Ehab',
url: 'https://portfolio.smakosh.com',
legalName: 'Mohamed Ehab',
defaultDescription: 'I’m John and I’m a Backend & Devops engineer!',
socialLinks: {
twitter: 'http://... |
import os
import subprocess
import sys
deltext=""
slashtext=""
copytext=""
if sys.platform.startswith("darwin") :
copytext="cp "
deltext="rm "
slashtext="/"
if sys.platform.startswith("linux") :
copytext="cp "
deltext="rm "
slashtext="/"
if sys.platform.startswith("win") :
copytext="copy "
deltext="del "
sl... |
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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.0
#
# Unless required by applicabl... |
export const golfCourse21 = "M10 13.998H9v-12l5 1.5-4 2.5v8zm8.738-.791c-1.584 1.875-2.21 3.497-4.877 4.997S9.125 18.706 7 16.998s-4.056-1.252-4.93-3.96c-.602-1.86 2.783-2.651 5.93-2.923v3.883a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1V9.999c.272.003.53.008.755.017 3.348.144 8.566 1.316 6.983 3.19zm-3.238.291a1 1 0 1 0-2 0 1 1 0 0 ... |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#pragma once
#include <wil/resource.h>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
namespace AppInstaller::Registry
{
namespace details
{
template <DWORD Type>
struct ValueTypeSpecifi... |
#!/usr/bin/env python3
""" generate_markdown docstring
This module is complete tool for creating as eyepleasing as possible pylint messages
with error codes and descriptions.
"""
from shutil import move
from subprocess import check_output, PIPE
from readable_pylint_messages.Message import Message
def pylint_list_msgs... |
import express from "express";
import {
getCategories,
getCategory,
createCategory,
updateCategory,
deleteCategory,
getCategoryCards,
} from "../controllers/categoriesController.js";
const router = express.Router();
router.get("/", getCategories);
router.get("/:categoryId", getCategory);
router.post("/", ... |
/**
*
* Author: Juarez Paulino(coderemite)
* Email: juarez.paulino@gmail.com
*
*/
n = parseInt(readline())
a = 1, b = 2, t = 3
for (k = 1; k <= n; k++)
write((k < 3) ? 'O' : (k == a+b) ? (t = a+b, a = b, b = t, 'O') : 'o') |
{
"name": "scrollbar.js",
"url": "https://github.com/cachd/scrollbar.js.git"
}
|
from octis.evaluation_metrics.metrics import AbstractMetric
import octis.configuration.citations as citations
import itertools
import numpy as np
from octis.evaluation_metrics.rbo import rbo
from octis.evaluation_metrics.word_embeddings_rbo import word_embeddings_rbo
from octis.evaluation_metrics.word_embeddings_rbo_ce... |
from .module_simple import *
from .module_simple2 import *
from .module_simple3 import * |
"""yosho plugin:bot moderator tools"""
import logging
import pickle
from telegram import ChatAction as Ca
from telegram.error import TelegramError
from telegram.ext import CommandHandler
from helpers import clean, db_push
ORDER = 0
handlers = []
def die(bot, update):
"""kills bot"""
update.message.reply_t... |
define(['services/services'],
function(services) {
'use strict';
services.factory('$$log', ['$log', function ($log) {
var logCategory = 'global',
logLevel = 'info',
logLevelPriority;
logLevelPriority = {
error: 4,
warn: 3,
info: 2,
log: 1
... |
#!python
import string
# Hint: Use these string constants to encode/decode hexadecimal digits and more
# string.digits is '0123456789'
# string.hexdigits is '0123456789abcdefABCDEF'
# string.ascii_lowercase is 'abcdefghijklmnopqrstuvwxyz'
# string.ascii_uppercase is 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
# string.ascii_letters ... |
"""
norx.py - STP code generator for differential search in the NORX permutation.
------
This file is part of NODE - the NORX Differential-Search Engine.
:copyright: (c) 2014 Philipp Jovanovic <philipp@jovanovic.io>
:license: BSD (3-Clause), see LICENSE
"""
import math
class NORX:
""" hammi... |
import React from "react";
import { Line } from "react-chartjs-2";
const Chart = props => <Line data={props.data} options={props.options} />;
export default Chart; |
/*
jQWidgets v13.1.0 (2021-Nov)
Copyright (c) 2011-2021 jQWidgets.
License: https://jqwidgets.com/license/
*/
/* eslint-disable */
(function(f){f.jqx.timeSpan=function(){var q={ticksPerMillisecond:10000,millisecondsPerTick:1/10000,ticksPerSecond:1000*10000,secondsPerTick:1/(1000*10000),ticksPerMinute:1000*10000*60,min... |
from . import (
simple_replay_pool,
union_pool,
active_replay_pool,
goal_replay_pool,
hindsight_experience_replay_pool,
prioritized_experience_replay_pool,
multigoal_replay_pool,
partial_save_pool,
uniformly_reweighted_replay_pool,
)
POOL_CLASSES = {
'SimpleReplayPool': simple_... |
import numpy
from oasys_srw.srwlib import srwl
from syned.storage_ring.light_source import LightSource
from wofry.beamline.decorators import LightSourceDecorator
from wofrysrw.srw_object import SRWObject
from wofrysrw.storage_ring.srw_magnetic_structure import SRWMagneticStructure
from wofrysrw.storage_ring.srw_elec... |
"""Tests the Python3 implementation of shpaml3"""
import pytest
import short
def test_short():
"""Test to ensure short works as expected"""
compiled = short.compile.text('> ,hey$there@is#something!more*bacon')
assert 'class="hey"' in compiled
assert 'name="there"' in compiled
assert 'href="is"' i... |
sys.swipe = {
/**
* Make lateral menus swipable and openable like Android Ui
*/
make: function () {
var menu = $('#menu');
var menu_btn = $('.opener[to=menu]');
var lateral = $('#lateral');
var lateral_btn = $('.opener[to=lateral]');
var win = $('body, html, #mi... |
# Copyright (c) - 2014, Clinton Knight. All rights reserved.
# Copyright (c) 2016 Mike Rooney. 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:... |
# region /// THIS IS THE WAY ///
# data: https://www.kaggle.com/c/interbank20/data
# Probabilidad de default de prestamo
# El reto consiste en desarrollar un algoritmo predictivo que estime la probabilidad de default o un score que ordene en función de la misma, respecto de los emprendedores que han adquirido un présta... |
from . import retinabot
import numpy as np
class OmniArmBot(retinabot.RetinaBot):
def initialize(self):
super(OmniArmBot, self).initialize()
self.motor(0, 0, 0)
self.arm(0.184, 0.172, 0.394, 0.052, 0.134)
def disconnect(self):
self.motor(0, 0, 0)
self.arm(0.184, 0.172,... |
var gulp = require('gulp'),
useref = require('gulp-useref'),
gulpif = require('gulp-if'),
uglify = require('gulp-uglify'),
minifyCss = require('gulp-clean-css');
gulp.task('html', function () {
return gulp.src('app/*.html')
.pipe(useref())
.pipe(gulpif('*.js', uglify()))
.pi... |
s1 = "abc\n\n\n"
s2 = "abc\n\t \n"
s3 = "abc "
for s in [s1,s2,s3]:
print("original("+s+")")
print("strip("+s.rstrip()+")")
|
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'basicstyles', 'th', {
bold: 'ตัวหนา',
italic: 'ตัวเอียง',
strike: 'ตัวขีดเส้นทับ',
subscript: 'ตัวห้อย',
superscript: 'ตัวยก',
underl... |
$(document).ready(function() {
document.getElementById('message_modal').classList.toggle("tiny")
document.getElementById('message_modal').classList.toggle("medium")
$('#datepicker').calendar({
monthFirst: false,
type: 'month',
formatter: {
date: function(date, settings) {
... |
import torch
import torch.nn as nn
import torch.nn.functional as F
class MNISTConvNet(nn.Module):
def __init__(self):
super(MNISTConvNet, self).__init__()
self.conv1 = nn.Conv2d(1, 32, kernel_size=(5, 5))
self.bn1 = nn.BatchNorm2d(32)
self.conv2 = nn.Conv2d(32, 32, kernel_size=(5, 5... |
#!/Users/quaiwentt/Desktop/Ada/capstone/qually/qually_env2/bin/python
# $Id: rst2pseudoxml.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing pseudo-XML.
"""
tr... |
module.exports = {
mixins: [
"canonical",
"og-title",
"og-site",
"twitter-author",
"og-image",
"favicon",
"twitter-player-responsive"
],
tests: [{
page: "http://www.ustream.tv/new/explore/technology",
selector: ".media-data"
},
... |
"""
T[i,j] = best cost for Ai..Aj
T[i,j] = min_k {
T[i,k] + T[k+1,j] + // sub-problems
mats[i].rows * mats[k].cols * mats[j].cols // cost of '[i..k] * A[k+1..j]
}
complexity: upper triu (n) => n^2, for each -> iter k => n^3
"""
from collections import namedtuple
import numpy as np
di... |
import json
from tkinter import EXCEPTION
from xmlrpc.client import boolean
from .constants import *
from .logging import Log
from .exceptions import *
from .utils import *
import os
from .login import *
from time import sleep
from datetime import datetime, date,timedelta
import logging
from playwright.async_api import... |
export { default as filterMap } from "./filterMap";
export { default as toHashMap } from "./toHashMap";
|
// Copyright 2015 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 CHROMEOS_COMPONENTS_MULTIDEVICE_DEBUG_WEBUI_PROXIMITY_AUTH_WEBUI_HANDLER_H_
#define CHROMEOS_COMPONENTS_MULTIDEVICE_DEBUG_WEBUI_PROXIMITY_AUTH_WEB... |
class ChildTracker(type):
def __new__(cls, name, bases, dict_):
new_class = type.__new__(cls, name, bases, dict_)
# Check if this is the tracking class
if '__metaclass__' in dict_ and dict_['__metaclass__']==ChildTracker:
new_class.child_classes = {}
else:
# Add the new class to the set
... |
import matplotlib.pyplot as plt
import numpy as np
import sys
import os
import json
def your_python_code(arg, input_path, output_path):
"""
Paste there your code you want to execute in iExec worker
"""
# time
dt = 0.01
t = np.arange(0, 30, dt) # 3k time points
# Read signal
signal = n... |
const uint8_t Aurebesh6pt7bBitmaps[] PROGMEM = {
0x27, 0x53, 0xA0, 0x9C, 0xA9, 0x8C, 0x00, 0x18, 0x3C, 0x42, 0x7E, 0x66,
0xDB, 0x7E, 0x99, 0x66, 0x48, 0xFF, 0x49, 0x4A, 0x06, 0x04, 0x08, 0x18,
0x30, 0x74, 0x6E, 0x27, 0x15, 0xF9, 0xCB, 0xFC, 0x32, 0x19, 0x0F, 0x80,
0x83, 0xE3, 0x91, 0x48, 0xA6, 0xD1, 0x48, 0... |
#Standard
import unittest
#external
import pandas as pd
#TCA
from TCANetData import CLNetData
from TCABuffer import CLBuffer, CLBSMAllBuffer
from TCASpacePartitioning import Find_RSE_range
from TCACore import Chk_Range, report_errors, Chk_Cellular_Range, Get_Heading, logger, Timer
class TCA_Algorithm:
def __ini... |
import numpy as np
import struct
def write_binary_stl(path, points):
n = len(points) // 3
points = np.array(points, dtype='float32').reshape((-1, 3, 3))
normals = np.cross(points[:,1] - points[:,0], points[:,2] - points[:,0])
normals /= np.linalg.norm(normals, axis=1).reshape((-1, 1))
dtype = np.... |
from pandac.PandaModules import *
from toontown.toonbase.ToontownGlobals import *
from direct.gui.DirectGui import *
from toontown.toonbase import TTLocalizer
class MinigamePowerMeter(DirectFrame):
def __init__(self, size, label = None):
DirectFrame.__init__(self, relief=None, state=DGG.NORMAL, image_colo... |
/**
* eZmax API Definition (Full)
* This API expose all the functionnalities for the eZmax and eZsign applications.
*
* The version of the OpenAPI document: 1.1.7
* Contact: support-api@ezmax.ca
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-gener... |
import multiprocessing
import math
import os
import subprocess
import psycopg2
# takes a list of sql queries or command lines and runs them using multiprocessing
def multiprocess_list(mp_type, work_list, settings, logger):
pool = multiprocessing.Pool(processes=settings['max_concurrent_processes'])
num_jobs =... |
// Write code to create a function takes a string and returns the string with all of the letter cases swapped
var swapCase = function(str) {
var result = "";
for (var i = 0; i < str.length; i++) {
var letter = str[i];
if (letter === letter.toUpperCase()) {
result += letter.toLowerCase();
} else... |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
'use strict';
const Hook = require('./Hook');
const HookCodeFactory = require('./HookCodeFactory');
class AsyncSeriesWaterfallHookCodeFactory extends HookCodeFactory {
content({ onError, onResult, onDone }) {
ret... |
require('./angular-locale_kk-cyrl-kz');
module.exports = 'ngLocale';
|
module.exports = /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])... |
#ifndef __MANAGER_I_SETTINGS_BUILDER_H_INCLUDED__
#define __MANAGER_I_SETTINGS_BUILDER_H_INCLUDED__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include "../../../../fwdheaders.h"
#pragma pack( push, 8 )
namespace Cobalt
{
namespace Import
{
namespace Utility
{
templ... |
import string
def loops():
""" solve the tasks with loops"""
list_a = []
for letter in string.ascii_lowercase:
list_a.append(ord(letter))
list_b = []
for number in range(1, 48):
if '3' not in str(number):
list_b.append(number)
return list_a, list_b
def list_comp... |
/*
* metadata-verify.c: Metadata verfication support
*
* Author:
* Mono Project (http://www.mono-project.com)
*
* Copyright (C) 2005-2008 Novell, Inc. (http://www.novell.com)
*/
#include <mono/metadata/object-internals.h>
#include <mono/metadata/verify.h>
#include <mono/metadata/verify-internals.h>
#include <mon... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
import * as searchServices from '../search.services';
import * as helpers from '../../utils/helpers';
describe('`search.services`', () => {
let event;
beforeEach(() => {
event = { preventDefault: jest.fn() };
});
describe('`search`', () => {
it('should exist', () => {
expe... |
/*
Copyright 2015 hp.weber GmbH & Co secucard KG (www.secucard.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 o... |
import React from 'react';
import { mount } from 'enzyme';
import toJson from 'enzyme-to-json';
import { ThemeProvider } from 'styled-components';
import { theme } from 'mcs-lite-theme';
import DataChannelAdapter from '../DataChannelAdapter';
it('should render PWM_DISPLAY correctly with default value to N/A', () => {
... |
import {
Component, $$, CustomSurface, platform,
DefaultDOMElement as DOM, domHelpers, getRelativeBoundingRect,
keys, getKeyForPath
} from 'substance'
import { Managed, Clipboard } from '../../kit'
import { getCellRange, computeUpdatedSelection, createTableSelection } from '../shared/tableHelpers'
import TableCel... |
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_BITCOINCONSENSUS_H
#define BITCOIN_BITCOINCONSENSUS_H
#if defined(BUI... |
# Generated by Django 3.1.8 on 2021-04-21 00:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("core", "0096_jj_pause"),
]
operations = [
migrations.RenameField(
model_name="concordanceidentifier",
old_name="source",
... |
/*
* This header is generated by classdump-dyld 1.0
* on Sunday, September 27, 2020 at 11:44:24 AM Mountain Standard Time
* Operating System: Version 14.0 (Build 18A373)
* Image Source: /System/Library/PrivateFrameworks/Navigation.framework/Navigation
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by E... |
function initializevbox1288931495375() {
vbox1288931495375 = new kony.ui.Box({
"id": "vbox1288931495375",
"isVisible": true,
"orientation": constants.BOX_LAYOUT_VERTICAL,
"position": constants.BOX_POSITION_AS_NORMAL
}, {
"containerWeight": 100,
"layoutType... |
from discord.ext.commands.view import _quotes
# WARNING:: [The commented code is important please don't remove it
# unless absolutely neccesary]
# TODO:: [Optimise this function more,
# and discard invalid commands to make up for lost cpu time.]
# Every conversion has a non-unique conversion ID
# The ID corresponds t... |
import os
from setuptools import setup, find_packages
def readfile(filename):
with open(os.path.join(os.path.dirname(__file__), filename)) as f:
return f.read()
setup(
name="landinggear",
version="0.0.3a0",
author="Jeremy Thurgood",
author_email="firxen@gmail.com",
description=("Whe... |