text stringlengths 2 999k |
|---|
"""
# tba_wildedeponien
This DAG updates the following datasets:
- [100070](https://data.bs.ch/explore/dataset/100070)
"""
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
from airflow.operators.docker_operator import DockerOperator
default_args... |
"""
tests.unit.runners.test_asam
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unit tests for the asam runner
"""
import logging
import salt.runners.asam as asam
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, patch
from tests.support.unit import TestCase
log = logging.getLogger(__na... |
from devpotato_bot.helpers import developer_only
@developer_only
def command_callback(_update, _context):
"""Generate error to be handled in error_handler"""
assert not 'a banana'
|
from Permainan import Permainan
class PermainanArcade(Permainan):
def __init__(self):
super().__init__();
def setNamaPemain(self, namaPemain: str) -> None:
super().setNamaPemain(namaPemain)
def setLevelPemain(self, levelPemain: int) -> None:
super().setLevelPemain(... |
from __future__ import absolute_import
from lnt.util import logger
from .profile import ProfileImpl
from .profilev1impl import ProfileV1
import os
import traceback
try:
from . import cPerf
except Exception:
pass
class LinuxPerfProfile(ProfileImpl):
def __init__(self):
pass
@staticmethod
... |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
from .random_sampler import RandomSampler
|
#!/usr/bin/env python3
# Collection of utility functions
import os
import sys
import yaml
import logging
import fcntl
import subprocess
import shutil
import requests
import time
import pyudev
import psutil
import apprise
import random
import re
# Added from pull 366
import datetime # noqa: F401
import psutil # noqa E... |
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th... |
#!/usr/bin/env python3
import os.path
from glob import glob
import sys
import logging as L
import datetime
class RunStatus:
"""This Class provides information about a PacBio sequel run, given a run folder.
It will parse information from the following sources:
*/*.subreadset.xml ?? for what ??
... |
import re
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
class TestSeriesReplace:
def test_replace(self, datetime_series):
N = 100
ser = pd.Series(np.random.randn(N))
ser[0:4] = np.nan
ser[6:10] = 0
# replace list with a single value
... |
import os
from collections import OrderedDict
import torch
import torch.nn as nn
from torch.nn.parallel import DistributedDataParallel
class BaseModel():
def __init__(self, opt):
self.opt = opt
self.device = torch.device('cuda' if opt['gpu_ids'] is not None else 'cpu')
self.is_t... |
from . import asserts
def test_access_tokens_list(api, access_token):
access_tokens = api.access_tokens.list()
assert len(access_tokens) >= 1
def test_access_token_can_be_created(api, access_token, access_token_params):
asserts.assert_resource(access_token)
asserts.assert_resource_params(access_token... |
import importlib
class BaseReader():
"""
Document to Element
"""
def __init__(self, package):
self.package = package
def link_to_path(self, link):
raise NotImplementedError("You have to implement link_to_path method.")
def extract(self, aspect_cls_or_str, property=""):
... |
# Copyright 2016-2018, Pulumi Corporation. All rights reserved.
from pulumi_aws import iam
lambda_role = iam.Role('lambdaRole',
assume_role_policy="""{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
... |
import requests, datetime, json2html, configparser
from obswebsocket import obsws
from obswebsocket import requests as obs_requests
from flask import Flask, render_template, Response
import youtube_streaming as yts
from optparse import OptionParser
import time, datetime, pytz
import os, random, shutil
from ptz_visca im... |
import os
import random
import json
from locust import HttpLocust, TaskSet, task
from lib.baseTaskSet import baseTaskSet
# TODO - make these config-driven
from lib.openstack.keystone import get_auth_token
from lib.openstack.nova import list_servers
from lib.openstack.nova import list_servers_detail
from lib.openstac... |
#!/usr/bin/env python3
"""
Converts the btab output of AAT (nap/gap2) to GFF3 format with option-dependent modeling.
Example input:
jcf7180000787896 Aug 28 2013 16242 /usr/local/packages/aat/nap /usr/local/projects/mucormycosis/protein_alignments/fungi_jgi/fungi_jgi.faa jgi|Rhior3|10928|RO3G_0120... |
#
# 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... |
import pandas as pd
import numpy as np
#Create a DataFrame
d = {
'Name':['Alisa','Bobby','jodha','jack','raghu','Cathrine',
'Alisa','Bobby','kumar','Alisa','Alex','Cathrine'],
'Age':[26,24,23,22,23,24,26,24,22,23,24,24],
'Score':[85,63,55,74,31,77,85,63,42,62,89,77]}
df = pd.DataFr... |
class Solution:
def lastStoneWeight(self, stones: List[int]) -> int:
import heapq
stones = [-val for val in stones]
heapq.heapify(stones)
while len(stones)>1:
stone1 = -heapq.heappop(stones)
stone2 = -heapq.heappop(stones)
if stone1==stone2:
... |
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from multiselectfield import MultiSelectField
import uuid
class RetailEnergyProvider(models.Model):
name = models.CharField(max_length=254, blank=True, null=True, unique=True)
image = models.ImageField(up... |
import torch
from torch import nn
from fastNLP import seq_len_to_mask
from fastNLP.modules import Embedding
from fastNLP.modules import LSTM
from fastNLP.modules import ConditionalRandomField, allowed_transitions
import torch.nn.functional as F
from fastNLP import Const
class CNNBiLSTMCRF(nn.Module):
def __init__... |
#!/usr/bin/python
a,b = 0,1
if a < b:
print('a ({}) est inférieur a b ({})'.format(a,b))
else:
print('a ({}) est suppérieur a b ({})'.format(a,b))
|
from __future__ import absolute_import, unicode_literals
from django.template.loader import render_to_string
from tuiuiu.tuiuiuembeds import embeds
from tuiuiu.tuiuiuembeds.exceptions import EmbedException
def embed_to_frontend_html(url):
try:
embed = embeds.get_embed(url)
# Render template
... |
# @Time : 2020/11/5, 2020/12/3
# @Author : Gaole He, Tianyi Tang
# @Email : hegaole@ruc.edu.cn, steventang@ruc.edu.cn
# UPDATE:
# @Time : 2020/12/8
# @Author : Gaole He
# @Email : hegaole@ruc.edu.cn
"""
textbox.quick_start
########################
"""
import torch
import logging
from logging import getLogger
fr... |
# Copyright (c) 2013-2014 Will Thames <will@thames.id.au>
#
# 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... |
import torch
import torch.nn as nn
class CLSA(nn.Module):
def __init__(self, base_encoder, args, dim=128, K=65536, m=0.999, T=0.2, mlp=True):
"""
:param base_encoder: encoder model
:param args: config parameters
:param dim: feature dimension (default: 128)
:param K: queue s... |
celsius = float(input('Digite a temperatura em °C: '))
print('A temperatura em Fahrenheit é {:.1f} °F.'.format(celsius * 1.8 + 32)) |
def bubble_sort(list1):
"""
It is similar is bubble sort but recursive.
:param list1: mutable ordered sequence of elements
:return: the same list in ascending order
>>> bubble_sort([0, 5, 2, 3, 2])
[0, 2, 2, 3, 5]
>>> bubble_sort([])
[]
>>> bubble_sort([-2, -45, -5])
... |
from detections import Load_Yolo_Model, yolo_predict
import random
import colorsys
from deep_sort import build_tracker
from config_parser import get_config
import torch
import argparse
import time
from yolov5.utils.datasets import letterbox
import tensorflow as tf
import numpy as np
import cv2
import os
os.environ['CUD... |
#!/usr/bin/env python
# encoding: utf-8
#
# This file is part of ckanext-doi
# Created by the Natural History Museum in London, UK
from datetime import datetime
from logging import getLogger
from ckanext.doi.helpers import get_site_title, now, package_get_year
from ckanext.doi.lib import (build_metadata, get_or_creat... |
# CUPS Cloudprint - Print via Google Cloud Print
# Copyright (C) 2011 Simon Cadman
#
# 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 3 of the License, or
# (at y... |
poem = '''There was a young lady named Bright,
Whose speed was far faster than light;
She started one day
In a relative way,
And returned on the previous night.'''
fout = open('relativity.txt', 'wt')
fout.write(poem)
fout.close() |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorboard/compat/proto/cpp_shape_inference.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message... |
#!/usr/bin/env python3
import argparse
import hypertoy
def main():
app = hypertoy.HyperToyApp(FakeServer)
app.add_argument("--content_file", nargs='?', type=argparse.FileType('r'))
app.add_argument("--status", default=555, type=int)
app.add_argument("--server", default="Funtime Server!")
args = app.parse... |
"""
1161. Maximum Level Sum of a Binary Tree
Given the root of a binary tree, the level of its root is 1, the level of its children is 2, and so on.
Return the smallest level X such that the sum of all the values of nodes at level X is maximal.
"""
# Definition for a binary tree node.
# class TreeNode:
# def __... |
#!/usr/bin/env python
#######################################################
# This is a Unit Test t that makes use of the Python #
# Module Sympy. #
#######################################################
import sympy as sym
from numpy import array, zeros, ones, shape
from nump... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... |
import requests
import httplib2
from bs4 import BeautifulSoup, SoupStrainer
import arrow
import database_model as db
http = httplib2.Http()
members_of_bundestag = requests.get('https://www.abgeordnetenwatch.de/api/v2/candidacies-mandates?parliament_period=111&range_end=999').json()['data']
session = db.get_session()... |
# To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
import torch
import librosa
import pickle
import soundfile as sf
from synthesis import build_model
from synthesis import wavegen
spect_vc = pickle.load(open('results.pkl', 'rb'))
device = torch.device("cuda")
model = build_model... |
import configparser
from dataclasses import dataclass
import argparse
@dataclass
class ReplaceAndroidArch:
arch: str
spec_file: str = "buildozer.spec"
def replace(self):
config = configparser.ConfigParser()
config.read(self.spec_file)
config["app"]["android.arch"] = self.arch
... |
import numpy as np
import json
import os
import cv2
import multiprocessing
import math
import random
import argparse
from PIL import Image, ImageDraw
def read_json_label_files(path):
data = None
with open(path,"r") as f:
text = f.read()
data = json.loads(text)
return data
def get_poly... |
from django.contrib import admin
from .models import Plan
class PlanAdmin(admin.ModelAdmin):
list_display = ('account', 'name', 'created')
list_filter = ('account',)
search_fields = ('account',)
ordering = ('-created',)
admin.site.register(Plan)
|
print("----------------")
print("hola mundo cruel")
print("----------------")
|
'''
Using this script to pre-train generator and discriminator
'''
from module.discriminator import Discriminator
from module.generator import Generator
from module.utils.dataset import EyeGlasses, Crop
from torchvision import transforms
from torch.utils.data import DataLoader
from torch import optim
impor... |
import argparse
from pathlib import Path
from random import random
from typing import Dict, Set
from binaryninja import BinaryView, BinaryViewType
from .instruction_data import InstructionData, get_instruction_data
from ..explanations import find_missing
find_missing()
SPACER = ""
def sample_instructions(bv: Bina... |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
try:
from gevent import monkey
except ImportError:
pass
else:
monkey.patch_all()
from solar.dblayer.gevent_patches import patch_all
patch_all()
|
# qubit number=2
# total number=8
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""Filters
Available Commands:
.addblacklist
.listblacklist
.rmblacklist"""
import asyncio
import re
import Bonten.plugin... |
from pathlib import Path
from Bio.PDB.Polypeptide import PPBuilder
from Bio.PDB import PDBParser
from PeptideConstructor import PeptideBuilder
from PeptideConstructor import Geometry
def compare_residues(r1, r2) -> bool:
if not r1 == r2:
return False
if not len(list(r1.get_atoms())) == len(list(r2.g... |
import json
import os
from keras.models import load_model
from keras.optimizers import SGD, Adam, RMSprop
from keras.callbacks import EarlyStopping, ModelCheckpoint, TensorBoard, ReduceLROnPlateau
from sklearn.model_selection import train_test_split
from .model import build
from .generator import BatchGenerator
from .... |
"""Unit test package for scipr."""
|
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
tt = ('1', '2', '3', '2', '4', '5', '1', '2', '3', '4', '5', '3', '3', '6', '7', '8')
'''
1 -> 2
2 -> 3
3 -> 4
'''
print(tt)
print(' --- count ---')
print(tt.count(1))
print(tt.count(2))
print(tt.count(3))
print(' --- index ---')
prin... |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
from ..utils import str_types
class MyVariantClientMixin:
'''Adding some utility methods specific to MyVariant.info API.'''
def get_hgvs_from_vcf(self, input_vcf):
'''
From the input VCF file (filename or file handle), return a generator
of genomic based HGVS ids.
:... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import datetime
import os
import sys
import nbformat
from jupyter_client.kernelspec import get_kernel_spec
from six import string_types, integer_types
from .conf import settings
from .exceptions import PapermillException, PapermillExec... |
from pfe.matrices.matrix import *
from pfe.matrices.plot_heatmap import plot_matrix
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from pfe.misc.log import Log
log: Log = Pretty()
log.info('Starting...')
data = Path('../../../data/graph/ig')
test_stuff = Path('test-data')
def plot_cumul... |
# Copyright 2015 Alex Brandt
#
# 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, ... |
'''
* 'show system status'
'''
# Metaparser
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengine import Any, Or, Optional
import genie.parsergen as pg
import re
# ===========================================
# Schema for 'show system status'
# ===========================================
cl... |
from manim import *
class SelfIntroduction(Scene):
def construct(self):
title = Tex("Frames of References") \
.scale(3) \
.set_color_by_gradient(GREEN, YELLOW)
names = Tex("Ashmita Bhattacharyya, Jerry Li, Jixin Chen") \
.set_color(BLUE) \
.next_to(t... |
from .defs import *
def count_seq(seq, match=''):
if not seq:
return 0
r = 0
if match == '':
try:
match = seq[0]
except IndexError:
return 0
for c in seq:
if c != match:
break
r+=1
return r
def peel_uint(s, d=None):
a,... |
import uuid
from django.core.cache import cache
from django.core.mail import send_mail
from django.http import HttpResponse, JsonResponse
from django.shortcuts import render, redirect
from django.template import loader
from django.urls import reverse
from App import order_status
from App.models import HomeWheel, Home... |
from reliapy.distributions.continuous import _Continuous
from scipy.stats import chi as prob
class Chi(_Continuous):
def __init__(self, df=None, loc=None, scale=None, random_state=None):
self.df = df
self.loc = loc
self.scale = scale
self.stats = prob.stats(df=self.df, loc=self.lo... |
# Copyright 2018 Google LLC
#
# 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 writing, ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, FinForce Consulting LLP and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
import frappe
import datetime
from frappe.model.document import Document
from dateutil.relativedelta import relativedelta
from... |
#!/usr/bin/env python
from __future__ import print_function
from ruffus.ruffus_utility import *
from ruffus import *
################################################################################
#
# test_ruffus_utility_parse_task_arguments.py
#
#####################################################################... |
import tensorflow as tf
import numpy as np
import os
import util as ut
import matplotlib.pyplot as plt
class dcgan():
def __init__(self, images, params, test_sample=None):
self.pm = params
images = tf.cast(images, tf.float32)
images = tf.image.resize_images(images, [self.pm['image_resize'], self.pm['image_re... |
import os
from .models import Entity, AnnotatedEntity, Concept, ICDCode, OPCSCode, ConceptDB
from medcat.cdb import CDB
from medcat.utils.vocab import Vocab
from medcat.cat import CAT
from medcat.utils.helpers import tkn_inds_from_doc, prepare_name
from medcat.utils.loggers import basic_logger
log = basic_logger("api.u... |
# 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 may ... |
# Generated by Django 3.1.1 on 2020-09-27 06:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0014_auto_20200927_0234'),
]
operations = [
migrations.AlterField(
model_name='user',
name='alias',
... |
# -*- coding: utf-8 -*-
"""Module to prepare the resultset."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import warnings
from influxdb.exceptions import InfluxDBClientError
_sentinel = object()
class ResultS... |
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# SLA Probe
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
... |
# -*- coding: utf-8 -*-
# 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... |
"""
=================================
Plotting EEG sensors on the scalp
=================================
In this example, digitized EEG sensor locations are shown on the scalp.
"""
# Author: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne.viz import plot_alignment, set_3d_view
... |
import os
import traceback
import uuid
from parallelm.common.bg_actor import BgActor
from parallelm.model.metadata import Metadata
from parallelm.model.model_env import ModelEnv
class ModelFetcher(BgActor):
POLLING_INTERVAL_SEC = 10.0
def __init__(self, mlops, model_filepath, ml_engine):
super(Model... |
# -*- coding: utf-8 -*-
{
'!langcode!': 'it',
'!langname!': 'Italiano',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" è un\'espressione opzionale come "campo1=\'nuovo valore\'". Non si può fare "update" o "delete" dei risultati ... |
"""
Django settings for oficina_django project.
Generated by 'django-admin startproject' using Django 3.2.9.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from ... |
# Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
import numbers
import os.path as osp
import mmcv
from mmedit.core import tensor2img
from ..registry import MODELS
from .basic_restorer import BasicRestorer
import numpy as np
import torch
import torchvision.transforms.functional as F
@MODELS.register_module()
class EDVR(BasicRestorer):
"""EDVR model for video s... |
# 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 app... |
# - Generated by tools/entrypoint_compiler.py: do not edit by hand
"""
Models.RankerEvaluator
"""
import numbers
from ..utils.entrypoints import EntryPoint
from ..utils.utils import try_set, unlist
def models_rankerevaluator(
data,
warnings=None,
overall_metrics=None,
per_instance_me... |
#!/usr/bin/env python
"""
Pandoc filter to inline SOLUTION 'html' blocks into markdown.
Works for RawInline and RawBlock.
"""
from pandocfilters import toJSONFilter, Str, Plain, Para
from subprocess import call, PIPE, Popen
import re
import json
SOL_RE = re.compile(r'^<!--\sSOLUTION\s+(?P<contents>.*)\s*SOLUTION\s+--... |
from model.contact import Contact
import re
from random import randrange
def clear(s):
return re.sub("[() -]", "", s)
def test_all_data_on_home_page(app):
if app.contact.count() == 0:
app.contact.create(Contact(firstname="test", lastname="lastname",
home="123", mobile="456", wor... |
# -*- coding: utf-8 -*-
'''
Python's multiprocessing.Pool class doesn't interact well with
``KeyboardInterrupt`` signals, as documented in places such as:
* `<http://stackoverflow.com/questions/1408356/>`_
* `<http://stackoverflow.com/questions/11312525/>`_
* `<http://noswap.com/blog/python-multiprocessing-keyboardin... |
from django.contrib.sitemaps import Sitemap
from django.conf import settings
from .util import get_template_directories, url_objects_from_file_tree
class StaticFlatpageSitemap(Sitemap):
changefreq = getattr(settings, 'STATICFLATPAGES_CHANGEFREQ', 'never')
priority = getattr(settings, 'STATICFLATPAGES_PRIORIT... |
# 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... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, omar jaber and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class MaterialDeliveryNote(Document):
pass
|
import logging
import numpy as np
import pickle
import random
from model import model
logger = logging.getLogger(__name__)
class CoreVAE(object):
""" Outlier detection using variational autoencoders (VAE).
Parameters
----------
threshold (float) : reconstruction error (mse) threshold used ... |
from nltk.tokenize import RegexpTokenizer
from nltk.corpus import stopwords
from stop_words import get_stop_words
from nltk.stem.porter import PorterStemmer
from gensim import corpora, models
from collections import defaultdict
from pprint import pprint
from datetime import datetime
import gensim
import os
import re
#... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import torch
class Matcher(object):
"""
This class assigns to each predicted "element" (e.g., a box) a ground-truth
element. Each predicted element will have exactly zero or one matches; each
ground-truth element may be matched to ... |
from pprint import pprint
import socket
import yaml
from netmiko import (
Netmiko,
NetmikoTimeoutException,
NetmikoAuthenticationException,
)
def send_show_command(device, commands):
result = {}
if type(commands) == str:
commands = [commands]
try:
with Netmiko(**device) as ssh... |
# Generated by Django 3.1.2 on 2020-10-05 16:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ReminderContent',
fields=[... |
import logging
import uuid
import hashlib
import tempfile
import time
from boto3.s3.transfer import TransferConfig
from botocore.exceptions import ClientError, WaiterError
import requests
from awsauth import S3Auth
import zenko_e2e.conf as conf
_log = logging.getLogger('util.bucket') # pylint: disable=invalid-name
... |
# Cutsence for Sengoku Era Questline | Honnou-ji : Precinct of Honnou-ji (811000011)
# Author: Tiger
PRINCESS_NO = 9000435
AYAME = 9130100
sm.lockInGameUI(True)
sm.hideUser(True)
sm.removeEscapeButton()
sm.blind(1, 255, 0, 0)
sm.sendDelay(1200)
sm.setSpeakerID(PRINCESS_NO)
sm.flipDialogue()
sm.sendNext("Your next ... |
'''
Author: Ankur Wasnik
Date 6th Jan 2020 22:17pm IST
Adaline means Adaptive linear neurons model
Difference between Perceptron and Adaline "
1. Perceptron compares true labels with net input. While , Adaline compares the output of activation function .
2. In Perceptron, weights are updated based on each training da... |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/player/shared_player_house_generic_large_style_01.iff"
result.attri... |
import discord
from redbot.core import checks, commands
from redbot.core.config import Config
from redbot.core.i18n import Translator, cog_i18n
from redbot.core.utils import chat_formatting as chat
from redbot.core.utils.mod import get_audit_reason
async def server_set(ctx):
"""Check if member has required role a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.