text stringlengths 3.07k 22.1k |
|---|
from __future__ import annotations
import json
import logging
import os
import sys
from hashlib import pbkdf2_hmac, sha256
from typing import TYPE_CHECKING, Any, List, Sequence, Union
import boto3
import pydgraph
from grapl_analyzerlib.node_types import (
EdgeRelationship,
EdgeT,
PropPrimitive,
PropTy... |
import random,pygame,sys
from pygame.locals import *
import numpy as np
WINDOWWIDTH = 1400
WINDOWHEIGHT = 1300
BOXSIZE = 100
GAPSIZE = 200
GRAY = (100, 100, 100)
NAVYBLUE = (60 ,60,100)
WHITE = (255,255,255)
RED = (255,0,0)
GREEN = (0,255,0)
BLUE = (0,0,255)
YELLOW = (255,255,0) # walking value = 0
ORANGE = (255,12... |
# Copyright 2020 Google LLC.
#
# 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 conditions and the following disclaimer.
#
#... |
"""
Three dimensional fractal generator.
Creates fractals based on 3 shapes - cube, tetrahedron and pyramid.
Fractal shape is defined by config tuple - info in README
Outputs tuple suitable for usage in simple_renderer.py - info in README
GENERATION METHODS:
generate_cube - generates cube-based fractal mesh
generate_... |
import idaapi
import idautils
import idc
from . import base
from .. import core
from .. import exceptions
OPND_WRITE_FLAGS = {
0: idaapi.CF_CHG1,
1: idaapi.CF_CHG2,
2: idaapi.CF_CHG3,
3: idaapi.CF_CHG4,
4: idaapi.CF_CHG5,
5: idaapi.CF_CHG6,
}
OPND_READ_FLAGS = {
0: idaapi.CF_USE1,
1: ... |
#!/usr/bin/env python
#==============================================================================
# Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License"). You may not use
# this file except in compliance with the License. A copy of the... |
"""Gitlab service support.
API docs: https://docs.gitlab.com/ee/api/
"""
from dateutil.parser import parse as parsetime
from snakeoil.klass import aliased, alias
from urllib.parse import urlparse, urlunparse, quote_plus
from ._jsonrest import JsonREST
from ..exceptions import RequestError, BiteError
from ..objects i... |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import copy
import numpy as np
import torch
import torchvision.models as models
import torch.nn as nn
import torchvision.transforms as transforms
import torch.nn.functional as F
from torch.autograd import Vari... |
# -*- coding: utf-8 -*-
from abc import abstractmethod
import numpy as np
__all__ = ['BinaryGeneticAlgorithm']
def even(n): return n % 2 == 0
def odd(n): return not even(n)
class GeneticAlgorithm:
"""
Binary Generic algorithm for continuous problems.
positional arguments:
fnc : Callable
... |
# -*- coding: utf-8 -*-
"""
This module provides an interface for data elements to be generated
by an image sampler.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import copy
import numpy as np
import tensorflow as tf
# pylint: disable... |
# dataset - preparing data and adding label noise
from __future__ import print_function
import torch
from PIL import Image
import os
import os.path
import numpy as np
import sys
if sys.version_info[0] == 2:
import cPickle as pickle
else:
import pickle
import torch.utils.data as data
from torchvision.datasets.ut... |
import math
from typing import List, Tuple
import cv2
import numpy as np
from pedrec.models.constants.skeleton_pedrec import SKELETON_PEDREC_IDS
from pedrec.models.data_structures import ImageSize
from pedrec.models.human import Human
from pedrec.tracking.color_tracking import get_color_similarity
from pedrec.trackin... |
"""
################################################################################
expressionVar_bins.py
parser for the expression variation data from http://www.weigelworld.org/resourc
es/microarray/AtGenExpress/AtGE_dev_gcRMA.txt.zip/ (which is no longer hosted).
Also take output from Affymetrix MAS5 software (B... |
import podatkovne_strukture as ps
from collections import defaultdict
import itertools
from random import choices
from copy import deepcopy
# Generira funkcijo, ki doloca igralno strategijo:
def strategija(q, e):
def izberi_akcijo(state):
akcije = q[state.pretvori_v_niz()]
se... |
# -------- energy in eV, temperature in K
from __future__ import division
import sys
import math
import numpy as np
import scipy.constants
from scipy.constants import eV, physical_constants
from scipy.optimize import brentq
from scipy.integrate import cumtrapz, trapz, simps
from scipy.interpolate import interp... |
# Flask packages
from flask import Flask, render_template, request, session, redirect, flash, send_file
from flask_bootstrap import Bootstrap
from flask_uploads import UploadSet,configure_uploads,IMAGES,DATA,ALL
# Systems
import os
import sys
import json
import string
from werkzeug.utils import secure_filename
impor... |
import asyncio
import datetime as date
import time
import re
import discord as ds
import JukeBox as juke
#TODO:
#Fix process permissions to work on raspberry pi
#Integrate me by copying https://discordapp.com/oauth2/authorize?&client_id=168310783900385280&scope=bot&permissions=0 into your browser!
ready = False
now =... |
# Based on https://github.com/giangpol/NLU-Evaluation-Scripts/tree/master/nlu_converters
import json
import shutil
import os
import hashlib
import zipfile
def parse_data(path):
X = []
y = []
docs = {}
with open(path, 'r') as f:
for line in f:
splitted = line.split(',')
... |
import smbus
POWER_CTL = 0x2D
POWER_CTL_OFF = 0x01
POWER_CTL_ON = ~POWER_CTL_OFF
POWER_CTL_DRDY_OFF = 0x04
POWER_CTL_DRDY_ON = ~POWER_CTL_DRDY_OFF
POWER_CTL_TEMP_OFF = 0x02
POWER_CTL_TEMP_ON = ~POWER_CTL_TEMP_OFF
RANGE = 0x2C
RANGE_MASK = 0x03
RANGE_2G =... |
import copy
from assemblyline.common.charset import safe_str
from assemblyline.common.user_defaults import ACCOUNT_DEFAULT, ACCOUNT_USER_MODIFIABLE, SETTINGS_DEFAULT
from assemblyline.al.common import forge
from assemblyline.al.common.remote_datatypes import Hash
from al_ui.config import LOGGER, STORAGE
from al_ui.he... |
"""
Various routines for dealing with generating input and processing output
for abstracted records of experimental tests.
These routines do things like:
* Convert simplified descriptions of tests into strain/strain time
histories that the models can use
* Generate random experiments and the corr... |
#-------------------------------------------------------------------------------
# Author: hjiang
# Email: <EMAIL>
# Time: Thu Nov 18 13:40:09 2021
#-------------------------------------------------------------------------------
from DataPlatForm.BasicUtils import *
from DataPlatForm.configs import *
from clickhouse_dr... |
import logging
from typing import List
import lxml
import re
from django.db import transaction
from django.urls import resolve, Resolver404
from django.urls import reverse
from tkapi.persoon import Persoon as TKPersoon
from tkapi.document import Document as TKDocument
from tkapi.document import DocumentSoort as TKDo... |
# -*- coding:utf-8 -*-
# precess the first frame of video
import numpy as np
import tensorflow as tf
import src.convolutional as conv
import src.ConvNetValue_Class as cnvc
def frame_init(img, bbgt, npad_value):
# bbgt is a np-type data
# img is a value, not a tensor
graph_fi = tf.Graph()
# TODO: <> ac... |
# Generated from /home/kraken/ppl-course/tutorial/week6/problem2/src/main/mc/parser/MC.g4 by ANTLR 4.7.1
# encoding: utf-8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u778... |
import os
from lxml.etree import Element, SubElement, tostring
from xml.dom.minidom import parseString
from data_augmentation.utils import io_utils,xml_store
import xml.etree.ElementTree as ET
import cv2
import numpy as np
def get_label(xml_path):
et = ET.parse(xml_path)
element = et.getroot()
element_objs ... |
import multiprocessing
import numpy as np
from functools import partial
import pandas as pd
pd.options.mode.chained_assignment = None
from sklearn import preprocessing
from joblib import dump, load
# For generation of enrichment heatmap values in Fig 6D.
# Values were used in Excel to generate heatmap.
# Python scri... |
"""
Functions to scrape by season, games, and date range
"""
import hockey_scraper.json_schedule as json_schedule
import hockey_scraper.game_scraper as game_scraper
import hockey_scraper.shared as shared
import pandas as pd
import time
import random
# This hold the scraping errors in a string format.
# This may seem... |
#!/usr/bin/env python
''' find contour '''
import cv2
import numpy as np
from myutil import read_setting
'''
| distance (mm) | pixel per mm | D * P |
|---------------|---------------|---------|
| 474 | 1.96 | 929.04 |
| 648 | 1.44 | 933.12 |
| 1004 | 0.96 ... |
"""txcelery
Copyright Sentimens Research Group, LLC
2014
MIT License
Module Contents:
- DeferredTask
- CeleryClient
"""
import logging
import threading
from builtins import ValueError
from datetime import datetime
from random import random
from typing import Any, Dict
import redis
from celery import __version... |
import contextlib
from io import BytesIO
import pytest
from clldutils.iso_639_3 import Code
from pyglottolog import iso
@pytest.fixture
def iso_data(mocker):
read_url = mocker.patch('pyglottolog.iso.read_url')
read_url.side_effect = [
"""\
Id Ref_Name Ret_Reason Change_To Ret_Remedy Effective
fri We... |
import argparse
import os
import datetime
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.utils.data import DataLoader
import torch.optim as optim
import numpy as np
from sklearn.metrics import f1_score
from maskrcnn_benchmark.config import cfg
from maskrcnn_benchmark.utils.miscellan... |
from collections import defaultdict
import json
import math
import enum
from time import sleep
import networkx as nx
import numpy as np
from typing import Dict, List, Set, Tuple
from networkx.algorithms.dag import descendants
from numpy import ndarray, vectorize
def sigmoidal(x: float):
# print(x)
if (x < -4... |
from django.views.generic import TemplateView
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from rest_framework import views, status
from rest_framework.response import Response
from posts.helpers import get_follow_request, get_user, get_local_user, get_w... |
import pandas as pd
import argparse
import os
import glob
import numpy as np
from itertools import product
class Subject:
pulse_dir = 'pulse_dir' # Can be modified from the command line
def __init__(self, name, label_df):
"""
variables:
name(subject name)
pulse_data: ... |
# vim: set ts=8 sts=2 sw=2 tw=99 et:
#
# This file is part of AMBuild.
#
# AMBuild 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 your option) any later version.
#
# ... |
import time,os,sys,shutil,platform,logging
current_script_path = __file__
project_root = os.path.realpath(os.path.join(current_script_path, os.path.pardir))
sys.path.append(project_root)
from serif.viewer import write_all_pages
logger = logging.getLogger(__name__)
def is_exe(fpath): # Is the given path an executa... |
"""
DC version of ceas
"""
from samflow.command import ShellCommand, PythonCommand
from samflow.workflow import attach_back
from chilin2.modules.ceas.qc import stat_ceas, stat_bedAnnotate
def bedtools_ceas(workflow, conf): # use bedtools
"""
#################################################################... |
"""Demo for using Communications Module."""
import argparse
import logging
import os
import re
import sys
from configparser import ConfigParser
from configparser import ExtendedInterpolation
from pathlib import Path
from typing import Any
from typing import Dict
from typing import List
import konsole
from faker import... |
#!/usr/bin/python2
#
# Copyright 2013 by Idiap Research Institute, http://www.idiap.ch
#
# See the file COPYING for the licence associated with this software.
#
# Author(s):
# <NAME>, May 2013
#
import numpy as np
import scipy.signal as sp
import matplotlib.pyplot as plt
from . import core
from . import ar as AR
de... |
#!/usr/bin/env python3
# @Time : 8/5/20 3:43 PM
# @Author : fangcheng.ji
# @FileName: bifpn.py
import torch
from torch import nn
from torch.nn import functional as F
import math
import fvcore.nn.weight_init as weight_init
from detectron2.modeling.backbone import Backbone
from detectron2.modeling.backbone.build i... |
"""
Main function for traininng DAG-GNN
"""
import argparse
import datetime
import math
import os
import pickle
import time
import matplotlib.pyplot as plt
import networkx as nx
from networkx.convert_matrix import from_numpy_matrix
import numpy as np
import pandas as pd
import torch.optim as optim
from torch.optim im... |
"""Install JSON Model"""
# standard library
import os
import uuid
from enum import Enum
from typing import Dict, List, Optional, Union
# third-party
from pydantic import BaseModel, Field, validator
from pydantic.types import UUID4, UUID5, constr
from semantic_version import Version
# first-party
from tcex.pleb.none_m... |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import os
import io
import tensorflow.compat.v1 as tf
import pandas as pd
import json
import numpy as np
from PIL import Image
from object_detection.utils import dataset_util
from collections import namedtuple... |
#!/usr/bin/python
"""
Docker Entrypoint
"""
import json
import logging
import math
import os
import pathlib
import sys
from copy import copy
from subprocess import run, call
from typing import Dict, List
import coloredlogs
import yaml
import yamale
SCRIPTS_PATH = os.getenv("SCRIPTS_PATH", "/scripts")
sys.path.app... |
# -*- coding: utf-8 -*-
"""
.. Authors
<NAME> <<EMAIL>>
<NAME> <<EMAIL>>
<NAME> <<EMAIL>>
A set of mathematical utilities and vector convenience functions for XICSRT.
"""
import numpy as np
def distance_point_to_line(origin, normal, point):
o = origin
n = normal
p = point
t = np.dot(p - ... |
import json
class Record:
startRegister = 0
endRegister = 1
numberOfRegisters = 2
description = 'L1 to Earth'
recordType = 'Single'
address = ''
dataValue = ''
units = ''
def __init__(self, startRegister, numberOfRegisters, description, recordType = None, units = ''):
... |
"""
Created by <NAME> on 05.11.20
jan.schiffeler[at]gmail.com
Changed by
"""
from math import asin, acos, sin, cos, pi
import numpy as np
def computer_operation(gene, register):
"""
Function to Computer Operation
Parameters
----------
gene : Gene for which the operation must be compute... |
import bpy
import math
from bpy.props import *
from itertools import chain
from functools import lru_cache
from ... base_types import AnimationNode, TextUIExtension
drawTextByIdentifier = {}
class ViewerNode(bpy.types.Node, AnimationNode):
bl_idname = "an_ViewerNode"
bl_label = "Viewer"
bl_width_default =... |
# Copyright 2020 gRPC 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 writing... |
#!/usr/bin/env python3
from pyroute2 import IPRoute
from pyroute2 import IPDB
from socket import AF_INET, AF_INET6
def GetNow():
ip = IPRoute()
ret = {}
for route in ip.get_routes() + ip.get_routes(family=AF_INET6):
if route.get_attr('RTA_GATEWAY'):
try:
ret['routes']... |
from django.shortcuts import render, redirect, get_object_or_404
from Organizer.models import OrganiseEvent, EventDetails, ShareResource
from Participant.models import ParticipateEvent, EventFeeback
from accounts.models import UserProfile
from django.contrib.auth.models import User
from django.utils import timezone
fro... |
from datetime import datetime
from typing import List
from taskmgr.lib.logger import AppLogger
from taskmgr.lib.model.calendar import Calendar, Today
from taskmgr.lib.model.day import Day
from taskmgr.lib.model.due_date import DueDate
from taskmgr.lib.model.model import Model
from taskmgr.lib.model.task import Task
fr... |
import requests
from datetime import date, timedelta
__author__ = "<NAME>"
__date__ = 2016 - 1 - 29
def get_stock(ticker):
query = 'select * from yahoo.finance.quotes where symbol in ("' + ticker + '")'
parameters = {'q': query, 'format': 'json', 'diagnostics': 'false',
'env': 'store://dat... |
#
# Copyright (c) 2022, NVIDIA CORPORATION. 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 appl... |
#!/usr/bin/python3
#################################################################################
#
# Copyright (c) 2016 <NAME>
# RpiPin by <NAME>
# Currently in extreme beta/experimentation stages
# I wouldn't expect this to be used by anyone, but if so, please let me know
# on github!
#
# Permission is hereby gr... |
import json
from pathlib import Path
import click
import matplotlib.pyplot as plt
from . import exciton, structures, util
from .util import Config
@click.group()
@click.version_option()
def cli():
pass
@click.command()
@click.option("-c", "--config", "config_file", type=click.File(), help="A config file used ... |
########################################################################
### ChainMap
########################################################################
class ChainMap(_collections_abc.MutableMapping):
''' A ChainMap groups multiple dicts (or other mappings) together
to create a single, updateable view.... |
import math
from abc import ABCMeta, abstractmethod
from threading import Lock
from typing import List, Union
import numpy as np
from .simulators import HSpiceSimulator, SimulationFailedError
__all__ = [
"Circuit", "AnalogCircuit", "DigitalCircuit",
"CircuitCreator", "RandomInitializer",
"QuasiMonteCarlo... |
import sys
import argparse
import logging
import time
def pase_info(seq):
info = {'SVLEN': 0, 'END': 0, "SVTYPE": '', "RE": 0, "CHR2": ''}
for i in seq.split(';'):
if i.split('=')[0] in ["SVLEN", "END", "RE"]:
try:
info[i.split('=')[0]] = abs(int(float(i.split('=')[1])))
except:
pass
i... |
import tensorflow as tf
import numpy as np
from utils.utils import reward
class GraphGANOptimizer(object):
def __init__(self, model, learning_rate=1e-3, feature_matching=True):
self.la = tf.placeholder_with_default(1., shape=())
with tf.name_scope('losses'):
eps = tf.random_uniform(t... |
from tkinter import *
from tkinter.ttk import Style
n1=0;c=1;temp1= " ";m=0;m1=0;d=[]
root =Tk()
root.geometry('385x420')
root.resizable(0,0)
root.title("simple calculator")
k = Entry(root,width =50,borderwidth=5,font="lucida 10 ")
k.grid(row=1,column=0,columnspan=4,padx=10,pady=10)
k1 = Entry(root,w... |
from viewpointdiversitydetection.Word2VecFeatureGenerator import Word2VecFeatureGenerator
from viewpointdiversitydetection.ExtractContexts import ExtractContexts
from viewpointdiversitydetection.SentimentFeatureGenerator import SentimentFeatureGenerator
from viewpointdiversitydetection.feature_vector_creation_utilities... |
#!/usr/bin/env python
from argparse import ArgumentParser
from utils import get_mnist_data_loaders, DataLoaderProgress
from fastprogress.fastprogress import master_bar, progress_bar
import torch
"""
Assignment #5:
We tried a variety of different algorithms including SGD, Adam, Adagrad and RMSprop with various epochs ... |
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from .attention import Attention, IntraAttention
from .baseRNN import BaseRNN
import random
class Gate(nn.Module):
def __init__(self, hidden_size):
super(Gate, self).__init__()
self.hidden_size =... |
#
# Copyright 2017 the original author or 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. codeauthor:: <NAME> <<EMAIL>>
"""
import pytest
import os.path
import numpy as np
import h5py
import conftest # noqa: F401
from photometry.image_motion import ImageMovementKernel
from photometry.utilities import find_ffi_files, find_hdf5_files, load_ffi_fits
#from p... |
#!/usr/bin/python
# encoding: utf-8
"""
The correctness "abacus" plot displays measurements M (e.g. the difference in binding affinity given in kcal/mol)
over a set of cases (e.g. peptide binders) and possibly many categories (e.g. binding partners). For each case on the X-axis,
the measurement is shown on the Y-axis a... |
# Copyright 2022 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... |
"""Next-gen sequencing alignment with Novoalign: http://www.novocraft.com
For BAM input handling this requires:
novoalign (with license for multicore)
novosort (also with license for multicore)
samtools
"""
import os
import subprocess
from bcbio import utils
from bcbio.distributed.transaction import file_transa... |
import base64
import enum
import decimal
import re
import requests
import requests.adapters
from requests.exceptions import ChunkedEncodingError, ContentDecodingError
from typing import Any, Optional, Dict, Callable, Generic, TypeVar, Union
from urllib.parse import quote
T = TypeVar("T")
def encode(value) -> str:
... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from dropblock import DropBlock2D, LinearScheduler
from modelR.layers.convolutions import Convolutional, Deformable_Convolutional
from modelR.layers.shuffle_blocks import Shuffle_new, Shuffle_Cond_RFA, Shuffle_new_s
import config.cfg_lodet as cfg
class... |
import argparse
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import scipy.interpolate
import time
from .utils import _init_modes, _init_precs
class EpochTimer:
def __init__(self):
self.reset()
def reset(self):
self._timing = {
'epoch': [],
'epoch_star... |
import logging
import numpy as np
import csv
from uncoverml import features
from uncoverml import mpiops
from uncoverml import geoio
from uncoverml.models import apply_masked
from uncoverml import transforms
log = logging.getLogger(__name__)
def predict(data, model, interval=0.95, **kwargs):
def pred(X):
... |
# coding=utf-8
# Copyright 2018 Google LLC & <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 o... |
import os
import urwid
import subprocess
import time
from multiprocessing import Pool
from .urwidHelper import *
from .tool import *
from .myutil import *
from .globalBase import *
from .mainRegList import DlgRegFolderSetting
def repoGetStatus(item):
status = dict(M=0, E=None)
if not item["re... |
#!/usr/bin/env python
# coding: utf-8
# # Python test script to read cross tabulation results and produce sankey plots
## conda install -c plotly plotly-orca
# First we import the required libraries
import numpy as np
import pandas as pd
#import plotly as py
import plotly.graph_objects as go
from pathlib import Path
... |
from flask import Flask, request, jsonify,render_template,url_for,request,redirect,session
from sql_connection import get_sql_connection
import mysql.connector
import json
import products_dao
import orders_dao
import uom_dao
from enum import EnumMeta
import re
from flask.wrappers import Request
import os
import razorp... |
import os
import math
import torch
import random
import numpy as np
import torch.nn as nn
import torch.utils.data
import torch.optim as optim
import torch.nn.init as init
import torch.nn.functional as F
import matplotlib.pyplot as plt
from torch.autograd import Variable
from torch.utils.data import DataLoader
from tor... |
import matplotlib.pyplot as plt
import numpy as np
from kndetect.features import calc_prediction
from kndetect.utils import extract_mimic_alerts_region
def plot_light_curve(
color_band_dict,
lc,
bands,
band_map=None,
fig=None,
band=None,
start_date=None,
end_date=None,
plot_points... |
# -*- coding: utf-8 -*-
"""DeeplabV2 model for Keras.
- This model uses VGG16 for encoding.
# Reference:
- [DeepLab: Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution,
and Fully Connected CRFs](https://arxiv.org/pdf/1606.00915v1.pdf)
"""
import warnings
import theano.tensor as T
fr... |
#!/usr/bin/env python3
import sys
import logging
#import soco
from ipaddress import *
from difflib import SequenceMatcher
from requests.exceptions import ConnectTimeout
from urllib3.exceptions import TimeoutError
from ast import literal_eval
from soco import SoCo
from soco.groups import ZoneGroup
from soco.discovery ... |
from models import build_model
from main import get_args_parser
from PIL import Image
from skimage import io
from datasets.spine_transforms import *
from torchvision import transforms
import torch
from torchvision.transforms import functional as F
import argparse
from util.spine_plot import *
import pandas as pd
import... |
# -*- coding: utf-8 -*-
"""
@author: hsowan <<EMAIL>>
@date: 2020/2/4
"""
import json
import time
from bs4.element import Tag
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.wait import WebDriverWait
... |
import random
import math
import numpy as np
import mxnet as mx
from mxnet import gluon, nd
from mxnet.gluon import nn
import gluonnlp as nlp
class DotProductAttention(nn.Block):
def __init__(self, dropout, **kwargs):
super(DotProductAttention, self).__init__(**kwargs)
self.dropout = nn.Dropout(d... |
# Copyright 2019 Quantapix 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 applicable l... |
import asyncio
import socket
import os
import re
import sys
import logging
from time import strftime
from functools import partial
from chaperone.cutil.logging import info, warn, debug, set_custom_handler
from chaperone.cutil.misc import lazydict, maybe_remove, remove_for_recreate
from chaperone.cutil.servers import ... |
from __future__ import annotations
import random
from collections import defaultdict
from dataclasses import dataclass, field
from itertools import product, groupby
from typing import Callable, Iterable, Literal
from bitarray import bitarray
from bitarray.util import int2ba, ba2int
@dataclass
class TruthTable:
... |
import sys
sys.setrecursionlimit(int(1e4))
sys.path.insert(0, "./semantics/dreamcoder")
import random
from collections import defaultdict, Counter
import json
import math
import os
import datetime
import numpy as np
import torch
from dreamcoder.dreamcoder import commandlineArguments, explorationCompression
from drea... |
"""
Localized p-value estimation methods for anomaly detection.
1. K-LPE method:
Zhao, Manqi, and <NAME>. "Anomaly detection with score functions based on nearest neighbor graphs."
Advances in neural information processing systems. 2009.
2. Averaged K-LPE method:
<NAME>, and <NAME>. "New statistic in p-value estimati... |
#!/usr/bin/python3
# Copyright 2020 <NAME> and <NAME>
# 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 ... |
from enum import Enum
from typing import List
import numpy as np
from tdw.controller import Controller
from tdw.tdw_utils import TDWUtils
from tdw.add_ons.third_person_camera import ThirdPersonCamera
from tdw.output_data import OutputData, Transforms, Bounds
from magnebot import Magnebot, ActionStatus, Arm, ArmJoint, I... |
import sys, os
FILEPATH, filename = os.path.split(os.path.abspath(__file__))
sys.path.insert(1, FILEPATH)
import asyncio, discord
from discord.ext import commands, tasks
from discord.ext.commands import Bot
import prawn, imgutils
import json, random
##########################
###bots helper commands###
#############... |
# TODO split these into module files with explicit names other than generic "helpers"
"""Common helper functions for tests."""
import asyncio
import concurrent.futures
import logging
import multiprocessing
import math
from hashlib import sha256
from typing import List
import aiohttp
from kin import Keypair
from kin.b... |
# Basic example of clearing and drawing pixels on a ST7565 graphic LCD display.
# This example and library is meant to work with Adafruit CircuitPython API.
# Author: <NAME>
# Modified: <NAME>, wa1tnr - February/March 2018
# License: Public Domain
print(" r019a0 ")
"""
We are on
Adafruit CircuitPython 2.2.3 on ... |
import os
import time
import datetime
from data import Data
from matplotlib import pyplot
from tensorflow.keras.initializers import RandomNormal
from tensorflow.keras.layers import Input, Conv2D, Conv2DTranspose, Dense, Reshape, Flatten, Embedding
from tensorflow.keras.layers import ReLU, LeakyReLU, Dropout, BatchNorm... |
#!/usr/bin/env python3
#
# susi-config
# Konfiguration of SUSI.AI, via the config.json
import sys
import os
import logging
import shutil
import urllib.request
from . import SusiConfig
FLITE_URL = 'http://www.festvox.org/flite/packed/flite-2.0/voices/cmu_us_slt.flitevox'
DEEPSPEECH_URL = 'https://github.com/mozilla/De... |
import ejemplar as e
import prestamo as p
import sistema_biblio as sb
import usuario as u
from libro import Libro
import os.path as path
from pickle import dump, load
"""Define el funcionamiento de las ocpiones que se presentan al usuario en el main."""
def crearLibros(sistema):
"""Si el usuario desea agregar un... |
#!/usr/bin/env python
"""
Plot chromosoms and misc variants. Can be invoked from commandline
or from imported.
$ ./chromograph.py --cyt cytoBand.bed
Further info:
https://matplotlib.org/3.1.1/api/collections_api.html#matplotlib.collections.BrokenBarHCollection
"""
# TODO: instead of padding look-ahead and co... |
import enum
class Alien(enum.Enum):
"""Enum to differentiate types of aliens."""
host = 1
guest = 2
class Bar:
"""Defines all the rules for the bar.
This class handles the internal representation of the seating bar
(for a rectangular table).
"""
def __init__(sel... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.