text stringlengths 3 1.05M |
|---|
// SPDX-License-Identifier: GPL-2.0+
/*
* u_serial.c - utilities for USB gadget "serial port"/TTY support
*
* Copyright (C) 2003 Al Borchers (alborchers@steinerpoint.com)
* Copyright (C) 2008 David Brownell
* Copyright (C) 2008 by Nokia Corporation
*
* This code also borrows from usbserial.c, which is
* Copyrig... |
"""Exchange and Queue declarations."""
from __future__ import absolute_import, unicode_literals
import numbers
from .abstract import MaybeChannelBound, Object
from .exceptions import ContentDisallowed
from .five import python_2_unicode_compatible, string_t
from .serialization import prepare_accept_content
TRANSIENT_... |
/******************************************************************************
* Copyright (C) 2010-2020 <Xilinx Inc.>
*
* This program 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 2 of t... |
/* $OpenBSD: progressmeter.h,v 1.1 2003/01/10 08:19:07 fgsch Exp $ */
/*
* Copyright (c) 2002 Nils Nordman. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source co... |
from PyQt5 import QtCore, QtGui, QtWidgets, uic
from PyQt5 import QtWidgets
from PyQt5.QtCore import *
from PyQt5 import QtGui
import scriptwrapper
from PyQt5.QtMultimedia import QMediaPlayer, QMediaPlaylist, QMediaContent
from PyQt5.QtCore import QDir, Qt, QUrl, pyqtSignal, QPoint, QRect, QObject
from PyQt5.QtM... |
import os
import time
import socket
import struct
from traceback import format_exc, format_stack
import scapy.compat
from scapy.utils import wrpcap, rdpcap, PcapReader
from scapy.plist import PacketList
from vpp_interface import VppInterface
from scapy.layers.l2 import Ether, ARP
from scapy.layers.inet6 import IPv6, ... |
# 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 ... |
from mongodb_connector import MongoSQLParser
if __name__ == "__main__":
print("lark sql")
# logger.setLevel(logging.DEBUG)
# p = Lark(GRAMMAR, parser='lalr', debug=True, transformer=SQLTransformer())
parser = MongoSQLParser.get_instance()
# select
# print(p.parse('SELECT hoge,hage FROM hoge ... |
import os
import sys
import unittest
import torch
import torch._C
from pathlib import Path
from test_nnapi import TestNNAPI
from torch.testing._internal.common_utils import TEST_WITH_ASAN
# Make the helper files in test/ importable
pytorch_test_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.pa... |
# ElasticQuery
# File: elasticquery/dsl_util.py
# Desc: utility functions for converting args/kwargs to Elasticsearch DSL
import six
from .exceptions import MissingArgError
def _check_input(arg):
if arg is None:
return False
if type(arg) in (list, dict, tuple) and len(arg) == 0:
return Fals... |
import _debug from 'debug'
const debug = _debug('server:coin:role')
import _ from 'lodash';
import Errcode, * as EC from '../Errcode'
const Roles = {
root: ['manage_users','edit_users','manage_posts','edit_posts','manage_orders','edit_orders'],
agent: ['manage_users','edit_users','manage_posts','edit_posts'],
... |
if ('serviceWorker' in navigator) {
navigator.serviceWorker
.register('app/service-worker.js')
.then(function() { console.log('Service Worker Registered'); });
}
var uploadForm = document.getElementById('uploadForm'),
downloadForm = document.getElementById('downloadForm'),
fileInput = docum... |
from django.apps import AppConfig
class MainConfig(AppConfig):
name = 'Main'
# everything above this line was autogenerated by django |
from tensorprob import utilities
def test_generate_name():
class SomeTestClass(object):
pass
def some_test_function():
pass
assert utilities.generate_name(SomeTestClass) == 'SomeTestClass_1'
assert utilities.generate_name(some_test_function) == 'some_test_function_1'
assert utili... |
import functools
import inspect
class Author:
def __repr__(self) -> str:
return f'{self.name}: {self.email}'
def __init__(self, name: str, email: str):
self.name = name
self.email = email
def blame(x):
if isblameable(x):
return x.__authors__
else:
raise Excepti... |
/**
* Copyright (c) 2015, Jozef Stefan Institute, Quintelligence d.o.o. and contributors
* All rights reserved.
*
* This source code is licensed under the FreeBSD license found in the
* LICENSE file in the root directory of this source tree.
*/
// typical use case: pathPrefix = 'Release' or pathPrefix = 'Debug'.... |
// controller calls a model, then processes the logic
// the model called
const User = require('../models/user')
const Product = require('../models/product')
//functions that we want the website to be able to do
// we may not need any get functions at the moment since data is being called
// directly from the field... |
/***************************************************************************
* Copyright (C) 2007 by Dominik Seichter *
* domseichter@web.de *
* *
* This pr... |
import TmModalSearch from "common/TmModalSearch"
import setup from "../../../helpers/vuex-setup"
import Vuelidate from "vuelidate"
describe(`TmModalSearch`, () => {
let wrapper, store
let { mount, localVue } = setup()
beforeEach(() => {
let instance = mount(TmModalSearch, { propsData: { type: `transactions`... |
from typing import Tuple, Union
import phidl.geometry as pg
import gdsfactory as gf
from gdsfactory.component import Component
from gdsfactory.types import ComponentOrReference, Int2, Layer
@gf.cell
def boolean(
A: Union[ComponentOrReference, Tuple[ComponentOrReference, ...]],
B: Union[ComponentOrReference,... |
from conans import AutoToolsBuildEnvironment, ConanFile, tools
from conans.errors import ConanException
from contextlib import contextmanager
import os
import re
import shutil
required_conan_version = ">=1.33.0"
class LibtoolConan(ConanFile):
name = "libtool"
url = "https://github.com/conan-io/conan-center-i... |
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2016 The Gdrcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef GDRCOIN_CHAINPARAMS_H
#define GDRCOIN_CHAINPARAMS_H
#include "chainparam... |
export default function getServiceMethod(service, getMethodName = (_ => _)) {
return ({ packageName, serviceName, methodName }) => {
return service[packageName][serviceName][getMethodName(methodName)];
}
}
|
'''
Created on Sep 20, 2018
@author: Vinu Karthek
'''
import tensorflow as tf
import numpy as np
import tf_basics as tfb
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data as mnist_data
class predict(object):
'''
#load saved models & predict images
'''
def _... |
"""Training objectives for reinforcement learning."""
from typing import Callable
import numpy as np
import tensorflow as tf
from typeguard import check_argument_types
from neuralmonkey.trainers.generic_trainer import Objective
from neuralmonkey.decoders.decoder import Decoder
from neuralmonkey.vocabulary import END... |
/* inih -- simple .INI file parser
inih is released under the New BSD license (see LICENSE.txt). Go to the project
home page for more info:
https://github.com/benhoyt/inih
*/
#ifndef __INI_H__
#define __INI_H__
/* Make this header file easier to include in C++ code */
#ifdef __cplusplus
extern "C" {
#endif
#inclu... |
import React from 'react'
import { Parallax } from 'react-scroll-parallax';
// images
import mobile from '../../../images/application/mobile.png'
const ApplicationBanner = () => {
return (
<div className="applicationBannerArea" id="home" >
<div className="container">
... |
import pell from 'pell';
function defaultOnChangeHandler(html) {
console.log(`Output html: ${html}`);
}
function startEditor(elemSelector, onChangeHandler) {
if (typeof elemSelector !== 'string') {
console.error(`Must pass valid css element selector as first parameter: ${elemSelector}`);
retur... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
# You can find misc modules, which dont fit in anything xD
""" Userbot module for other small commands. """
from rando... |
var searchData=
[
['_7ecameracalibration',['~CameraCalibration',['../class_camera_calibration.html#af14cdd05871dac737f34a2b27d0a206b',1,'CameraCalibration']]],
['_7edepthsensor',['~DepthSensor',['../class_depth_sensor.html#aaa8402ff2596f0db6d201ac0229a83d0',1,'DepthSensor']]],
['_7edesktopcapture',['~DesktopCaptu... |
import { ipcMain } from 'electron'
import { getMenuItemById } from '../utils'
const MENU_ID_FORMAT_MAP = {
'strongMenuItem': 'strong',
'emphasisMenuItem': 'em',
'inlineCodeMenuItem': 'inline_code',
'strikeMenuItem': 'del',
'hyperlinkMenuItem': 'link',
'imageMenuItem': 'image'
}
const selectFormat = format... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(name="modelgym",
version='0.1.5',
description='predictive model optimization toolbox.',
long_description=open('README.rst').read(),
url='https://github.com/yandexdataschool/modelgym/',
li... |
const { browserStackErrorReporter } = requireHelper('browserstack-error-reporter');
const utils = requireHelper('e2e-utils');
const config = requireHelper('e2e-config');
requireHelper('rejection');
jasmine.getEnv().addReporter(browserStackErrorReporter);
describe('Pie Chart tests', () => {
beforeEach(async () => {
... |
import React from "react"
export default function Corsi(){
return(
<div className="py-5">
<h1 className="text-center font-bold text-gray-100 text-4xl">Corsi</h1>
<div className="grid sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8 p-3">
<a href="htt... |
import smtplib as root
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
def send_mail():
login = input('Введите вашу почту:')
password = input('Введите ваш пароль:')
url = input('URL:')
toaddr = input('Кому:')
topic = input('Тема:')
message = input('Введите сообщение:')... |
/* Copyright 2012-2013 Theo Berkau <cwx@cyberwarriorx.com>
This file is part of Yabause.
Yabause 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 2 of the License, or
(at your option) a... |
// TODO: pre-generate layouts of numbers for different sized grids
// input sizes row=[4..10] col=[4..10] nums=[3..9]
// take inputs
// rows, cols, nums
// output
// upto 25 interesting configurations
// dump to JSON file asset
|
import React from 'react'
import Header from '../components/header'
import Info from '../components/info'
import Items from '../components/items'
import '../styles/page.styl'
class IndexPage extends React.Component {
constructor() {
super()
this.state = {
item: 0,
prevItem: 0,
}
this.o... |
import json
import os
import os.path
from pathlib import Path
DATADIR = Path(os.path.abspath(os.path.join(os.path.dirname(__file__), '../data')))
def gahj():
with (DATADIR / 'apps.json').open() as f:
data = json.load(f)
with (DATADIR / 'apps-custom.json').open() as f:
data_custom = json.load... |
import numpy as np
from tqdm import tqdm
from consts import (
CONSTS,
DISC_CONSTS,
NUM_POSITIONS,
NUM_VELOCITIES,
)
from mountain_car_runner import test_solution
save_folder = "value_fn"
SAVE_LOCATION1 = f"{save_folder}/value.npy"
SAVE_LOCATION2 = f"{save_folder}/v100_x200.npy"
FINAL_SAVE_... |
# -*- coding: utf-8 -*-
import datetime
from wechatpy.client.api.base import BaseWeChatAPI
class WeChatDataCube(BaseWeChatAPI):
API_BASE_URL = "https://api.weixin.qq.com/datacube/"
@classmethod
def _to_date_str(cls, date):
if isinstance(date, (datetime.datetime, datetime.date)):
re... |
import { useState, useEffect } from 'react';
import useAuth from './useAuth';
import { Container, Form } from 'react-bootstrap';
import SpotifyWebApi from 'spotify-web-api-node';
import TrackSearchResult from './TrackSearchResult';
import Player from './Player'
import axios from 'axios';
const spotifyApi = new Spotify... |
const path = require('path');
const webpackBase = require('./webpack.base.conf');
const SpeedMeasureWebpackPlugin = require('speed-measure-webpack-plugin');
const smp = new SpeedMeasureWebpackPlugin();
const config = {
// 配置源码显示方式
mode: 'production',
entry: {
app: ['./src/index.jsx']
},
out... |
import pandas as pd
from pandas.testing import assert_frame_equal
from test_common import CLEAN_NAME_DATA, DIRTY_COLUMN_NAMES, CLEAN_COLUMN_NAMES
def make_test_dfs():
df = pd.DataFrame(CLEAN_NAME_DATA).T
expected_df = df.copy()
df.columns = DIRTY_COLUMN_NAMES
expected_df.columns = CLEAN_COLUMN_NAMES
... |
import contextlib
@contextlib.contextmanager
def config_test():
print('start') # 前処理
try:
yield
finally:
print('done') # 後処理
with config_test():
print('process...') |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.engine.console import Console
from pants.engine.goal import Goal, GoalSubsystem, LineOriented
from pants.engine.rules import goal_rule
from pants.source.source_root import AllSo... |
# #######
# Copyright (c) 2018-2020 Cloudify Platform Ltd. 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... |
const path = require("path");
const express = require("express");
const app = express();
app.set("view engine", "ejs");
const adminRoutes = require("./routes/admin");
const shopRoutes = require("./routes/shop");
const errorController = require("./controllers/error");
app.use(express.json());
app.use(e... |
'use strict';
const Command = require('cmnd').Command;
const APIResource = require('api-res');
const config = require('../../config.js');
class HostsAddCommand extends Command {
constructor() {
super('hosts', 'add');
}
help() {
return {
description: 'Adds a new hostname route from a source c... |
import vdomr as vd
import time
import sys
import mtlogging
import numpy as np
import json
from .tablewidget import TableWidget
class RecordingTableView(vd.Component):
def __init__(self, context, opts=None):
vd.Component.__init__(self)
self._context = context
self._size = (100, 100)
... |
'use strict';
var object = require('../utils/object');
var GuardianError = require('./guardian_error');
function EnrollmentMethodDisabledError(method) {
GuardianError.call(this, {
message: 'The method ' + method + 'is disabled',
errorCode: 'enrollment_method_disabled'
});
this.method = method;
}
Enrol... |
/** Copyright (c) 2018 Uber Technologies, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
import type {
ExtractDepsType,
Context,
ExtractTokenType,
FusionPlugin,
Middleware,
Token,
SSRBodyTemplate,
Rend... |
from datetime import datetime, timedelta
from apprise import Apprise
from monitor.database import async_session
from monitor.database.queries import (get_blockchain_state, get_connections,
get_farming_start, get_og_plot_count,
get_og_plot_size... |
import os
from typing import Any
from openapidocs.common import Format
def debug() -> bool:
return bool(os.environ.get("DEBUG", "1"))
def debug_result(version: str, instance: Any, result: str, format: Format) -> None:
if not debug():
return
with open(
f"{version}_debug_{instance.__clas... |
soma = n1 = cont = 0
n1 = int(input('digite um numero: '))
while n1 != 999:
soma = soma + n1
cont += 1
n1 = int(input('digite um numero: '))
print('foram digitados {} numeros'.format(cont))
print('e a soma dos numeros digitados é ', soma)
|
/****************************************************************************
* Copyright (C) 2009-2015 EPAM Systems
*
* This file is part of Indigo toolkit.
*
* This file may be distributed and/or modified under the terms of the
* GNU General Public License version 3 as published by the Free Software
* Founda... |
/*! For license information please see app.js.LICENSE.txt */
(()=>{var e,t={669:(e,t,n)=>{e.exports=n(609)},448:(e,t,n)=>{"use strict";var r=n(867),i=n(26),o=n(372),u=n(327),a=n(97),s=n(109),c=n(985),f=n(61),l=n(655),p=n(263);e.exports=function(e){return new Promise((function(t,n){var h,d=e.data,v=e.headers,_=e.respons... |
import React, { Component } from 'react';
import classes from './Modal.css';
import Aux from '../../../hoc/Aux';
import Backdrop from '../Backdrop/Backdrop';
class Modal extends Component {
shouldComponentUpdate(nextProps, _nextState) {
return nextProps.show !== this.props.show;
}
render() {
return (
... |
import numpy as np
class DeltaJSDivergence(object):
def __init__(self, pi1=0.5, pi2=0.5):
assert pi1 + pi2 == 1
self.pi1 = pi1
self.pi2 = pi2
def get_scores(self, a, b):
# via https://arxiv.org/pdf/2008.02250.pdf eqn 1
p1 = 0.001 + a / np.sum(a)
p2 = 0.001 + b /... |
module.exports={A:{A:{"1":"E A B","2":"L H G jB"},B:{"1":"8 C D e K I N J"},C:{"1":"0 1 2 3 4 5 7 9 gB BB F L H G E A B C D e K I N J P Q R S T U V W X Y Z a b c d f g h i j k l m n o M q r s t u v w x y z JB IB CB DB EB O GB HB aB ZB"},D:{"1":"0 1 2 3 4 5 7 8 9 F L H G E A B C D e K I N J P Q R S T U V W X Y Z a b c d... |
/usr/lib/python3.8/os.py |
'use strict';
const urllib = require('url');
const querystring = require('querystring');
const sax = require('sax');
const request = require('miniget');
const util = require('./util');
const sig = require('./sig');
const FORMATS = require('./formats');
const VIDEO_URL = 'https://w... |
# The ReactRoleTagger cog and all associated commands and data.
import os
import pickle
from datetime import datetime
from collections import defaultdict
from typing import Union, List, Optional
import discord as dc
from discord.ext import commands
from cogs_textbanks import url_bank, query_bank, response_bank
from b... |
// MIT License
// Copyright (c) 2020 SUNY Oswego
// 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, mer... |
"""
Django models for user_data app.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/db/models/
"""
from itertools import chain
from django.contrib.auth import get_user_model as User
from django.contrib.auth.hashers import check_password
from django.db import models
from polymorph... |
# Copyright 2020 Avinash S Sah
# 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 applicable law or agreed to in w... |
define(
//begin v1.x content
{
"field-quarter-short-relative+0": "ова тромесечје",
"field-quarter-short-relative+1": "следното тромесечје",
"field-tue-relative+-1": "минатиот вторник",
"field-year": "година",
"field-wed-relative+0": "оваа среда",
"field-wed-relative+1": "следната среда",
"field-minute": "минута"... |
# Copyright (c) 2019 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... |
import argparse
from projecteuler import classes
from utils.resources import load_problem_resources
# Problem-specific constants
PROBLEM_NAME = "Problem 009 - Special Pythagorean triplet"
PROBLEM_DESCRIPTION = """
A Pythagorean triplet is a set of three natural numbers, a < b < c, for
which, a^2 + b^2 = c^2
For ex... |