text stringlengths 3 1.05M |
|---|
from typing import Union, List
from youtubesearchpython.__future__.internal.json import loads
import httpx
from youtubesearchpython.__future__.internal.constants import *
class VideoInternal:
videoId = None
videoComponent = None
timeout = None
def __init__(self, videoLink: str, componentMode: str, ti... |
const PanelView = require('panels/view/PanelView');
const Panel = require('panels/model/Panel');
module.exports = {
run() {
describe('PanelView', () => {
var fixtures;
var model;
var view;
beforeEach(() => {
model = new Panel();
view = new PanelView({
model
... |
import datetime
from django.conf import settings
from django.db import models
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
# Create your models here.
class Category(models.Model):
slug = models.SlugField(max_length=128, unique=True, blank=True)
name = models.Cha... |
module.exports = {
extends: require.resolve('eslint-config-ostai'),
rules: {
'no-underscore-dangle': 'off',
'no-new': 'off'
}
}
|
/*
* Copyright 2010-2016 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 "license" fil... |
import { parseObjects } from '../CSV'
import * as fs from 'fs'
test("test the CSV", () => {
let data = fs.readFileSync(`${__dirname}/parser_test.csv`, 'utf-8')
let rows = parseObjects(data)
expect(rows.length).toBe(3)
// depends on file contents of course
expect(rows[0]['title']).toBe('a good day'... |
import { expect } from 'chai';
import { loadFixture } from './test-utils.js';
describe('Sitemaps', () => {
let fixture;
before(async () => {
fixture = await loadFixture({
projectRoot: './fixtures/astro-sitemap-rss/',
buildOptions: {
site: 'https://astro.build/',
sitemap: true,
},
});
await fi... |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import requireAuth from './requireAuth';
import { secretAction } from '../actions';
class Secret extends Component {
async componentDidMount() {
await this.props.secretAction(localStorage.getItem('token'));
}
render() {... |
import xml.etree.ElementTree as ET
xml_string = '''
<stuff>
<users>
<user x="2">
<id>001</id>
<name>Chuck</name>
</user>
<user x="7">
<id>009</id>
<name>Brent</name>
</user>
</users>
</stuff>
'''
root_stuff = ET.fromstring(xml_st... |
import re
from src import _base
class Atom(_base.BaseAtom):
MYSQL_ERR_CODE = r'(?P<err_code>[A-Z0-9][A-Z0-9-_]+)'
MYSQL_SUBSYSTEM = r'(?P<subsystem>[A-Z]\S+)'
# https://mariadb.com/kb/en/error-log/#format
# https://dev.mysql.com/doc/refman/8.0/en/error-log-format.html
MYSQL = re.compile((
r'{DATE}[T|\s... |
import React from 'react';
// const VideoDetail = (props) => {
const VideoDetail = ({video}) => {
if(!video){
return <div>Loading...</div>
//Added a condition that makes sure if someone tries to render VideoDetail and a video is not provided then the page will return a div that says Loading...
... |
# Copyright (c) 2022, Framras AS-Izmir and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class TRUTSUsageNotification(Document):
pass
|
'use strict';
// Init the application configuration module for AngularJS application
var ApplicationConfiguration = (function() {
// Init module configuration options
var applicationModuleName = 'youtubesw';
var applicationModuleVendorDependencies = ['ngResource', 'ngCookies', 'ngAnimate', 'ngTouch', 'ngSanitize... |
#!/usr/bin/python
#
# Copyright (c) SAS Institute 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... |
/*
Copyright (c) 2013 William Malone (www.williammalone.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merg... |
import airflow
from airflow import DAG
dag = DAG(
dag_id="listing_2_03",
start_date=airflow.utils.dates.days_ago(14),
schedule_interval=None,
)
|
# Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from .aws import Action as BaseAction
from .aws import BaseARN
service_name = "AWS Elemental MediaPackage VOD"
prefix = "mediapackage-vod"
class Action(BaseAction):
def __init__(self, action: str =... |
from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QLineEdit, QPushButton, QVBoxLayout, QHBoxLayout
from PyQt5.QtWidgets import QAction, qApp, QMainWindow
from PyQt5.QtGui import QFont, QIcon
from PyQt5 import QtCore
import json
import sys
import os
class Game(QWidget):
def __init__(self):
... |
/* @(#) $Header$ (LBL) */
/* $NetBSD: ip6.h,v 1.9 2000/07/13 05:34:21 itojun Exp $ */
/* $KAME: ip6.h,v 1.9 2000/07/02 21:01:32 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, ... |
from collections.abc import MutableMapping
import functools
import numpy as np
import matplotlib
from matplotlib import _api, docstring, rcParams
from matplotlib.artist import allow_rasterization
import matplotlib.transforms as mtransforms
import matplotlib.patches as mpatches
import matplotlib.path as mpath
class ... |
import React from 'react'
import MyNavbar from './MyNavbar'
import AddBlogForm from './AddBlogForm'
function PageAddBlog(prop) {
return (
<div>
<MyNavbar location={prop.location.pathname}/>
<div className='container mt-5'>
<AddBlogForm/>
</div>
</... |
var graphic = require('../../util/graphic');
var HeatmapLayer = require('./HeatmapLayer');
var zrUtil = require('zrender/lib/core/util');
function getIsInPiecewiseRange(dataExtent, pieceList, selected) {
var dataSpan = dataExtent[1] - dataExtent[0];
pieceList = zrUtil.map(pieceList, f... |
# -*- coding: utf-8 -*-
"""
hyper/httplib_compat
~~~~~~~~~~~~~~~~~~~~
This file defines the publicly-accessible API for hyper. This API also
constitutes the abstraction layer between HTTP/1.1 and HTTP/2.
This API doesn't currently work, and is a lower priority than the HTTP/2
stack at this time.
"""
import socket
try... |
import _ from 'lodash';
import { logger } from 'lib/logger';
import { has } from 'lib/utilities';
import { buildErrorMessage } from 'lib/error-helpers';
/**
* @typedef PaginationArticle
* @property {string} slug - The slug of the article
*/
/**
* Fetches a page of articles where pages are a given length
* @para... |
/*jslint node: true */
/* eslint-env node */
'use strict';
// Require express, socket.io, and vue
var express = require('express');
var app = express();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var path = require('path');
// Pick arbitrary port for server
var port = 3000;
app.set(... |
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
*/
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license... |
import logging
import urllib
from mandrill_email import send_email
from application.handlers.base import BaseHandler
class TaskQueueEmailsHandler(BaseHandler):
def post(self):
if self.POST("subject") and self.POST("email_type"):
logging.info("prepping email")
content = {}
... |
// @flow
import React from 'react';
import { FormattedMessage, injectIntl } from 'react-intl';
import type { $npm$ReactIntl$IntlShape } from 'react-intl';
import { ReactComponent as ErrorIcon } from './svg/Error.svg';
import './BluetoothApiWarning.scss';
type BluetoothApiWarningProps = {
intl: $npm$ReactIntl$Intl... |
const webpack = require('webpack');
const path = require('path');
module.exports = {
entry: {
app: './src/client/app.js',
'react.bundle': [
'react',
'react-dom',
'react-redux',
'react-router',
'react-router-redux',
'redux',
'redux-thunk',
]
},
output: {
p... |
from __future__ import unicode_literals
import datetime
import logging
from inspect import isclass
from django.core.exceptions import ImproperlyConfigured, FieldDoesNotExist
from django.db.models import Q
from .fields import SlickReportField
from .helpers import get_field_from_query_text
from .registry import field_... |
a = []
b = [None]*10
c = [40, 10, 70, 60]
print(c)
print(c[0])
print(c[-1])
c.pop()
print(c)
c.pop(0)
print(c)
c.append(90)
print(len(c))
print(c)
|
'use strict';
class Component extends THREE.Object3D {
constructor() {
super();
}
negWireframe() {
this.children.forEach(function (element) {
element.material.wireframe = !element.material.wireframe;
});
}
}
class Base extends Component {
constructor() {
... |
#ifndef SRC_SPELLCHECKER_HUNSPELL_H_
#define SRC_SPELLCHECKER_HUNSPELL_H_
#include "spellchecker.h"
#include "transcoder.h"
class Hunspell;
namespace spellchecker {
class HunspellSpellchecker : public SpellcheckerImplementation {
public:
HunspellSpellchecker();
~HunspellSpellchecker();
bool SetDictionary(con... |
({
"descTemplate": "${2} - ${1} ${0} 之 ${3}",
"firstTip": "首頁",
"lastTip": "末頁",
"nextTip": "下一頁",
"prevTip": "上一頁",
"itemTitle": "項目",
"pageStepLabelTemplate": "頁面 ${0}",
"pageSizeLabelTemplate": "每頁 ${0} 個項目",
"allItemsLabelTemplate": "所有項目",
"gotoButtonTitle": "跳至特定的頁面",
"dialogTitle": "跳至頁面",
"dialogInd... |
#pragma once
#include "stdafx.h"
class HitboxComponent
{
private:
sf::Sprite& sprite;
sf::RectangleShape hitbox;
sf::Vector2f offset;
public:
bool render = false;
HitboxComponent(sf::Sprite& sprite, sf::Vector2f offset, sf::Vector2f size);
~HitboxComponent();
//Functions
void Update(const float& DeltaTime)... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from . import get_assert_same_ggplot, cleanup, assert_same_elements
assert_same_ggplot = get_assert_same_ggplot(__file__)
from nose.tools import (assert_true, assert_raises, assert_is, assert_is_not, assert_e... |
/*
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free... |
import tensorflow as tf
import os
import time
class bcolors:
WARNING = '\033[93m'
ENDC = '\033[0m'
@tf.function
def syrk_tf(A):
#ret = A@tf.transpose(A)
ret = tf.linalg.matmul(A,A,transpose_b=True)
return ret
if __name__ == "__main__":
#Check if MKL is enabled
import tensorflow.python.... |
const MOCK_INITIAL_METRICS = {
frame: {
width: 320,
height: 640,
x: 0,
y: 0,
},
insets: {
left: 0,
right: 0,
bottom: 0,
top: 0,
},
};
const RNSafeAreaContext = jest.requireActual('react-native-safe-area-context');
export default {
...RNSafeAreaContext,
initialWindowMetrics:... |
#!/usr/local/bin/flask
import sys
import os
sys.path.append("../")
import json
import requests
import pony.orm as pny
import Database
from ExternalServices import logins
from flask import Flask, request, jsonify
from flask_jwt_extended import JWTManager, create_access_token, jwt_required, fresh_jwt_required, get_jwt_id... |
const test = require('tape')
const nlp = require('../_lib')
test('tagset-change-isA-basic', function (t) {
nlp.extend((Doc, world) => {
world.addTags({
Doctor: {
isA: 'Person',
},
})
world.addWords({
surgeon: 'Doctor',
'surgeon general': 'Doctor',
})
})
let doc = n... |
/****************************************************************************
* drivers/sensors/ads1242.c
* Character driver for the MCP3426 Differential Input 16 Bit Delta/Sigma ADC
*
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2015 DS-Automotion GmbH. All rights reserved.
* Aut... |
# Copyright 2014 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.
"""Provides a variety of device interactions based on adb.
Eventually, this will be based on adb_wrapper.
"""
# pylint: disable=unused-argument
import coll... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var CameraFill = {
name: 'camera',
theme: 'fill',
nameWithTheme: 'camera-fill',
tag: 'svg',
attrs: {
xmlns: 'http://www.w3.org/2000/svg',
class: 'icon',
viewBox: '0 0 1024 1024'
},
children: ... |
const babel = require('@babel/core');
const expect = require('expect');
const path = require('path');
const plugin = require('../index');
describe('babel-plugin-auto-symbol-description', () => {
function expectTransform(source, transformed) {
const { code } = babel.transform(source, { plugins: [plugin] });
e... |
/*!
* OOUI v0.44.0
* https://www.mediawiki.org/wiki/OOUI
*
* Copyright 2011–2022 OOUI Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
* Date: 2022-05-17T17:50:55Z
*/
( function ( OO ) {
'use strict';
/**
* Toolbars are complex interface components that permit us... |
import types, itertools, exceptions
def type_string(obj):
objType = type(obj)
if objType is types.InstanceType:
objType = obj.__class__
return getattr(objType, '__module__', '-') + '.' + objType.__name__
class NetRepr(object):
def __init__(self, objectPool):
self.objectPool = objectPoo... |
# https://www.hackerrank.com/challenges/reduce-function/problem
def product(fracs):
t = reduce(lambda x,y:x*y,fracs,1)
return t.numerator, t.denominator
|
export default 'react imported from root';
|
# -*- coding: utf-8 -*-
"""
ITU-R BT.2100
=============
Defines *ITU-R BT.2100* opto-electrical transfer functions (OETF / OECF),
opto-optical transfer functions (OOTF / OOCF) and electro-optical transfer
functions (EOTF / EOCF) and their inverse:
- :func:`colour.models.oetf_PQ_BT2100`
- :func:`colour.models.oetf... |
const router = require("express").Router();
const { Character, Checkpoint, Item, Drop, Raid } = require("../db/models");
const NOUN = "character";
router.get(`/`, async (req, res, next) => {
try {
res.json(
await Character.findAll({
include: [
{ model: Drop, include: [Item, Checkpoint] },... |
import shutil
import tempfile
import pytest
@pytest.fixture
def temp_dir():
dir_name = tempfile.mkdtemp(suffix='-pytest').rstrip('/')
yield dir_name
shutil.rmtree(dir_name)
|
#!/usr/bin/env python
import datetime
import hashlib
import math
import operator
import optparse
import os
import re
import sys
import threading
import time
import webbrowser
from collections import namedtuple, OrderedDict
from functools import wraps
from getpass import getpass
from io import TextIOWrapper
# Py2k com... |
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas at Austin
Copyright (C) 2018 - 2019, Advanced Micro Devices, Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted prov... |
import os
import shutil
from conans import ConanFile, CMake, tools
class CmsisConan(ConanFile):
name = "CMSIS-DSP"
version = "1.9.0" # DSP package version
git_sha = "13b9f72f212688d2306d0d085d87cbb4bf9e5d3f"
license = "Apache-2.0"
author = "Torfinn Berset <torfinn@bloomlife.com>"
url = "https... |
'use strict';
module.exports = function parseJSON(res, fn){
res.text = '';
res.setEncoding('utf8');
res.on('data', chunk => {
res.text += chunk;
});
res.on('end', () => {
try {
var body = res.text && JSON.parse(res.text);
} catch (e) {
var err = e;
// issue #675: re... |
'use strict'
/*
* Create a `get` function that takes a key and return the corresponding value
* in the sourceObject
*
* @notions Functions, Data-Structures, Get
*/
// Provided code :
const sourceObject = {
num: 42,
bool: true,
str: 'some text',
log: console.log,
}
// Your code :
function get(whatever){
... |
from __future__ import annotations
import logging
import time
from dataclasses import replace
from secrets import token_bytes
from typing import Any, Dict, List, Optional, Set
from blspy import AugSchemeMPL, G2Element
from chia.consensus.cost_calculator import calculate_cost_of_program, NPCResult
from chia.full_node... |
/**
* Copyright IBM Corp. 2016, 2020
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* Code generated by @carbon/icon-build-helpers. DO NOT EDIT.
*/
var _24 = {
"elem": "svg",
"attrs": {
"xmlns": "http://www.w3.org/200... |
const Router = require("koa-router");
const router = new Router();
const gamebank = require("gamebank");
const Customer = require("config").get("Customer");
router.post("/API/:attribute/:method", ctx => {
return new Promise((resolve, reject) => {
const { attribute, method } = ctx.params;
let params = ctx.requ... |
var BABYLON;
(function (BABYLON) {
var intersectBoxAASphere = function (boxMin, boxMax, sphereCenter, sphereRadius) {
if (boxMin.x > sphereCenter.x + sphereRadius)
return false;
if (sphereCenter.x - sphereRadius > boxMax.x)
return false;
if (boxMin.y > sph... |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
import torch.nn.functional as F
import os
import os.path as osp
import time
import sys
import logging
import numpy as np
import argparse
import importlib
import json
import cv2
from lib.model_1 impor... |
// Copyright 2012 the V8 project 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 V8_HEAP_HEAP_H_
#define V8_HEAP_HEAP_H_
#include <atomic>
#include <cmath>
#include <memory>
#include <unordered_map>
#include <unordered_set>
... |
#include "orientation.cpp"
#include "hostcommand.cpp"
#ifndef HOST_COMMUNICATOR_H
#define HOST_COMMUNICATOR_H
class HostCommunicator {
public:
HostCommunicator();
HostCommand* getCommandQueue();
};
#endif /* HOST_COMMUNICATOR_H */
|
"""
Only the tests from the watching (simulated) to the handling (substituted).
Excluded: the watching-streaming routines
(see ``tests_streaming.py`` and ``test_watching.py``).
Excluded: the causation and handling routines
(to be done later).
Used for internal control that the event queueing works are intended.
If t... |
// Copyright (c) 2014-2020 The Crown developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef CROWN_CACHE_H
#define CROWN_CACHE_H
#include <flat-database.h>
#include <masternode/masternode-budget.h>
#include <masterno... |
#pragma once
#include "webrtc.VideoFrame.VideoFrame.g.h"
namespace winrt::Microsoft::WinRTC::WebRtcWrapper::webrtc::VideoFrame::implementation
{
struct VideoFrame : VideoFrameT<VideoFrame>
{
VideoFrame() = default;
// VideoFrame(::webrtc::VideoFrame webrtc_videoframe);
int32_t Width();
... |
from django.contrib import admin
from .models import Question, Choice
# Register your models here.
#one ways of changing things
# class QuestionAdmin(admin.ModelAdmin):
# fields = ['pub_date', 'question_text']
# another way of doing things
class ChoiceInline(admin.TabularInline):
model = Choice
extra = 3... |
# Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
import { InjectionToken } from '@angular/core';
export const /** @type {?} */ ORIGIN_URL = new InjectionToken('ORIGIN_URL');
export const /** @type {?} */ REQUEST = new InjectionToken('REQUEST');
export const /** @type {?} */ RESPONSE = ... |
/*=========================================================================
Program: ParaView
Module: pqCreateCustomFilterReaction.h
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms... |
#!/usr/bin/env python3
# Copyright (c) 2020 SiFive Inc.
# SPDX-License-Identifier: Apache-2.0
"""Generate Freedom E SDK settings.mk from devicetree source files"""
import argparse
import sys
import pydevicetree
SUPPORTED_TYPES = ["rtl", "arty", "qemu", "hifive", "spike", "vc707", "vcu118"]
def parse_arguments(arg... |
macDetailCallback("24693e000000/24",[{"d":"2015-01-29","t":"add","a":"5F., No. 237, Sec. 1, Datong Rd., Xizhi Dist.\nNew Taipei City Taiwan 221\n\n","c":"TAIWAN, PROVINCE OF CHINA","o":"innodisk Corporation"},{"d":"2015-08-27","t":"change","a":"5F., No. 237, Sec. 1, Datong Rd., Xizhi Dist. New Taipei City Taiwan TW 221... |
from unittest import TestCase
from kata import PaginationHelper
class TestPaginationHelper(TestCase):
def setUp(self):
collection = range(1, 25)
self.helper = PaginationHelper(collection, 10)
def test_item_count(self):
self.assertEqual(self.helper.item_count(), 24, 'item_count return... |
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Property descriptor for `Number.MAX_SAFE_INTEGER`
esid: sec-number.max_safe_integer
es6id: 20.1.2.6
info: >
The value of Number.MAX_SAFE_INTEGER is 90071992547... |
# -*- coding:utf-8 -*-
import oneflow as flow
import oneflow.nn as nn
from models.resnet50 import resnet50
def conv3x3(
in_planes: int, out_planes: int, stride: int = 1, groups: int = 1, dilation: int = 1
) -> nn.Conv2d:
"""3x3 convolution with padding"""
return nn.Conv2d(
in_planes,
out_p... |
import { combineReducers, createStore, applyMiddleware } from 'redux'
import Immutable from 'seamless-immutable'
import createSagaMiddleware from 'redux-saga'
import rootSaga from '../Sagas'
import { reducer as NewsReducer } from './NewsRedux'
export const reducers = combineReducers({
news: NewsReducer
})
export c... |
import numpy as np
import time
from bicycle_dynamics import BicycleDynamics
from irs_lqr.all import IrsLqrParameters, IrsLqrZeroOrder
import matplotlib.pyplot as plt
from matplotlib import cm
# 1. Load dynamics.
bicycle = BicycleDynamics(0.1)
# 2. Set up desried trajectory and cost parameters.
timesteps = 100
par... |
from __future__ import unicode_literals
from __future__ import absolute_import
import copy
import datetime
import json
import time
import django
import django.utils.timezone as timezone
from django.test import TestCase, TransactionTestCase
import error.test.utils as error_test_utils
import job.test.utils as job_test... |
# Copyright (c) OpenMMLab. All rights reserved.
import mmcv
import numpy as np
def adjust_hue(img, hue_factor):
"""Adjust hue of an image.
Args:
img (ndarray): Image to be adjust with BGR order.
value (float): the amount of shift in H channel and must be in the
interval [-0.5, 0... |
# coding: utf-8
#
# Copyright 2018 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... |
#-*- coding: utf-8 -*-
from django.db.models import get_model
from shopping_cart.config import PRODUCT_MODEL
class CartItem(object):
"""
Representa um item do Cart
"""
def __init__(self, item_pk, quantity):
"""
Guarda o id do item e a quantity
"""
self.item_pk = item_... |
/*
* Copyright (c) 2017 Spotify AB.
*
* 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,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Tests binary search of BaseConnection and exception thrown when available is called while disconnected
"""
import pytest
from com_server import Connection, ConnectException
def test_bin_srch() -> None:
b = Connection(port="test", baud=123)
b._rcv_queue = [... |
#!/usr/bin/env python2
# coding: utf-8
import os
import time
import unittest
from pykit import daemonize
from pykit import proc
from pykit import ututil
dd = ututil.dd
this_base = os.path.dirname(__file__)
def subproc(script, env=None):
if env is None:
env = dict(PYTHONPATH=this_base + '/../..',)
... |
import React, { useEffect, useState, Component } from 'react'
import CIcon from '@coreui/icons-react'
import { cilSearch } from '@coreui/icons'
import ReactPaginate from 'react-paginate'
import branch from './../../assets/images/avatars/branch.png'
import { Link } from 'react-router-dom'
import axios from 'axios'
impor... |
from django.utils.http import urlencode
#django <2 compat
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
from .exceptions import InvalidActionError
from .exceptions import InvalidControllerError
class ApplicationHelper(object):
"""ApplicationHelpers ... |
#!/usr/bin/env python
import argparse
import sys
import socket
import random
import struct
from sendutils import *
from headers import *
def test_message(dest):
init_stk = [
STACK(dest)
]
prog = [
LOAD(0), # load destination
VARLOADREG(), # load egress port value corresponding to de... |
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env(
"DJANGO_SECRET_KEY... |
#
# 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 us... |
/*!
* Angular Directives For Accessible Applications
*
* Copyright (C) 2015-2017 Deque Systems Inc., All Rights Reserved
*
* See the project LICENSE file for usage - https://github.com/dequelabs/ngA11y/blob/master/LICENSE
*/
!function(){"use strict";function a(a){for(var b=a[0].querySelectorAll(c),d=[],e=0,f=b.length;e... |
import numpy as np
import pandas as pd
from sklearn.linear_model import LassoLarsCV
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsRegressor
from sklearn.pipeline import make_pipeline, make_union
from tpot.builtins import StackingEstimator, ZeroCount
# NOTE: Make sure that... |
import json
import traceback
from typing import IO
from typing import Iterable
class Meta(type):
def __new__(mcs, name, base, attr):
mappings = {}
for k, v in attr.items():
if isinstance(v, Field):
mappings[k] = v
for k in mappings:
attr.pop(k)
... |
from typing import Optional
from bxcommon import constants
from bxcommon.messages.bloxroute.bloxroute_message_control_flags import BloxrouteMessageControlFlags
from bxcommon.messages.bloxroute.bloxroute_message_type import BloxrouteMessageType
from bxcommon.messages.validation.abstract_message_validator import Abstrac... |
(function( ab, eventTarget ){
"use strict";
ab.threeBase = function(config){
config = config || {};
var aspectRatio = 2.58,
scene = (function(){
var scn = new THREE.Scene();
return function(){
return scn;
}
}()),
renderer = (function(){
var rnd = new THREE.WebGLRenderer();
... |
import streamlit as st
import pandas as pd
import base64
class DataLoader:
def __init__(self):
self.is_without_labels = False
self.separator = ','
def check_labels(self):
if st.checkbox('The file has no labels for columns in the first row'):
self.is_without_labels = True
... |
#! /usr/bin/env python3
# Method that handles piping to allow communication between processes
import os, sys, time, re, pipe
from redirection import outRedir, inRedir
def piping(args):
# '|' for split command
#args = args.split('|')
'''''
left and right arguments. lArg retrieves data of the pipe's... |
#!/bin/python3
import math
import os
import random
import re
import sys
if __name__ == '__main__':
s = input()
the_letters = {}
total = len(s)
for character in s:
if character in the_letters: continue
else: the_letters[character] = s.count(character)
frequencies = sorted(the_lett... |
import React from "react";
// import { Link } from 'gatsby'
import icon1 from "../img/img/icon1.svg";
import icon2 from "../img/img/icon2.svg";
// import instagram from '../img/social/instagram.svg'
// import twitter from '../img/social/twitter.svg'
// import vimeo from '../img/social/vimeo.svg'
import contactus from ... |
import firebase from 'firebase'
require('dotenv').config()
let config = {
apiKey: process.env.apiKey,
authDomain: process.env.authDomain,
databaseURL: process.env.databaseURL,
projectId: process.env.projectId,
storageBucket: process.env.storageBucket,
messagingSenderId: process.env.messagingSen... |