text stringlengths 3.07k 22.1k |
|---|
"""
Various containers exposed to the user.
"""
from construct.lib.py3compat import *
globalfullprinting = None
def setglobalfullprinting(enabled):
r"""
Sets full printing for all Container instances. When enabled, Container str produces full content of bytes and strings, otherwise and by default, it produ... |
"""
CoreMQ
------
A pure-Python messaging queue.
License
-------
The MIT License (MIT)
Copyright (c) 2015 <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, incl... |
# MIT License
#
# Copyright (c) 2020 <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, publi... |
import torch
import torch.nn.functional as F
import matplotlib.pyplot as plt
from torch.autograd import Variable
from typing import Tuple
from torch import nn
from torch import Tensor
from PIL import Image
from torchvision.transforms import Compose, Resize, ToTensor
from einops import rearrange, reduce, repeat
from ei... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from ..layers.convolutions import Convolutional
def sobel_kernel(channel_in, channel_out, theta):
sobel_kernel0 = np.array([[1, 2, 1], [0, 0, 0], [-1, -2, -1]], dtype='float32')
sobel_kerne... |
import numpy as np
from matplotlib import pyplot as plt
from sklearn import metrics
from math import sqrt
import seaborn as sns
sns.set(rc={'figure.figsize': (6.4, 4.8)})
from sklearn.metrics import confusion_matrix
from sklearn.utils.multiclass import unique_labels
import sys
sys.path.insert(0, '/Users/chanaross/dev... |
import collections
import csv
import hashlib
import os
import re
from dataclasses import dataclass
from pathlib import Path
from typing import (
cast,
FrozenSet,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Sequence,
Tuple,
Union)
from warnings import warn
import numpy as np
... |
#!/usr/bin/env python3
# This script converts GEDCOM genealogy members
# to the FHKB turtle semantic web ontology individuals.
# (A header with FHKB ontology definitions is still required.)
# TODO adoptive families (>1) are not considered (TODO?)
# Author: <NAME>
# License: MIT
import sys
from functools import partia... |
#! /home/smithw/.tensorflow2/bin/python
# use python in (TF2) venv on acer: opencv installed there
# change-detection-from-file.py
# WESmith 01/27/22
# test change-deteciton algorithms using video files
# initial change-detection architecture from <NAME>
import cv2
import numpy as np
import os, sys
from time import... |
"""
This script contains supporting function for the data processing.
It is used in several other scripts:
for calculation of speech features, aligning sequences and generating bvh files
"""
import ctypes
import librosa
import librosa.display
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Ac... |
import urllib2
import urllib
import json
import datetime
import hashlib
import base64
import binascii
import hmac
import os
import time
import webapp2
from webapp2_extras import auth
from webapp2_extras import sessions
from google.appengine.api import memcache
from google.appengine.api import users
from google.appeng... |
from subprocess import call
from os import path
import os
import click
import numpy as np
from joblib import Parallel, delayed
from csv2hdf5 import glob_and_check
from remove_events import get_run
# supposed to be called from the same dir where superstar etc subdirs are in
# otherwise change constants
SCRIPTDIR = pat... |
### ============================================================================
### Extract met data from the NASA Nature Model run files and put them in a
### managable format
### ============================================================================
from netCDF4 import Dataset
import math
import numpy as np
fr... |
# Copyright The PyTorch Lightning team.
#
# 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 i... |
from __future__ import print_function, absolute_import
import time
from collections import OrderedDict
import pdb
import torch
import numpy as np
from .evaluation_metrics import cmc, mean_ap
from .utils.meters import AverageMeter
from torch.autograd import Variable
from .utils import to_torch
from .utils import to_n... |
import argparse
import os
import time
import torch
import matplotlib.pyplot as plt
from torch import optim
from torch.utils.data import DataLoader
from collections import deque
from dataset.baseobject import DatasetBase
from backbone.basenet import BackboneBase
from config.train_config import TrainConfig as Config
from... |
# ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... |
import time
import random
import unicodedata
import re
import discord
from jshbot import utilities, configurations, plugins, data, logger
from jshbot.exceptions import ConfiguredBotException
from jshbot.commands import (
Command, SubCommand, Shortcut, ArgTypes, Attachment, Arg, Opt, MessageTypes, Response)
__ver... |
"""
Compute Engine for FFC API
"""
from abc import (
ABCMeta,
abstractmethod,
)
from operator import and_
from six import (
iteritems,
with_metaclass,
)
from six.moves import (
reduce,
zip,
zip_longest,
)
from networkx import (
DiGraph,
get_node_attributes,
topological_sort,
)
f... |
"""
The ``mlflow.spacy`` module provides an API for logging and loading spaCy models.
This module exports spacy models with the following flavors:
spaCy (native) format
This is the main flavor that can be loaded back into spaCy.
:py:mod:`mlflow.pyfunc`
Produced for use by generic pyfunc-based deployment tools ... |
""" This file defines the linear Gaussian policy class. """
from video_prediction.utils.im_utils import npy_to_gif, resize_store
import copy
from video_prediction.control.policy.cem_controllers.cem_base_controller import CEMBaseController
import numpy as np
import matplotlib.pyplot as plt
import ray
import traceback
im... |
#
# The Python Imaging Library.
# $Id$
#
# EPS file handling
#
# History:
# 1995-09-01 fl Created (0.1)
# 1996-05-18 fl Don't choke on "atend" fields, Ghostscript interface (0.2)
# 1996-08-22 fl Don't choke on floating point BoundingBox values
# 1996-08-23 fl Handle files from Macintosh (0.3)
# 2001-02-17 fl ... |
#!/usr/bin/python3
"""
This script reports and fixes invalid ISBN numbers.
Additionally, it can convert all ISBN-10 codes to the ISBN-13 format, and
correct the ISBN format by placing hyphens.
These command line parameters can be used to specify which pages to work on:
¶ms;
Furthermore, the following command li... |
#!/usr/bin/env python3
# Copyright (c) 2019 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
This test checks that blocks containing segwit recovery transactions will be accepted,
that segwit recovery tran... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
'''
Created on Aug 9, 2016
Keras Implementation of Multi-Layer Perceptron (GMF) recommender model in:
He Xiangnan et al. Neural Collaborative Filtering. In WWW 2017.
@author: <NAME> (<EMAIL>)
'''
from time import time
import argparse
import os
import pickle
from tkinter import HIDDEN
os.environ['TF_CPP_MIN_LOG_LEV... |
import h5py as h5
import numpy as np
################################################################################
def load(filename=None, verbose=False, desired_datasets=None, subset=None):
'''
Reads all, or a subset of the data, from the HDF5 file to fill a data dictionary.
Returns an empty dictionar... |
import os
import prometheus_client
import time
import structlog
import traceback
import requests
from flask import Flask, request, Response, abort, logging
from pymongo import MongoClient
from bson.objectid import ObjectId
from bson.json_util import dumps
from helpers import http_healthcheck_handler, log_event
from py_... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Utilities to handle BIDS inputs."""
from collections import defaultdict
from pathlib import Path
from json import loads
from pkg_resources import resource_filename as pkgrf
from bids.layout.writing impor... |
"""Compute differences on a configuration dictionary,
providing callbacks when a change is detected"""
# This allow python type hints to cross reference objects
# before they are referenced
from __future__ import annotations
from collections.abc import MutableMapping
from typing import Callable, Any, Union
import ... |
"""
A platform which allows you to get information
about successful logins to Home Assistant.
For more details about this component, please refer to the documentation at
https://github.com/custom-components/authenticated
"""
from datetime import datetime, timedelta
import json
import logging
import os
from ipaddress im... |
import json
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseBadRequest
from django.shortcuts import get_object_or_404
from onefin... |
# Copyright 2022, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... |
# 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, software
# d... |
import textwrap
from datetime import datetime, timedelta
from io import BytesIO
from math import ceil
from os import path
from flask import Flask, send_file, Response
from PIL import Image, ImageFont, ImageDraw
# PyCharm will complain about this not resolving, IGNORE IT, IT WORKS
from Api import get_weather, get_quote... |
import pandas as pd
from typing import Tuple
from bitarray import bitarray
import traceback
class RouteTable():
"""
逻辑:使用索引,找到子网/掩码对应的项,直接返回
不足:真正的转发表应该是寻找最长匹配,找到最适合这个子网的ip来返回
并且表中还需要有这一项 ‘0.0.0.0,/0’这样无论是哪一个子网和掩码都会匹配到这一项
从而避免转发表找不到的情况(相当于默认路由)
"""
def __init__(self, csv_file_name='', local_... |
# -*- coding: utf-8 -*-
"""?
:copyright: Copyright (c) 2020 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
import sys
import synergia
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib import gridspec
#RC stuff
#mpl.rc('axes'... |
import time, os, re, json, requests
import pandas as pd
import numpy as np
from datetime import datetime, timedelta
from bs4 import BeautifulSoup
from urllib.request import urlopen, Request
headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/22.0'}
class DLsite_catalo... |
# coding=utf-8
# Copyright 2020 The Uncertainty Baselines Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... |
from hypergan.gans.base_gan import BaseGAN
from examples.common import *
from hyperchamber import Config
from hypergan.discriminators import *
from hypergan.distributions import *
from hypergan.gan_component import ValidationException, GANComponent
from hypergan.generators import *
from hypergan.inputs import *
from hy... |
#!/usr/bin/env python
# Fit proper motion and parallax using ra/dec/mjd data
# Most of this code was taken from here:
# https://github.com/ctheissen/WISE_Parallaxes/blob/master/WISE_Parallax.py
import os, sys
import numpy as np
from astropy.table import Table, vstack, join
#import matplotlib.pyplot as plt
from astro... |
from __future__ import division
import xml.etree.ElementTree as ET
import argparse
import json
circuit_bill = {}
xml_root = None
detailed = False
def main():
parser = argparse.ArgumentParser()
parser.add_argument("file", help="The logisim file")
parser.add_argument("circuit_name", help="The name of the c... |
import base64
import datetime
import gzip
import json
import logging
import os
import time
from json import JSONDecodeError
import boto3
import dateutil.parser
from aws_kinesis_agg.deaggregator import iter_deaggregate_records
from aws_xray_sdk.core import xray_recorder, patch
from fluent import sender
# set up loggin... |
import abc
import os
import pickle
import numpy as np
import torch
import torchtext
from torch import nn
import stanza
from spacy_stanza import StanzaLanguage
from tensor2struct.utils import registry
from tensor2struct.utils import batched_sequence
import logging
logger = logging.getLogger("tensor2struct")
class ... |
## -*- coding: utf-8 -*-
##
## <NAME> - 2014-05-12 - ROPgadget tool
##
## http://twitter.com/JonathanSalwan
## http://shell-storm.org/project/ROPgadget/
##
from capstone import *
from ctypes import *
class MACH_HEADER(Structure):
_fields_ = [
("magic", c_uint),
... |
from __future__ import print_function
import os
import sys
import vcs
import acme_diags
import acme_diags.plot.vcs as utils
from acme_diags.driver.utils.general import get_output_dir
textcombined_objs = {}
def managetextcombined(tt_name, to_name, vcs_canvas):
"""Caches textcombined objects"""
new_name = "%s... |
# -*- coding: utf-8 -*-
import cv2
import numbers
import math
import random
import numpy as np
from skimage.util import random_noise
def show_pic(img, bboxes=None, name='pic'):
'''
输入:
img:图像array
bboxes:图像的所有boudning box list, 格式为[[x_min, y_min, x_max, y_max]....]
names:每个box对应的名称
... |
import os
import pickle
import numpy as np
import pandas as pd
from sklearn.model_selection import GridSearchCV
from sklearn.utils import resample
# depent on tensorflow 1.14
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.layers import Conv1D, AveragePooling1D, Dropout, Flatten, Dense
fro... |
from uuid import uuid4
from Firefly import logging, scheduler
from Firefly.components.virtual_devices import AUTHOR
from Firefly.const import (COMMAND_UPDATE, DEVICE_TYPE_THERMOSTAT, LEVEL)
from Firefly.helpers.action import Command
from Firefly.helpers.device.device import Device
from Firefly.helpers.metadata.metadat... |
'''
File: data_processing.py
Project: dataset
File Created: Wednesday, 11th July 2018 6:33:11 pm
Author: xiaofeng (<EMAIL>)
-----
Last Modified: Wednesday, 11th July 2018 6:33:16 pm
Modified By: xiaofeng (<EMAIL>>)
-----
Copyright 2018.06 - 2018 onion Math, onion Math
'''
import json
import logging
import os
import pi... |
import json
import torch
import torch.utils.data as data
import torch.nn as nn
from utils.config import *
import ast
from utils.utils_general import *
relation_set = [
"is",
"distance",
"traffic_info",
"poi_type",
"address",
"monday_weather", "monday_low", "monday_high",
"tuesday_weather",... |
# -*- coding: utf-8 -*-
import discord
from discord.ext import commands
from discord.enums import ChannelType
from time import sleep
from .utils import checks
import asyncio
import re
import os
class Filter:
"""Deletes all filtered messages messages."""
def __init__(self, bot):
self.bot = bot
self.regs = [
[re.... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
# Copyright 2020 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
import json
import uuid
import logging
from datetime import datetime
import time
from flask import jsonify, render_template, request, redirect, url_for, Markup
from flask import current_app as app
from . import main
from web_utils import get_backend
from backend import Status
from src.basic.event import Event
# from... |
# Copyright 2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... |
from flask import Flask, render_template, request, redirect, jsonify
from flask_cors import CORS, cross_origin
from datetime import datetime
from flask import Blueprint
from flask_paginate import Pagination, get_page_parameter
import botocore
import boto3
import decimal
import logging
import time
import argparse
impo... |
# coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
"""
UserFeed utilities package
:author: <NAME>
:copyright: Copyright 2021, LINKS Foundation
:version: 1.0.0
..
Copyright 2021 LINKS Foundation
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... |
"""
# Try with custom `simulate_petab` first.
*. TODO Remove timecourse measurements from main PEtab problem
*. TODO Generate subset PEtab problems, one per timecourse
1. [x] Subset PEtab data/problem by timepoints in timecourse.
2. [x] Replace conditions table with timecourse timepoint condition
- OR remove and use ... |
import os
from flask import Flask, jsonify, session, abort, render_template, redirect, url_for, request
from game_logic import Game
import threading
import uuid
import logging
NAME_LENGTH_MAX = 30
MAX_PLAYER_TIMEOUT = 10
app = Flask(__name__, template_folder='templates')
app.logger.setLevel("DEBUG")
app.secret_key = ... |
import pytest
import torch
import torch.nn as nn
import torch.nn.functional as F
from syft.frameworks.torch.tensors.interpreters import FixedPrecisionTensor
def test_wrap(workers):
"""
Test the .on() wrap functionality for LoggingTensor
"""
x_tensor = torch.Tensor([1, 2, 3])
x = FixedPrecisionTe... |
import collections.abc
import logging as log # FIXME
import numpy as np
#-------------------------------------------------------------------------------
NAT = np.datetime64("nat")
def get_dtype(name, val):
try:
return val.dtype
except AttributeError:
return np.array([val]).dtype
def resize... |
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
"""Core ColOut classes and functions."""
from __future__ import annotations
import logging
import textwrap
import weakref
from typing import Any, Callable, Tuple, TypeVar, Union
import torch
import torch.utils.data
from PIL.Image impor... |
# The MIT License (MIT)
#
# Copyright (c) 2015 University of East Anglia, Norwich, UK
#
# 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 r... |
""" VERSION 1.0.0 """
# TIC TAC TOE
try:
import pygame_sdl2
pygame_sdl2.import_as_pygame()
except ImportError:
pass
# Importing necessary modules
import pygame, time, sys
# Check errors
# Pygame.init returns suc. process and errors in tuple
check_errors = pygame.init()
if check_errors[1] > 0:
print... |
import warnings
import torch
import numpy as np
from .typing import TypePath
from .data.subject import Subject
from .data.image import Image, LabelMap
from .transforms.preprocessing.spatial.to_canonical import ToCanonical
from .transforms.preprocessing.intensity.rescale import RescaleIntensity
def import_mpl_plt():... |
from event.io.dataset.base import (
Span,
DataLoader,
DEDocument,
Corpus,
)
import json
import os
import sys
from event.arguments.prepare.event_vocab import EmbbedingVocab
from traitlets.config import Configurable
from traitlets import (
Int,
List,
Unicode,
)
from event.util import load_mix... |
"""Auth module role settings."""
import gramex
import gramex.handlers
import json
import os
import re
import sys
from binascii import b2a_base64
from cachetools import TTLCache
from gramex.config import app_log
from gramex.http import INTERNAL_SERVER_ERROR
from six.moves import StringIO
from tornado.gen import coroutin... |
# coding: utf-8
from encoder import XML2Dict
import dpath.util as dp
import re
from lxml import etree
def read(p):
xml = XML2Dict()
with open(p, 'r', encoding='utf-8') as f:
s = f.read()
root = etree.fromstring(s.encode())
# Remove namespace prefixes
for ... |
"""
Copyright (c) 2015 <NAME>, 2017 Mosen
Licensed under the MIT license. See the included LICENSE.txt file for details.
"""
from flask import Blueprint, make_response, abort, jsonify, g, current_app
from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound
from commandment.mdm import CommandStatus
from comman... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import zipfile
import os, logging
from six.moves import urllib
import requests
from requests.packages import urllib3
REQUESTS_TIMEOUT = 2000
#DEFAULT_HEADERS = {
# 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) App... |
menu_name = "WiFi repair"
from time import sleep
from ui import LoadingBar, PrettyPrinter as Printer, TextReader, Listbox, DialogBox
from helpers import setup_logger
from libs import dmesg, dkms_debug
from libs.rpi import vcgencmd, rpiinfo, config as rpi_config
import sdio_debug
logger = setup_logger(__name__, "de... |
"""
Basic Python API to MongoDB Atlas Services
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@Author:Jo<EMAIL>
"""
import os
import pprint
import logging
import json
from requests.auth import HTTPDigestAuth
import requests
from enum import Enum
from mongodbatlas.atlaskey import AtlasKey
from mongodbatlas.errors import ... |
from robosuite.controllers.base_controller import Controller
from robosuite.utils.control_utils import *
import robosuite.utils.transform_utils as T
import numpy as np
import math
# TODO: Maybe better naming scheme to differentiate between input / output min / max and pos/ori limits, etc.
def matprint(mat, fmt="g")... |
from indic_transliteration.sanscript.schemes.brahmic import BrahmicScheme
class DevanagariScheme(BrahmicScheme):
def __init__(self):
super(DevanagariScheme, self).__init__({
'vowels': str.split("""अ आ इ ई उ ऊ ऋ ॠ ऌ ॡ ए ऐ ओ औ ऎ ऒ"""),
'marks': str.split("""ा ि ी ु ू ृ ॄ ॢ ॣ े ै ो ौ ... |
#!/usr/bin/env python
# coding: utf-8
# ## CSC 4850/6850 Machine Learning - Assignment 2
# ### 1. (20 points) Please illustrate the 𝑘-means algorithm on the dataset in Figure 1
# <center><div style="width:25%; height:25%"> <img src="./Fig1_Dataset.jpg"> </div></center>
# In[51]:
from sys import *
import os
import... |
"""
Author: <NAME>
Institute: Stony Brook University
"""
import sys
sys.path.append('..')
import argparse, os
import torch, ignite
import torch.optim as optim
import torch.nn as nn
import numpy as np
from Youtube8M.models import *
from tqdm import tqdm
from random import shuffle
from sklearn.metrics i... |
#!/usr/bin/python
"""
(C) Copyright 2019-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
import time
from command_utils_base import CommandFailure, FormattedParameter
from command_utils import ExecutableCommand
from ClusterShell.NodeSet import NodeSet
from general_utils import check_file... |
#
# (C) Copyright IBM Corp. 2021
# (C) Copyright Cloudlab URV 2021
#
# 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 ap... |
# -*- coding: utf-8 -*-
"""Create and lookup activity events."""
__all__ = [
'ActivityEventFactory',
'LookupActivityEvent',
'NotificationFactory',
'LookupNotification',
'LookupNotificationDispatch',
'NotificationPreferencesFactory',
'get_or_create_notification_preferences',
]
import loggi... |
# ===============================================================================
# Copyright 2015 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... |
from dataclasses import dataclass, field
from typing import TypeVar, MutableMapping, Mapping, Union, List
from hologram import JsonSchemaMixin
from dbt.contracts.graph.manifest import SourceFile, RemoteFile, FileHash
from dbt.contracts.graph.parsed import (
ParsedNode, HasUniqueID, ParsedMacro, ParsedDocumentatio... |
from posixpath import dirname
from flask import Flask, render_template, request, session, redirect, url_for, send_file
import os
import sys
import requests
from flask_paginate import Pagination, get_page_args #pip install flask-paginate
from datetime import timedelta
import json
import uuid
import base64
import redis
i... |
from scapy.all import *
from ccsds_base import CCSDSPacket
class CFE_TIME_HK_TLM_PKT_TlmPkt(Packet):
"""Housekeeping data (general status) autonomously sent
app = CFE_TIME
command = HK_TLM_PKT
msg_id = CFE_TIME_HK_TLM_MID = 0x0805 = 0x0800 + 0x005
"""
name = "CFE_TIME_HK_TLM_PKT_TlmPkt"
f... |
"""
Path tracking simulation with pure pursuit steering and PID speed control.
author: <NAME> (@Atsushi_twi)
<NAME> (@Gjacquenot)
"""
import numpy as np
import math
import matplotlib.pyplot as plt
# Parameters
look_ahead_distance = 2.0 # [m] look-ahead distance
look_foward_gain = 0.1 # look forward gain
prop... |
from collections import defaultdict
from bson import ObjectId
from flask import Blueprint, session, json, jsonify, request
from mongolia import ID_KEY
from werkzeug.exceptions import abort
from backend.admin_portal.common_helpers import validate_cohort
from backend.admin_portal.data_reports_helpers import (re... |
#!/usr/bin/env python
"""This script downloads NCBI records based on user search query.
Requires the biopython package.
"""
__author__ = '<NAME>'
__copyright__ = "Copyright (C) 2014-2018 <NAME>. All rights reserved."
__license__ = "GPL"
import sys
import os
import shutil
import re
import traceback
import urllib
... |
from abc import ABC, abstractmethod
from copy import deepcopy
from deap import creator, base, tools, algorithms
from ray.tune import grid_search, variant_generator
from slm_lab.experiment import analysis
from slm_lab.experiment.monitor import InfoSpace
from slm_lab.lib import logger, util
from slm_lab.lib.decorator imp... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from datet... |
# Copyright 2020 The TensorTrade Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
#!/usr/bin/env python
#-------------------------------------------------------------------------------
# Name: OctopusLite
# Purpose: OctopusLite is a simple script based timelapse acquisition. It
# uses other open-source hardware control software for image
# acquisition and some hardware synch... |
from collections import deque
from enum import Enum
class Techniques(Enum):
DEAL = 0,
CUT = 1,
INCR = 2,
def modinv(n, deck_size):
# Fermat: n^deck_size = n % deck_size
# but we want n^(-1) s.t. n^(-1) * n = 1 % deck_size, so:
# n^(deck_size - 1) = 1 % deck_size
# And therefore:
# n^(d... |
"""
Zoning models
(not MapEntity : just layers, on which intersections with objects is done in triggers)
"""
from django.conf import settings
from django.contrib.gis.db import models
from django.utils.translation import ugettext_lazy as _
from geotrek.common.utils import uniquify, intersecting
from geotrek.main... |
#!/usr/bin/env python2
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Script to control tigertail USB-C Mux board."""
import argparse
import sys
import time
import ecusb.tiny_servo_common as c
ST... |
import os, grpc
import numpy as np
import image_slicer
from PIL import Image
import io
import requests
import json
import logging
import cv2
from simplification.cutil import simplify_coords
from skimage.measure import find_contours
from detectron2 import model_zoo
from detectron2.config import get_cfg
from detectron2.... |
"""Tests file.
Tests for:
st_shaft_element.py
st_disk_element.py
st_bearing_seal_element.py
st_point_mass.py
"""
import numpy as np
import pytest
from plotly import graph_objects as go
from ross.stochastic.st_bearing_seal_element import ST_BearingElement
from ross.stochastic.st_disk_element import ST_D... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from enum import Enum
__all__ = [
'AccessControlEntryAction',
'AutoHealActionType',
'AzureResourceType',
'AzureStorageType',
'Buil... |
# Copyright (c) 2022 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.