text stringlengths 3.07k 22.1k |
|---|
"""
Code for integer only arithmetic inferencing for quantization aware trained model,
limited to Dense, Conv1D layers
Original Source Code:
https://github.com/google/gemmlowp/blob/master/fixedpoint/fixedpoint.h
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/kernels/internal/common.h
"""
import... |
import tvm
import time
import numpy as np
import torch
import random
from tvm.tensor_graph.testing.models import capsule_tg as capsule
from tvm.tensor_graph.testing.pytorch_examples import resnet_annotated
from tvm.tensor_graph.nn.layers import Layer, Conv2d, BatchNorm2d, ReLU, \
AvgP... |
import numpy as np
import random
import matplotlib.pyplot as plt
from core.constants import SMALL_VALUE
from core.constants import SEED
from sklearn.metrics import confusion_matrix
from sklearn.metrics import roc_curve
from collections import Counter
def prety_print_result(mem, pred):
tn, fp, fn, tp = confusion_... |
"""
This module delivers assets (Dublin Core catalogs or acls) of events and series, by getting them from a request module
and performing checks to see if the data is consistent. If it is not, a Malformed object with the encountered
errors is returned instead.
"""
from check.check_data import create_errors
from check.c... |
import os
import sys
import shutil
import numpy as np
import time, datetime
import torch
import random
import logging
import argparse
import torch.nn as nn
import torch.utils
import torchvision.datasets as dset
import torchvision.transforms as transforms
import torch.backends.cudnn as cudnn
from torch.nn import functio... |
# Author: <NAME>
# Copyright <NAME> 2019
#
import psycopg2
import sys
import os
from database import database
class location(object):
"""locatoin class object """
def __init__(self,
lid=None,
location_name=None,
location_size=None,
elist=None,... |
"""
SANS data format
================
Internal data representation for SANS data.
"""
import sys
import datetime
from copy import copy, deepcopy
import json
from io import BytesIO
from collections import OrderedDict
import numpy as np
from dataflow.lib.uncertainty import Uncertainty
from dataflow.lib.exporters impo... |
"""This is a somewhat delicate package. It contains all registered components
and preconfigured templates.
Hence, it imports all of the components. To avoid cycles, no component should
import this in module scope."""
import logging
import typing
from typing import Any, Dict, List, Optional, Text, Type
from rasa.nlu.... |
# 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 use ... |
import neat
from neat.graphs import required_for_output
import copy
import numpy as np
import itertools
from math import factorial
from pytorch_neat.recurrent_net import RecurrentNet
from pytorch_neat.cppn import get_nd_coord_inputs
import torch
from pytorch_neat.activations import str_to_activation
from pytorch_neat.... |
import requests, json
import numpy as np
import importlib
import pandas as pd
import pickle
import os
import seaborn as sns
import matplotlib.pyplot as plt
def pkl_file(filename, filepath):
'''
Save a file named 'filename' to 'filepath' via the pickle module
'''
with open(filepath, 'wb') as filehandl... |
import sys
import os
import psutil
import gc
from pympler.asizeof import asizeof
from pyrosetta import rosetta as ros
from worms import util
from worms.ssdag_pose import make_pose_crit
from worms.filters.db_filters import run_db_filters
from worms.filters.db_filters import get_affected_positions
from worms.ssdag imp... |
from bs4 import BeautifulSoup
import lxml.html
import urllib.request, urllib.error
from urllib.parse import urlparse
import requests
import csv
#県毎のURLを取得する関数
def getPrefUrls():
url = "http://kikucyt.o.oo7.jp/f/f_jiti/fjiti_left.html"
res = requests.get(url)
soup = BeautifulSoup(res.content, 'html.parse... |
# Copyright 2020 Huawei Technologies Co., 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 agreed to... |
import os
from pathlib import Path
import json
import numpy as np
import pandas as pd
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
from collections import defaultdict
import torch
import torch.nn as nn
import gym
import neurogym as ngym
from neurogym import spaces
import pynwb
from pynwb impo... |
import networkx as nx
import json
from schematic.utils.curie_utils import extract_name_from_uri_or_curie
from schematic.utils.validate_utils import validate_class_schema
from schematic.utils.validate_rules_utils import validate_schema_rules
def load_schema_into_networkx(schema):
G = nx.MultiDiGraph()
for rec... |
import sys
import numpy as np
from enum import Enum
class Sequence():
def __init__(self):
self.__channel_digital={0:[], 1:[], 2:[], 3:[], 4:[], 5:[], 6:[], 7:[]}
self.__channel_analog={0:[], 1:[]}
self.__union_seq=[(0,0,0,0)]
self.__setby = self.Setby.UNDEFINED
self.__union... |
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
import asyncio
import json
import sys
from pathlib import Path
from typing import Callable, Dict
import pytest
import sqlalchemy as sa
from _helpers import ExpectedResponse, standard_role_response
from a... |
'''
This module defines the `StateUpdateMethod` class that acts as a base class for
all stateupdaters and allows to register stateupdaters so that it is able to
return a suitable stateupdater object for a given set of equations. This is used
for example in `NeuronGroup` when no state updater is given explicitly.
'''
fr... |
import pytest
import pickle
import ray
from ray.experimental.dag import (
DAGNode,
PARENT_CLASS_NODE_KEY,
PREV_CLASS_METHOD_CALL_KEY,
)
@ray.remote
class Counter:
def __init__(self, init_value=0):
self.i = init_value
def inc(self):
self.i += 1
def get(self):
return s... |
import torch
import torch.nn as nn
from torch.autograd.function import Function
import torch.nn.functional as F
from torch.nn import Parameter
import numpy as np
import os
import math
import pdb
import time
import copy
import mmcv
from sklearn.cluster import KMeans
# This file contains implementations of some algorit... |
import functools
from matplotlib import artist as martist, cbook, transforms as mtransforms
from matplotlib.axes import subplot_class_factory
from matplotlib.transforms import Bbox
from .mpl_axes import Axes
import numpy as np
class ParasiteAxesBase:
def get_images_artists(self):
artists = {a for a in ... |
import os
import json
import sklearn
import tqdm
import torch
from collections.abc import Mapping
def classification_report(labels, predictions, return_dict=True, label_map=None, label_indices=None, target_names=None):
r"""
Print classification report and return as a dict
Parameters
----------
la... |
"""
Collect remote information on Ceph daemons, store everything in memory and make
it available as a global part of the module so that other checks can consume it
"""
from ceph_medic import metadata, remote, terminal
from ceph_medic.terminal import loader
from ceph_medic.connection import get_connection
from execnet.g... |
'''Example of VAE on MNIST dataset using MLP
The VAE has a modular design. The encoder, decoder and VAE
are 3 models that share weights. After training the VAE model,
the encoder can be used to generate latent vectors.
The decoder can be used to generate MNIST digits by sampling the
latent vector from a Gaussian dist... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import errno
import glob
import json
import subprocess
import sys
from pkg_resources import require
from mlx.junit_checker import JUnitChecker
from mlx.regex_checker import CoverityChecker, DoxyChecker, SphinxChecker, XMLRunnerChecker
from mlx.robot_chec... |
from __future__ import annotations
import io
import itertools
import logging
import os
import subprocess # nosec
import tempfile
from typing import Any, Type, Optional, List
import yaml
from checkov.common.graph.checks_infra.registry import BaseRegistry
from checkov.common.graph.graph_manager import GraphManager
fro... |
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code mus... |
import sysv_ipc
import urllib.request
#import matplotlib.pyplot as plt
import numpy as np
import time as timeP
from numpy.random import uniform
from filterpy.monte_carlo import systematic_resample
from numpy.linalg import norm
from numpy.random import randn
import scipy.stats
from numpy.random import uniform
from nump... |
import torch
from torchvision import transforms, datasets
from torch.utils.data import DataLoader
import torch.nn as nn
from torch import optim
import matplotlib.pyplot as plt
from fseai import fseai_models as models
def input_dataset(name):
"""Function to load specified dataset from torchvision.datasets
Arg... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 27 18:57:57 2019
@author: r17935avinash
"""
import torch
from pykp.reward import *
from torch import nn as nn
import torch.nn.functional as F
import sys
def matmul(X, Y):
taken = []
for i in range(X.size(2)):
result = (X[:,:,i]*... |
from flask import Flask
from flask import request
from flask import abort
import json
import logging
import requests
import time
import urllib
import flames_controller
import poofermapping
import pattern_manager
from flask_utils import CORSResponse
from flask_utils import JSONResponse
'''
Webserver for the flame... |
from revelation.registers import reg_map
from revelation.utils import trim_32
from pydgin.misc import FatalError, NotImplementedInstError
def execute_nop16(s, inst):
"""The instruction does nothing, but holds an instruction slot.
"""
s.pc += 2
def execute_idle16(s, inst):
"""
STATUS[0]=0
... |
#
# BitBake Graphical GTK based Dependency Explorer
#
# Copyright (C) 2007 <NAME>
# Copyright (C) 2007 - 2008 <NAME>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This p... |
from doepy.doe_functions import (
build_full_fact,
build_frac_fact_res,
build_plackett_burman,
build_sukharev,
build_box_behnken,
build_central_composite,
build_lhs,
build_space_filling_lhs,
build_random_k_means,
build_maximin,
build_halton,
build_uniform_random,
)
def ... |
# acl.py - changeset access control for mercurial
#
# Copyright 2006 <NAME> <<EMAIL>>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''hooks for controlling repository access
This hook makes it possible to allow or deny write a... |
import collections
import itertools
from routes18xx import boardtile
from routes18xx.cell import Cell
from routes18xx.tokens import Station
class PlacedTile(object):
@staticmethod
def _rotate(side, orientation):
# ((side num) + (number of times rotated)) mod (number of sides)
return (side + in... |
import altair as alt
import pandas as pd
import streamlit as st
import aws
import driver
import requests
import json
import os
from textblob import TextBlob
import datetime
import time
credentials_path = "credentials.json"
def get_individual_stock_data(ticker, start="", end="", interval="1d", period="ytd"):
"""g... |
import logging
import pendulum
import celery
from django.apps import apps
from django.conf import settings
from django.db.models import Q
from elasticsearch import Elasticsearch
from share.search import SearchIndexer
from share.search.fetchers import CreativeWorkFetcher
logger = logging.getLogger(__name__)
def ... |
#!/usr/bin/python
# Copyright (c) 2020, 2022 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
import json
import os
import random
from os import path
from string import ascii_uppercase, digits, punctuation
import argparse
import colorama
import numpy
import regex
import torch
from colorama import Fore
from torch.utils import data
from my_classes import TextBox, TextLine
from my_utils import robust_padding
VOC... |
# -*- coding: utf-8 -*-
"""
system monitoring tool
"""
__author__ = '<NAME>'
import argparse
import builtins
import datetime
import json
import logging
import os
import signal
import sys
import time
import traceback
from collections import OrderedDict
from pathlib import Path
import psutil
from ... |
'''
Popup
=====
.. versionadded:: 1.0.7
.. image:: images/popup.jpg
:align: right
The :class:`Popup` widget is used to create modal popups. By default, the popup
will cover the whole "parent" window. When you are creating a popup, you
must at least set a :attr:`Popup.title` and :attr:`Popup.content`.
Remember t... |
import re
from collections import namedtuple
from itertools import chain
from typing import Optional, List, Union, Dict, Type, Tuple
from django.db.models import QuerySet, Model
from django.http import HttpRequest, JsonResponse
from django.urls import reverse
from .columns import TableColumn
if False: # pragma: noc... |
# /usr/bin/env python
import random
from math import pi
import numpy as np
from hpp import Quaternion, Transform
from hpp.corbaserver.manipulation import (
ConstraintGraph,
ProblemSolver,
Rule,
newProblem,
)
from hpp.corbaserver.manipulation.robot import Robot
from hpp.gepetto.manipulation import Viewe... |
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 27 22:40:09 2019
@author: ishan
"""
import numpy as np
from numpy import linalg as LA
import os, sys
from numpy import linalg as la
import math
# from PIL import Image
import random
try:
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
except:
pas... |
# -*- coding: utf-8 -*-
import unittest
import warnings
import time
import inspect
import numpy as np
from sklearn.datasets import load_breast_cancer, load_boston
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.metrics import accuracy_sco... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from collections import Iterable, Mapping
import time
from pybel.constants import NAMESPACE_DOMAIN_TYPES, belns_encodings
from pybel.resources.utils import get_iso_8601_date
from .write_utils import DATETIME_FMT, make_author_header, make_citation_header,... |
"""
File providing the getch() function to easily read character inputs.
Credits:
- Original getch implementation: <NAME> (https://code.activestate.com/recipes/134892)
- Modern additions & idea: kcsaff (https://github.com/kcsaff/getkey)
"""
# pylint doesn't see the C source
# pylint: disable=c-extension-no-memb... |
import io
import tempfile
from dummy_file_generator import DummyFileGenerator
from django.contrib.auth.models import AnonymousUser
from django.core.cache import cache
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import Client, TestCase
from django.urls import reverse
from posts.model... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2009-2016 <NAME>. All rights reserved.
# Distributed under the (new) BSD License.
# -----------------------------------------------------------------------------
"""
PySide2 is the official Python mod... |
"""
Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
Functions to aid in monitoring log files being actively written to for a set of lines to read for.
"""
import loggi... |
import os
import json
from pathlib import Path
import jimi
# Initialize
dbCollectionName = "model"
class _model(jimi.db._document):
name = str()
className = str()
classType = str()
location = str()
hidden = bool()
manifest = dict()
_dbCollection = jimi.db.db[dbCollectionName]
def ne... |
from pathlib import Path
from typing import (
Tuple,
Dict,
List,
Iterable,
Optional,
Any
)
import click
import toml
from robotidy.app import Robotidy
from robotidy.transformers import load_transformers
from robotidy.utils import (
GlobalFormattingConfig,
split_args_from_name_or_path,
... |
# Just some tests so you can be assured that sg_eval.py works the same as the (original) stanford evaluation
import numpy as np
from six.moves import xrange
from dataloaders.visual_genome import VG
from lib.evaluation.sg_eval import evaluate_from_dict
from tqdm import trange
from lib.fpn.box_utils import center_size, ... |
from simtk import unit
import sys
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
from openmmtools.constants import kB
import matplotlib.pyplot as plt
################################################################################
# NUMBER OF ATTEMPTS
#######################################################... |
import sympy
import sys
import unittest
import sophus
import functools
class Se3:
""" 3 dimensional group of rigid body transformations """
def __init__(self, so3, t):
""" internally represented by a unit quaternion q and a translation
3-vector """
assert isinstance(so3, sophus.So... |
import dash_core_components as dcc
import dash_bootstrap_components as dbc
import dash_leaflet as dl
import dash_html_components as html
import dash_leaflet.express as dlx
# the style arguments for the sidebar. We use position:fixed and a fixed width
SIDEBAR_STYLE = {
"position": "fixed",
"top": 0,
... |
import click
import logging
import time
import atexit
import asyncio
from datetime import datetime
from pprint import pprint
from client import order_book, c2c_order_book as _c2c_order_book, \
balances, cancel_orders, cancel_order, get_order, open_orders, cancel_all_orders, \
async_balances, async_c2c_order_boo... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 14 12:05:07 2020
@author: Gary
"""
import numpy as np
import pandas as pd
import shutil
import os
import subprocess
from datetime import datetime
import pickle
import core.get_google_map as ggmap
today = datetime.today()
# for nicer displays of numbers: round to signifi... |
# Copyright (c) 2013 Mirantis 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 writ... |
# -*- coding: utf-8 -*-
"""This module implements LVS/RCX using PVS/QRC and stream out from Virtuoso.
"""
from typing import TYPE_CHECKING, Optional, List, Dict, Any, Sequence, Tuple
import os
import subprocess
import time
from ..io import read_yaml, open_temp, readlines_iter, fix_string
from .virtuoso import Virtu... |
from time import time
import os
import numpy as np
import scipy.io as sio
import argparse
import random
import sklearn
from config import cfg, get_data_dir, get_output_dir
from sklearn.preprocessing import scale as skscale
from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import normalize
fro... |
import datasets
import numpy as np
from tqdm import tqdm
import torch
import mxnet as mx
from transformers import GPT2LMHeadModel, GPT2TokenizerFast, BertTokenizer, BertForSequenceClassification
from readability_assessment import *
from training_utils import *
from data_form import *
import argparse
import pickle
pars... |
"""
Functions modified from the np_read_clustering workflow that plot gene annotations
get_cluster_genes(gene_data, cluster, genome_lengths)
* pulls out the annotations for the given cluster and flips annotations of any genomes that are predominantly in the reverse strand
plot_annot_positions(gene_data, genome_len... |
from __future__ import division
import numpy as np
from scipy.sparse import issparse
from .linalg import dot_inplace_right
def eigenvalue_decomposition(C, is_inverse=False, eps=1e-10):
r"""
Eigenvalue decomposition of a given covariance (or scatter) matrix.
Parameters
----------
C : ``(N, N)`` `n... |
"""QUIP driver.
The main program takes QUIP Operation XML file from WEx.
Then, it starts Ginga with custom plugins.
For more information, see :ref:`running-quip-doc`.
"""
# STDLIB
import glob
import os
import platform
import shutil
import sys
# THIRD-PARTY
from astropy.io import fits
from astropy.utils.data import g... |
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 22 23:31:48 2015
2nd Version Flowchart Node
@author: <NAME>
"""
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.togglebutton import ToggleButton
from Connector import Connector
from Magnet import Magnet
from kivy.properties import ObjectProperty, ListProperty, Bo... |
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 31 17:05:23 2017
@author: yzhu16
"""
import pandas as pd # Used to open CSV files
import numpy as np # Used for matrix operations
import cv2 # Used for image augmentation
from matplotlib import pyplot as plt
from sklearn.model_selection import train_test_sp... |
# Copyright 2014 eBay Software Foundation
# 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 ... |
import copy
from generators import ecs_helpers
from schema import visitor
# This script performs a few cleanup functions in place, within the deeply nested
# 'fields' structure passed to `clean(fields)`.
#
# What happens here:
#
# - check that mandatory attributes are present, without which we can't do much.
# - clea... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
plugin.audio.roon
osd.py
Special window to display an OSD for remote control of zone player
'''
import threading
import thread
import xbmc
import xbmcgui
from utils import log_msg, log_exception, PLUGIN_BASE, addon_setting
from metadatautils import MetadataUti... |
#!/usr/bin/env python3
# MIT License
# Copyright (c) 2018 The University of Michigan
# 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... |
####################################################################################################
#
# exponential_module.py
#
# Author:
# <NAME>
#
# The routine for learning facts about exponential functions
#
#
####################################################################################################
imp... |
from Authors.models import Author
from Authors.serializers import AuthorSerializer
from django import forms
from django.contrib import messages
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.core.... |
# -*- coding: utf-8 -*-
import uuid
import ctypes
import json
import sys
import argparse
import time
import os
try:
import Adafruit_BluefruitLE
except ImportError:
print("Unable to import module: Adafruit_BluefruitLE. You may need to install it manually. See the README.md for WonderPy.")
raise
if sys.ve... |
import os
import logging
import time
import json
import redis
import attr
import io
from abc import ABC, abstractmethod
from datetime import datetime
from itertools import tee
from redis import Redis
from rq import Queue, get_current_job
from rq.registry import StartedJobRegistry, FinishedJobRegistry, FailedJobRegistr... |
# Copyright 2013 by Rackspace Hosting, 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 t... |
from .models import Friendship, FriendRequest, Friend
from .helper_functions import getAllFriends, checkFriendship, SendFriendRequestRemote
import json
from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse
from django.contrib.auth import get_user_model
from accounts.permission... |
#!/usr/bin/env python3
from fronius_gen24 import *
from pyfritzhome import Fritzhome
from influxdb_client import influxdb_cli
import paho.mqtt.client as paho
from devices import *
import time
import sys
import statistics
gen24 = SymoGen24(ipaddr=gen24_ip)
if gen24 is None:
print("Gen24 don't like to talk to us... |
from matplotlib import pyplot as py
import torch
from torch import nn, optim
import torch.nn.functional as f
from torchvision import datasets, transforms, models
from PIL import Image
import os, random
import seaborn as sns
import numpy as np
import json
device = torch.device("cuda" if torch.cuda.is_available() else... |
"""
Twitter Sentiment Analysis in Python - A bot which will monitor, store and categorize Sentiment Analysis based on Twitter
for cryptocurrencies, and implement a strategy for profitable trading based on Bitcoin Barbie Bot (BBB) Strategy, described here:
https://medium.com/@BlockchainEng/crypto-trading-bot-sentim... |
import random
import math
from decimal import Decimal
def evaluation (q):
fxx = q
total = 0
#total = (6.983*math.pow(fxx[0], 2)) + (12.415*math.pow(fxx[1], 2))-fxx[0]
#Step
# for x in range(len(fxx)):
# total += math.pow(int(fxx[x]+0.5), 2)
#Schwefel
# for x in range(len(fxx)):
... |
import os
import matplotlib
#Allow headless use
if os.environ.get('DISPLAY') is None:
print("Falling back to Agg engine")
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import matplotlib.colors
import matplotlib.image
import matplotlib.gridspec as gridspec
import matplotlib.dates as mdates
import matplot... |
# Copyright (C) 2020 leafcloud b.v.
# Copyright (C) 2020 FUJITSU LIMITED
# 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/lice... |
"""The InterUSS Platform Data Node storage API server.
This flexible and distributed system is used to connect multiple USSs operating
in the same general area to share safety information while protecting the
privacy of USSs, businesses, operator and consumers. The system is focused on
facilitating communication among... |
import numpy as np
from numpy import newaxis as na
from py_wake.deficit_models.no_wake import NoWakeDeficit
from py_wake.deficit_models import BlockageDeficitModel
class SelfSimilarityDeficit(BlockageDeficitModel):
"""References:
[1] <NAME>, <NAME>, Wind Energy, 2016
"""
args4deficit = ['WS_ilk', ... |
# DExTer : Debugging Experience Tester
# ~~~~~~ ~ ~~ ~ ~~
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Test tool."""
import math
import os
im... |
import torch
import numpy as np
from collections import OrderedDict
from copy import deepcopy
from robopose.utils.logging import get_logger
from robopose.lib3d.robopose_ops import loss_refiner_CO_disentangled_reference_point
from robopose.lib3d.transform_ops import add_noise, invert_T, transform_pts
from robopose.li... |
#!/usr/bin/env python3
import base64
import json
import subprocess
from scapy.layers.inet import IP, TCP
from scapy.utils import hexdump, import_hexcap
FIREWALL_COMMANDS_HELP = "\r\n( · - · · · \r\n\
You may need to temporarily block RST output packets in your firewall.\r\n\
For example:\r\n\
iptables -A OUTPUT -p tc... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... |
"""Second stage: Composition"""
# Third party imports
import panel as pn
import param
import pyplugs
# Geo:N:G imports
from app import config
from app.assets import panes
from app.assets import state
from geong_common import config as geong_config
from geong_common import readers
from geong_common.data import net_gro... |
#!/usr/bin/env python
#
# Controller for robot actions. Able to perform actions such as:
# - Forward
# - Reverse
# - Turn Right
# - Turn Left
# - Buzz Horn
#
# Uses the XBee device to communicate with robot target (see README for wiring).
from __future__ import division
import busio
import digitalio
import b... |
from __future__ import absolute_import, division, print_function
import logging
import json
import datetime
import uuid
from pbcommand.models import FileType
from pbsmrtpipe.models import (TaskStates, ToolContractMetaTask,
MetaTask, MetaScatterTask,
Scatt... |
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 28 11:19:30 2017
@author: neerbek
"""
import os
import io
from numpy.random import RandomState
import time
import re
from collections import defaultdict
import server_rnn
import inference_enron
import EnronDocument
import sys
sys.setrecursionlimit(10000)
class Serve... |
# Certipy - Active Directory certificate abuse
#
# Description:
# Request a new certificate
#
# Authors:
# @ly4k (https://github.com/ly4k)
#
# References:
# https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-icpr/d98e6cfb-87ba-4915-b3ec-a1b7c6129a53
# https://docs.microsoft.com/en-us/openspecs/wind... |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# whois utilities
# ----------------------------------------------------------------------
# Copyright (C) 2007-2018 The NOC Project
# See LICENSE for details
# --------------------------------------------------------------... |
"""
Code to build spatially-dependent network.
There's two sides to it:
- Use correct density of different cell types and place them in space
- Connect them according to spatially-dependent radial connectivity profiles
For the connectivity part we need to evaluate all-to-all-distances which is O(n... |
# Copyright (c) 2018 <NAME> et al. All rights reserved.
# Use of this source code is governed by an MIT license that can be found in the LICENSE file.
from .expression_lexer import *
class Number(object):
"""Number AST Node"""
def __init__(self, value, is_angle=False):
"""Initialize AST node
... |
#!/usr/bin/python3.4
# to allow code to work with Python 2 and 3
from __future__ import print_function # print is a function in python3
from __future__ import unicode_literals # avoid adding "u" to each string
from __future__ import division # avoid writing float(x) when dividing by x
import argparse
import logging ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.