text stringlengths 6.04k 39.5k |
|---|
import random
from random import randint, randrange
from abc import ABCMeta, abstractmethod
from time import time, localtime, sleep
from math import sqrt
class Person(object):
def __init__(self, name, age):
self._name = name
self._age = age
# 访问器 - getter方法
@property
def name(self):
... |
from __future__ import unicode_literals
from collections import Counter
import logging
from django.db import models, transaction
from django.contrib.auth.models import Group
from django.contrib.auth import get_user_model
from nodeconductor.core.tasks import send_task
from nodeconductor.core.models import SshPublicKe... |
import catpy
import json
from typing import NamedTuple, List, Dict
import random
import pickle
from pathlib import Path
import datetime
from sarbor.skeletons import Skeleton
"""
A script to gather data.
handles fetching from catmaid and compiling skeletons into
reusable datasets
GOAL: make datasets easily obtainable... |
import os
from io import StringIO
import streamlit as st
import pymongo
import pandas as pd
import numpy as np
from cryptography.fernet import Fernet
from PIL import Image
from math import floor, ceil
import pydeck as pdk
def decrypt(token: bytes, key: bytes) -> bytes:
return Fernet(key).decrypt(token)
def chec... |
# -*- coding: utf-8 -*-
# @Time : 2021/3/22 13:20
# @Author : Shigure_Hotaru
# @Email : <EMAIL>
# @File : tools.py
# @Version : Python 3.8.5 +
import json
import math
import os
import socket
import logging
import struct
import time
import traceback
from concurrent.futures import ThreadPoolExecutor
from ... |
# Created by <NAME>
# Date 2/27/2020
# This code implements a recurrent neural network that takes the last 12 observations (Lidar data) and actions
# (velocity, steering angle) to predict the current state and next state.
# --------------- IMPORTING THE NECESSARY MODULES ----------------
# importing the necessary mo... |
from datetime import date
import itertools
import json
import uuid
from persistent import Persistent
from persistent.list import PersistentList
from persistent.mapping import PersistentMapping
from plone.uuid.interfaces import IUUID
from repoze.catalog import query
import transaction
from zope.component import adapts,... |
from typing import List, Optional
import graphene
import base64
import math
import flask
from gtmcore.activity import ActivityStore
from lmsrvcore.caching import DatasetCacheController
from lmsrvcore.auth.user import get_logged_in_username
from lmsrvcore.api.interfaces import GitRepository
from lmsrvcore.utilities imp... |
# Copyright (c) 2015 Rackspace, 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 wr... |
# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# Modifications copyright (c) 2021 DocYard 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
#
# ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import io
import base64
import math
import hashlib
import re
import xml.etree.ElementTree as ET
from PIL import Image
from escpos.constants import *
import logging
import six
_logger = logging.getLogger(__name__)
def utfstr(stuff):
""" converts stu... |
"""
Design reference
https://github.com/openai/baselines/blob/master/baselines/deepq/replay_buffer.py
"""
import tensorflow as tf
import numpy as np
import shutil
import random
import os
from tf_rl.common.segment_tree import SumSegmentTree, MinSegmentTree
def check_path(path):
if path[-1] == "/":
return ... |
import argparse
import time
import yaml
import os
import sys
import logging
from collections import OrderedDict
from contextlib import suppress
from datetime import datetime
import torch
import torch.nn as nn
import torchvision.utils
from torch.nn.parallel import DistributedDataParallel as NativeDDP
from config impor... |
import collections
import random
import operator
import numpy as np
from matplotlib import pyplot as plt
import pylab
import matplotlib.colorbar as cbar
import matplotlib.patches as patches
from curriculum.logging.visualization import save_image
from rllab.misc import logger
class Region(object):
def __init__(... |
import os
import time
import asyncio
import aiohttp
import urllib
import requests
from threading import Thread
from datetime import datetime
# discord
import discord
from discord.ext import commands
# discordgsm
from bin import *
from servers import Servers, ServerCache
from settings import Settings
# bot static dat... |
import csv
import datetime
import os
#extra
class myLists():
def __init__(self, nome, num, lista):
self.nome = nome
self.num = num
self.lista = lista
#diretorio
def openTxt(nameFile):
dir = os.path.dirname(os.path.abspath(__file__)) # tira o ultimo elemento que é o nome... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import DataLoader
from data_preprocessing import data_load
import datetime
import time
import os
import csv
import copy
import argparse
import configparser
from torchsummaryX import su... |
import os
import sys
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import RandomizedSearchCV
from initialize import load_tmp_file, ALL_SEGMENTS, \
REAL_SEGMENTS, GROUNDTRUTH_DIR
SLOT_3_LEAVING = [
[(2, 0, 0), (2, 1, 1), (2, 0, 1)],
[(2, 0, 0), (0, 0, 0... |
try:
from simtk.openmm.app.internal import amber_file_parser
from simtk.openmm.app import *
from simtk.openmm.vec3 import Vec3
from simtk.openmm import *
from simtk.unit import *
except:
from openmm.app.internal import amber_file_parser
from openmm.app import *
from openmm.vec3 import Ve... |
"""
File: score_to_vst_midi_converter.py
Purpose: Provides a means to convert a score to an object representation for vst.
"""
import logging
from fractions import Fraction
from structure.score import Score
from timemodel.tempo_event import TempoEvent
from timemodel.time_signature_event import TimeSignatureEvent
f... |
import argparse
import datetime
import hashlib
import os
import sys
try:
from math import isclose
except (ImportError, AttributeError): # not in Python 2.7
def isclose(a, b, rel_tol=1e-09, abs_tol=0.0):
return abs(a - b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)
from . import Path
from dateutil i... |
import sys
import cv2
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorboard as tb
from torchvision.transforms import ToTensor
import torch
import torch.nn.functional as F
from torch_geometric.data import Data, DataListLoader
from torch_geometric.nn import DataParallel
from PIL ... |
#
# taut_polytope.py
#
# Analyze manifolds and their taut/veering triangulations.
# TODO - Gurobi?
import regina
import snappy
from sage.numerical.mip import MIPSolverException, MixedIntegerLinearProgram
from sage.geometry.polyhedron.constructor import Polyhedron
from sage.matrix.constructor import Matrix
from sag... |
import json, hashlib, os, os.path, shutil, fcntl, errno
from collections import defaultdict
from datetime import datetime
from typing import List, Dict, Any, cast
from typing_extensions import TypedDict
import bversion.common as sfs
from bversion.storage.server_db import get_server_db_instance_for_thread
#+++++++++... |
import torch
import torch.nn as nn
import math
import numpy as np
def make_batch_mask(nframes, max_seq_len, device):
"""
makes a mask for a single batch.
Parameters:
nframes (torch.Tensor [batch])
- Tensor containing the lengths of each sequence in batch
"""
nframes =... |
import skoolkit.disassembler
class OperandFormatter(skoolkit.disassembler.OperandFormatter):
def is_char(self, value):
return 32 <= value < 127
class Disassembler:
def __init__(self, snapshot, config):
self.snapshot = snapshot
self.defb_size = config.defb_size
self.defm_size = ... |
import numpy as np
import cv2
import threading
import time
from CMDcontrol import action_append,action_list
# from Robot_control import action_append,action_list
import math
def detectrectangle(contour):
shape = "unidentified"
peri = cv2.arcLength(contour, True)
#print(peri)
approx = cv2.approxPolyDP(... |
#!/usr/bin/env python3
# Copyright 2021 <NAME>
# Copyright 2021 Quarkslab
# Copyright 2021 Association STIC
#
# 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/lice... |
'''
Copyright (C) 2021 S[&]T, The Netherlands.
'''
import datetime
import os
import shutil
import tempfile
import unittest
from pathlib import Path
from typing import List, Set, Tuple, Type, Union
from xml.etree import ElementTree as et
from procsim.biomass.main_product_header import (MainProductHeader, bio, eop,
... |
# -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
import h5py
from PIL import Image
import cv2
from functools import reduce
from operator import mul
from os.path import exists
import os
from tensorflow.python.layers.convolutional import Conv2D,conv2d
from tensorflow.python.layers.pooling import Average... |
import cmocean
import copy
from datetime import datetime
from matplotlib import pyplot as plt
import matplotlib.colors
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import numpy as np
import pandas as pd
import os
import seaborn as sns
import utm
i... |
# -*- coding:utf-8 -*-
import os
import os.path
from threading import Lock
import logging
from ..common.agent import BaseAgent
from ..common.base import (XOPEN,
XCLOSE,
STATE_PATH,
BaseObject,
LONG,
... |
import numpy as np
import numpy.testing as npt
import unittest
import floatingse.substructure as subs
from commonse import gravity as g
NSECTIONS = 5
NPTS = 100
class TestSubs(unittest.TestCase):
def setUp(self):
self.params = {}
self.unknowns = {}
self.resids = {}
self.params['st... |
#! /usr/bin/env python3
#
# Copyright (C) 2020 <NAME>
# This file is part of the legocad python module.
# 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 witho... |
# logisticleave1out.py
#
# Based on parallel_crossvalidate.py
# from the paceofchange repo.
#
# Reads all volumes meeting a given set of criteria,
# and uses a leave-one-out strategy to distinguish
# reviewed volumes (class 1) from random
# class 0. In cases where an author occurs more
# than once in the dataset, it le... |
"""
This module provides main functionality for planet search.
:License: :doc:`LICENSE`
.. moduleauthor:: <NAME> <<EMAIL>>
"""
# import glob
import os
import pandas as pd
from astropy.io import fits
from astropy.stats import sigma_clip
from scipy import signal
import numpy as np
from transitleastsquares import (tran... |
from asyncore import write
from distutils.command.clean import clean
from functools import reduce
from operator import length_hint
import sys
from pyarrow.dataset import field
import pyarrow.compute as pc
import pyarrow as pa
import builtins
from copy import deepcopy
import uuid
import gc
from concurrent.futures import... |
from collections import OrderedDict
import numpy as np
from gym.spaces import Box, Dict
from roworld.envs.env_util import get_stat_in_paths, \
create_stats_ordered_dict, get_asset_full_path
from roworld.core.multitask_env import MultitaskEnv
from roworld.envs.mujoco.ur5e_xyz.base import UR5eXYZEnv
class UR5ePush... |
"""
weasyprint.images
-----------------
Fetch and decode images in various formats.
"""
import math
from io import BytesIO
from xml.etree import ElementTree
import cairocffi
import cairosvg.parser
import cairosvg.surface
from .layout.percentages import percentage
from .logger import LOGGER
from .urls i... |
"""
Installs packages using PIP
"""
import sys
import re
import subprocess
from email.parser import FeedParser
from .compat import lambda_abi
from .compat import pip_import_string
from .compat import pip_no_compile_c_env_vars
from .compat import pip_no_compile_c_shim
from .utils import OSUtils
# TODO update the wo... |
from nipype.pipeline import engine as pe
from nipype.interfaces import afni, ants,fsl,utility as niu
from nipype.interfaces.fsl import Split
from nipype.interfaces.fsl.preprocess import FUGUE,PRELUDE
import nibabel as nb
import numpy as np
def meanimage(in_file,out_file):
'find mean of the 4D data'
import n... |
#!/usr/bin/env python
"""
@package mi.dataset.parser
@file marine-integrations/mi/dataset/parser/dbg_pdbg_cspp.py
@author <NAME>
@brief Parser for the dbg_pdbg_cspp dataset driver
Release notes:
initial release
"""
import copy
import re
import string
import numpy
from mi.core.log import get_logger
from mi.core.com... |
"""Render method of trading operations with multi pairs.
This environment use an array rank 1 with 220 items as it's observations space.
<NAME>
2019
"""
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from matplotlib import style
from configs.vars import *
# fi... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# License: MIT. See LICENSE
import json
import os
from urllib.parse import parse_qs, urlparse
import dropbox
from rq.timeouts import JobTimeoutException
import frappe
from frappe import _
from frappe.integrations.offsite_backup_utils ... |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. 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/LI... |
# -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we as... |
# -*- coding: utf-8 -*-
##
# Copyright 2018 University of Bristol - High Performance Networks Research
# Group
# All Rights Reserved.
#
# Contributors: <NAME>, <NAME>, <NAME>
# Muqaddas, <NAME>, <NAME> and <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in c... |
import itertools
import torch
import torch.nn as nn
import torch.nn.functional as F
from .functional import mask, positional_encoding
from .transform import Pad
# ===============================================
# Parallel Text2Mel
# ===============================================
def expand_encodings(encodings, du... |
# import sys
# import os
# import jsonpickle
import json
# import string
# import csv
from pandas import json_normalize
import pandas
import numpy
from scipy.signal import savgol_filter
#numpy.float64
#pd.DataFrame
# with open('C:/Users/jacci/Documents/DS 710/coffee_roasting_profiles/data-raw/saved/Haiti--2021-02-09-2... |
# 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... |
from collections import defaultdict
from dist_zero import transaction, messages, errors, ids, intervals
from dist_zero.node.link import manager
class CreateLink(transaction.ParticipantRole):
'''
Used to start up the root `LinkNode` of a link (sub)tree.
Connects that link to source and target root nodes.
'''... |
import reinforcement.core as core
import reinforcement.distribution as distribution
import tensorflow as tf
import numpy as np
from reversi.game_core import Field, Board, GameState
import multiprocessing
import os
# WARNING - WARNING - WARNING
# This code will not execute with the current project structure.
# It is he... |
# coding: utf-8
#
# Misc. utility functions for Mailpile.
#
import cgi
import datetime
import hashlib
import locale
import re
import subprocess
import os
import sys
import string
import tempfile
import threading
import time
import StringIO
from gettext import gettext as _
try:
from PIL import Image
except:
Ima... |
#!/usr/bin/env python3
# Usage:
# PYTHONPATH=src ./train --dataset <file|directory|glob>
import argparse
import json
import os
import numpy as np
import tensorflow as tf
import time
import tqdm
from tensorflow.core.protobuf import rewriter_config_pb2
import sys
sys.path.append('tf_gpt2/src/')
import model, sample,... |
import numpy as np
from generic import pad_sequences
from textworld.logic import Proposition
# Helper functions to query state/facts.
def _check_attributes(attributes, entity, facts):
attributes = set(attributes)
filtered = (fact for fact in facts
if (fact.name in attributes and
... |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the MIT License. See the LICENSE file in the root of this
# repository for complete details.
"""
Processors and helpers specific to the :mod:`logging` module from the `Python
standard library <https://docs.python.org/>`_.
See also... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import math
from datetime import datetime, time, timedelta
from dateutil.rrule import rrule, DAILY
from functools import partial
from itertools import chain
from pytz import timezone, utc
from odoo import api, fields, m... |
"""
Copyright (c) Facebook, Inc. and its affiliates.
"""
import argparse
import logging
import os
import shutil
import time
from subprocess import Popen, PIPE, TimeoutExpired
import boto3
from datetime import datetime
import torch
import random
from typing import List
from utils.data_generator import DataGenerator
f... |
import json
import os
import threading
import time
import requests
from flask import jsonify
import config
AGENT_ADMIN_API_KEY = os.environ.get("AGENT_ADMIN_API_KEY")
ADMIN_REQUEST_HEADERS = {}
if AGENT_ADMIN_API_KEY is not None:
ADMIN_REQUEST_HEADERS = {"x-api-key": AGENT_ADMIN_API_KEY}
TOB_ADMIN_API_KEY = os.... |
try:
# installed by bootstrap.py
import sqla_plugin_base as plugin_base
except ImportError:
# assume we're a package, use traditional import
from . import plugin_base
import argparse
import collections
from functools import update_wrapper
import inspect
import itertools
import operator
import os
import... |
import io
import math
import warnings
import itertools
import numpy as np
from PIL import Image
from tqdm import tqdm
import argparse
import lightkurve as lk
import matplotlib.pyplot as plt
from astropy.stats import sigma_clip
from wotan import flatten
from .common_utils import warning_on_one_line
warnings.formatwar... |
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... |
# Copyright 2014 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
import functools
import sys
import typing as ty
import multiaddr # type: ignore[import]
from . import DEFAULT_ADDR, DEFAULT_BASE, DEFAULT_USERNAME, DEFAULT_PASSWORD
from .. import multipart, http, utils
from ..http_common import ClientSyncBase
#XXX: Review if this is still necessary after requiring Python 3.8.
if... |
#!/usr/bin/env python3
import os
import re
import sys
import logging
import argparse
import subprocess
import traceback
import unittest
import random
from io import StringIO
from functools import wraps
def main(args=sys.argv[1:]):
"""
Perform the final Zcash release process up to the git tag.
"""
opt... |
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
#from __future__ import absolute_import, division, print_function
from collections import OrderedDict
from operator import itemgetter
from datetime import datetime
import os
import glob
import shutil
#DNA to bit {'A':bit(00), C:01, G:10, T:11}
def is_id(line)... |
from suzieq.gui.guiutils import display_help_icon
from suzieq.gui.guiutils import (gui_get_df, get_base_url, get_session_id,
SuzieqMainPages)
from suzieq.sqobjects.path import PathObj
from copy import copy
from urllib.parse import quote
from typing import Tuple
import graphviz as graphv... |
from django.core.exceptions import ImproperlyConfigured
from django.forms import MediaDefiningClass, ModelForm
from django.utils.functional import lazy
from django.utils.module_loading import import_string
from django.utils.text import format_lazy
from django.utils.safestring import SafeText, mark_safe
from entangled.f... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (c) 2014, <NAME> <<EMAIL>>
# Py-osinfo is a Python module to get the OS type, brand, release, and kernel
# It uses a MIT style license
# It is hosted at: https://github.com/workhorsy/py-osinfo
#
# Permission is hereby granted, free of charge, to any person obta... |
'''This script is to test the BGP Allow List feature of SONiC.
'''
import json
import logging
import time
import yaml
import pytest
import requests
import ipaddr as ipaddress
from jinja2 import Template
from natsort import natsorted
from tests.common.helpers.assertions import pytest_assert
from tests.common.helpers.p... |
import logging
import re
from collections.__init__ import OrderedDict
from copy import deepcopy
import torch.nn as nn
from .utils import _parse_ksize
from .units import *
def _decode_block_str(block_str):
""" Decode block definition string
Gets a list of block arg (dicts) through a string notation of argument... |
import os
import shutil
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.spatial.distance import cdist
from skmultiflow.drift_detection import PageHinkley, KSWIN, EDDM, DDM
from skmultiflow.drift_detection.adwin import ADWIN
from src.utils.drift_detectors import DetectorZScores, Detec... |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""
This module implements Version and version-ish objects. These are:
Version
A single version of a package.
VersionR... |
__author__ = 'saeedamen & mhockenberger' # <NAME> & <NAME>
#
# Copyright 2016-2020 Cuemacro - https://www.cuemacro.com / @cuemacro
#
# 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.a... |
""" Simple Python class to access the JLR Remote Car API
https://github.com/ardevd/jlrpy
"""
from urllib.request import Request, build_opener
import json
import datetime
import calendar
import uuid
import sys
import logging
logger = logging.getLogger('jply')
logger.setLevel(logging.INFO)
ch = logging.StreamHandler(... |
"""fast_package_file
https://github.com/Kataiser/fast-package-file
https://fast-package-file.readthedocs.io/en/latest/
https://pypi.org/project/fast-package-file/
"""
__author__ = "Kataiser (https://github.com/Kataiser)"
__version__ = "1.1"
__copyright__ = "Copyright (c) 2019 Kataiser (https://github.com/Kataiser)"
__... |
# -*- coding: utf-8 -*-
# # # #
# train_vgcn_bert.py
# @author Zhibin.LU
# @created 2019-09-01T19:41:49.613Z-04:00
# @last-modified 2020-05-08T01:25:03.040Z-04:00
# @website: https://louis-udm.github.io
# @description : Train vgcn_bert model
# # # #
# %%
import os
import time
import numpy as np
import pickle as pkl
... |
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# 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... |
import pybullet as p
import time
import pybullet_data
import gym
import time
import numpy as np
import xml.etree.ElementTree as ET
import random
import pickle
import os
from fns import *
class PinkPantherEnv(gym.Env):
def __init__(self, render=True):
if render:
self.physicsClient = p.connect(p.GUI)
self.rende... |
#!/usr/bin/env python3
#
# Post Kali Installer
# --------------------
# This script was built for simple post installation of any tool needed
# after the initial installation of the regular 64 bit version of Kali Linux.
#
# For configuring this script according to your own needs please review the packages in ... |
"""
Convert model from Detectron to SimpleDet
@author: <NAME>
@usage: Follow following steps to support new model.
1. Implement functions listed below.
- get_[part]_regex: regular expression to match parameter name
- get_[part]_map: mapping relations
- parse_[part]: parse parameter name into... |
#!/usr/bin/python3
from PIL import Image, ImageOps
from PIL import ImageFont
from PIL import ImageDraw
import os
import sys
import logging
import RPi.GPIO as GPIO
from waveshare_epd import epd2in7
import time
import requests
import urllib, json
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
imp... |
# Standard Library
from enum import Enum
# Third Party
import pandas as pd
# First Party
from smdebug.core.logger import get_logger
class StatsBy(Enum):
"""
Enum to get stats by different categories.
"""
# training phase such as TRAIN/EVAL/GLOBAL.
TRAINING_PHASE = "training_phase"
# framew... |
#!/usr/bin/env python
# Copyright (c) <NAME>, 2017
# Licensed under the Apache License, Version 2.0 (the "License")
import distutils.version
import subprocess
import os
import re
from unittest import main, skipUnless, TestCase
TOOLS_DIR = "../../tools/"
def kernel_version_ge(major, minor):
# True if running kern... |
# Copyright 2013 Red Hat, 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 agr... |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 05 11:55:37 2018
@author: hugonnet
Python functions for vector and geometry manipulation with OGR/OSR Python bindings
LIST OF FUNCTIONS:
- read_geom_from_shp: read geometry from ESRI shapefile
- write_geom_to_shp: write (polygon or multipolygon) geometry to ESRI shape... |
#!/usr/bin/python
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'network'}
DOCUMENTATION = r'''
---
module: nxos_hsrp
extends_documentation_frag... |
import re
import urllib.parse
from itertools import chain
from os import PathLike
from pathlib import Path
from typing import *
import numpy as np
import pandas as pd
from typer import *
from .common import *
app = Typer()
ftdna_url_template = "https://www.familytreedna.com/public/{0}?iframe=ysnp"
def get_releva... |
import numpy as np
import numpy.random as npr
from sds import erARHMM
from sds.utils import sample_env
from joblib import Parallel, delayed
import copy
import matplotlib.pyplot as plt
from matplotlib import rc
import multiprocessing
nb_cores = multiprocessing.cpu_count()
rc('lines', **{'linewidth': 1})
rc('text',... |
'''
Copyright (c) 2020 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Cisco Sample
Code License, Version 1.1 (the "License"). You may obtain a copy of the
License at
https://developer.cisco.com/docs/licenses
All use of the material herein must be in accordance wit... |
# Copyright 2021 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, ... |
'''
Example of Continuation/Generalized-inverse (G/Ginv) method
Made in Feb. 2022 ver. 0.1
Feb. 2022 ver. 0.1.1
Bug fixed.
BSD 2-Clause License
Copyright (c) 2022, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provid... |
#! /usr/bin/env python
import argparse
from pqu import PQU
from brownies.legacy.converting import endfFileToGNDS
from fudge.core.utilities.brb import winged_banner
from fudge.productData.distributions import XYs2d, regions2d, Legendre
from fudge.productData.distributions import XYs1d as angularXYs1d
from xData import ... |
# Lint as: python3
# Copyright 2020 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 agr... |
#!/usr/bin/env python
"""This module uses the `BerkleyAutomation GQCNN
<https://berkeleyautomation.github.io/gqcnn>`_
grasp detector to compute a valid grasp out of RBG-D sensor data.
"""
# Make script both python2 and python3 compatible
from __future__ import absolute_import
from __future__ import division
from __fut... |
import argparse, os
from copy import deepcopy
from basic_utils import Fvp, conjugate_gradients
import torch
import math, random
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.utils.data import DataLoader
import torchvision.... |
# TODO 1. solve batch variable sequence length problem
# TODO 2. might reimplement as a class instead
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torch.optim import Optimizer, lr_scheduler
from livelossplot import PlotLosses
from... |
#!/usr/bin/python3
"""Tests for bar submodule"""
import unittest
import unittest.mock
from io import StringIO
from typing import ContextManager
from ascii_progress.bar import (
LAZY_FORMATTER,
BarContext,
Bar,
ASCIIBar,
ThresholdDecorator,
PercentDecorator,
BarDecorator,
BarFormat
)
... |
# Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# 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
#
# U... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 1 09:38:39 2019
@author: coleman
"""
import numpy as np
from scipy import constants,integrate,stats
import matplotlib.pyplot as plt
import seaborn as sns
#Computing integrals of the transverse & longitudinal forces from the
# D&S model.
class eb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.