text stringlengths 3.07k 22.1k |
|---|
# -*- coding: utf-8 -*-
import os
from ptsd import ast
from ptsd.parser import Parser
class IdlNode(object):
def __repr__(self):
return "%s(%s)" % (
type(self).__name__,
", ".join("%s=%s" % item for item in vars(self).items()),
)
def __eq__(self, other):
if isi... |
"""
Generate base anchors on index 0
"""
from __future__ import print_function
import sys
from builtins import range
import numpy as np
from ..cython.anchors import anchors_cython
def anchors_plane(feat_h, feat_w, stride, base_anchor):
return anchors_cython(feat_h, feat_w, stride, base_anchor)
def generate_anchors(... |
# coding: utf-8
# In[ ]:
import numpy as np
import sys
import matplotlib.pyplot as plt
import math
import pickle
from mpl_toolkits.mplot3d import Axes3D
from numpy import linalg as LA
from scipy.spatial import Delaunay
from sklearn.preprocessing import normalize
import time
from info3d import *
#from utils_3d im... |
"""
show_acl.py
NXOS parsers for the following show commands:
* show access-lists
* show access-list <acl>
* show access-lists summary
"""
# Python
import re
# Metaparser
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengine import Schema, Any, Optional
# parser utils
from geni... |
import abc
import numpy as np
import pandas as pd
## Noise functions
# All of these take a template index.
def normal(index, name="normal"):
return pd.Series(np.random.normal(scale=1, size=len(index)),
index, name=name)
def constant(index, name="constant"):
return pd.Series(np.ones(len(i... |
#!/usr/bin/env python3
# coding=utf-8
# *****************************************************
# struts-pwn: Apache Struts CVE-2017-9805 Exploit
# Author:
# <NAME> <Mazin AT MazinAhmed DOT net>
# This code is based on:
# https://github.com/rapid7/metasploit-framework/pull/8924
# https://techblog.mediaservice.net/2017/09... |
# This files contains the functions to perform first order descent for HO
# hyperparameter setting
import numpy as np
from numpy.linalg import norm
def grad_search(
algo, criterion, log_alpha0, monitor, n_outer=100, verbose=False,
tolerance_decrease='constant', tol=1e-5,
convexify=False, gamm... |
import argparse
import numpy as np
import matplotlib.pyplot as plt
import itertools
import copy
import os
import time
import torch
import random
import math
import torch.nn as nn
import gym
from torch.utils.tensorboard import SummaryWriter
import datetime
from nets import Simple_model
from buffer import ... |
import unittest
from unittest.mock import Mock
from hamcrest import *
from tournament import *
class TestTournament(unittest.TestCase):
def init(self, toml):
self.cup = Tournament()
self.cup.load(toml)
def test_create_empty_Tournament(self):
tr = Tournament()
assert_that(tr, ... |
'''Interpretation of the Siemens GSL functions.
Author: <NAME> <<EMAIL>>
Copyright (C) 2020 University of Oxford '''
import numpy as np
def class_ori(sag_comp, cor_comp, tra_comp, debug):
''' Python implementation of IDEA-VB17/n4/pkg/MrServers/MrMeasSrv/SeqFW/libGSL/fGSLClassOri.cpp
Function to determine whe... |
from timsconvert.timestamp import *
import alphatims.bruker
import alphatims.utils
import sqlite3
import numpy as np
import pandas as pd
import os
import sys
import itertools
import logging
# Function for itertools.groupby() to sort dictionaries based on key.
def key_func_frames(k):
return k['parent_frame']
# F... |
# Copyright 2018 reinforce.io. 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 law or... |
# Written by <NAME>
from WikiPage import WikiPage
import wikipedia
# to draw the graph
from graphviz import Digraph
# for saving the file the right way
import os
import shutil
# to measure time
import time
# for the output label
from datetime import datetime
# separator for printing
SEP = "--------------------------... |
from __future__ import division
import logging
import warnings
import math
from base64 import b64encode
try:
from io import BytesIO as StringIO # python3
except ImportError:
from StringIO import StringIO # python2
import numpy as np
import PIL.Image
import ipywidgets
import ipywebrtc
from ipython_genutils.... |
# Copyright 1999-2022 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) 2019, xiaomu <<EMAIL>>
#
# 根据系统盘符读取到真实的磁盘
#
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
import os
import re
import json
import argparse
from collections import OrderedDict
from subprocess import check_call, check... |
import pyredner
import torch
import math
import redner
def compute_vertex_normal(vertices, indices):
def dot(v1, v2):
return torch.sum(v1 * v2, dim = 1)
def squared_length(v):
return torch.sum(v * v, dim = 1)
def length(v):
return torch.sqrt(squared_length(v))
def safe_asin(v):
... |
# pylint: disable=E0611
from fastapi import FastAPI, Body, Request
from fastapi.responses import PlainTextResponse, Response
from environs import Env
from fastapi.middleware.cors import CORSMiddleware
from typing import Optional, Dict
from wechatpy import parse_message
from wechatpy.utils import check_signature
from w... |
import pandas as pd
import torch
from greattunes.data_format_mappings import (
tensor2pretty_covariate,
tensor2pretty_response,
)
@staticmethod
def _find_max_response_value(train_X, train_Y):
"""
determines best (max) response value max_X across recorded values in train_Y, together with the correspond... |
import math
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
#FIX: take into account daylight savings time like in Example 11.1
#ignoring for now
#FIX: figure out where this came from in old raytracer
kSOLAR_constant = 2600
def rotation_matrix(theta, u):
r"""Get the rotation matrix necessa... |
import sys
from argparse import ArgumentParser, RawTextHelpFormatter
from re import match
from msm_pele.PPP.global_variables import supported_aminoacids, input_keywords, aminoacids_1letter, aminoacids_3letter
import msm_pele.PPP.parameters_help as parameters_help
from prody import parsePDB
__author__ = 'jelisa'
def... |
# -*- coding: utf-8 -*-
# BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules
# Copyright (C) 2020-2021, <NAME> <<EMAIL>>
#
# This module is under the UIUC open-source license. See
# github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt
# for license details.
"""
"""
import thermo... |
from __future__ import absolute_import
import numpy as np
import numpy.testing as npt
from nose.tools import assert_raises
import tangos as db
import tangos.testing as testing
import tangos.live_calculation as lc
import warnings
import tangos.testing.simulation_generator
from tangos.testing import assert_halolists_eq... |
import requests
from requests.auth import HTTPBasicAuth
import sys
import json
from decimal import Decimal
import time
from .part import Part
from .partkeepr_units import Units
class DecimalEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, Decimal):
return str(obj)
... |
#!/usr/bin/python3
# -*- mode: python; coding: utf-8 -*-
from typing import List, Dict, Optional, Tuple, Generator
import collections
import enum
import functools
import logging
from dsapy.algs import bdfs
from jf import branch
from jf import command
from jf import config
from jf import git
_logger = logging.getL... |
"""
Simple computation graph implmentation. Doesn't handle
cycles.
Used to do back propigation for a batch normalization node.
"""
from collections import deque
import numpy as np
class CompNode(object):
def __init__(self):
self.name = "unamed"
self.output = None
d... |
# Copyright 2021 Division of Medical Image Computing, German Cancer Research Center (DKFZ)
# and Applied Computer Vision Lab, Helmholtz Imaging Platform
#
# 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 L... |
import json
import logging
import random
import ssl
import threading
import time
from abc import abstractmethod
from enum import Enum
from typing import List, Dict, Optional
from urllib.parse import urlencode
from websocket import WebSocketApp, ABNF, WebSocketException, setdefaulttimeout, WebSocketConnectionClosedExce... |
#!/usr/bin/env python
"""
Quick and dirty attempt to migrate issues from Request Tracker to Zammad.
"""
import base64
import json
import os
import pickle
import sys
from rt import Rt
from zammad_py import ZammadAPI
from zammad_py.api import Resource, TagList, TicketArticle
class Tag(Resource):
path_attribute =... |
# Copyright 2018-2021
# Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH
# 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/LICE... |
# -*- coding: utf-8 -*-
import copy
from typing import Callable
import gym
from gym import spaces
import numpy as np
from pettingzoo import ParallelEnv
from gfootball import env as raw_grf_env
from malib.envs.gr_football.encoders import encoder_basic, rewarder_basic
class BaseGFootBall(ParallelEnv):
metadata = {... |
import random
import discord
from discord import app_commands
from discord.ext import commands
from utils.ids import GuildIDs
class Funcommands(commands.Cog):
"""Contains the "funny" commands.
They all pretty much just trigger random responses.
"""
def __init__(self, bot):
se... |
import CSDGAN.utils.constants as cs
import CSDGAN.utils.img_data_loading as cuidl
import os
import pandas as pd
import shutil
import logging
import unicodedata
import string
import datetime as d
from zipfile import ZipFile
import pickle as pkl
from collections import OrderedDict
def get_CGAN(username, title):
pa... |
# Copyright 2020 Soda
# 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
#... |
from collections import namedtuple
import logging
import traceback
import attr
from .. import repositories, entities, services
logger = logging.getLogger(name=__name__)
class PipelineNodeIO:
def __init__(self, port_id, input_type, name, color, display_name, port_percentage):
self.port_id = port_id
... |
# Copyright 2022 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, ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 3 13:52:11 2019
@author: fnammour
"""
import numpy as np
from numpy.linalg import norm
from scipy.signal import convolve
from skimage.measure import label
from AlphaTransform import AlphaShearletTransform as AST
def rotate180(img):
"""This fu... |
import os.path
from .snapshots import HASnapshot, Snapshot, AbstractSnapshot
from .config import Config
from .time import Time
from .model import SnapshotSource, CreateOptions
from typing import Optional, List, Dict
from threading import Lock, Thread
from .harequests import HaRequests
from .exceptions import LogicError... |
"""
Usage: aoc-dt [--help] [options]
Options:
-u, --update
-r, --ranking Show scores ranked by delta time
-t, --total Show total scores
-y, --year YEAR The year to use
-l, --leaderboard LEADERBOARD_ID The leaderboard ID
-c, --cookie COOKIE ... |
import os
import time
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.multiprocessing
import torch.nn.functional as F
from numba import jit
from speechbrain.pretrained import EncoderClassifier
from torch.cuda.amp import GradScaler
from torch.cuda.amp import autocast
from torch.nn.utils.rnn... |
import math
import Terminal
import numpy as np
type_factor_sigma = {'UWB' : 0, 'BlueTooth' : 0.3}
def get_distance(terminalA : 'Terminal.CartesianPoint', terminalB : 'Terminal.CartesianPoint'):
#print(terminalA._x, terminalB._x, terminalA._y, terminalB._y)
dis = math.sqrt( ((terminalA._x-terminalB._x)... |
'''
calibre_plugins.comicvine - A calibre metadata source for comicvine
'''
import logging
import random
import re
import time
import threading
from calibre.ebooks.metadata.book.base import Metadata
from calibre.utils import logging as calibre_logging # pylint: disable=W0404
from calibre.utils.config import JSONConfig... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import seaborn as sns
import os
from scipy import stats
import argparse
# In[2]:
parser = argparse.ArgumentParser(description='GAN-SODE')
parser.add_argument('--GPU', type=int, default=0, help... |
# (c) 2015, Logentries.com, <NAME> <<EMAIL>>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: logentries
type: notificatio... |
from __future__ import unicode_literals
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models.signals import post_init, post_save
from django.urls import reverse
from django.utils import timezone
from django.utils.encoding import python_2... |
import logging
from copy import deepcopy
from io import BytesIO
from typing import Any, Mapping, Tuple, Protocol, Optional, Sequence
import discord
from discordmenu.embed.menu import EmbedMenu
from menulistener.errors import CogNotLoaded, MissingImsMenuType, InvalidImsMenuType
from discordmenu.embed.emoji import Embe... |
from __future__ import absolute_import
from builtins import str
from builtins import object
import sys, os
import forcebalance
import forcebalance.forcefield as forcefield
import unittest
from __init__ import ForceBalanceTestCase
import numpy as np
from copy import deepcopy
class FFTests(object):
"""Tests common t... |
# coding=utf-8
"""
Tensorflow implementation of PV-DM algorithm wrapper class.
:author: <NAME> (<EMAIL>)
:refer: http://arxiv.org/abs/1405.4053
"""
import tensorflow as tf
import numpy as np
from option import Option
import math
import time
import collections
from itertools import compress
def generate_batch_pvd... |
r"""
============
quantnn.data
============
This module provides generic classes to simplify the handling of training
data.
"""
from collections import OrderedDict
from collections.abc import Iterable, Mapping
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
import logging
import multiprocessing
... |
from __future__ import print_function
import concurrent.futures
import numba
import numpy as np
import time
from collections import defaultdict
from disc_learning import NoiseAwareModel
from math import copysign, exp, log
MIN_LR = 1e-6
class FMCT(NoiseAwareModel):
"""fastmulticontext"""
def __init__(self,... |
import numpy as np
import pandas as pd
import os, sys, glob, pickle
from pathlib import Path
from os.path import join, exists, dirname, abspath
import random
from plyfile import PlyData, PlyElement
from sklearn.neighbors import KDTree
from tqdm import tqdm
import logging
from .utils import DataProcessing
from .base_da... |
#!/usr/bin/python3.6
'''
Functions for easily translating generated AMBA and GenBuf specifications
NOTE: 1. Run function from python (no main here).
2. Set the paths to perl and python2.7 (perl_path and py2_path below),
since the generators are written in perl and Slugs and Ratsy trunslators
wri... |
import math
import numpy as np
import h5py
import matplotlib.pyplot as plt
import tensorflow as tf
from tf_utils import load_dataset, random_mini_batches, convert_to_one_hot, predict
from sys import stdout
import time
import inspect
np.random.seed(1)
# Loading the dataset
X_train_orig, Y_train_orig, X_test_orig, Y_te... |
from django.db.models import Q
from django.shortcuts import get_object_or_404
from django.views import View
from django.views.generic import ListView, DetailView, CreateView, FormView
from django.views.generic.detail import SingleObjectMixin
from django.contrib.auth.models import User, Group
from django.contrib.auth.mi... |
# coding=UTF-8
'''
@Description:
@Author: dingyadong
@Github: https://github.com/bansheng
@LastAuthor: dingyadong
@since: 2019-04-17 11:23:11
@lastTime: 2019-04-27 15:20:27
'''
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.nn import (Conv2d, Conv3d, LeakyReLU, Lin... |
#!/usr/bin/env python
import cherrypy
import json
import core
import tappedout
import datetime
import logging
import deckstats
import random
import kmeans
import mtgsalvation
import deckstatscom
import gracefulstats
COMMANDERS = sorted( core.sanitize_cardname(cn.decode('utf-8').strip().lower()) for cn in open('comman... |
import numpy as np
from osgeo import gdal, osr
from ..generic.handler_im import get_image_subset
from ..generic.mapping_tools import ref_trans, pix2map
from ..generic.mapping_io import read_geo_image
from ..input.read_sentinel2 import read_band_s2, read_sun_angles_s2
from ..input.read_rapideye import read_band_re
fro... |
import collections
import ida_lines
import ida_idaapi
#-----------------------------------------------------------------------------
# Text Abstractions
#-----------------------------------------------------------------------------
#
# This file contains a number of 'text abstractions' that will serve as
# the ... |
# Copyright (c) 2014 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... |
from __future__ import absolute_import, print_function
from qtpy import QtCore, QtWidgets, uic
from collections import OrderedDict
import os
import logging
import pyqtgraph as pg
import threading
class OrderedAttrDict(object):
def __init__(self):
self._odict = OrderedDict()
def add(self, name... |
import time
import os
import functools
import itertools
import numpy as np
import tensorflow as tf
from tensorflow.contrib import slim
import six
from six.moves import xrange # pylint: disable=redefined-builtin
import icdar_dataset
from uaitrain.arch.tensorflow import uflag
tf.app.flags.DEFINE_integer('input_size'... |
"""JSON API.
This module contains the url endpoints of the JSON API that is used by the web
interface for asynchronous functionality.
"""
import functools
import os
import shutil
from os import path
from os import remove
from typing import List
from flask import Blueprint
from flask import get_template_attribute
from... |
from argparse import ArgumentParser
import json
import glob
import numpy as np
from mpi4py import MPI
import pySDC.helpers.plot_helper as plt_helper
import matplotlib.ticker as ticker
from pySDC.helpers.stats_helper import filter_stats, sort_stats
from pySDC.implementations.collocation_classes.gauss_radau_right impor... |
import sys
import math
import numpy
import itertools
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
# n: the total number of nodes in the level, including the gateways
# l: the number of links
# e: the number of exit gateways
n, l, e = [int(i) for i in ... |
from os import environ
from types import new_class
import numpy as np
import torch
from PIL import Image
import matplotlib.pyplot as plt
import cv2
from matplotlib.backends.backend_agg import FigureCanvasAgg
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from spirl.utils.pytorch_utils import pad_... |
from telethon import events, functions
from datetime import datetime
import asyncio, io, random, speedtest, emoji, urbandict, types
from googletrans import Translator
from uniborg.util import admin_cmd
from telethon.errors.rpcerrorlist import YouBlockedUserError, UserAlreadyParticipantError
from telethon.tl.functions.a... |
"""
@author: <NAME>
@contact: yuhao.cheng[at]outlook.com
"""
import time
import torch
import weakref
from collections import OrderedDict
from pyanomaly.core.hook.abstract import HookBase
import abc
import logging
logger = logging.getLogger(__name__)
class AbstractEngine(object):
"""Abstract engine... |
import datetime as dt
from paraview import servermanager
from paraview.simple import *
from paraview.benchmark import *
#import logbase, logparser
logbase.maximize_logs()
records = []
n0 = dt.datetime.now()
def get_render_view(size):
'''Similar to GetRenderView except if a new view is created, it's
created wi... |
import os
from datetime import datetime
from flask import Flask, render_template, url_for, request
from werkzeug.utils import secure_filename, redirect
from Models import create_table, database
from App import api
app = Flask(__name__)
# This hook ensures that a connection is opened to handle any queries
# generat... |
import requests
from bs4 import BeautifulSoup
import re
import time
import csv
import sys
import os.path
sys.stdout.reconfigure(encoding='utf-8')
# Get the format type of the book content
def get_number_of_formats(formats):
list_of_formats = formats.find_all("span")
if len(list_of_formats) == 2:
retur... |
from . import machines
from . import syntax
from . import graphs
__all__ = ['from_regexp', 'to_regexp', 'RegularExpression']
### Regular expression objects
UNION = syntax.Operator('|')
STAR = syntax.Operator('*')
LPAREN = syntax.Operator('(')
RPAREN = syntax.Operator(')')
class RegularExpression:
"""A (abstract... |
import csv
from dataset_specific.prostate.utils.preprocess import *
THRESHOLD = 0.5
def jaccard(prediction, groundTruth):
filter = sitk.LabelOverlapMeasuresImageFilter()
filter.Execute(prediction, groundTruth)
return filter.GetJaccardCoefficient()
def getDice(prediction, groundTruth):
filter = sit... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
from __future__ import print_function
import argparse
import os
import re
import string
import textwrap
TEXT_WIDTH = 78
SEP_LINE = "-" * TEXT_WIDTH
def wrap_print(msg):
print(textwrap.fill(msg, width=TEXT_WIDTH))
def wrap_input(msg):
return input(
te... |
#!/usr/bin/python3
import cv2
import numpy as np
# single or double panel? choose here
DOUBLEPANEL = True
# default values
display = "img"
# no windowing
apod_size = 0
# not drawing a mask
drawing = False
# drawing non-symetric mask
symetric_mask = False
##############################################################... |
#!/usr/bin/env python3
'''
Notes:
Script to convert .xsd file to VASP input files.
This version is specialized for Thomas the Server.
Last updated by jyxu.
Description:
Create VASP input files, POSCAR->POTCAR->PBS.sh->INCAR->...
'''
import argparse
import os
import re
import sys
import numpy as np
fr... |
from mip import *
from enum import Enum
class Dole(Enum):
MaO = 0
MaM = 1
DiO = 2
DiM = 3
WoO = 4
WoM = 5
DoO = 6
DoM = 7
VrO = 8
VrM = 9
d=0
doleHours = {}
for data in Dole:
d += 1
doleHours[data.name] = 4
m = Model()
zz = {1: 1/6, 2: 1/3, ... |
import logging
import time
from client import Client
from peloton_client.pbgen.peloton.api.v0.host import host_pb2 as host
from peloton_client.pbgen.peloton.api.v0.host.svc import (
host_svc_pb2 as hostsvc,
)
from tests.integration.conf_util import HOSTPOOL_DEFAULT
from retry import retry
log = logging.getLogge... |
# Automated, robust apt-get mirror selection for Debian and Ubuntu.
#
# Author: <NAME> <<EMAIL>>
# Last Change: April 15, 2020
# URL: https://apt-mirror-updater.readthedocs.io
"""Discovery of Ubuntu package archive mirrors."""
# Standard library modules.
import logging
# External dependencies.
from bs4 import Beauti... |
# -*- coding: utf-8 -*-
# file: pyabsa_utils.py
# time: 2021/5/20 0020
# author: yangheng <<EMAIL>>
# github: https://github.com/yangheng95
# Copyright (C) 2021. All Rights Reserved.
import json
import os
import pickle
import time
import requests
import torch
from autocuda import auto_cuda, auto_cuda_name
from findfil... |
'''
Docker Monitor component
'''
from datetime import timedelta
import logging
import async_timeout
import homeassistant.util.dt as dt_util
from homeassistant.components.sensor import ENTITY_ID_FORMAT
from homeassistant.const import (
CONF_MONITORED_CONDITIONS,
CONF_NAME,
CONF_SCAN_INTERVAL,
EVENT_HOME... |
"""
*********************
Core GPIO Digital Pin
*********************
:Author: <NAME>
"""
# Copyright (c) 2019-2021 MQTTany contributors
#
# 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 wit... |
#!/usr/bin/env python3
# coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... |
"""
A* grid based planning
author: <NAME> (<EMAIL>)
See Wikipedia article (https://en.wikipedia.org/wiki/A*_search_algorithm)
"""
import heapq
import math
import matplotlib.pyplot as plt
show_animation = False
class Node:
def __init__(self, x, y, cost, parent_index):
self.x = x
self.y = y
... |
# -*- coding: utf-8 -*-
"""
This module gives access to the console.
"""
if __host__ is not widget:
from rubicon.objc import *
from _get_variables_hierarchy import get_variables_hierarchy
from code import interact
import stopit
import pdb
if __platform__ is iOS:
import _codecompletion
from... |
#!/usr/bin/env python
from ctypes import *
from ctypes.util import find_library
import _ctypes
import locale
import sys
# load the library
#minclocation = find_library("minc2")
#print("PYMINC: using", minclocation)
try:
libminc = cdll.LoadLibrary("libminc2.dylib")
except OSError:
try:
libminc = cdll.... |
#!/usr/bin/env python3
"""
Copyright 2017 <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, including without limitation the rights
to use, copy, modify, merge,... |
import sys
sys.path.append("./keras-ssd")
from keras import backend as K
from keras.models import load_model
from keras.preprocessing import image
from keras.optimizers import Adam
from imageio import imread
import numpy as np
from matplotlib import pyplot as plt
from models.keras_ssd300 import ssd_300
from keras_los... |
import plotly as py
import plotly.graph_objs as go
from plotly import tools
from crdt.ops import OpAddRightLocal, OpDeleteLocal
from crdt.ordered_list.arr_ordered_list import ArrOrderedList
from crdt.ordered_list.ll_ordered_list import LLOrderedList
from crdt.ordered_list.lseq_ordered_list import LSEQOrderedList
from ... |
#!/usr/bin/env python3
import os
from ctypes import *
import json
import collections
import numpy as np
import faulthandler
import struct
faulthandler.enable()
basedir = os.path.dirname(os.path.abspath(os.path.realpath(__file__)))
libane = None
aneregs = None
def init_libane():
global libane, aneregs
libane = cdl... |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# Copyright 2013 BrewPi
# This file is part of BrewPi.
# BrewPi is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# BrewPi is distribut... |
"""Utilities for Nobrainer."""
from collections import namedtuple
import csv
import os
import tempfile
import numpy as np
import psutil
import tensorflow as tf
_cache_dir = os.path.join(tempfile.gettempdir(), "nobrainer-data")
def get_data(cache_dir=_cache_dir):
"""Download sample features and labels. The feat... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
try:
# calling from train
from net.utils import *
except:
# calling from __main__
from utils import *
# create a attention block with given kwargs
def get_att_block(att_type, planes, **att_kwargs):
att_dict = {... |
# Copyright 2017-2022 <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/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Copyright 2020 VMware, Inc. All rights reserved.
# AUTO GENERATED FILE -- DO NOT MODIFY!
#
# vAPI stub file for package com.vmware.appliance.recovery.backup.system_name.
#--------------------------------------------... |
#!/usr/bin/python
#
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# 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 limitat... |
# Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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
# ... |
#!/usr/bin/env python3
__license__ = """
Copyright 2009-2020 National Technology and Engineering Solutions of Sandia,
LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government
retains certain rights in this software.
Sandia National Laboratories is a multimission laboratory managed and operated
by... |
from requests.sessions import session
from bs4 import BeautifulSoup
import requests
import time
import socket
__version__ = '0.1.4'
# Used to create profile object for the devices connected on the JioFiber Network
class NodeProfile:
def __init__(self,vendorName,ipv4:str,mac:str,ntime:str,ap:list,security:list):
... |
#!/usr/bin/env python
from connectfour.agents.agent import HumanPlayer
from connectfour.util import delay_move_execution
import csv
import copy
import json
import tkinter.font
from tkinter import Frame, Canvas, Tk, Label, NSEW, Button
import time
LEFT_MOUSE_CLICK = "<Button-1>"
ROW_SPACE = int(400 / 6)
COL_SPACE = i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.