text stringlengths 6.04k 39.5k |
|---|
# Copyright 2017 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... |
"""Data used by the kernel object."""
from __future__ import division
__copyright__ = "Copyright (C) 2012 <NAME>"
__license__ = """
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 restri... |
""" Plot Tools
This script have a sets of tools that handle metrics and plots graphs, matrix and tables.
The tools here are implemented basically by Scikit, and adapted as demanded, bellow is possible
see the references to this fonts:
- A compilation of bests 50 matplotlib visualization, to analysis data:
https:... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""
This script computes features on the GEFCom2017_D dataset. It is
parameterized so that a selected set of features specified by a feature
configuration list are computed and saved as csv files.
"""
import os
from math import ceil
import pandas... |
"""
Find isomorphisms between fans
"""
#*****************************************************************************
# Copyright (C) 2012 <NAME> <<EMAIL>>
#
# Distributed under the terms of the GNU General Public License (GPL)
# as published by the Free Software Foundation; either version 2 of
# the License... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import datetime
import time
import pytz
from django.db import models
from django.db.models import Sum, Count
from django.contrib.auth.models import User
from django.template.loader import render_to_string
from django.template.defaultfilters import linebreaks, truncatewords
from django.urls import reverse
from django.u... |
# SFM Bridge: Open_Menu.py
# This software is licensed under the MIT License.
# Copyright (c) 2021 KiwifruitDev
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.... |
#############################################################################
#
# Author: <NAME>
# Reimplemented from Babel v1.6 from <NAME> and <NAME>
#
# Copyright: <NAME> TSRI 2000
#
#############################################################################
#
# $Header: /opt/cvs/python/packages/share1.5/PyBabel/a... |
import collections
import functools as ft
import inspect
import itertools as it
import math
import operator
import os
import random
import shutil
import tempfile
import flaky
import numpy as np
import pytest
import scipy.spatial
import adaptive
from adaptive.learner import (
AverageLearner,
BalancingLearner,
... |
import sqlite3
import datetime
import pandas as pd
from utils import WeatherData
from random import Random
from configuration import *
import matplotlib.pyplot as plt
def get_data_from_database(query, db_path=DB_PATH):
"""
Executes query on SQLite database located at db_path and returns response as DataFrame
:para... |
"""
MIT License
Copyright (c) 2021 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribu... |
# Copyright (c) 2006-2016 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# dist... |
import datetime as _datetime
import logging as _logging
import uuid as _uuid
import six as _six
from deprecated import deprecated as _deprecated
from flytekit.common import interface as _interface
from flytekit.common import nodes as _nodes
from flytekit.common import promise as _promises
from flytekit.common import ... |
from typing import Any, Union, Sequence, cast, Dict, Optional, Callable, TypeVar
from typing import List
import numpy
import random
import functools
from wasabi import table
from pydantic import create_model, ValidationError
import inspect
import os
import tempfile
import threading
import contextlib
from contextvars im... |
"""This module is adapted from https://github.com/Open-Catalyst-Project/ocp/tree/master/ocpmodels/models
"""
import torch
import torch.nn as nn
from torch_scatter import scatter
from torch_geometric.nn.acts import swish
from torch_geometric.nn.inits import glorot_orthogonal
from torch_geometric.nn.models.dimenet impor... |
import pygame
import random
import numpy as np
from cube3d import cube_3d
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 800
red = (255, 0, 0)
orange = (255, 153, 0)
green = (0, 255, 0)
blue = (0, 0, 255)
white = (255, 255, 255)
yellow = (255, 255, 0)
colors = {'R':red, 'O':orange, 'B':blue, 'G':green, 'W':white, 'Y':yellow}
cl... |
# coding: utf-8
from __future__ import unicode_literals
from hashlib import md5
from base64 import b64encode
from datetime import datetime
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlencode,
compat_str,
compat_itertools_count,
)
from ..utils import (
sanit... |
#
# Copyright (c) 2021, 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... |
# -*- coding: utf-8 -*-
from base import SingleWindow
from .. import manager
from .. import window
from .. import drawer
from .. import hook
to_superscript = dict(zip(map(ord, u'0123456789'), map(ord, u'⁰¹²³⁴⁵⁶⁷⁸⁹')))
class TreeNode(object):
def __init__(self):
self.children = []
self.expanded =... |
"""
@package generalUtility This module contains some general-purpose utility functions
@copyright GNU Public License
@author written 2009-2014 by <NAME> (www.christian-herbst.org)
@author Partially supported by the SOMACCA advanced ERC grant, University of Vienna,
Dept. of Cognitive Biology
@note
This program is... |
import argparse
import csv
import datetime
import json
import gzip
import os
import numpy as np
import pandas as pd
import oyaml as yaml
from sklearn.preprocessing import StandardScaler
## HELPERS
def load_embeddings(file_list, emb_dir):
"""
Load saved embeddings from an embedding directory
Parameters
... |
# coding=utf-8
# copied from hugginface github
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc.
# team.
# Copyright (c) 2018, 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 t... |
# Copyright (c) 2014, <NAME> <<EMAIL>>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions ... |
"""Module-level functions."""
import bisect
import os
import glob
import norns
import random
import re
from appdirs import user_config_dir
from collections.abc import Iterable
from pyfaidx import Fasta, Sequence
from genomepy.provider import ProviderBase
from genomepy.plugin import get_active_plugins, init_plugins
fro... |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distribut... |
# -*- coding: utf-8 -*-
from . import *
from . fixtures import *
import os
from flanker import mime
from talon import quotations
@patch.object(quotations, 'MAX_LINES_COUNT', 1)
def test_too_many_lines():
msg_body = """Test reply
-----Original Message-----
Test"""
eq_(msg_body, quotations.extract_from_pl... |
import numpy as np
import scipy as sp
from functools import partial
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.utils.validation import check_is_fitted, check_X_y, check_array
import pywsl.utils.comcalc as com
from pywsl.utils import check
class PNU_SL(BaseEstimator, ClassifierMi... |
# Copyright 2012 NetApp
# Copyright 2016 Mirantis Inc.
# 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
#... |
#
# Copyright (c) 2019-2020, NVIDIA CORPORATION.
#
# 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 a... |
"""First group of pytest test cases for phmdoctest."""
import configparser
import copy
from pathlib import Path
import subprocess
import sys
import pytest
import yaml
import phmdoctest
import phmdoctest.cases
from phmdoctest.fenced import Role
import phmdoctest.main
import phmdoctest.simulator
import phmdoctest.tool
... |
############################################################################
# Copyright 2018 <NAME> & Stanford University #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not us... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
r"""Differentials :mod:`abelfunctions.differentials`
================================================
This module contains functions for computing a basis of holomorphic
differentials of a Riemann surface given by a complex plane algebraic curve
:math:`f \in \mathbb{C}[x,y]`. A differential :math:`\omega = h(x,y)dx` d... |
from docopt import docopt
from graph_tool.all import *
from operator import itemgetter
class Ontobuilder:
"""
Iteratively adds the most probable relation between two terms to the ontology. Currently supports hyperonymy and
cohyponymy relations. Also, any new relations that are implied by adding the first... |
# Copyright (c) 2019 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... |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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... |
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 21 13:28:38 2021
@author: lukepinkel
"""
import numpy as np
import pandas as pd
from pystatsm.utilities.random import exact_rmvnorm, vine_corr
from pystatsm.pyglm.betareg import BetaReg, LogitLink, LogLink
from pystatsm.pyglm.clm import CLM
from pystatsm.pyglm.glm import... |
# -*- coding: utf-8 -*-
"""Configuration parsing and export for tmuxp.
tmuxp.config
~~~~~~~~~~~~
"""
from __future__ import absolute_import, unicode_literals
import copy
import logging
import os
from . import exc
from ._compat import string_types
logger = logging.getLogger(__name__)
def validate_schema(sconf):
... |
import numpy as np
import tensorflow as tf
import cv2
import random
import colorsys
from yolo_cnn.core.utils import get_keys_alpr, get_keys_car_brand, get_keys_car_color, read_class_names, containsLP
from util.paths import class_names_yolo_car
def _extract_contours(box, thresh):
'''
Find and extract letter c... |
"""General purpose composite argument parsing and completion."""
from __future__ import annotations
import abc
import contextlib
import dataclasses
import enum
import os
import re
import typing as t
# NOTE: When choosing delimiters, take into account Bash and argcomplete behavior.
#
# Recommended characters for assig... |
import logging
import tensorflow as tf
import numpy as np
from numpy import linalg as LA
from numpy import random as np_random
import os
import random
PROJ_EPS = 1e-5
EPS = 1e-15
MAX_TANH_ARG = 15.0
def tf_project_hyp_vecs(x, c):
# Projection op. Need to make sure hyperbolic embeddings are inside the unit ball.
... |
# encoding: UTF-8
"""
"""
import hashlib
import sys
import hmac
import json
import time
from datetime import datetime
from threading import Lock
from urllib.parse import urlparse
from copy import copy
from requests import ConnectionError
from vnpy.api.rest import Request, RestClient
from vnpy.api.websocket import We... |
"""
Implementation of base class for extension to models describing actual data.
.. moduleauthor:: <NAME> <<EMAIL>>
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import copy
import lmfit as lm
from satlas.loglikelihood import create_gaussian_priormap
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
fro... |
#!/usr/bin/env python
# encoding: utf-8
"""
@Author: yangwenhao
@Contact: <EMAIL>
@Software: PyCharm
@File: output_extract.py
@Time: 2020/3/21 5:57 PM
@Overview:
"""
from __future__ import print_function
import argparse
import json
import os
import pickle
import random
import time
from collections import OrderedDict
... |
import base64
import contextlib
import hashlib
import io
import os
import logging
import queue
import select
import socket
import struct
import subprocess
import sys
import threading
import time
from collections import namedtuple
from enum import Enum
from http.server import BaseHTTPRequestHandler
from itertools impor... |
from os import listdir
from os.path import isfile, join
import os
from bs4 import BeautifulSoup
import pandas as pd
import re
import json
from datetime import datetime
dossier_pages = 'BASIAS_pages/'
dossiers_regions = os.listdir(dossier_pages)
# Création du répertoire des résultats par région
dossier_resultats = 'BA... |
"""
------------------------------------------------------------------------------
The MIT License (MIT)
Copyright (c) 2016 Newcastle University
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 with... |
# Copyright (c) 2019, 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 applic... |
# ----------------------------------------------------------------------------
# Copyright (c) 2017-2021, 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.
# ------------------------------------------------... |
"""Base GUI for Modis."""
import asyncio
import importlib
import logging
import os
import threading
import tkinter as tk
import tkinter.ttk as ttk
from modis import datatools, helptools
logger = logging.getLogger(__name__)
class Frame(ttk.Frame):
"""The main window frame for Modis."""
def __init__(self, p... |
# -*- coding: utf-8 -*-
"""
femagtools.windings
~~~~~~~~~~~~~~~~~~~
Handling windings
Conventions
Number of slots: Q
Numper of pole pairs: p
Number of phases: m
Number of layers: l
Number of wires per slot side: n
Number of slots per pole and phase: q = Q/p/2/m
Number of coils per phase: c = Q * ... |
from django.core.exceptions import ValidationError
from rest_framework import exceptions
from rest_framework import serializers as ser
from rest_framework.fields import empty
from rest_framework.exceptions import ValidationError as DRFValidationError
from api.base.exceptions import Conflict, JSONAPIException
from api.... |
# Copyright (C) 2018 Intel Corporation
#
# 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 wri... |
import asyncio
import datetime
import itertools
import json
import random
import socket
import ssl
import traceback
from collections import defaultdict
from pathlib import Path
from typing import List, Optional
import aiorpcx
from aiorpcx import SOCKSProxy, SOCKSFailure
from aiorpcx.jsonrpc import ProtocolError, Notif... |
import numpy as np # Matrix and vector computation package
import matplotlib.pyplot as plt # Plotting library
# np.random.seed(1)
from sklearn import datasets, cross_validation, metrics # data and evaluation utils
from matplotlib.colors import colorConverter, ListedColormap # some plotting functions
import itertools
i... |
import os
import io
from typing import Optional
import gi
import zbar
import logbook
from logbook import Logger
from PIL import Image
gi.require_version('GObject', '2.0')
gi.require_version('GLib', '2.0')
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
gi.require_version('Gio', '2.0')
gi.require_ver... |
import json
import pytest
from flask import Flask
from sqlalchemy import create_engine, Column, Integer, DateTime, String, ForeignKey
from sqlalchemy.orm import sessionmaker, relationship
from sqlalchemy.ext.declarative import declarative_base
from flask import Blueprint, make_response
from marshmallow_jsonapi.flask... |
import torch
import torch.nn as nn
import torch.nn.init as init
from torch.autograd import Variable
import torch.nn.functional as F
from torch.nn.parameter import Parameter
import math
from component.stn import SpatialTransformer
capsule_dim = 2
class Relu_Caps(nn.Module):
def __init__(self, num_C, nu... |
'''\
:mod:`ecoxipy.pyxom.indexing` - Indexing PyXOM Structures
=========================================================
This package is a foundation for indexing :mod:`ecoxipy.pyxom` structures.
The abstract base class :class:`Indexer` establishes an interface for indexing
PyXOM structures.
Two mapping implementati... |
# -*- coding: utf-8 -*-
from functools import reduce
from itertools import product
from operator import mul
try:
from collections.abc import Mapping
except ImportError:
from collections import Mapping
import numpy as np
from africanus.util.requirements import requires_optional
from africanus.rime.predict i... |
import datetime
import logging
import os
import sys
from collections import defaultdict
from time import clock
import pandas as pd
import sklearn.model_selection as ms
from sklearn.ensemble import RandomForestClassifier
from sklearn.feature_selection import SelectFromModel
from sklearn.metrics import make_scorer, acc... |
# Setup list of patches and books to use
#
import os
import sys
# LOGGING
import sharedLogger
bookKeys = {
'FRT': '000',
'GEN': '001',
'EXO': '002',
'LEV': '003',
'NUM': '004',
'DEU': '005',
'JOS': '006',
'JDG': '007',
'RUT': '008',
'1SA': '009',
'2SA': '010',
'1KI': '011',
'2KI': '012',
'1CH': '013',
'2CH': '014',
... |
import random
import string
import logging
import argparse
from multiprocessing import Pool
from functools import wraps
from pathlib import Path
import errno
import os
import signal
import time
import json
import util
# configure logging
log = logging.getLogger(__name__)
FILE_DIR = Path(__file__).parent.resolve()
RO... |
"""Unifi Protect Data."""
from __future__ import annotations
from datetime import datetime, timedelta
from ipaddress import IPv4Address
from typing import (
TYPE_CHECKING,
Any,
ClassVar,
Dict,
List,
Optional,
Set,
Type,
TypeVar,
)
from pydantic import BaseModel
from pydantic.fields... |
import numpy as np
from mogapy.solver import Solver
def cndsa2(fitnesses, constraints):
"""Take in an MxN array of fitnesses and an MxO array of constraints, rank according to level of constrained
non-dominance.
Input:
fitnesses: A MxN numpy array, each row is a solution, each column is a fitness var... |
# <NAME>
# roadway class in python
from src.curves import CurvePt
from src.Vec import VecSE2, VecE2
from src.Vec.geom import geom
import math
import re
import warnings
class LaneBoundary:
def __init__(self, style: str, color: str):
'''
:param style: LaneBoundary style
:param color: LaneBou... |
#
# Copyright (c) 2009-2021 <NAME> <<EMAIL>>
#
# See the file LICENSE.txt for your full rights.
#
"""Generate images for up to an effective date.
Should probably be refactored into smaller functions."""
from __future__ import absolute_import
from __future__ import with_statement
import datetime
import logging
i... |
import scipy, numpy, typing, numbers
from tequila.objective import Objective
from tequila.objective.objective import assign_variable, Variable, format_variable_dictionary, format_variable_list
from .optimizer_base import Optimizer, OptimizerResults
from ._containers import _EvalContainer, _GradContainer, _HessContainer... |
from scipy import stats
import numpy as np
import networkx as nx
from generate_network import Dynamic_Social_Net
from spread import draw_curve
import matplotlib.pyplot as plt
import csv
import random
class Gill_Sim():
def __init__(self, d_G = Dynamic_Social_Net(n=3000), n_i = 3, default = True):
if default... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
"""
Base dialect for translating column operations to SQL.
A dialect requires three pieces:
1. Classes representing column data under normal and aggregate settings.
(e.g. SqlColumn, SqlColumnAgg).
2. Functions for creating the sqlalchemy clause corresponding to an
operation.
(e.g. a func... |
#!/usr/bin/env python
# Copyright (C) 2012 Ion Torrent Systems, Inc. All Rights Reserved
"""
TSconfig.py works with the GUI updates page to check if new version is available and update TS
In TS version < 5.4 update tasks instantiate TSConfig class directly, in order for this to work
all class functions... |
'`matflow_damask.main.py`'
import os
import copy
import json
from textwrap import dedent
from pathlib import Path
import hickle
import numpy as np
import pkg_resources
from damask_parse import (
read_geom,
read_material,
read_HDF5_file,
write_load_case,
write_geom,
write_material,
write_nu... |
#! python
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# serial driver for win32
# see __init__.py
#
# (C) 2001-2009 <NAME> <<EMAIL>>
# this is distributed under a free software license, see license.txt
#
# Initial patch to use ctypes by <NAME> <<EMAIL>>
import ctypes
from . import win32
from .serialu... |
# -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
"""
Methods for creating and using a linear regression model.
"""
from __future__ im... |
"""
This is the model that organizes the full simulation.
It handles all the choices of the model,
set at the 'params' module.
Disclaimer:
This code was generated for research purposes only.
It is licensed under GNU v3 license
"""
import copy
import json
import logging
import os
import random
import sys
from collecti... |
from __future__ import annotations
import numpy as np
import plotly.graph_objects as go
from typing import Tuple, Optional, List
from scipy.interpolate import interp1d
import lmfit as lm
import dat_analysis.analysis_tools.nrg
from dat_analysis.dat_analysis.characters import DELTA
from dat_analysis.plotting.plotly.dat_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import io
import glob
import shutil
import random
import argparse
import sys
from string import Template
from mimetypes import add_type, guess_type
if sys.version_info[0] >= 3:
unicode = str
platforms = ("win32", "android", "macosx", "ios", "cmake", "all"... |
from tinyec import registry
import secrets
#import numpy as np
from socket import*
#import pickle
'''Public and Private key Generation using Elliptic curve cryptography'''
def Elliptic_crypto():
curve = registry.get_curve('secp256r1')#standard elliptic curves
privkey = secrets.randbelow(curve.field.n)
f=... |
import os, random, requests, glob, cv2, string
from PIL import Image
import numpy as np
import moviepy.editor as mpe
from myDrive.gdriveservice import drive
from datetime import datetime
################
# variable setup
lineNames = "lines_"
coloredName = "color_"
imagesPath = '\\Images\\'
linesPath = '\\Lines\\'
fra... |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
import numpy as np
import arviz as az
import seaborn as sns
import pandas as pd
import pickle as pkl
import importlib
import anndata as ad
import ast
import matplotlib.pyplot as plt
from scdcdm.util import result_classes as res
from scdcdm.util import multi_parameter_sampling as mult
from scdcdm.util import multi_para... |
import gzip
import io
import os
import json
import shutil
from pathlib import Path
from PIL import Image, ImageFont, ImageDraw
import numpy as np
import pandas as pd
from tqdm.auto import tqdm
from thc_net.utils import do_parallel_numpy
MAX_MEMORY_USE = 1 # in Go
# https://he-arc.github.io/livre-python/pillow/inde... |
from __future__ import absolute_import
import uuid
import os
from celery.utils.log import get_task_logger
from celery import Task
from celery import signals
from django.contrib.auth import get_user_model
from django.core.exceptions import ObjectDoesNotExist
from django.core.files import File
from django.core.files.ba... |
# static analysis: ignore
from qcore.testing import Anything
import collections
import collections.abc
from collections.abc import MutableSequence, Sequence, Collection, Reversible, Set
import contextlib
import io
from pathlib import Path
import sys
import tempfile
import textwrap
import time
from typeshed_client impor... |
#!/usr/bin/python
import os, sys
from . property import get_property
from . utils import err, dbg, enable_debug
from . exceptions import SymbioticException
def get_versions():
""" Return a tuple (VERSION, versions, llvm_versions) """
# the numbers must be separated by '-, otherwise it will
# break the t... |
#!/usr/bin/env python
# This script trains a Self-Supervised Model using a folder containing anndata.h5ad files
import argparse
import torch
import sys
from typing import List
from datetime import timedelta
import pytorch_lightning as pl
from pytorch_lightning.plugins import DDPPlugin
from pytorch_lightning.profiler... |
import os
import sys
import math
from neuralprophet.df_utils import join_dataframes
import numpy as np
import pandas as pd
import torch
from collections import OrderedDict
from neuralprophet import hdays as hdays_part2
import holidays as pyholidays
import warnings
import logging
log = logging.getLogger("NP.utils")
d... |
import copy
import warnings
from collections.abc import Iterable
import numpy as np
import sklearn
from sklearn.utils.validation import check_array, column_or_1d, \
assert_all_finite, check_consistent_length
# Define constant for missing label used throughout the package.
MISSING_LABEL = np.nan
def check_scalar... |
# This implementation is a new efficient implementation of Densenet-BC,
# as described in "Memory-Efficient Implementation of DenseNets"
"""
From:
https://raw.githubusercontent.com/gpleiss/efficient_densenet_pytorch/master/models/densenet_efficient.py
"""
import math
import torch
import torch.nn as nn
import torch... |
from django.http import HttpResponse, HttpResponseRedirect
from django.conf import settings
from django.core.validators import validate_email
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.shortcuts import render, get_object_or_404
from django.views.decorator... |
import torch
import torch.nn as nn
from model.core_module.ConvLSTM import ConvLSTM
from model.SpatialAttention import SpatialAttention
class StackedConvLSTM(nn.Module):
def __init__(self, mode, channel, kernel, n_layers, is_attn=False):
super(StackedConvLSTM, self).__init__()
self.channel = channel
self.kernel... |
### <NAME> 10/2018
## Next Steps
# /0 Error in Hits/Pageviews
# Use a time-series split cross validation so information from future events don't leak
# Use multiple regression model types (catboost, etc...)
# Use Bayesian hyperparameter optimization
## Sources/Inspiration
# https://www.kaggle.com/ashishpate... |
##########################################################
# This RNS example demonstrates a simple filetransfer #
# server and client program. The server will serve a #
# directory of files, and the clients can list and #
# download files from the server. #
#########################... |
"""Ambianic pipeline interpreter module."""
import logging
import threading
import time
from ambianic.configuration import DEFAULT_DATA_DIR, get_root_config
from ambianic.pipeline import HealthChecker, PipeElement, pipeline_event
from ambianic.pipeline.ai.face_detect import FaceDetector
from ambianic.pipeline.ai.fall_... |
# AEBN
import re, os, platform, urllib, cgi
PLUGIN_LOG_TITLE='AEBN' # Log Title
VERSION_NO = '2017.07.26.0'
# Delay used when requesting HTML, may be good to have to prevent being
# banned from the site
REQUEST_DELAY = 0
# URLS
BASE_URL='http://gay.theater.aebn.net'
BASE_VIDEO_DETAILS_URL=BASE_URL + '%... |
#Embedded file name: www_auth_digest.py
import sys
import urlparse
import re
import hashlib
import struct
if 0:
i11iIiiIii
if 0:
O0 / iIii1I11I1II1 % OoooooooOO - i1IIi
o0OO00 = None
oo = None
if 0:
oO0OooOoO * o0Oo
def i1IiI1I11(data):
return hashlib.md5(data).hexdigest()
if 0:
ooOO00oOo %... |
import torch
from torch_geometric.data import InMemoryDataset, Data, DataLoader
from torch_geometric.transforms import Compose
import numpy as np
from scipy.spatial.transform import Rotation
import math
import urllib.request
import tarfile
from pathlib import Path
import requests
from data_preprocessing.convert_pdb2npy... |
from typing import Optional
import discord as dc
import os
from discord.ext.commands.core import command
import requests
import json
from CowsAndBulls import CowsAndBulls
import Anagram as ana
import feedparser
import random
import discord
from discord.ext import commands
from dotenv import load_dotenv
from Crossword i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.