text stringlengths 6.04k 39.5k |
|---|
# encoding=utf8
# 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 requ... |
# Auto generated from chemont.yaml by pythongen.py version: 0.4.0
# Generation date: 2020-07-14 19:03
# Schema: chemont
#
# id: chemont
# description: A data model describing metaclasses for chemical ontology classes
# license: https://creativecommons.org/publicdomain/zero/1.0/
import dataclasses
import sys
from typin... |
import torch
import time
import os
import random
import math
import torchvision
import torch.nn as nn
from data.dataset import *
from tqdm import tqdm
import torch.nn.functional as F
from config import Config
import matplotlib.pyplot as plt
import torch.nn.init as init
# 数据类实例
dst = Dataset()
# 配置类实例
conf = Config()
#... |
import bw2data as bd
import bw2calc as bc
import bw_processing as bwp
import numpy as np
import pandas as pd
from pathlib import Path
from consumption_model_ch.utils import get_habe_filepath
from gsa_framework.utils import read_pickle, write_pickle
import plotly.graph_objects as go
from scipy.stats import norm
from con... |
#!/usr/bin/env python
"""Provides conversion from files to molecular graphs."""
from sklearn.base import BaseEstimator, TransformerMixin
import openbabel as ob
import pybel
import networkx as nx
import scipy.spatial.distance
import numpy as np
import subprocess
import shlex
from eden.util import read
import logging
l... |
"""The bot's Owner module."""
from __future__ import print_function
from importlib import import_module as imp
import distutils.dir_util
import json
import json.decoder
import random
import functools
import io
import copy
import subprocess
import aiohttp
import discord
import os
import shutil
import async_timeout
impor... |
#!/usr/bin/env python3
import multiprocessing
import logging
import socket
import time
import sys
import os
import json
import urllib.request
from cloudscheduler.lib.attribute_mapper import map_attributes
from cloudscheduler.lib.db_config import Config
from cloudscheduler.lib.ProcessMonitor import ProcessMonitor
from ... |
from datetime import datetime
from time import mktime
from fit.types.general import UInt32, UInt16, UInt8, Enum, UInt32Z, UInt8Z
from fit.types.helpers import KnownMixin
class LocalDateTime(UInt32):
start_ts = 631062000 # 00:00 Dec 31 1989
def _load(self, data):
return datetime.fromtimestamp(self.s... |
# PyDia Code Generation from UML Diagram
# Copyright (c) 2005 <NAME> <<EMAIL>>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) a... |
#!/usr/bin/env python
# coding: utf-8
# updated!!!!
'''
For more information and details about the algorithm, please refer to PhD thesis of <NAME>
LEARNING AND AGGREGATION OF FUZZY COGNITIVE MAPS – AN
EVOLUTIONARY APPROACH
by
<NAME>
'''
import numpy as np
import copy
import tqdm.auto as tq
import matplotlib.pylab as ... |
"""
This is the codebase for Depth Completion GAN paper titled
"Sparse to Dense Depth Completion using a Generative Adversarial Network with Intelligent Sampling Strategies"
Training file for the depth-completion-gan.
In order to invoke type:
python train.py --gpus=0,1,2,3 --batch_size=8 --n_epochs=10 --residual_bloc... |
from __future__ import print_function
import httplib2
import os
import json
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
import pandas as pd
from prospecting.env import (PROJECTNAME,
CREDSDIR,
... |
"""
Report views
Functions to handle all of the reporting views.
"""
from datetime import datetime, timedelta
import sys
from time import strptime
from django.template import Context, RequestContext
from django.http import \
HttpResponse, HttpResponseRedirect, HttpResponseServerError, Http404
from django.shor... |
import numpy as np
import dynet as dy
class RRTNetwork:
def __init__(self):
self._initialised = False
self.pc = dy.ParameterCollection()
self.params = {}
self.in_bilstm = None
self.in_bilstm_dp = 0.3
self.hid_lstm = None
self.hid_lstm_dp = 0.3
self.h... |
# Copyright (C) 2016 Ion Torrent Systems, Inc. All Rights Reserved
from iondb.rundb.plan.views_helper import get_ir_set_id
from iondb.rundb.plan.views_helper import get_default_or_first_IR_account_by_userName
from iondb.rundb.sample.sample_validator import (
validate_population,
validate_mouseStrains,
val... |
# Extend perceptron decoding to learn the weights from a test file
import numpy as np
import torch
import time
import sys
from typing import List, Tuple, Optional
from dataclasses import dataclass
from torch import nn
from torch.functional import Tensor
START_LABEL = "START"
EMPTY_LABEL = "EMPTY"
@dataclass
class S... |
'''
Created on Jul 6, 2012
@author: sbolduc
'''
from struct import pack, unpack
HEADING_FACTOR = 360.0 / 1024.0
DEPTH_FACTOR = 10.0 / 16.0
def create_kill():
return pack(">1B1B1B1B", 42, 42, 42, 42)
def encodeCrc8(heading, depth, light):
header = 0
message_id = 1
scaled_heading = int(float(head... |
import numpy as np
import logging
import emcee
from uncertainties import unumpy, ufloat
import matplotlib
from scipy.interpolate import interp1d, interp2d
from scipy.integrate import trapz
import time
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import corner
import VmaxLumFunc as V
import seaborn... |
import os
import pickle
import numpy as np
import xml.etree.ElementTree as ET
import random
import svgwrite
from IPython.display import SVG, display
VOCAB = list("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ")
REV_VOCAB = {char: digit for digit, char in enumerate(VOCAB)}
def rev_one_hot(data):
""" Conver... |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 <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/licens... |
# Written by: <NAME>, MS, DABR
# ==============================================================================
#
# This script returns PNG image files and associated masks for 2D training of images
# using FCN architectures in tensorflow.
#
# Usage:
#
# python dicomrt_to_traindata.py \
# --cerr=False
# --rawdata... |
from __future__ import absolute_import, division, print_function, unicode_literals
from functools import reduce # forward compatibility for Python 3
import operator
import numpy as np
from scipy.stats import multivariate_normal
from scipy.spatial.distance import cdist
_HEATMAP_THRESH = 0.0027
_2D_MAH_DIST_THRESH = 3.... |
""".. Line to protect from pydocstyle D205, D400.
Automated CLI creation
======================
This module offers CLI to iCount Python package. To separate Python
package from CLI and to avoid code and docstring duplication, CLI commands are
semi-automatically created from functions that already exist in the package... |
#!/usr/bin/env python
# Copyright 2008-2014 Nokia Solutions and Networks
#
# 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 r... |
import bpy
import os
import xml.etree.ElementTree as ET
from mathutils import Vector, Matrix, Quaternion
import math
import bmesh
from bpy_extras.io_utils import ImportHelper
from bpy.props import StringProperty, BoolProperty, EnumProperty
from bpy.types import Operator
from datetime import datetime
import random
fr... |
import logging
import re
import struct
from collections import defaultdict, namedtuple
from Crypto.Cipher import AES
from streamlink.exceptions import StreamError
from streamlink.stream import hls_playlist
from streamlink.stream.ffmpegmux import FFMPEGMuxer, MuxedStream
from streamlink.stream.http import HTTPStream
f... |
import os
import sys
import numpy as np
import tensorflow as tf
import config
import download
class SALICON:
"""This class represents the SALICON dataset. It consists of 10000 training
and 5000 validation images. The corresponding mouse tracking maps were
acquired from 16 observers during free-vie... |
# Copyright (c) OpenMMLab. All rights reserved.
import sys
from collections import OrderedDict
from tempfile import TemporaryDirectory
from unittest.mock import MagicMock, patch
import pytest
import torch
import torch.nn as nn
import torch.optim as optim
from torch.nn.parallel import DataParallel
from mmcv.fileio.fil... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#import ponio
import os,sys
import argparse
import jinja2 as jinja
import pickle
import numpy as np
import sympy as sp
from sympy import I
import ponio.runge_kutta as rk
import ponio.utils as utils
def runge_kutta_list () :
"""
Function return list of Runge Kut... |
# -*- coding:utf-8 -*-
# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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
#
# Unl... |
# -*- coding: utf-8 -*-
"""This module defines input and output functions."""
import os
from os.path import abspath, join, isfile, isdir, split, splitext
import numpy as np
from prody import LOGGER, SETTINGS, PY3K
from prody.atomic import Atomic, AtomGroup, AtomSubset
from prody.utilities import openFile, isExecutab... |
"""Implements the setuptools command 'antlr'."""
import collections
import datetime
import distutils.errors
import distutils.log
import distutils.version
import os.path
import pathlib
import re
import shutil
import shlex
import subprocess
import typing
import setuptools
from setuptools_antlr import __... |
#!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# not... |
# from __future__ import absolute_import, division, print_function, unicode_literals
import tensorflow as tf
from tensorflow import keras
from time import strftime
from corl.model.tf2.common import DelayedCosineDecayRestarts
class GlobalStepMarker(keras.layers.Layer):
'''
Record global steps.
'''
... |
#!usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under a 3-clause BSD license.
#
# @Author: <NAME>
# @Date: 2018-07-14 14:31:36
# @Last modified by: <NAME>
# @Last Modified time: 2018-07-14 19:03:32
from __future__ import print_function, division, absolute_import
import sys
import os
import argparse
impor... |
"""
PlaceInfo class
Provides reverse geolocation info for photos
See https://developer.apple.com/documentation/corelocation/clplacemark
for additional documentation on reverse geolocation data
"""
from abc import ABC, abstractmethod
from collections import namedtuple # pylint: disable=syntax-err... |
# -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2016, 2017, 2018 <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 Softw... |
"""
Get API information encoded in C files.
See ``find_function`` for how functions should be formatted, and
``read_order`` for how the order of the functions should be
specified.
"""
import sys, os, re
try:
import hashlib
md5new = hashlib.md5
except ImportError:
import md5
md5new = md5.new
if sys.vers... |
# Copyright 2019 Open Source Robotics Foundation, 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... |
from mask import longest_match
from util import reverse_complement, _debug, _warn
class _Target(object):
def __init__(self, name, seq, rowid):
self.rowid = rowid
self.name = name
self.seq = str(seq).upper()
self.n = len(self.seq)
class Targets(object):
def __init__(self, in... |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... |
#!/usr/bin/env python3
''' Written to log the in/out dates of tenants and split
house
bills appropriately according to their time at the
house. The program does no management of bills, just stores
their information for recalculation purposes in a JSON file
Author: <NAME>
Contact: evan {... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from enum import Enum
from typing import Mapping, Optional, List, Tuple, Union
import pathlib
import os
import torch
import copy
import yaml
from archai.common import utils
from archai.common.common import logger
"""
Note: All ... |
import functools
import math
from typing import Dict, Optional, List, Any, Union, Tuple, Callable
import numpy as np
import opensfm.synthetic_data.synthetic_dataset as sd
import opensfm.synthetic_data.synthetic_generator as sg
import opensfm.synthetic_data.synthetic_metrics as sm
from opensfm import pygeometry, types,... |
# Copyright 2020, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... |
#! /usr/bin/env python3
"""Tests for templite."""
from re import escape
from templite import Templite, TempliteSyntaxError
from unittest import TestCase, main
# pylint: disable=W0612,E1101
# Disable W0612 (Unused variable) and
# E1101 (Instance of 'foo' has no 'bar' member)
class AnyOldObject(object):
"""Simple t... |
# Copyright 2018 The TensorFlow Probability 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 o... |
# 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.
import argparse
import json
import logging
import os
import random
from io import open
import numpy as np
from tensorboardX import SummaryWrit... |
import asyncio
import os
import re
from io import BytesIO
from random import choice, randint
from textwrap import wrap
from PIL import Image, ImageDraw, ImageFont
from requests import get
from telethon.utils import get_display_name
from audynesia import udy
from ..Config import Config
from ..core.managers import edi... |
from datetime import datetime
import os
import os.path
from django.db import models
from django.contrib.auth.models import User, Group
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.hashcompat import sha_constructor
from django.db.models.signals import post_s... |
#!/usr/bin/env python
from __future__ import print_function, unicode_literals
import argparse
import ast
from datetime import datetime
import glob
import io
import json
import os
from pkg_resources import Requirement
import re
import sys
import textwrap
# Todo: This should use a common omit logic once ci scripts are r... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 <NAME>
# Copyright (c) 2020 <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.module_utils.basic import env_f... |
"""Functions to make simple plots with M/EEG data
"""
from __future__ import print_function
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: Simplified BSD
import copy
import warnings
fr... |
import difflib
import time
from datetime import datetime, timedelta
from typing import Any, Dict, Optional, Type
from urllib.error import URLError
from urllib.parse import quote_plus
from loguru import logger
from sqlalchemy import Column, DateTime, Integer, String, Table, func, sql
from sqlalchemy.orm import Session,... |
"""Support for RainMachine devices."""
import asyncio
from datetime import timedelta
import logging
from regenmaschine import Client
from regenmaschine.errors import RainMachineError
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import (
ATTR_ATTRIBUTION,... |
#!/usr/bin/env python3
################################################################################
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),... |
"""Support for statistics for sensor values."""
from collections import deque
import contextlib
import logging
import statistics
import voluptuous as vol
from homeassistant.components.recorder.models import States
from homeassistant.components.recorder.util import execute, session_scope
from homeassistant.components.... |
import xml.etree.ElementTree as ET
import re
import os
import pypandoc
import difflib
########################################################
# this is meant to be run from the docs folder
# if running manually, cd docs first
########################################################
pypandoc.pandoc_download.download_... |
##########################################################
# Author: <NAME>
# LinkedIn: https://www.linkedin.com/in/raghavsikaria/
# Github: https://github.com/thepirhana
# Last Update: 5-4-2020
# Project: Visualise t-SNE Iterations for NIFTY 50 Stocks
# with User interactivity features
#######################... |
import json
import os
import random
import tempfile
from django.core.urlresolvers import reverse
from django.http import HttpResponse, JsonResponse
from django.views.generic.base import View
from django.views.decorators.http import require_http_methods
from django.shortcuts import get_object_or_404
from django.db.mode... |
... |
"""OAI-PMH to BIBFRAME 2.0 ingester Classes"""
__author__ = "<NAME>, <NAME>"
import click
import datetime
import io
import logging
import os
import time
try:
from lxml import etree
except ImportError:
import xml.etree.ElementTree as etree
import rdflib
import requests
import sys
import urllib.parse
import uuid... |
"""
Dateien:
- Kurse: Die Liste der Kurse
- Personen -> importiert aus ldap
- Teilnehmer: repräsentiert die Anmeldungen mit referenz zu
Personen und Durchführungen
- Ausführungen: die Listen der Durchführungen.
Verlinkungen
- Teilnehmer.TEILNEHMER_ID is ForeignKey für Personen.OBJ_ID
Im folgenden eine Beschreibu... |
"""Hybrid Script Parser"""
import ast
import operator
import logging
import sys
import types
import numbers
from enum import Enum
from .util import _internal_assert
from . import calls
from . import util
from .var_decl import determine_variable_usage
from ..api import all as _all
from ..api import any as _any
from .... |
import collections
import importlib
import h5py
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader, ConcatDataset
import augment.transforms as transforms
from unet3d.utils import get_logger
class SliceBuilder:
def __init__(self, raw_datasets, label_datasets, weight_dataset, patch_s... |
import re
import collections
from copy import copy
from numbers import Number
from operator import truediv
from itertools import chain, repeat, product, accumulate
from typing import Any, Iterable, Dict, List, Tuple, Optional, Sequence, Hashable, Iterator, Union, Type, Callable
from coba.config import CobaConfig
from... |
#!/usr/bin/env python3
import re
import glob
import json
import lzma
import argparse
from functools import reduce
from collections import OrderedDict, defaultdict
from datetime import datetime, timedelta
def main():
parser = argparse.ArgumentParser(description="Parse result files and render an HTML page with a st... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, jan and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe.model.document import Document
from erpnext.stock.stock_ledger import get_previous_sle
from frappe.utils import cint, flt
fr... |
# Copyright (c) 2016 by <NAME> and the other collaborators on GitHub at
# https://github.com/rmjarvis/Piff All rights reserved.
#
# Piff is free software: Redistribution and use in source and binary forms
# with or without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistribut... |
# visionEnhancementProviders/NVDAHighlighter.py
# A part of NonVisual Desktop Access (NVDA)
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
# Copyright (C) 2018-2019 NV Access Limited, Babbage B.V., <NAME>
"""Default highlighter based on GDI Plus."""
from typing impor... |
"""Extreme Learning Machines
"""
# Author: <NAME> <<EMAIL>>
# Licence: BSD 3 clause
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy import linalg
from sklearn.base import BaseEstimator, ClassifierMixin, RegressorMixin
from base import logistic, softmax, ACTIVATIONS
from sklearn.... |
"""
Support for a generic MQTT vacuum.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/vacuum.mqtt/
"""
import logging
import voluptuous as vol
from homeassistant.components import mqtt
from homeassistant.components.mqtt import (
ATTR_DISCOVERY_HASH, M... |
#!/usr/bin/env python3
#
# Copyright 2022 Graviti. Licensed under MIT License.
#
"""Paging list related class."""
from bisect import bisect_right
from functools import partial
from itertools import accumulate, chain, repeat
from math import ceil
from typing import (
Any,
Callable,
Iterable,
Iterator,
... |
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.linalg import lu_factor, lu_solve
from scipy.sparse import issparse, csc_matrix, eye
from scipy.sparse.linalg import splu
from scipy.optimize._numdiff import group_columns
from .common import (validate_max_step, validate_tol,... |
#! /usr/bin/env python
##############################################################################
#
# Copyright (c) 2001-2005 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 t... |
#!/usr/bin/env python
"""
Analyze docstrings to detect errors.
If no argument is provided, it does a quick check of docstrings and returns
a csv with all API functions and results of basic checks.
If a function or method is provided in the form "pandas.function",
"pandas.module.class.method", etc. a list of all error... |
#!/usr/bin/env python
# Copyright (C) 2016 The Android Open Source Project
#
# 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 b... |
from datetime import datetime
from flask import render_template_string
from jinja2 import Markup
from flask_moment import _moment, Moment, default_jquery_version, \
default_moment_version, default_moment_sri
# Mock Objects
class NewDate(datetime):
"""http://stackoverflow.com/questions/4481954"""
@classm... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from scipy import misc
import cv2
import os
import shutil
import tensorflow as tf
import numpy as np
from recognition import detect_face, facenet
import sys
from PyQt5.QtWidgets import (QApplication, QWidget, ... |
import os
import warnings
import numpy as np
import torch
import torch.nn.functional as F
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from sklearn.metrics import adjusted_rand_score as ari_score
from sklearn.metrics.cluster import normalized_mutual_info_score as nmi_score
from torch.autogr... |
import base64
import json
import uuid
from abc import ABCMeta, abstractmethod # Abstract Base Class
import logging
from typing import List, Union, Dict, Any
from nexinfosys import Issue, IssuesOutputPairType
from nexinfosys.common.helper import create_dictionary, PartialRetrievalDictionary
logger = logging.getLogge... |
"""CFNgin config."""
import copy
import logging
import sys
import warnings
from io import StringIO
from string import Template
import yaml
from schematics import Model
from schematics.exceptions import BaseError as SchematicsError
from schematics.exceptions import UndefinedValueError, ValidationError
from schematics.t... |
# Copyright 2021 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 __future__ import annotations
import atexit
import os
import pickle
import sys
import traceback
from datetime import timedelta
from enum import Enum
from functools import cached_property, partial
from pathlib import Path
from typing import Any, Dict, List, Sequence, Set, Tuple, Union
from uuid import UUID
from b... |
##################################################################
## (c) Copyright 2015- by <NAME> ##
##################################################################
#====================================================================#
# qmcpack.py ... |
# original code: https://github.com/dyhan0920/PyramidNet-PyTorch/blob/master/train.py
import argparse
import os
import shutil
import time
import cv2
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torch.utils.data.distr... |
from past.builtins import basestring
from .typedsheets import cast_row_values
from functools import reduce
import io
import logging
import os.path
text = type(u'')
DEFAULT_LOG_LEVEL = logging.INFO
logger = logging.getLogger('encoded')
logger.setLevel(DEFAULT_LOG_LEVEL) # doesn't work to shut off sqla INFO
ORDER = ... |
"""This module provides functions that interface with the JWST calibration code to determine
things like "reference types used by a pipeline."
>>> header_to_reftypes(test_header("0.7.0", "FGS_DARK"))
['ipc', 'linearity', 'mask', 'refpix', 'rscd', 'saturation', 'superbias']
>>> header_to_reftypes(test_header("0.7.0", ... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... |
"""
1D Regression demo with SDELayer.
"""
from __future__ import absolute_import
import argparse
import collections
import os
import sys
from functools import partial
from brax._impl.layers import SDELayer, Const, Affine, AugmentedLayer, shape_dependent, Additive, ConcatSquashLineartx, DiffEqWrappertx
from brax.utils... |
import pytest
class Release:
def __init__(self, version, description, from_external):
self.version = version
self.description = description
self.from_external = from_external
class GRelease:
def __init__(self, title, content):
self.title = title
self.content = [{"valu... |
#------------------------------------------------------------------------------
# Unit tests for Clorm ORM @-syntax integration (calling Python from ASP).
#
# Note: I'm trying to clearly separate tests of the official Clorm API from
# tests of the internal implementation. Tests for the API have names
# "test_api_XXX" w... |
# Copyright 2014
# The Cloudscaling Group, 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... |
"""Unit tests for the WaveNet that check that it can train on audio data."""
import json
import numpy as np
import sys
import tensorflow as tf
import random
import os
from wavenet import (WaveNetModel, time_to_batch, batch_to_time, causal_conv,
optimizer_factory, mu_law_decode)
SAMPLE_RATE_HZ = 2... |
# Copyright 2019 Xilinx 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 in writing, ... |
import pymc3 as pm
import numpy as np
import scipy as sp
import theano.tensor as tt
import patsy as p
import utilities
def cross_validate_rwfmm(rwfmm_args,rwfmm_kwargs,param_for_tuning,tuning_set,criterion='LOO'):
model_dict = {}
trace_list = []
for param_val in tuning_set:
modified_kwargs = rwf... |
import random
import cv2
import numpy as np
def Rotate_aug(src, angle, label=None, center=None, scale=1.0):
image = src
(h, w) = image.shape[:2]
if center is None:
center = (w / 2, h / 2)
M = cv2.getRotationMatrix2D(center, angle, scale)
if label is None:
for i in range(image.shap... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
# ----------------------------------------------------------------------------
# Copyright (c) 2017 Massachusetts Institute of Technology (MIT)
# All rights reserved.
#
# Distributed under the terms of the BSD 3-clause license.
#
# The full license is in the LICENSE file, distributed with this software.
# -------------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.