text stringlengths 3.07k 12.6k |
|---|
import csv
import os
import sqlite3
import sys
from datetime import datetime
# platform_table maps the name of user's OS to a platform code
platform_table = {
'linux': 0,
'linux2': 0,
'darwin': 1,
'cygwin': 2,
'win32': 2,
}
# it supports Linux, MacOS, and Windows platf... |
import torch
from torch._six import int_classes as _int_classes
class Sampler(object):
r"""Base class for all Samplers.
Every Sampler subclass has to provide an __iter__ method, providing a way
to iterate over indices of dataset elements, and a __len__ method that
returns the length of the returned i... |
########################################################################
# trigger.py - command line application to manage the triggers
# checked every 30 minutes by agileTriggers.py the tool makes sqlite calls
# to the database to update the triggers table.
#
# Copyright 2020 <NAME>.
#
# Licensed under the Apache Li... |
"""
Copyright (c) 2016, <NAME>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WIT... |
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
import argparse
import logging
from pathlib import Path
import time
import os
import numpy as np
import torch
from torch.utils import data
from torch.utils.data import DataLoader
import torchvision
from torchvision import datasets, transforms
import torchvision.utils as v... |
"""
Authentication management
=========================
Coaster provides a :obj:`current_auth` for handling authentication. Login
managers must comply with its API for Coaster's view handlers to work.
If a login manager installs itself as ``current_app.login_manager`` and
provides a ``_load_user()`` method, it will b... |
import warnings
from typing import List, Optional, Union
import numpy as np
from spyrmsd import constants, graph, utils
class Molecule:
def __init__(
self,
atomicnums: Union[np.ndarray, List[int]],
coordinates: Union[np.ndarray, List[List[float]]],
adjacency_matrix: Optional[Unio... |
from keras.layers.core import Dense, Dropout
from keras.layers.recurrent import LSTM
from keras.models import Sequential
from sklearn.preprocessing import MinMaxScaler
import tensorflow as tf
import datetime
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
def data_preparation(company_input_dat... |
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function
import os
import sys
import argparse
from subprocess import Popen, PIPE
import logging
import logging.config
try:
import configparser
except:
import ConfigParser as configparser
BASIC_LOGGING = {
'version': 1,
'fo... |
import math
# TODO Features:
# Player position on map
# Discover areas as the player progresses
# Doors that appear on map
# CoLoRs
# Better error handling
# Better clarity around what 0,0 represents
# TODO Bugs:
# A map that is not connected properly can cause a forever hang
class Position:
def __init__(self, x... |
import pyswip as p
import os
import sys
import shutil
BASEFOLDER = "./raw/"
def create_folder(name):
try:
os.mkdir(name)
except:
pass
def delete_folder(name):
shutil.rmtree(name, ignore_errors=True)
def setup_raw(base):
folder = str(base)
folders = folder.split("/")
base = BA... |
#
# Copyright (c) 2006-2019, RT-Thread Development Team
#
# SPDX-License-Identifier: MIT License
#
# Change Logs:
# Date Author Notes
# 2019-07-15 SummerGift first version
#
import os
import hashlib
import binascii
def get_file_hash(file_path):
myhash = hashlib.md5()
f = open(file_path,... |
import json
import requests
import urllib2
import jwt
import time
import traceback
from flask import (
render_template,
redirect,
request,
url_for,
session,
flash,
)
from mwoauth import Handshaker, RequestToken
from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound
from flask.ext.log... |
import numpy as np
import pandas as pd
# FEATURES
ranking_features = [
"TEAM_ID",
# TODO: REMOVE -----
# "G",
# "W",
# "L",
# ------------------
"W_PCT",
"HOME_RECORD",
"ROAD_RECORD",
]
game_features = ["PTS", "FG_PCT", "FT_PCT", "FG3_PCT", "AST", "REB"]
# GET AGREGATED HISTORICA... |
"""Functions for downloading data and lists of geographies from the Census API."""
from __future__ import absolute_import, division, print_function, unicode_literals
from . import censusgeo
import pandas as pd
from collections import OrderedDict
import requests
def _download(src, year, params, baseurl = 'https://api... |
import asyncio, sys
from onvif import ONVIFCamera
IP="192.168.0.100" # Camera IP address
PORT=10080 # Port
USER="admin" # Username
PASS="password" # Password
XMAX = 1
XMIN = -1
YMAX = 1
YMIN = -1
moverequest = None
ptz = None
active = False
async def do_move(ptz, request):
# Start con... |
# import necessary libraries
import argparse
from genericpath import exists
import os
import torchvision
import torchvision.transforms as T
from pathlib import Path
from runpy import run_path
from PIL import Image
from PIL import Image
from PIL.ExifTags import TAGS
from pathlib import Path
import shutil
from src.piexif... |
import argparse
import os
import numpy as np
import torch
from torch import nn, autograd, optim
from torch.nn import functional as F
from torchvision import transforms, utils
os.environ["CUDA_VISIBLE_DEVICES"]="0"
from model import G_NET
from finegan_config import finegan_config
def child_to_parent(c_code, c_dim,... |
#!/usr/bin/env python
"""Filters Module
Author: <NAME>
Summary: Provides a framework for Kalman Filters for the WheresMySat project
Currently Implemented filters include:
- Classic Kalman Filter
"""
# standard library imports
from abc import ABCMeta, abstractmethod
# third party imports
from scipy.integrate import ... |
# -*- coding: utf-8 -*-
import math
from abc import ABCMeta, abstractmethod
import numpy as np
class Object(object):
def __init__(self, move, region, samples=100):
self._move = move
self._region = region
self.samples = samples
@abstractmethod
def __call__(self, dt):
raise... |
import asyncio
import functools
import logging
import sys
import time
from typing import Any, Dict, Iterable, Optional, Tuple
import attr
import croniter
from procrastinate import exceptions, tasks
# The maximum delay after which tasks will be considered as
# outdated, and ignored.
MAX_DELAY = 60 * 10 # 10 minutes
... |
import os
import subprocess
from datetime import datetime
from dateutil.tz import tzutc
import logging
import boto3
from botocore.exceptions import ProfileNotFound
import timeago
from tabulate import tabulate
from . import settings
logger = logging.getLogger(__name__)
try:
session = boto3.session.Session(
... |
# -*- coding: utf-8 -*-
import warnings
from functools import wraps
from flask import current_app, Markup, Blueprint, url_for, request
from flask_ckeditor.fields import CKEditorField
from flask_ckeditor.utils import get_url
class _CKEditor(object):
"""The class implement funcitons for Jinja2.
"""
... |
import json
import logging
import operator
import re
from datetime import datetime, timedelta
from typing import Union
from sqlalchemy import extract, exists, desc
from bookbot import dataentities
from bookbot.dataentities import session
from bookbot import bot_scheduler
class Consts:
def __init__(self):
... |
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... |
import logging
import os
from functools import partial
from multiprocessing.pool import ThreadPool
from urllib.parse import urlparse
from urllib.request import urlopen
import fiona
import requests
from tqdm import tqdm
BASE_HOST = 'https://visualizador.ide.uy'
DATA_PATH = '/descargas/datos/'
DEFAULT_CRS = 'epsg:4326'... |
"""
Created by: <NAME>
Last updated: July, 2016
Provides classes and functions implementing probability-related calculations
"""
from collections import defaultdict
from math import log
def js_divergence(dist1, dist2):
"""
Calculates JS-divergence between 2 distributions
:param dist1: first distributio... |
# util functions that do not require tensorflow
import os
import numpy as np
import pandas as pd
from PIL import Image
from typing import List, Optional, Text, Tuple
from datetime import datetime as dt
import csv
import logging
import urllib
from io import BytesIO
import re
def make_fpath_from_id(_id, image_fldr="..... |
#!/usr/bin/env python3
'''
Convert an HTML file of book notes exported from an Amazon Kindle
to a Markdown document
'''
import argparse
from collections import OrderedDict
import sys
import traceback
from bs4 import BeautifulSoup
from eglogging import *
logging_load_human_config()
class Note:
# highlight, possibl... |
#!/usr/bin/python
# this is a modified simple-agent
# changes by <NAME>:
# * capability = NoInputNoOutput
# * fixed PIN 0000
# * always return "yes" on all prompts.
# **** USE AT YOUR OWN RISK ****
from __future__ import absolute_import, print_function, unicode_literals
from optparse import OptionParser
import sys
i... |
import binascii
import struct
import hashlib
import math
import bittensor
import rich
import time
import torch
import numbers
import pandas
from typing import Tuple, List, Union, Optional
def indexed_values_to_dataframe (
prefix: Union[str, int],
index: Union[list, torch.LongTensor],
values:... |
"""Unit tests for sciunit utility functions and classes"""
import tempfile
import unittest
import sciunit
from sciunit.utils import use_backend_cache
import numpy as np
class CacheTestCase(unittest.TestCase):
def test_basic_cache(self):
class dummy_test(sciunit.Test):
# The name of the cac... |
from flask import jsonify, url_for, request, make_response
from flask.ext.restful import reqparse, abort
from web_api.models import db
import requests
import base64
import json
#### Helper Functions ####
def abort_if_record_doesnt_exist(id, entity):
if entity is None:
abort(404, message="ID {} doesn't ... |
#!/usr/bin/env python
# encoding: utf-8
#
# See CONTRIBUTING.md for an explanation of this file.
#
# NOTE: The test suite is not working under Windows right now as I have no
# access to a windows system for fixing it. Volunteers welcome. Here are some
# comments from the last time I got the test suite running under win... |
import enum
import mimetypes
import os
import pathlib
import warnings
from collections import namedtuple
from dataclasses import dataclass
from enum import Enum
from os import PathLike
from typing import IO, Dict, ItemsView, List, Optional, Tuple
from zipfile import BadZipFile, LargeZipFile, Path, ZipFile
import magic... |
import concurrent.futures
import datetime
import os
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
import pandas as pd
import pymongo
import QUANTAXIS as QA
from QUANTAXIS.QAFetch.QATdx import QA_fetch_get_stock_list
from QUANTAXIS.QAUtil import (DATABASE, QA_util_date_stamp,
... |
import sqlite3
from datetime import datetime
import pytz
from google.api_core.exceptions import Conflict, NotFound
from google.cloud import bigquery
from jiraslackpm.jira import get_all_users, get_info_from_issue, get_all_issues_by_user
class BigQueryDatabase(object):
"""BigQuery database class that holds our d... |
"""Docstring"""
import sys
import copy
import pickle
import numpy as np
import matplotlib.pyplot as plt
from context import mla
import internal_args
def produce_and_minimize(
pm_analysis: mla.Analysis,
n_trials: int,
**kwargs
) -> np.ndarray:
"""Docstring"""
if args['verbose']:
print(
... |
import os
import glob
from cmd import Cmd
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" # Disable unnecesarry TensorFlow logs
import numpy as np
import tensorflow as tf
from tokenizers import Tokenizer
import whatsapp_parser
processes = None
w_parsers, tokenizers = {}, {}
def enable_gpu():
# Enable GPU memory growth... |
import os
from enum import Enum
from discord import Color
from yaml import safe_load
DEV_MODE = True
log_channel = 728570503169704014
contact_channel = 728570526443896934
support_channel = 728570540998262834
bug_report_channel = 728570578507923526
suggestions_channel = 728570594899132456
complaints_channel = 7285706... |
from typing import Tuple, List
import os
import re
from IntrinsicAnalysis.feature_extractors.utils import EXTERNAL_DIR
with open(os.path.join(EXTERNAL_DIR, "common_abbrevs.txt"), 'r', encoding="utf8") as fin:
ABBREVS_FORMS = [abbrev_form.split() for abbrev_form in fin.readlines()]
with open(os.path.join(EXTERNAL_D... |
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import functools
from .argument import Argument
from .code_generator_info import CodeGeneratorInfo
from .composition_parts import WithCodeGeneratorInfo
from... |
#!/usr/bin/env python3
from icmplib import ping
import json
import logging
import requests
from requests.structures import CaseInsensitiveDict
from pathlib import Path
import configparser
import argparse
import sys
import subprocess
import shlex
import os
from concurrent.futures import ThreadPoolExecutor, as_completed... |
import cv2
import numpy as np
MODEL_PATH_MAX_VERTICES_CNT=98
eon_focal_length=910
medmodel_zoom = 1.
# MEDMODEL_INPUT_SIZE = (512, 256)
# MEDMODEL_YUV_SIZE = (MEDMODEL_INPUT_SIZE[0], MEDMODEL_INPUT_SIZE[1] * 3 // 2)
# MEDMODEL_CY = 47.6
# intrinsic = np.array([
# [ eon_focal_length / medmodel_zoom, 0., 0.... |
import torch.nn
from .manifolds import Euclidean, Manifold
from .docutils import insert_docs
import functools
from typing import Union, Tuple
from .utils import copy_or_set_
__all__ = ["ManifoldTensor", "ManifoldParameter"]
class ManifoldTensor(torch.Tensor):
"""Same as :class:`torch.Tensor` that has information... |
import os
import sys
import numpy as np
import pandas
from numpy import unravel_index
import pims
import matplotlib.pyplot as plt
import SpheroidSegmentBF
def _getState(pos, xSph, ySph, radius):
"""
Returns:
- 0 if cell not on spheroid
- 1 if cell on spheroid
"""
if not isinstance(pos, t... |
import scipy.signal as signal
import scipy.ndimage as ndimage
import numpy as np
import lenstronomy.Util.kernel_util as kernel_util
import lenstronomy.Util.util as util
import lenstronomy.Util.image_util as image_util
class PixelKernelConvolution(object):
"""
class to compute convolutions for a given pixeliz... |
#!/usr/bin/env python3
"""
Converts anvil annotation to a per-frame CSV annotation.
Anvil annotations are xml files with information on the annotator and
video stored in the <head> and operative steps stored in the <body>.
This script takes a directory which contains anvil files, then for each
file determines the an... |
from __future__ import print_function
# import httplib2
# import os
#
# from googleapiclient import discovery
# from oauth2client import client
# from oauth2client import tools
# from oauth2client.file import Storage
#
# import datetime
#
# from googleapiclient.http import MediaFileUpload
#
#
#
#
# from __future__ im... |
#!/usr/bin/python3
import ast
import importlib
import sys
import warnings
from hashlib import sha1
from inspect import getmembers, isfunction
from pathlib import Path
from types import ModuleType
from typing import Any, Dict, Generator, Optional, Tuple
from brownie.exceptions import ProjectNotFound
from brownie.proje... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, <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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
#!/usr/bin/env python
"""
in order to create virtual environment with the required (dev) dependencies:
make venv
TODO use bandit to check for vulnerabilities:
conda install bandit
bandit ./multivar_horner/*.py
"""
import os
import re
import sys
from os.path import abspath, isfile, join, pardir
PACKAGE = "mult... |
from __future__ import division
import numpy as np
import os
from six.moves.urllib import request
import unittest
from chainer import testing
from chainercv.evaluations import calc_instance_segmentation_voc_prec_rec
from chainercv.evaluations import eval_instance_segmentation_voc
@testing.parameterize(*(
testi... |
# Copyright 2016 NTT DATA
# 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... |
import smepu
import inspect
import json
import os
import sys
import warnings
from argparse import ArgumentParser, Namespace
from pathlib import Path
from pydoc import locate
from typing import Any, Dict
import matplotlib.cbook
import numpy as np
from gluonts.dataset.common import TrainDatasets, load_datasets
from glu... |
import gc
import glob
import os.path
import numpy as np
import pandas as pd
import torch
from sentence_transformers import SentenceTransformer, util
from torch import nn
from bin.inference.chunks import chunks
from bin.transformers.concat_regression import ConcatRegression
from bin.file_utils import rm_and_new_folder... |
from __future__ import absolute_import
import os
import uuid
from flask import (
Blueprint,
url_for,
jsonify,
current_app,
request,
abort,
send_file,
)
from werkzeug import exceptions
from munimap.export import mapfish, raw
from munimap.queue.queue import SqliteQueue
from munimap.print_re... |
import logging
import boto3
import enum
from botocore.exceptions import ClientError
logger = logging.getLogger(__name__)
class ServiceState(enum.Enum):
STARTING = enum.auto()
ACTIVE = enum.auto()
STOPPING = enum.auto()
FAILING = enum.auto()
class Provisioner:
"""
Runnable Task to monitor SQ... |
from elftools.dwarf import callframe
import enum
import subprocess
import re
import json
import collections
from math import ceil
class ProportionFinder:
''' Finds figures such as median, etc. on the original structure of a
dictionnary mapping a value to its occurrence count '''
def __init__(self, count... |
from ase.md.verlet import VelocityVerlet
from theforce.calculator.posterior import PosteriorVarianceCalculator
from theforce.run.pes import potential_energy_surface
from theforce.descriptor.atoms import TorchAtoms, AtomsData, LocalsData, sample_atoms
from theforce.util.util import iterable
import numpy as np
def mlm... |
"""Dataset class template
This module provides a template for users to implement custom datasets.
You can specify '--dataset_mode template' to use this dataset.
The class name should be consistent with both the filename and its dataset_mode option.
The filename should be <dataset_mode>_dataset.py
The class name should... |
"""
Article content presenter
=========================
Contains ArticleContent, ArticleSubtitle, ArticleParagraph, ArticleImage, ArticleAudio and ArticleVideo
classes which presents data to the 'articlecontent.kv' components views.
"""
from kivy.properties import ListProperty
from kivy.uix.boxlayout import BoxLayout
... |
import numpy as np
from ..resources import Buffer
from ._base import Geometry
from .utils import merge
def generate_torso(
radius_bottom,
radius_top,
height,
radial_segments,
height_segments,
theta_start,
theta_length,
):
# compute POSITIONS assuming x-y horizontal plane and z up axis... |
import sys
import time
import datetime
import logging
from docopt import docopt
import numpy as np
from pysilcam import __version__
from pysilcam.acquisition import Acquire
from pysilcam.background import backgrounder
from pysilcam.process import processImage, statextract
import pysilcam.oilgas as scog
from pysilcam.co... |
import yfinance as yf
import seaborn as sns
import pandas as pd
import warnings
import requests
import getpass
import csv
# warnings.simplefilter(action="ignore", category=SettingWithCopyWarning)
class YFinanceDataset:
# fetch data by interval (including intraday if period < 60 days)
# valid intervals: 1m,2m... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import im2mesh.common as common
from matplotlib import pyplot as plt
import numpy as np
import warnings
warnings.filterwarnings("ignore", category=UserWarning, module="torch.nn.functional")
class GraphUnpooling(nn.Module):
''' Graph Unpooling Layer... |
#
# GDAX/AuthenticatedClient.py
# <NAME>
#
# For authenticated requests to the GDAX exchange
import hmac, hashlib, time, requests, base64, json
from requests.auth import AuthBase
from GDAX.PublicClient import PublicClient
class AuthenticatedClient(PublicClient):
def __init__(self, key, b64secret, passphrase, api_... |
# coding=utf-8
# 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 re... |
from datetime import datetime
from json import (dumps, loads)
import os
from typing import Union
from dotenv import load_dotenv
from flask import (
abort,
Blueprint,
jsonify,
request,
Response,
send_from_directory,
)
from werkzeug.utils import secure_filename
# Load .env file in the env variab... |
#A k-ary tree is a tree with k-children,
# and a tree is symmetrical if the data of the left side of the tree is the same as the right side of the tree.
#Here's an example of a symmetrical k-ary tree.
# 4
# / \
# 3 3
# / | \ / | \
#9 4 1 1 4 9
#Given a k-ary tree, figure out if the ... |
#!/usr/bin/env python3
import sys
import subprocess
import platform
import os
import urllib.request
import shutil
import hashlib
import zipfile
import argparse
LATEST_MIDA_BINARY_LINUX = 'https://files.mida.sprai.org/mida_linux_amd64'
LATEST_MIDA_BINARY_MAC = 'https://files.mida.sprai.org/mida_darwin_amd64'
PATH_TO_B... |
import numpy as np
import keras.backend as K
import gc
import sys
from keras.layers import Dense,LSTM,Embedding,Input,GlobalAveragePooling2D
from keras.models import Model
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint
from preprocessing import START,STOP,LINE,DIC_NAME,EXTRA,get_in,get_ou... |
from data_analysis.parallel_statistics.err_mem_size_statistics import prlp_tag, rlp_tag, mem_size_tag
from paper_figures.tkde.data_legacy.static_data_loader import *
def get_algorithm_indexing_time_lst(tag):
if tag is vldbj_reasd_tag:
return [0.00522976, 0.00612305, 0.00374263, 0.00103439, 0.00722572, 0.0... |
import pandas as pd
import numpy as np
from visions.application.summaries.functional import (
summarize_frame,
summarize_series,
summarize,
)
from visions.application.summaries.summary import CompleteSummary
from visions.core.implementations.types import visions_string, visions_integer
def test_summarize... |
"""Naming convention is thus:
VDApprox -- approximate KL-div from improper pow2 prior for complex VD
VDScaleFree -- exact KL-div (improper pow1 prior) for complex VD
VDBogus -- improper pow2 prior, but with fake forward outputs for complex VD
"""
import torch
import torch.nn.functional as F
from ..complex import CplxL... |
import pickle
from erdos.message import Message, WatermarkMessage
from erdos.internal import (PyReadStream, PyWriteStream, PyLoopStream,
PyIngestStream, PyExtractStream, PyMessage)
from erdos.timestamp import Timestamp
def _parse_message(internal_msg):
"""Creates a Message from an int... |
# -*- coding: utf-8 -*-
################################################################################
## Generated by alexpdev
##
## PySide6
##
## 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 P... |
import numpy as np
import matplotlib
#matplotlib.use('Agg')
from matplotlib import pyplot as plt
def calculate_window_average(values, win_size):
nrof_values = len(values)
nrof_windows = int(nrof_values / win_size)
winavg = np.ndarray((nrof_windows))
for window_index in range(nrof_windows):
wi... |
import argparse
import json
import numpy as np
import torch
from torch.utils.data import DataLoader
from tqdm import tqdm
from pynif3d.common.verification import check_not_none, check_path_exists
from pynif3d.datasets import Shapes3dDataset
from pynif3d.models import ConvolutionalOccupancyNetworksModel, PointNet_Loca... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@Author : yanyongyu
@Date : 2020-05-26 22:09:24
@LastEditors : yanyongyu
@LastEditTime : 2020-05-30 13:33:09
@Description : None
@GitHub : https://github.com/yanyongyu
"""
__author__ = "yanyongyu"
import logging
from typing import Lis... |
import asyncio
import functools
import secrets
from abc import ABC, abstractmethod
from datetime import timedelta
from enum import Enum
from typing import Optional
from hivemind.proto.auth_pb2 import AccessToken, RequestAuthInfo, ResponseAuthInfo
from hivemind.utils.crypto import RSAPrivateKey, RSAPublicKey
from hivem... |
"""Utilities for serializing arbitrary objects."""
from typing import Any, Mapping, Type, TypeVar
from src.utils.typing import PathLike
import spacy
import torch
from torch import nn
# Useful type aliases to help with subclassing.
Properties = Mapping[str, Any]
Serialized = Mapping[str, Any]
Children = Mapping[str, ... |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 28 13:09:50 2016
MIT License
Copyright (c) 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 limita... |
# Copyright (c) 2020, <NAME>
# All rights reserved.
# Published under the BSD license. See LICENSE For details.
"""Ansi-enhanced output printer library."""
import io
import sys
from colors import color
from colors import STYLES
default_style = {
'display': 'inline',
'padding-top': 0,
'padding-bottom': 0... |
"""Backend supported: tensorflow.compat.v1, tensorflow
Identification of the parameters of the modified Lorenz attractor (with exogenous input)
see https://github.com/lululxvi/deepxde/issues/79
"""
import re
import deepxde as dde
import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
from scipy.integra... |
import tensorflow as tf
from odps import ODPS
from elasticdl.python.common.constants import Mode
from elasticdl.python.data.odps_io import ODPSReader
from elasticdl.python.data.reader.data_reader import (
AbstractDataReader,
Metadata,
check_required_kwargs,
)
class ODPSDataReader(AbstractDataReader):
... |
import time
from collections import defaultdict
from functools import lru_cache
from typing import Literal, Optional
import requests
from bscscan import BscScan
from net_worth_tracker.utils import euro_per_dollar, read_config
IGNORE_TOKENS = {"VERA"}
# Pool/vault -> coin name
LP_MAPPING = {
"BELT-BNB BELT LP": ... |
import pytest
import numpy as np
from astropy import units
from py21cmsense import GaussianBeam, Observation, Observatory, PowerSpectrum
from py21cmsense.sensitivity import Sensitivity, _kconverter
@pytest.fixture(scope="module")
def bm():
return GaussianBeam(150.0 * units.MHz, dish_size=14 * units.m)
@pytest... |
import json
import asyncio
import aiohttp
import async_timeout
from .errors import (FCMError, FCMAuthenticationError, FCMInvalidParameters, FCMMissingRegistration,
FCMInvalidRegistration, FCMNotRegistered, FCMInvalidPackageName,
FCMMismatchSenderId, FCMMessageTooBig, FCMInval... |
import collections
import json
import os
import types
import torch
from tqdm import tqdm
from train import argument_parser, parse_args, configure
from train import get_validation_dataset, get_validation_iterator
from train import build_net
from diora.logging.configuration import get_logger
from diora.analysis.cky ... |
# -*- coding: utf-8 -*-
import numpy as np
import networkx as nx
from scipy import sparse
from scipy.linalg import eig
from itertools import product
def get_base_modularity_matrix(network):
'''
Obtain the modularity matrix for the whole network
Parameters
----------
network : nx.Graph or nx.DiGrap... |
import torch
def initialize_decoder_module(in_channels: int, out_channels: int) -> torch.nn.Module:
"""Initialize a decoder module including a ConvT, batchnorm and ReLU
"""
m = torch.nn.Sequential(
torch.nn.ConvTranspose2d(in_channels=in_channels, out_channels=out_channels, kernel_size=4, stride=2,... |
#!/usr/bin/env python
#
# Copyright (c) 2015, 2016, 2017, 2018, 2019, 2020, Intel Corporation
#
# 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 copyrig... |
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 19 15:32:44 2018
@author: <NAME>
"""
from getKeys import key_check
from grabScreen import grab_screen
import cv2
import numpy as np
import os
import time
### vcituvanje na objektite za detekcija ###
img_template1 = cv2.imread('cactus1.png',0)
img_temp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test basic GDAL open
# Author: <NAME> <even dot rouault at mines dash paris dot org>
#
###################################################... |
import json
from json import JSONDecodeError
from typing import Tuple, Optional, Dict, Any, List
import click
from pathlib import Path
from rossum import option, argument
from rossum.lib import QUEUES
from rossum.lib.api_client import RossumClient
from tabulate import tabulate
def cleanup_config(config: Dict) -> Dic... |
import os
import numpy as np
import argparse
import torch
import torch.optim as optim
from tqdm import *
from torch.autograd import Variable
import torch.nn.functional as F
import torch.nn as nn
import torch.utils.data
import torchvision.transforms as transforms
import torchvision.datasets as datasets
impor... |
import serial
import time
from ctypes import cast, POINTER
from comtypes import CLSCTX_ALL
from pycaw.pycaw import AudioUtilities, IAudioEndpointVolume, ISimpleAudioVolume
DELIMITER = "#"
SYSTEM_SOUNDS = 0
MASTER_VOLUME = 1
active_pid = MASTER_VOLUME
button_down = False
volume_val = 0
devices = AudioUtilities.GetS... |
# chess objects and functions
# utf-8
"""
Remake of an old chess calculator I made back in 1998
"""
import tkinter as tk
import sqlite3
# import wrapper_sqlite3
conn = sqlite3.connect("data\\chess.db")
# function for rebuilding the database to zero ##############################
def rebuild():
curs = conn.curs... |
# -*- coding: utf-8 -*-
"""models"""
from datetime import datetime
import uuid
from django.conf import settings
from django.contrib.sites.models import Site
from django.db import models
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from coop_cms.models import Newsletter
c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.