text stringlengths 3.07k 12.6k |
|---|
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# file: $Id$
# lib: templatealchemy.engine
# auth: <NAME> <<EMAIL>>
# date: 2013/07/03
# copy: (C) Copyright 2013 Cadit Health Inc., All Rights Reserved.
#------------------------------------------------------------... |
#!/usr/bin/env python
import dash
from dash.dependencies import Input, Output
import dash_html_components as html
import dash_table
import pandas as pd
import argparse
import re
import webbrowser
from collections import defaultdict
import pathlib
import os
app = dash.Dash(__name__)
def toId( s):
return s.replace... |
#!/usr/bin/env python
# -*- coding: Latin-1 -*-
"""
@file readPlot.py
@author <NAME>
@author <NAME>
@author <NAME>
@date 2008-07-26
@version $Id$
SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
Copyright (C) 2008-2017 DLR (http://www.dlr.de/) and contributors
This file is part of SUMO.
SUMO is f... |
#
# This file is part of BDC-Collectors.
# Copyright (C) 2020 INPE.
#
# BDC-Collectors is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
"""Driver for Access Data on DGI Server."""
import os
import re
import shutil
from datetime import... |
#-*- coding: utf-8 -*-
#
from gevent import monkey
monkey.patch_all()
import gevent
import sys
import requests
import argparse
import socket
import time
from gevent.pool import Pool
# from urllib3.util import url
from requests import RequestException
from collections import defaultdict, namedtuple
http_methods = ['G... |
"""Arbitrary classes of which instances can be interpreted
as :py:mod:`scipy` sparse matrices or 2D square :py:mod:`numpy` arrays
can be registered as abstract subclasses of :class:`GraphABC`.
This way all main classes/functions implemented in :mod:`pathcensus`
can automatically interpret them as graph-like objects all... |
#!/usr/bin/env python
#Use python 3
import sys
import math
import matplotlib.pyplot as plt
import numpy as np
print('version:{}'.format(sys.version))
'''
A very simple simulation of orifice flow in a 3 bottle PSA system, but with
no adsorption modeled. Just for simple testing.
Uses English units
'''
Ta... |
# Parent Library class
import json
import getpass
available_books = "files/available_books.json"
the_issued_books = "files/issued_books.json"
super_login = "files/super_user.json"
librarian_files = "files/librarian.json"
payment_file = "files/payment.json"
class Library:
""" This is the parent Library class """
... |
from SkinningTools.Maya import api, interface
from SkinningTools.Maya.interface import getInterfaceDir
from SkinningTools.Maya.tools import shared
from SkinningTools.Maya import api
from SkinningTools.UI.qt_util import *
from SkinningTools.UI.utils import *
from functools import partial
from maya import cmds
from maya ... |
import os
from io import BytesIO
from PIL import Image
import cv2
import tensorflow as tf
FLAGS = tf.app.flags
FLAGS.DEFINE_string('data_dir',
'/Users/Chenqi/3d-DenseNet-sagemaker/kth_video',
'Path to the input data')
FLAGS.DEFINE_string('train_output_path',
... |
"""
Copyright 2012-2019 <NAME>
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... |
from model import *
from data import *
import os
import glob
from PIL import Image, ImageOps
import numpy as np
from utils import *
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing.image import ImageDataGenerator
import matplotlib.pyplot as plt
TRAIN_FOLDER = "F:/Datasets/CRAG_LabServ... |
import numpy
import matplotlib.pyplot as plt
import matplotlib
from polymuse import constant
font = {'family' : 'normal',
'size' : 12}
matplotlib.rc('font', **font)
"""
The file contains functionality to evaluate the output from the various models
All functions take input as tarray the top level repres... |
import argparse
import netifaces
from scapy.all import *
import sys
import threading
quiet = False
stop_threads = False
def print_message(message: str):
"""
Print message to STDOUT if the quiet option is set to False (this is the default).
:param message: message to print
:return: None
"""
gl... |
"""
Module for statical analysis.
"""
from jedi import debug
from jedi.parser import tree
from jedi.evaluate.compiled import CompiledObject
from jedi.common import unite
CODES = {
'attribute-error': (1, AttributeError, 'Potential AttributeError.'),
'name-error': (2, NameError, 'Potential NameError.'),
'i... |
import torch
from model.backbone import resnet
import numpy as np
class conv_bn_relu(torch.nn.Module):
def __init__(self,in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1,bias=False):
super(conv_bn_relu,self).__init__()
self.conv = torch.nn.Conv2d(in_channels,out_channels, ker... |
from tkinter import Button, Entry, Frame, StringVar, Tk
# Raíz
raiz = Tk()
raiz.title("Calculadora")
raiz.iconbitmap("icon.ico")
# Frame
frame = Frame(raiz)
frame.pack()
# Variables
numero_pantalla = StringVar()
operacion = ""
resultado = 0
reset_pantalla = False
# Pantalla
pantalla = Entry(frame, textvariable=nume... |
import copy
import numpy as np
import torch
from sklearn.cluster import KMeans
from utils.checkings import *
from torch.optim.lr_scheduler import LambdaLR
os.environ["OMP_NUM_THREADS"] = "8" # Limit the CPU usage during KMeans clustering
def create_folders(names, data_dir):
datasets = ["ethucy", "SDD"]
folde... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2020-2021 <NAME> <<EMAIL>>
#
# Distributed under terms of the BSD 3-Clause license.
"""Comparison to the analytical solutions of subcritical flow benchmark.
"""
import pathlib
import numpy
import h5py
from matplotlib import pyplot
# pylint... |
import os
import time
from typing import Tuple, List, Union
import tensorflow as tf
def plot_model_svg(model: tf.keras.Model,
path: str):
from IPython.display import SVG
data = tf.keras.utils.model_to_dot(
model, show_shapes=True, show_layer_names=True, rankdir="TB").create("dot"... |
# General imports
import os, json, logging, pathlib
import click
import tempfile
import subprocess
import yaml
# From common
from luna_core.common.custom_logger import init_logger
from luna_core.common.DataStore import DataStore_v2
from luna_core.common.config import ConfigSet
from luna_pathology.co... |
# -*- coding:utf-8 -*-
__author__ = '<NAME>'
"""
Implementation of the end-to-end curiosity module.
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import optim
def process(tensor, normalize=False, range=None, scale_each=False):
"""Make a grid of images.
Args:
tensor ... |
from __future__ import print_function
from builtins import zip
from builtins import range
from builtins import object
import abc
import numpy as np
import scipy
import pandas as pd
import xarray as xr
from tqdm import tqdm
from pykrige import OrdinaryKriging
from .idw import Invdisttree
from ..util.temporal import agg... |
import math
from tkinter import *
import random
from itertools import permutations
from scipy.spatial import distance
root = Tk()
root.title("Найду Вам оптимальный путь")
N = 9
root.geometry(str(N*100) + "x" + str(N*100))
my_canvas = Canvas(root, width=N*100, height=N*100, bg="black")
my_canvas.pack(pady=1)
record... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
#!/usr/bin/env python
import sys
import os.path
import json
import shutil
import subprocess
import hashlib
import tarfile
import zipfile
import time
########################################################################################################
## The original script was created by ngld in https... |
# Copyright 2019 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... |
import os
import six
import random
from absl import flags
from absl import app as absl_app
import tensorflow as tf
from utils import vocab_utils
from comm_utils.flags import core as flags_core
"""Code Reference: Tensorflow official transformer model"""
# Number of files to split train and dev data
_TRAIN_SHARDS = 10... |
import tensorflow as tf
from tensorflow.python.util import tf_inspect
def hinge_discriminator_loss(
discriminator_real_outputs,
discriminator_gen_outputs,
real_weights=1.0,
generated_weights=1.0,
scope=None,
loss_collection=tf.GraphKeys.LOSSES,
reduction=tf.losses.Reduction.SUM_BY_NONZERO_... |
import pygame
from pygame.locals import *
import random
pygame.init()
clock = pygame.time.Clock()
fps = 60
screen_width = 864
screen_height = 936
screen = pygame.display.set_mode((screen_width, screen_height))
pygame.display.set_caption('Flappy Bird')
#define font
font = pygame.font.SysFont('Bauhaus 93', 60)
#def... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# Standard library
import sys
import time
import json
import subprocess
import sys
import time
import datetime
from collections import OrderedDict, namedtuple
from pprint import pprint
def load_libray():
try:... |
import wx
class FormObj:
pass
from src.wx.player import VideoPlayerPanel
class MoviesPanel(wx.Panel):
movie_data=[]
update_label = ["Save", "Update"]
edit_mode=False
selectedMovie=None
def __init__(self, parent, event_handler, tab_title, movie_controller):
super().__init__(parent, w... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
import re
from tensorflow.python.platform import gfile
from six import iteritems
from subprocess import Popen, PIPE
import numpy as np
def triplet_loss(anchor, positive, neg... |
"""
Common code for loading MoleculeNet datasets.
"""
import os
import logging
import deepchem as dc
from deepchem.data import Dataset, DiskDataset
from typing import List, Optional, Tuple, Type, Union
logger = logging.getLogger(__name__)
class TransformerGenerator(object):
"""Create Transformers for Datasets.
... |
import os
import sys
from argparse import Namespace, ArgumentParser
from pprint import pprint
from typing import Tuple, Dict
from pytorch_lightning import seed_everything
from pytorch_lightning.loggers import MLFlowLogger
from baseline.rf import RandomForest
from datasets import Hergophores, HERGClassifierDataModule
... |
"""VERY simple skeleton for plugin stuff
This is here mainly to make MQTT easier, this will almost defintiely change
significantly if/when a proper plugin system is implemented!
"""
import logging
import yaml
import stevedore
from future.utils import raise_from
from .util import exceptions
logger = logging.getLogge... |
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... |
""" Contains bindings for tensorflow.
Registers __array_function__ implementations for dealing with tensorflow Tensor objects.
"""
import numpy as np
import tensorflow as tf
import tensorflow.keras.backend as K
import tensorflow_probability as tfp
TENSORFLOW_BINDINGS = {}
__all__ = ["TENSORFLOW_BINDINGS", "implemen... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys, random
from PyQt5.QtWidgets import QMainWindow, QFrame, QDesktopWidget, QApplication, QHBoxLayout, QLabel
from PyQt5.QtCore import Qt, QBasicTimer, pyqtSignal
from PyQt5.QtGui import QPainter, QColor
from tetris_model import BOARD_DATA, Shape
from tetris_ai impor... |
# -*- coding: utf-8 -*-
#
#
# $Date: 2005/11/04 14:06:36 $, by $Author: ivan $, $Revision: 1.1 $
# The documentation of the module, hence the convention for the documentation of methods and classes,
# is based on the epydoc tool. This tool parses Python source files
# and generates API descriptions XHTML.
# The latest... |
# coding: utf-8
# created by deng on 2019-01-23
from utils.torch_util import set_random_seed
RANDOM_SEED = 233
set_random_seed(RANDOM_SEED)
import os
import sys
import torch
import json
import torch.nn.functional as F
from torch.utils.data import DataLoader
from datetime import datetime
import utils.json_util as ju... |
import pytest
from queryset_serializer.db.models import SerializerPrefetch
from queryset_serializer.serializers import (DefaultMetaQuerySetSerializer,
QuerySetMetaSerializer,
QuerySetSerializer, get_meta,
... |
from django.shortcuts import render, redirect
from django.db import transaction
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_POST, require_GET
from gui.utils import ... |
"""Some common functions for HTTP requests used by all API modules"""
import threading
from contextlib import contextmanager
from logging import getLogger
from os import getenv
from typing import Dict
from unittest.mock import Mock
from requests import Response, Session
import pyinaturalist
from pyinaturalist.constan... |
# -*- coding: utf-8 -*-
"""
CUDA-accelerated streaming operations
-------------------------------------
"""
from functools import partial
from itertools import repeat
from operator import iadd, imul
from subprocess import run, PIPE
import numpy as np
from . import array_stream, itercopy, nan_to_num, peek
# Determine... |
import random
import os
from random import randrange
from datetime import datetime, timedelta
class Prompts(object):
""" Holds Contest prompts """
def __init__(self, prompts: list=None):
self.prompts = prompts or list()
def add_prompt(self, prompt: str, after_index: int=0) -> bool:
"""Inse... |
import csv
import platform
import os
def char_range(c1, c2): # crea un iterador de carácters
"""Generates the characters from `c1` to `c2`, inclusive."""
for c in range(ord(c1), ord(c2) + 1):
yield chr(c)
class Sonder: # clase que sirve para explorar el sistema de ficheros
def __in... |
# Automated mark parsing Script
#
# Automatically generate csv for uploading back to the grade center on Connect
#
# Author: <NAME> (<EMAIL>)
# Version: 20161228-all-assignments-handback
import a1.parsingmodule as a1
import a2.parsingmodule as a2
import a3.parsingmodule as a3
import a4.parsingmodule as a4
import a5.pa... |
import os
import sys
import grequests
import logfetch_base
import time
from termcolor import colored
import callbacks
TASK_FORMAT = '/task/{0}'
S3LOGS_URI_FORMAT = '{0}/logs{1}'
REQUEST_FORMAT = '/request/{0}?excludeMetadata=true'
FILE_REGEX="\d{13}-([^-]*)-\d{8,20}\.gz"
progress = 0
goal = 0
def download_s3_logs(a... |
# Copyright 2020 Akamai Technologies, 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 or agreed to... |
from itertools import starmap
from warnings import warn
import numpy as np
from pandas import Series, DataFrame
from skgof import ks_test, ad_test
from scipy.stats import genpareto
def ecdf_p_value(test_statistics: Series, null_distribution: DataFrame, ecdf_pseudocount=1):
# note: using biased p-value estimator ... |
"""Get WHOIS information for a given host."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from datetime import datetime, timezone
from typing import cast
from whois import Domain
from homeassistant.components.sensor import (
SensorDeviceClass,
Sen... |
import os
import time
import math
import torch
from eval import *
import torch.nn as nn
from utils import evalIoU
from networks import get_model
from torch.autograd import Variable
from dataloader.dataset import NeoData
from torch.utils.data import DataLoader
from dataloader.transform import MyTransform
from torchvisi... |
import re, nltk, string, TurkishStemmer
import pandas as pd
import numpy as np
import fuzzywuzzy
from sklearn.model_selection import train_test_split
# Performance Metrics
from sklearn.metrics import mean_squared_error
# PLOT
import matplotlib.pyplot as plt
import seaborn as sns
pd.set_option("display.max_co... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
import time
import os
import sys
# Train on CPU (hide GPU) due to memory constraints
os.environ['CUDA_VISIBLE_DEVICES'] = ""
import tensorflow as tf
import scipy.sparse as sp
import argparse
import nu... |
#!/usr/bin/env python3
__description__ = "stamp-extractor, use it to extract german stamps from downloaded pdf stamp from shop.deutschepost.de"
__author__ = "<NAME>"
__version__ = "0.1.0"
__date__ = "2021/11/26"
__minimum_python_version__ = (3, 6, 0)
__maximum_python_version__ = (3, 9, 7)
import sys
import glob
impor... |
FILE = "days/18/input.txt"
class TreeNode(object):
def __init__(self, value=None):
self.children = []
self.value = value
self.parent = None
def add_child(self, child):
"""
Add a child under this node. Max of 2 allowed!
"""
assert(len(self.children) <... |
import backend
import pygame
import datetime
# Gives the current number of milliseconds since epoch
def msecs_since_epoch():
epoch = datetime.datetime(1970, 1, 1)
diff = datetime.datetime.now() - epoch
return (diff.microseconds * 1000)
# Provides the display for the simulation and allows interaction
class... |
import math
import numpy as np
from .. import util
from ..array import extent
from ..util import divup, Assert
try:
import parakeet
parakeet.config.backend = 'c'
jit = parakeet.jit
except:
def jit(fn):
return fn
def tiles_like(array, target_shape):
orig_shape = array.shape
orig_tile = array.tile_sha... |
"""
retrohotspot
~~~~~~~~~~~~
This is a traditional hotspotting technique. A window of past data (values
around two months seem to be common) is used; the timestamps of the data are
then ignored. Around each point we lay down a kernel: typically this is
localised in space, e.g. a "quartic" kernel with a certain band... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import requests
from flask import Flask
from flask.ext.restful import Api, Resource
from flask.ext.restful.reqparse import RequestParser, Argument
from werkzeug.datastructures import FileStorage
from imgtl.db import db, log_db, User
from imgtl.const import BASE... |
from django.db import models
from django.db.models import Count, Sum
from utils.utils import file_extension, django_now
from django.utils.text import slugify
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from web.models import User
# Create your models here.
#Common fields th... |
# 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... |
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework 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
... |
"""
test_build_linkcheck
~~~~~~~~~~~~~~~~~~~~
Test the build process with manpage builder with the test root.
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import json
import re
from unittest import mock
import pytest
@pytest.mark.s... |
import tensorflow.compat.v1 as tf
from tensorflow.keras import layers as tfkl
import numpy as np
import tools
class Encoder(tools.Module):
"""
Multi-level Video Encoder.
1. Extracts hierarchical features from a sequence of observations.
2. Encodes observations using Conv layers, uses them directly fo... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-strict
from contextlib import contextmanager
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Iterable, Iter... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import pulumi
import pulumi.runtime
from .. import utilities, tables
class GetImageResult(object):
"""
A collection of values ... |
import time
import os
import pandas as pd
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms, models
import json
from PIL import Image
def loaders(batch_size, data_dir):
train_dir = data_dir + '/tra... |
# Copyright 2019-2020 Arm Limited.
# SPDX-License-Identifier: Apache-2.0
#
# 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... |
import os
from typing import Iterable, Optional, Tuple, Union
import gin
import tensorflow as tf
import kblocks.extras.callbacks as ecb
import kblocks.keras.callbacks as kcb
from kblocks.data.repeated import RepeatedData, dataset_and_steps
from kblocks.experiments.core import Experiment
from kblocks.models import fit... |
# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
#
# SPDX-License-Identifier: GPL-2.0
# Test operation of the "if" shell command.
import os
import os.path
import pytest
# The list of "if test" conditions to test.
subtests = (
# Base if functionality.
('true', True),
('false', False),
... |
import asyncio
import logging
import discord
from discord import message_command
from discord.commands import context
from discord.ext import commands
from chiya import config
from chiya.utils import embeds
log = logging.getLogger(__name__)
@commands.Cog.listener()
async def on_ready(self) -> None:
"""
Re... |
# pylint: disable=wrong-or-nonexistent-copyright-notice
"""An example demonstrating Bell's theorem.
Bell's theorem or inequality proves that entanglement based
observations can't be reproduced with any local realist theory [1].
This example shows Bell's inequality in form of CHSH game where two
players Alice and Bob ... |
"""Unit tests and functional tests for the pod.py package
"""
from __future__ import division, print_function
import numpy as np
import math
from pod import *
from example2sys import *
import unittest
from numpy.testing import assert_array_equal, assert_array_almost_equal
def _number_to_array(s):
return np.arra... |
"""Used to get baseline score. Models include Xception, Squeeze-Excitation Inception Resnet V2 and EfficientNetB3
"""
import os
from pathlib import Path
from multiprocessing import cpu_count
import random
import numpy as np
from sklearn.utils.class_weight import compute_class_weight
import tensorflow as tf
import kera... |
from collections import Counter
from . import evaluator
class Keyboard():
"""
キーボードを表すクラス
"""
def __init__(self, name, keytop, hand, finger, row, column, arpcol):
"""
# レイアウト名(Heatmapのレイアウト名に合わせる)
'QWERTY',
# 文字
'1234567890-^|qwertyuiop@[asdfghjkl;:]zxcvbnm,./_',... |
import torch
from torch.distributions import constraints
from torch.distributions.uniform import Uniform
from torch.distributions.transformed_distribution import TransformedDistribution
from torch.distributions.transforms import AffineTransform, PowerTransform
from torch.distributions.utils import broadcast_all
from to... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : imgproc.py
# Author : <NAME>
# Email : <EMAIL>
# Date : 01/19/2018
#
# This file is part of Jacinle.
# Distributed under terms of the MIT license.
import math
import functools
import numpy as np
from jacinle.utils.argument import get_2dshape
from jacinle.... |
from typing import Optional
import igraph as ig
import numpy as np
from ..._compat import Literal
from ._fr_size_aware_layout import layout_fr_size_aware
def layout_components(
graph: ig.Graph,
component_layout: str = "fr_size_aware",
arrange_boxes: Literal["size", "rpack", "squarify"] = "squarify",
p... |
#!/bin/env python
from bs4 import BeautifulSoup
from bs4.element import Tag
from requests import get
from requests.exceptions import RequestException
from contextlib import closing
from datetime import date
import json
#
# static definitions
#
class MovieNightDefs:
imdb_url = 'https://www.imdb.com/'
imdb_url... |
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
import torchvision.datasets as datasets
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from Models.DCGAN.Discriminator import Discriminator
from Model... |
#!/usr/bin/env python3
import datetime
import logging
import os
import random
import shlex
import shutil
import string
import subprocess
import tempfile
import fire
import parsedatetime
import whoosh
import whoosh.fields
import whoosh.index
import whoosh.qparser
import yaml
class GitTask:
"""Git-task is a task ... |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2018, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# --------------------------... |
import uuid
import codecs
import json
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateNumbers, RSAPublicNumbers, \
generate_private_key, rsa_crt_dmp1, rsa_crt_dmq1, rsa_crt_iqmp, RSAPrivateKey
from .key import Key
from .algorithms import R... |
import argparse
import better_exceptions
from pathlib import Path
from contextlib import contextmanager
import urllib.request
import numpy as np
import cv2
import dlib
import torch
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torch.nn.functional as F
fr... |
# coding = utf-8
# The MIT License (MIT)
# Copyright (c) 2015 by <NAME> (<EMAIL>)
#
# 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... |
__all__ = [
'BaseLayoutV1',
'BarsLayoutV1',
'ColumnsLayoutV1',
'SideBySideLayoutV1',
'SidebarLayoutV1'
]
from enum import Enum, unique
from typing import List
from ...primitives.base import attribute
from .base import BaseComponent, ComponentType, VersionedBaseComponentMetaclass, base_component_or... |
#__BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance ... |
"""Classification Report"""
# Authors: <NAME>
# License: BSD 3 clause
import numpy as np
from sleepens.analysis import multiconfusion_matrix
def calculate_statistics(Y_hat, Y, beta=1, average=None):
"""
Calculate the precisions, recalls, F-beta scores, and
supports for each class in `targets`.
Pa... |
"""Write output to an HTML file."""
from collections import defaultdict
from datetime import datetime
from html import escape
from itertools import cycle
from jinja2 import Environment, FileSystemLoader
from spacy import displacy
OPTIONS = {
'colors': {
'GENUS': '#a6cee388',
'SCI_NAME': '#1f78b4... |
from collections import namedtuple
import os
import json
import numpy as np
from tqdm import tqdm
from data_generators.utils import load_image_rgb
# Copied from: https://github.com/mcordts/cityscapesScripts/blob/master/cityscapesscripts/helpers/labels.py
#
# Cityscapes labels
#
#-------------------------------------... |
#!/usr/bin/env python3
import os
import sys
import random
import numpy as np
src = open("input.txt", "r").readlines()
example = """
be cfbegad cbdgef fgaecd cgeb fdcge agebfd fecdb fabcd edb | fdgacbe cefdb cefbgd gcbe
edbfga begcd cbg gc gcadebf fbgde acbgfd abcde gfcbed gfec | fcgedb cgb dgebacf gc
fgaebd cg bdaec... |
import matplotlib
matplotlib.use('Agg')
from matplotlib.collections import PolyCollection
from numpy.fft import fft, fftfreq, fftshift
from locker import mkdir
from locker.analysis import *
from locker.data import *
from scripts.config import params as plot_params, FormatedFigure
def generate_filename(cell, contrast)... |
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
riko.modules.subelement
~~~~~~~~~~~~~~~~~~~~~~~
Provides functions for extracting sub-elements from an item
Sometimes the data you need from a stream is buried deep in its hierarchy. You
need to extract just those select sub-elements from the stream. This is what ... |
"""High-pass filter and locally detrend the EEG signal."""
import logging
import mne
import numpy as np
from pyprep.utils import _eeglab_create_highpass, _eeglab_fir_filter
def removeTrend(
EEG,
sample_rate,
detrendType="high pass",
detrendCutoff=1.0,
detrendChannels=None,
matlab_strict=Fals... |
"""
Manages and updates the game state every frame and sets up new games
"""
from random import randint
import config
from . import collisionDetector, gameData
import dataModels
from serverLogic import serverData
from serverLogic.logging import logPrint
def startGame():
"""
Starts a new game
"""
game... |
import speech_recognition as sr
import datetime
import webbrowser as wb
import os
import pyttsx3
import wikipedia
import pywhatkit
import pyjokes as pj
import smtplib
import requests
from bs4 import BeautifulSoup
import winsound
import operator
engine = pyttsx3.init()
def sendmail():
recivers = ['<EMAIL>'... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
import time
import math
from util import EnVietDataset, collate_fn
from attention_network import AttnEncoderRNN, AttnDecoderRNN
def train(input_batch, ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# copyright 2014 <NAME> <<EMAIL>>
# Modified from code by <NAME> <<EMAIL>>
# 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.apa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.