text stringlengths 3 1.05M |
|---|
"""
This file offers the methods to automatically retrieve the graph Stenotrophomonas nitritireducens.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protei... |
'''
Created on Jul 20, 2012
@author: Allis Tauri <allista@gmail.com>
'''
from .AbortableBase import AbortableBase, aborted
from .WaitingThread import WaitingThread
from .EchoLogger import EchoLogger
from .Pipeline import PipelineNode |
document.addEventListener('DOMContentLoaded', () => {
const squares = document.querySelectorAll('.grid div')
const scoreDisplay = document.querySelector('span')
const startBtn = document.querySelector('.start')
const width = 10
let currentIndex = 0 //so first div in our grid
let appleIndex = 0 //so first d... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Created on Mon Jan 04 2021 17:22:26 by codeskyblue
"""
import argparse
import base64
import datetime
import fnmatch
import json
import logging
import os
import re
import shutil
import socket
import subprocess
import sys
import threading
import time
import traceback
fro... |
from task import Task
class Section():
def __init__(self, name):
self.name = name
def add_task(self, new_task: Task):
if new_task in new_task.tasks:
return f"Task is already in the section {self.name}"
new_task.tasks.append(new_task)
return f"Task {Task.details(new_... |
/*
* Tencent is pleased to support the open source community by making TBase available.
*
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
*
* TBase is licensed under the BSD 3-Clause License, except for the third-party component listed below.
*
* A copy of the BSD 3-Clause Li... |
"""
Copyright 2018 Goldman Sachs.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software di... |
#!/usr/bin/env python
from wsgiref.simple_server import make_server
import sys
import json
import traceback
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, ServerError, InvalidRequestError
from os imp... |
// var express = require('express'),
// httpProxy = require('http-proxy'),
// fs = require('fs'),
// proxy = new httpProxy.createProxyServer();
// const appRoute = {
// target: 'http://localhost:8081'
// };
// debugger;
// const routing = JSON.parse(fs.readFileSync('./api.json'));
// console.log(routing)... |
print('{:=^40}'.format(' lojas guanabara '))
p=float(input(' preço do produto'))
print(p)
print('escolha a opção de pagamento')
pag=int(input('''[1] á vista com cheque/dinheiro;
[2] á vista no cartão;
[3] 2x no cartão;
[4] 3x ou mais no cartão; '''))
print(pag)
if pag == 1:
print('valor á pagar R$ {} com 10% de d... |
# $Id: ToggleButton.py,v 1.29.2.5 2007/01/26 22:51:33 marcusva Exp $
#
# Copyright (c) 2004-2007, Marcus von Appen
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source co... |
import copy
import os
from typing import Optional, Union
from .structure import PrioritizedBuffer
from ctools.utils import read_config, deep_merge_dicts
default_config = read_config(os.path.join(os.path.dirname(__file__), 'replay_buffer_default_config.yaml')).replay_buffer
class ReplayBuffer:
"""
Overview: ... |
// Include component
import component from './Footer.js';
// Export
export {
component
};
|
""" This is the Bokeh charts testing interface.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with thi... |
# -*- coding: utf-8 -*-
"""sysdescrparser."""
import sys
import os
sys.path.append(os.path.dirname(__file__))
# pylint: disable=C0413
from cisco_ios import CiscoIOS
from cisco_nxos import CiscoNXOS
from cisco_iosxr import CiscoIOSXR
from juniper_junos import JuniperJunos
from juniper_screenos import JuniperScreenOS... |
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolar... |
/**
* Created by JOSEVALDERLEI on 26/09/2014.
*/
(function () {
'use strict';
define([
], function () {
function TranslationController($scope, translationService){
this.$scope = $scope;
this.translationService = translationService;
this.iniciar();
}
... |
import asyncio
import discord
import logging
import aiosqlite
import json
from discord.ext import commands
logger = logging.getLogger('discord')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(
filename='discord.log', encoding='utf-8', mode='w')
handler.setFormatter(logging.Formatter(
'%(asctime)s... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
ORStools
A QGIS plugin
QGIS client to query openrouteservice
-------------------
begin : 2017-02-01
git sha ... |
# tests speed of solving systems of linear equations
import numpy as np
import time
import matplotlib.pyplot as plt
counts = []
times = []
for count in range(2, 1024):
a = np.random.rand(count, count)
b = np.random.rand(count)
start = time.time()
x = np.linalg.solve(a, b)
dt = time.time() - start
... |
r"""
Homsets between simplicial complexes
AUTHORS:
- Travis Scrimshaw (2012-08-18): Made all simplicial complexes immutable to
work with the homset cache.
EXAMPLES::
sage: S = simplicial_complexes.Sphere(1)
sage: T = simplicial_complexes.Sphere(2)
sage: H = Hom(S,T)
sage: f = {0:0,1:1,2:3}
sag... |
import argparse
import sys
config = {}
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"--slides",
action="store_const",
const=True,
help="Automatically open the videos as fullscreen slides once its done",
)
args, extra = parser.parse_known_args(sys... |
import express from 'express';
import router from '@routes';
const app = express();
app.use(express.json());
app.use(router());
app.listen(4200, () => {
console.log('app is listening to port 4200');
});
|
# encoding: utf-8
'''🤠 PDS Roundup: Main entrypoint'''
from .context import Context
from .errors import InvokedProcessError
from .util import populateEnvVars, invoke
from .assembly import (
StablePDSAssembly, UnstablePDSAssembly, IntegrativePDSAssembly, NoOpAssembly, EnvironmentalAssembly
)
import os, logging,... |
"use strict";
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { ... |
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import { ratingContract } from './setup';
import { ShowMovieRatings } from "./ShowMovieRatings";
class App extends Component {
constructor(props){
super(props)
this.state={
movies: [{name:'Top Gun', rating:0},{... |
# Copyright (c) 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
import sys
import pandas as pd
from get_my_tweets import preprocess
from get_my_tweets import preprocess_for_tweet
from tokenize_module import tokenize_sp
from tokenize_module import tokenize_mecab
if __name__ == "__main__":
# 引数を受け取る
tokenizer = sys.argv[1]
input_text = sys.argv[2]
# 学習時と同様の前処理
... |
# Inspired by "Georgia's Spirals"
from turtle import *
bgcolor ('black')
for a_color, a_pensize, start_radius, stop_radius, radius_step in (
('green', 1, 82, 40, -6),
('red', 1, 84, 40, -6),
('white', 2, 98, 50, -5),
('yellow', 2, 70, 50, -5),
('blue', 2, 97, 70, -5),
('or... |
# -*- coding: utf-8 -*-
from setuptools import setup,find_packages
import codecs
with codecs.open('README-pythainlp.md','r',encoding='utf-8') as readme_file:
readme = readme_file.read()
readme_file.close()
with codecs.open('requirements.txt','r',encoding='utf-8') as f:
requirements = f.read().splitlines()
set... |
async function searchVideoSuggestions(text) {
return await (await fetch(`/api/v1/search/autocomplete/${text}`)).json();
}
async function searchYoutubeVideos(q) {
return await (await fetch(`/api/v1/youtube/${q}`)).json();
}
async function createRoom(name) {
const request = new Request('/api/v1/room/create'... |
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/medialive/MediaLive_EXPORTS.h>
#include <aws/medialive/MediaLiveRequest.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
... |
!
!svn $Id: nemuro_mod.h 2328 2014-01-23 20:16:18Z arango $
!================================================== Hernan G. Arango ===
! Copyright (c) 2002-2014 The ROMS/TOMS Group !
! Licensed under a MIT/X style license !
! See License_ROMS.txt ... |
/* ***********************************************************
* This file was automatically generated on 2018-11-28. *
* *
* C/C++ Bindings Version 2.1.23 *
* *
* If... |
import os
import argparse
from bilm.training import test, load_options_latest_checkpoint, load_vocab
from bilm.data import LMDataset, BidirectionalLMDataset
def top_level(args):
options, ckpt_file = load_options_latest_checkpoint(args.save_dir)
vocab_file = os.path.join(args.save_dir, 'vocabs.txt')
# loa... |
# 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... |
config = {
"interfaces": {
"google.ads.googleads.v5.services.AccountBudgetService": {
"retry_codes": {
"idempotent": [
"DEADLINE_EXCEEDED",
"UNAVAILABLE"
],
"non_idempotent": []
},
"retry_params": {
"default": {
"initial_retry_delay_m... |
import Vue from "vue";
import App from "./layouts/default.vue";
import VueHighlightJS from "vue-highlightjs";
import VueClipboard from "vue-clipboard2";
import store from "./store";
import vuetify from "./plugins/vuetify";
import md from "./plugins/markdown-it";
import router from "./router";
Vue.config.productionTip ... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('transmittals', '0052_remove_trsrevision_originator'),
]
operations = [
migrations.RenameField(
model_name='trsrevision',
old_name='originator_new',
new_n... |
#include "convirter/oci/blob.h"
#include "oci/blob.h"
#include "oci/config.h"
#include "oci/layer.h"
#include "oci/manifest.h"
#include "sha256.h"
#include "xmem.h"
#include <archive.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
struct cvirt_oci_blob *cvirt_... |
import sqlite3, os
def fetch_images(db):
con=sqlite3.connect(db)
query="select * from elements;"
cur = con.cursor()
cur.execute(query)
data = cur.fetchall()
con.close()
return data
def get_image_by_name(name,db):
con=sqlite3.connect(db)
query="select IMAGE,TYPE from elements where ... |
# This file contains DGL distributed samplers APIs.
from ...network import _send_nodeflow, _recv_nodeflow
from ...network import _create_sender, _create_receiver
from ...network import _finalize_sender, _finalize_receiver
from ...network import _add_receiver_addr, _sender_connect, _receiver_wait
from multiprocessing i... |
module.exports = (function (env) {
var config = {};
switch (env) {
case 'production':
config = require('./env/production');
break;
case 'development':
config = require('./env/development');
break;
case 'testing':
config = require('./env/testing');
break;
case 'sta... |
/* Generator object interface */
#ifndef Py_LIMITED_API
#ifndef Py_GENOBJECT_H
#define Py_GENOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
struct _frame; /* Avoid including frameobject.h */
typedef struct {
PyObject_HEAD
/* The gi_ prefix is intended to remind of generator-iterator. */
/* Note: gi_fr... |
import {
endent,
first,
flatten,
map,
mapValues,
pick,
property,
values,
} from '@dword-design/functions'
import stylelint from 'stylelint'
import config from '.'
const runTest = test => async () => {
test = { messages: [], output: test.code, ...test }
const messages =
stylelint.lint({
... |
define('model.timeslot',
['ko'],
function (ko) {
var TimeSlot = function () {
var self = this;
self.id = ko.observable();
self.start = ko.observable();
self.duration = ko.observable();
self.dateOnly = ko.computed(function () {
... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
import seaborn as sns
def SEIRVAC(beta,beta_v, p, p_v):
# Parametros
T_inc = 9 # Periodo de incubación(dias)
delta = 1 / T_inc # Tasa a la cual una persona deja la clase de expuestos. delta tasa de transferenc... |
import React from "react";
import "./links.css";
const LinksBox = (props) => {
return (
<div className="links-box" style={{ backgroundColor: props.bgColor }}>
{props.children}
</div>
);
};
class LinksButton extends React.Component {
render() {
return (
<div ... |
#!/usr/bin/env python
#
# License: BSD
# https://raw.github.com/yujinrobot/kobuki/hydro-devel/kobuki_testsuite/LICENSE
#
##############################################################################
# Imports
##############################################################################
import threading
impo... |
/**
* Copyright 2018 The AMP HTML 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 require... |
import { REDIRECT_TO, LSYNC_DATA_COMING } from '../actions/PureClientActions';
import { WS_SEND_MESSAGE, WS_RECEIVED_MESSAGE } from '../actions/WebSocketActions';
const mainScreen = (state = {
snapshots: []
}, action) => {
switch (action.type) {
case REDIRECT_TO.name:
return {
...state,
u... |
"""
GitLab API: https://docs.gitlab.com/ce/api/issues.html
"""
import re
import pytest
import responses
from gitlab.v4.objects import (
GroupIssuesStatistics,
IssuesStatistics,
ProjectIssuesStatistics,
)
@pytest.fixture
def resp_list_issues():
content = [{"name": "name", "id": 1}, {"name": "other_na... |
__author__ = 'Admin'
|
/*
* Copyright (C) 2020 Daniel Efimenko
* github.com/Danya0x07
*/
#include "tm1637.h"
#include "tm1637_port.h"
// Command sets
#define CS_DATA (1 << 6)
#define CS_DISPLAY (2 << 6)
#define CS_ADDRESS (3U << 6) // 11000000
// Data command set bits
#define BIT_READKEY 1
#define BIT_NOAUTOINC 2
// #d... |
import os
import pandas as pd
import pickle as pkl
import numpy as np
import argparse
import yaml
import librosa
import scipy
from scipy.io import wavfile
import multiprocessing
import time
import datetime
import socket
def resample_wav_data(wav_data, orig_sr, target_sr):
""" Resample wav_data from sampling rate ... |
g_db.quests[17613]={id:17613,name:"Get Red Register Tag",type:0,trigger_policy:3,on_give_up_parent_fail:1,on_success_parent_success:0,can_give_up:1,can_retake:1,can_retake_after_failure:1,on_fail_parent_fail:0,fail_on_death:0,simultaneous_player_limit:0,ai_trigger:0,ai_trigger_enable:0,auto_trigger:0,trigger_on_death:0... |
import React, { useState, useEffect } from 'react';
import ReactDOM from 'react-dom';
import { Radar } from '@ant-design/plots';
const DemoRadar = () => {
const [data, setData] = useState([]);
useEffect(() => {
asyncFetch();
}, []);
const asyncFetch = () => {
fetch('https://gw.alipayobjects.com/os/an... |
import React, { memo } from 'react';
import { Accordion, HorizontalLine } from 'components';
import { Box, Br, Cell, Pair, Row, Table } from 'components/Stats';
import { QUAKECRAFT as consts } from 'constants/hypixel';
import { useAPIContext } from 'hooks';
import * as Utils from 'utils';
/*
* Stats accordion for Quak... |
import os
import shutil
import cv2
import numpy as np
from PIL import Image, ImageTk
import pandas as pd
import datetime
import time
import sqlite3
from datetime import datetime
import pickle
import PySimpleGUI as sg
def TakeImages(uid):
Id = str(uid)
if not os.path.exists('VisitorImages/' + Id)... |
import os
import pytest
@pytest.mark.parametrize('channel', ['GitHub', 'Test-PyPI'])
def test_install(utils, config, tmpdir, sh, channel):
tmpdir.chdir() # Work in separate tmp dir
if channel == 'GitHub': # Try to install from GitHub repository
repo_dir = 'repo'
# Prepare venv and clone rep... |
//
// ZLBaseView.h
// ZLKit
//
// Created by Sunny Leong on 2021/1/6.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface ZLBaseView : UIView
@end
NS_ASSUME_NONNULL_END
|
"""Enhanced Pygame module for loading and rendering computer fonts"""
from pygame._freetype import (
Font,
STYLE_NORMAL, STYLE_OBLIQUE, STYLE_STRONG, STYLE_UNDERLINE, STYLE_WIDE,
STYLE_DEFAULT,
init, quit, get_init,
was_init, get_cache_size, get_default_font, get_default_resolution,
get_error, get_ve... |
/** @file
Copyright 2006 - 2016 Unified EFI, Inc.<BR>
Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full tex... |
import 'https://api.mapbox.com/mapbox-gl-js/v1.12.0/mapbox-gl.js';
mapboxgl.accessToken = 'pk.eyJ1IjoiZ3VhcmRyZXgiLCJhIjoiY2tvZnBkZmlqMGtyZTJ3bnJvdjJ0bWNhNiJ9.zvSwQMBflS5EjgC3dp4cyg';
export function addMapToElement(element) {
return new mapboxgl.Map({
container: element,
style: 'mapbox://styles/mapbox/str... |
function flyIn(obj){
$(obj).next().addClass('flyIn').one('animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd',function(){
$(this).removeClass('flyIn');
})
} |
goog.provide('ol.test.format.GML');
var readGeometry = function(format, text, opt_options) {
var doc = ol.xml.parse(text);
// we need an intermediate node for testing purposes
var node = goog.dom.createElement(goog.dom.TagName.PRE);
node.appendChild(doc.documentElement);
return format.readGeometryFromNode(no... |
import random
class Person:
female_names = ['Olivia',
'Emma',
'Ava',
'Sophia',
'Isabella',
'Charlotte',
'Amelia',
'Mia',
'Harper',
'Ev... |
def hello_thing(name, age):
print("Hello " + name + " I am " + str(age) + " years old.")
print("Hello Class")
hello_thing("Geoffery", 17)
print("Hi", "my name is", "Paul") |
var narrow = (function () {
var exports = {};
var unnarrow_times;
function report_narrow_time(initial_core_time, initial_free_time, network_time) {
channel.post({
url: '/json/report/narrow_times',
data: {initial_core: initial_core_time.toString(),
initial_free: initial_free_time.to... |
# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/
# Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# 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 wi... |
/*
* Copyright (c) 2006, 2007, 2008 QLogic Corporation. All rights reserved.
* Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License... |
(function() {
function UserModalCtrl($uibModalInstance, $cookies) {
/**
@method
@desc saves a new user and closes the modal window
param (name)
*/
this.setUsername = function() {
if (this.newUsername && this.newUsername !== '') {
$cookies.blocChatCurrentUser = this.... |
import React, {Component} from 'react'
import { connect } from 'react-redux'
import { debounce } from 'throttle-debounce'
import { bindActionCreators } from 'redux'
import { changeLocation } from '../store'
export class Search extends Component {
changeCity = (event) => debounce(1000, this.props.changeLocation(eve... |
import React, { Component } from "react"
import styled from "styled-components"
import { FaInstagram, FaFacebook, FaGoogle } from "react-icons/fa"
class Footer extends Component {
state = {
icons: [
{
id: 2,
icon: <FaInstagram className="icon facebook-instagram" />,
path: "https://w... |
#!/usr/local/lib/mailinabox/env/bin/python
#
# Checks that the upstream DNS has been set correctly and that
# TLS certificates have been signed, etc., and if not tells the user
# what to do next.
import sys, os, os.path, re, subprocess, datetime, multiprocessing.pool
import asyncio
import dns.reversename, dns.resolve... |
//
const fs = require('fs');
try {
const file = process.argv[2]; // [0] = node [1] = sync-file.js
const content = fs.readFileSync(file).toString();
const lines = content.split("\n").length;
console.log("Lines in file: " +lines);
} catch (error) {
console.log(error);
}
|
# Copyright 2022 The Kubeflow 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 or agreed to in ... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "utils.h"
int getResultByQuery(char * query, char * result)
{
FILE * stream;
char buf[128] = {'\0'};
stream = popen(query, "r");
fread(buf, sizeof(char), sizeof(buf), stream);
pclose(stream);
if (strlen(buf) != 0) {
st... |
import os
import math
import pytest
from .common import *
from helpers.cluster import ClickHouseCluster
from helpers.dictionary import Field, Row, Dictionary, DictionaryStructure, Layout
from helpers.external_sources import SourceMongo
SOURCE = None
cluster = None
node = None
simple_tester = None
complex_tester = No... |
"""
This module enables working with gunzip to open gzip files
The reason for this module is the following benchmark:
- with python gzip decoded to text:
$ time ./flipkart_read_all_clickstream.py
real 4m23.271s
user 55m55.884s
sys 1m28.552s
- with pipe from zcat:
$ time ./flipkart_read_all_clickstream.py
rea... |
DustIntl.__addLocaleData({"locale":"vun","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"},"fields":{"year":{"displayName":"Maka","relative":{"0":"this year","1":"next year","-1":"last year"},"relativeTime":{"future":{"other":"+{0} y"},"past":{"other":"-{0} y"}}},"month":{"displayNam... |
//
// RCRedPacketMessage.h
// MineSweeper
//
// Created by liuwu on 2018/9/25.
// Copyright © 2018年 liuwu. All rights reserved.
//
#import <RongIMLib/RongIMLib.h>
#define RCRedPacketMessageTypeIdentifier @"app:RedpackMsg"
@interface RCRedPacketMessage : RCMessageContent<RCMessageContentView>
// 红包ID
@property (... |
from django.db.models import QuerySet, Q
from house.models import House
def _filter_houses_by_form(form_data: dict, filtered_houses: QuerySet[House]) -> QuerySet[House]:
filtered_houses = filtered_houses.filter(public=True)
for key, value in form_data.items():
if value is not None and value != '':
... |
import argparse
import cv2
import json
import math
import numpy as np
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
import torch
from datasets.body25 import Body25ValDataset
from models.with_mobilenet import PoseEstimationWithMobileNet
from modules.keypoints_1 import extract_keypoints, g... |
// If debug available require it.
let debug; try { debug = require(`debug`)(`hoast-rename`); } catch(error) { debug = function() {}; }
/**
* Rename the path of files.
* @param {Object} options The module options.
*/
module.exports = function(options) {
debug(`Initializing module.`);
options = Object.assign({
... |
import argparse
import codecs
import cPickle as pkl
import numpy as np
from scipy import spatial
from operator import itemgetter
import matplotlib as ml
ml.use('Agg')
import matplotlib.pyplot as plt
from os import path
from sklearn.decomposition import TruncatedSVD
from sklearn.manifold import TSNE
import mpl_cfaces
fr... |
const gulp = require('gulp')
const nodemon = require('gulp-nodemon')
const mocha = require('gulp-mocha')
nodemon({
script: './app.js'
})
gulp.task('default', cb => {
})
gulp.task('test', cb => {
return gulp.src('test/*.test.js', { read: false })
.pipe(mocha({
reporter: 'spec'
}))
.once('end', proc... |
from fastapi.testclient import TestClient
from sub_applications.tutorial001 import app
client = TestClient(app)
openapi_schema_main = {
"openapi": "3.0.2",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/app": {
"get": {
"responses": {
... |
/**
* Copyright 2018 The AMP HTML 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 require... |
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["vendors~table"],{
/***/ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/vue2-dropzone/dist/vue2Dropzone.min.css":
/*!******************************************************************************************... |
GENIUS_API_TOKEN='XXXXXXXX.....'
import requests
from bs4 import BeautifulSoup
import os
import re
# Get artist object from Genius API
def request_artist_info(artist_name, page):
base_url = 'https://api.genius.com'
headers = {'Authorization': 'Bearer ' + GENIUS_API_TOKEN}
search_url = base_url + '/search?... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const build_1 = require("./build");
const Command = require('../ember-cli/lib/models/command');
// defaults for BuildOptions
exports.baseEjectCommandOptions = [
...build_1.baseBuildCommandOptions,
{
name: 'force',
type:... |
import os
from nornir.core import inventory
import pytest
import ruamel.yaml
yaml = ruamel.yaml.YAML(typ="safe")
dir_path = os.path.dirname(os.path.realpath(__file__))
with open(f"{dir_path}/../inventory_data/hosts.yaml") as f:
hosts = yaml.load(f)
with open(f"{dir_path}/../inventory_data/groups.yaml") as f:
... |
from heapq import *
from tabulate import tabulate
import matplotlib.pyplot as plt
# class for doing heap operations
class minHeap:
def __init__(self):
self.hea = []
def push_heap(self,ele):
heappush(self.hea,ele)
def pop_heap(self):
return heappop(self.hea)
... |
#!/usr/bin/env python3
"""Forward kinematic example using pinocchio
Sends zero-torque commands to the robot and prints finger tip position.
"""
import os
import numpy as np
from ament_index_python.packages import get_package_share_directory
import pinocchio
import robot_interfaces
import robot_fingers
if __name__ == ... |
from contextlib import suppress
import ibis.config_init # noqa: F401
import ibis.expr.api as api # noqa: F401
import ibis.expr.types as ir # noqa: F401
# pandas backend is mandatory
import ibis.pandas.api as pandas # noqa: F401
import ibis.util as util # noqa: F401
from ibis.common.exceptions import IbisError
fro... |
import React, { PropTypes } from 'react';
const Header = ({authenticated, signOut}) => {
return (
<header className="header">
<div className="g-row">
<div className="g-col">
<h1 className="header__title">Todo React Redux</h1>
<ul className="header__actions">
{authe... |
# Copyright (c) 2017 The PyBigQuery Authors
#
# 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, merge, publi... |
# Copyright (c) 2016, Xilinx, Inc.
# 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 code must retain the above copyright notice,
# this list of ... |
module.exports = {
siteMetadata: {
title: `Covid-19`,
description: `shows updated stats for covid 19.`,
author: `@suleiman-mayow`,
},
plugins: [
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/i... |