text stringlengths 3.07k 12.6k |
|---|
"""
Copyright (C) 2018-2021 Intel Corporation
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... |
# stdlib
import json
import sys
# 3p
import argparse
# datadog
from datadog import api
from datadog.dogshell.common import report_errors, report_warnings
from datadog.util.format import pretty_json
class DashboardClient(object):
@classmethod
def setup_parser(cls, subparsers):
parser = subparsers.ad... |
import math
from numbers import Number
class Vector(tuple):
"""
Three ways of initializing:
Vector(a,b,c,...) -> vector with components a,b,c,...
Vector(iterable) -> vector whose components are given by the iterable
Vector(cx) -> 2D vector with components cx.real,cx.imag where cx is co... |
import itertools
import numpy as np
import torch
import matplotlib.pyplot as plt
from .helpers import rdm
# Show 2D the tensor.
def show_tensor(aTensor, _vmin=None, _vmax=None):
r"""Plots a 2D tensor in gray color map and shows it in a window.
Args:
aTensor (Tensor): The input tensor.
... |
import gammalib as g
import sys
import numpy as np
gobs = g.GCTAObservation()
caldb = g.GCaldb('cta', 'prod3b')
irf = 'South_z20_average_30m'
gobs.response(irf, caldb)
rsp = gobs.response()
# print(rsp)
"""
=== GCTAResponseIrf ===
Caldb mission .............: cta
Caldb instrument ..........: prod3b
Response name .... |
"""
#;+
#; NAME:
#; continuum
#; Version 1.0
#;
#; PURPOSE:
#; Module for continuum code
#; 20-Aug-2015 by JXP
#;-
#;------------------------------------------------------------------------------
"""
from __future__ import print_function, absolute_import, division, unicode_literals
import numpy as np
import ... |
"""Command line tool for starting a Cheroot WSGI/HTTP server instance.
Basic usage::
# Start a server on 127.0.0.1:8000 with the default settings
# for the WSGI app myapp/wsgi.py:application()
cheroot myapp.wsgi
# Start a server on 0.0.0.0:9000 with 8 threads
# for the WSGI app myapp/wsgi.py:main... |
import sys
sys.path.insert(0, './pix2pixlib')
import os
import pathlib
import logging
import argparse
import json
from collections import namedtuple
from PIL import Image
import numpy as np
import torch
from nni.utils import merge_parameter
from pix2pixlib.data.aligned_dataset import AlignedDataset
from pix2pixlib.dat... |
import random
from math import sqrt
from enum import IntEnum
from dataclasses import dataclass
from copy import copy
from interface import implements
from behavior_tree_learning.sbt import World
@dataclass
class Pos:
"""
Cartesian position
"""
x: float = 0
y: float = 0
z: float = 0
def _... |
# -*- coding: utf-8 -*-
# author: <NAME>
"""get_pomological_data.py
This script scrapes the USDA Pomological Watercolors Collection ()
and creates a dataframe with the following columns:
- `painting_number`: Painting number as enumerated in collection.
- `fruit`: Name of the primary fruit depicted in t... |
"""Module to aid in the creation of spacetime diagrams."""
import numpy as np
import matplotlib.pyplot as plt
class WorldLine:
"""Represents an object traveling through space at a given speed."""
def __init__(self, label, point, speed=None, start=None, end=None):
"""Initialize a new WorldLine object.... |
import argparse
import copy
import json
import sys
from argparse import RawTextHelpFormatter
from statistics import mean
def get_file_paths(file_prefix, num_files):
"""
Generates the json file paths of the format <file_prefix>idx.json
where idx is an integer between 0 and num_files-1
:param file_pref... |
#!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import re
import os
from pathlib import Path
from six.moves import cPickle as pickle
import optparse
import tables
from Chandra.Time import DateTime
import Ska.DBI
import pyyaks.logger
import pyyaks.context
import numpy as np
imp... |
# -*- coding: utf-8 -*-
"""
@Author: Lyzhang
@Date:
@Description:
"""
import numpy as np
from path_config import *
from config import *
from config import *
from utils.file_util import *
from utils.text_process_util import rm_edge_s, get_sent_words_syns, s_list
def build_glove_word_dict():
""" 对词... |
from time import sleep
import models
import store
"""function create members takes three members as input
and create them using Member class."""
def create_members():
member1=models.Member("Karen",19)
member2=models.Member("Jhon",23)
member3 =models.Member('Nour', 28)
print(member1)
print(member2)
print(member... |
# 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... |
"""
<NAME>
Thu Jan 30 13:52:28 2020
Python 2 - DAT-129 - Spring 2020
Homework 1
Icon Processing
"""
#PLAN
# =============================================================================
# Print an icon using a static input
# loop through list, print @ if 1, " " if 0
# At (position +1... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Dict, List
import torch
from torch import Tensor
@torch.jit.script
def script_skip_tensor_list(x: List[Tensor], mask):
... |
# -*- coding: utf-8 -*-
"""
Small useful tools for general purpose
requirement:
Python 2.7
"""
import csv
import time
import json
import hashlib
import os
# File system tools
def mkdir(original_dir):
"""Return original dir with os.sep if not ends with it and make this dir if not exists."""
if '~' in o... |
# Copyright (c) 2019 Microsoft Corporation
# Distributed under the MIT software license
import sys
this = sys.modules[__name__]
this.is_debug_mode = False
def print_debug_info(file=None):
""" This function varies version-by-version, prints debug info as a pretty string.
Args:
file: File to print to... |
#!/usr/bin/env python3
from pathlib import Path
import cups
from exceptions import (JobCompletedError, JobDocumentNotAvailableError,
JobNotFoundError, PrinterNotFoundError)
class BaseCUPS:
"""A basic cups class."""
def __init__(self):
self.conn = cups.Connection()
class CUPS... |
from __future__ import print_function
import datetime
import os, sys
import json
import boto3
import numpy
import pandas
sys.path.append('/opt/pooled-cell-painting-lambda')
import create_CSVs
import run_DCP
import create_batch_jobs
import helpful_functions
s3 = boto3.client('s3')
sqs = boto3.client('sqs')
pipeline_... |
# -*- coding: utf-8 -*-
import functools
import logging
from ._nodes import Root, Section, Simple
from .exceptions import (
NoMatchException, NoParentException, NoTypeException, IgnoredMatchException
)
from .patterns import (
COMMENT, BLANK_LINE, DASHES, LIST, SIMPLE, SECTION,
LIST_ITEM, NULL, TRUE, FAL... |
from __future__ import division
import math
import numpy as np
import sympy as sp
from scipy.special import gamma
def read_riemann_siegel_coeffs(filename):
f = open(filename, 'r')
lines = f.read().split("\n")
all_coeffs = []
for line in lines:
if len(line) != 0:
coeffs = [ float(c) for c in line.split(... |
"""
Copyright (c) 2010, Cambridge Silicon Radio Ltd.
Written by <NAME> <<EMAIL>>
"""
from io import StringIO
from bintools.elf.stream import ElfStream
from bintools.elf.enums import ELFCLASS, ELFDATA
from bintools.elf.exception import *
from bintools.dwarf.enums import DW_FORM
from bintools.dwarf.expressions import Ex... |
from dataclasses import dataclass, field
from types import FunctionType, TracebackType
from typing import Any, Dict, List, Set, Tuple, Union
from uuid import UUID, uuid4
from roview import rodict, roset
from arrlio.settings import (
MESSAGE_ACK_LATE,
MESSAGE_EXCHANGE,
MESSAGE_PRIORITY,
MESSAGE_TTL,
... |
import functools
import random
import discord
from redbot.core import commands
from redbot.core.config import Config
from redbot.core.utils.menus import DEFAULT_CONTROLS, menu
real_send = commands.Context.send
def chunks(l, n):
"""Yield successive n-sized chunks from l."""
for i in range(0, len(l), n):
... |
# encoding: utf-8
import uuid
import os
import random
import json
from collections import Counter
from flask import request, abort, jsonify, g, url_for, current_app, session
from flask_restful import Resource, reqparse
from flask_socketio import (
emit,
disconnect
)
from app.ansibles.ansible_task import INVENT... |
from functions import convert, decimal_numbers, small_numbers, thousand_numbers
def test_convert():
assert convert(1.00) == 'um real'
assert convert(1000.54) == 'mil reais e cinquenta e quatro centavos'
assert convert(1000.10) == 'mil reais e dez centavos'
assert convert(100000.10) == 'cem mil reais e... |
import tensorflow as tf
import argparse
import os
def training_config_parser():
""" Training config class can be overide using the script arguments
"""
parser = argparse.ArgumentParser()
# Dataset info
parser.add_argument("--data_dir", type=str, required=False, help="Path to the dataset director... |
# Copyright (c) 2017 Cisco Systems, 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 re... |
import warnings
import numpy as np
from typing import Optional, Sequence, List, Tuple, IO
from ffm.libffm import train as libffm_train
from ffm.libffm import predict as ffm_predict
__all__ = ["Dataset", "Model", "train"]
class Dataset:
def __init__(
self,
data: Sequence[Sequence[Tuple[int, int, f... |
import frappe
from money_transfer.money_transfer.db import get_service_control
from money_transfer.money_transfer.utils import console_print, get_total_amount, num2str
from money_transfer.money_transfer.socket_handler import make_socket_connection
def get_customer_details(client_no):
customer_name, customer_add, c... |
import numpy as np
import matplotlib.pyplot as plt
class GridWorld(object):
def __init__(self, m, n, magicSquares):
self.grid = np.zeros((m,n))
self.m = m
self.n = n
self.stateSpace = [i for i in range(self.m*self.n)]
self.stateSpace.remove(80)
self.stateSpacePlus = ... |
from math import inf
from numpy.core.defchararray import decode
import torch
from torch import optim
import torch.nn.functional as F
from torch._C import DeviceObjType
import torch.nn as nn
from .attack import Attacker
from .utils import target_sentence_to_label, levenshteinDistance
from tqdm import tqdm
import numpy a... |
import logging
import os
import shutil
import sys
import time
import numpy as np
import torch
import torch.nn as nn
import torch.distributed as dist
class AverageMeter(object):
def __init__(self):
self.reset()
def reset(self):
self.avg = 0
self.sum = 0
self.cnt = 0
def u... |
# -*- coding: utf-8 -*-
"""User blueprint for the bioregistry web application."""
from typing import Optional
from flask import Blueprint, abort, redirect, render_template, url_for
import bioregistry
from .utils import _get_resource_mapping_rows, _get_resource_providers, _normalize_prefix_or_404
__all__ = [
'u... |
#!/usr/bin/python3
# Demonstrates OpenGL coordinate transformation
# <NAME>
# <EMAIL>
#
# Based heavily on: Atom.cpp
# OpenGL SuperBible
# Program by <NAME>.
import math
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
ESCAPE = b'\033'
xRot = 0.0
yRot = 0.0
# Angle... |
## @file integtest.py
## @brief Various extensions to the PyUnit framework (module unittest).
##
## Detailed description (for Doxygen goes here)
## @package integtest
## @brief Various extensions to the PyUnit framework (module unittest).
"""
Various extensions to the PyUnit framework (module unittest).
Detailed desc... |
import torch
from progress_bar import progress_bar
from helpers import *
def individual2population(f):
return lambda P : torch.stack([f(p) for p in P])
class DifferentialEvolver:
def __init__(self, f,
initial_pop = None, # In next version, I'll remove the option of giving pop_size, dim... |
#
# this module converts a floating point caffe model to the model conv.dat and fc.dat
# conv.dat -- run on TEE comput stick.
# fc.dat -- runs on host device
# Note: the input model has to be trained as 1bit/3bits network.
#
# Run:
# python convt_cnnsvic.py teeNet1.caffemodel teeNet1.prototxt teeNet1.json test.jpg ./... |
import cv2
import numpy as np
import pyk4a
from helpers import colorize
from pyk4a import Config, PyK4A
from datetime import datetime
# Store into HDF5 dataset
# https://docs.h5py.org/en/stable/high/dataset.html
import h5py
import sys
# Profiling
import cProfile
import time
import Threshold
# For concating: http... |
import numpy as np
import matplotlib.pyplot as plt
import os
import dataloggervis as dv
from matplotlib import cm, colors
from collections import deque
from fitnessFunction import fitnessFunction
import seaborn as sns
from matplotlib.collections import LineCollection
from matplotlib.colors import ListedColormap, Bounda... |
import torch
import torch.nn.functional as F
from torch import nn
from math import sqrt
import numpy as np
class ContrastProjection(nn.Module):
def __init__(self, __C):
super().__init__()
self.linear1 = nn.Linear(__C.HIDDEN_SIZE, __C.HIDDEN_SIZE)
self.linear2 = nn.Linear(__C.HIDDEN_SIZE, ... |
# Copyright (c) 2016 Red Hat, 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 require... |
from classytags.arguments import Argument, KeywordArgument
from classytags.core import Tag, Options
from classytags.helpers import InclusionTag
from django import template
from django.forms import (Select, CheckboxSelectMultiple, Textarea, RadioSelect,
SelectMultiple, CheckboxInput, MultiWidge... |
from itertools import combinations as combinations
from operator import attrgetter
import Player as P
###
class PokerPool(P.Player):
'''Derived class for pool of common cards'''
max_cards = 5
def __init__(self, name):
P.Player.__init__(self, name)
self.hand.max_cards = self.max_cards
###
class PokerHand... |
#!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2009-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... |
"""Support for the 'attrs' library."""
import logging
from pytype import abstract
from pytype import function
from pytype import overlay
from pytype import overlay_utils
from pytype.overlays import classgen
log = logging.getLogger(__name__)
# type aliases for convenience
Param = overlay_utils.Param
Attribute = clas... |
#!/usr/bin/env python3
import dns.resolver
import re
import sys
# -----------------------------------------------------
# SPFlattener - Because who needs limits??
# Requires: dnspython
# Usage: SPFlatten.py yourdmomain.com and-optional-others.net etc.org
# -----------------------------------------------------
# To-do... |
import os
import json
from six.moves import http_client
from kubernetes import client, config
import requests
class KubernetesClient(object):
def __init__(self):
if 'KUBERNETES_LOAD_KUBE_CONFIG' in os.environ:
config.load_kube_config()
else:
config.load_incluster_config()
... |
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import json
import os
import re
from pkg_resources import parse_version
from subprocess import check_output, CalledProcessError
from traitlets.config.configurable import LoggingConfigurable
from traitlets import Dict... |
from typing import List, Dict
import simplejson as json
from flask import Flask, render_template, request, redirect, url_for, session
from flask import render_template
from flaskext.mysql import MySQL
from pymysql.cursors import DictCursor
import smtplib, ssl
from email.mime.text import MIMEText
from email.mime.multipa... |
import errno
import os
import json
import subprocess
import time
from distutils.version import LooseVersion
from metaflow.exception import MetaflowException
from metaflow.metaflow_environment import InvalidEnvironmentException
from metaflow.util import which
class CondaException(MetaflowException):
headline = 'Co... |
from ephemeral_port_reserve import reserve
from glob import glob
import logging
import os
import psycopg2
import random
import re
import signal
import sqlite3
import string
import subprocess
import time
class Sqlite3Db(object):
def __init__(self, path):
self.path = path
def get_dsn(self):
""... |
"""Parse HTTP Forwarded header and overwrites relevant metadata.
See IETF RFC 7239 and/or
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded
for details on this header.
"""
import logging
import re
from ipaddress import IPv4Address
from ipaddress import IPv6Address
from ipaddress import ip_address
fr... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import ray
from ray.utils import binary_to_hex
OBJECT_INFO_PREFIX = b"OI:"
OBJECT_LOCATION_PREFIX = b"OL:"
TASK_PREFIX = b"TT:"
def flush_redis_unsafe(redis_client=None):
"""This removes some non-critica... |
from flask_sqlalchemy import SQLAlchemy
from collections import defaultdict
from config import data as config
db = SQLAlchemy()
class Database:
@classmethod
def get_or_add_user(cls, user_name):
user = db.session.query(User).filter_by(name=user_name).first()
if user is None:
user = User(user_name)
db.sess... |
#!/usr/bin/env python
import sys
import datetime
import os
import argparse
import ipaddress
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import hashes
from... |
import os
import secrets
import arrow
from PIL import Image
from flask import Blueprint, render_template, request, redirect, url_for, session, current_app
from flask_login import current_user, login_required
from htmlmin.minify import html_minify
from slugify import slugify
from app import db, app, current_user_image... |
from nose.tools import assert_equal, raises, assert_is_none, assert_true, \
assert_false, assert_list_equal, assert_raises
from werkzeug.datastructures import MultiDict
from slivka.server.forms.fields import BaseField, ValidationError, \
ArrayFieldMixin
class FieldStub(BaseField):
def run_validation(self... |
"""
MIT License
Copyright (c) 2017 s0hvaperuna
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, publish, d... |
# coding=utf-8
# Copyright 2018 The TF-Agents 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... |
# Gigawhat Website database module.
# Copyright 2022 Gigawhat Programming Team
# Written by <NAME>, 2022.
#
# 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 3 of the License,... |
# Parser for Kegtron BLE advertisements
import logging
import struct
_LOGGER = logging.getLogger(__name__)
# Sensors type dictionary
# {device type code: (device name, binary?)}
KEGTRON_TYPE_DICT = {b'\x1E\xFF\xFF\xFF': ("Kegtron", False)}
KEGTRON_SIZE_DICT = {
9464: "Half Corny (2.5 gal)",
18927: "Corny (5.... |
import tkinter as tk
import tkinter.ttk as ttk
from PIL import Image, ImageTk
from selenium import webdriver
import time
import pyautogui
height = pyautogui.size()[1]
width = pyautogui.size()[0]
print("resolution = " + str(width) + ", " + str(height))
window = tk.Tk()
window.title("YouTube Bot")
window.r... |
from flask import render_template, redirect, url_for, abort, request
from . import main
from flask_login import login_required, current_user
from ..models import User, Pitch, Comment, Upvote, Downvote
from .form import UpdateProfile, PitchForm, CommentForm, SubscriberForm
from .. import db, photos
from ..request import... |
"""
Switch management views
"""
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib import messages
from django.view... |
from tkinter import *
import tkinter.font as tkfont
from tkinter import *
from random import randint
import time
def No1(event):
print('no')
def Start(event):
StartBt.destroy()
ExpLb2.destroy()
ExpLbY.destroy()
ExpLbN.destroy()
ExpLb1.destroy()
WelcomeLb1.destroy()
#Cli... |
import functools
from typing import Any, Dict, List
import requests
from dbt.events.functions import fire_event
from dbt.events.types import (
RegistryProgressMakingGETRequest,
RegistryProgressGETResponse,
RegistryIndexProgressMakingGETRequest,
RegistryIndexProgressGETResponse,
RegistryResponseUnexp... |
import copy
import csv
import glob
import json
import os
import fire
import cv2
import tqdm
# remove args due to security check. can't make this file to md since other files are calling the method from it.
# previous commit with args is
# https://jet-tfs.visualstudio.com/Kepler/_git/ap/commit/<PASSWORD>9<PASSWORD>ada25... |
"""
Our Proxy-Protocol is based on a simple structure of a packet.
This agent is a simple implementation of the idea, and it should work on HTTP packets only.
The client sends a request in this format:
<ip_in_bytes><port_in_bytes><HTTP_method>...
For example, if the requesting ip is 192.168.3.11 and the port i... |
# -*- coding: utf-8 -*-
from abc import ABC, abstractmethod
import fsspec
import geopandas
from intake.source.base import DataSource, Schema
from ._version import get_versions
__version__ = get_versions()["version"]
del get_versions
class GeoPandasSource(DataSource, ABC):
"""
Base class intake source for l... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 <NAME>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
... |
# -*- coding: latin-1 -*-
import numpy as np
def LoadUXDData(filename, path="", friendly_name=""):
""" Load two-dimensional mesh scans from Bruker x-ray files """
###################
# By <NAME> #
###################
#This program assumes that the step sizes of all Rocking Curves are the same
... |
class Empty(Exception):
pass
class _DoublyLinkedBase:
"""A base class providing a doubly linked list representation"""
class _Node:
__slots__ = '_element', '_prev', '_next'
"""Lightweight, nonpublic class for storing a doubly linked node."""
def __init__(self, element, prev, next... |
"""
This module contains custom methods to extract time series data.
"""
__author__ = "<NAME>"
__date__ = "12/10/2012"
__license__ = "GPL (version 2 or later)"
import datetime
import time
import os
from copy import deepcopy
from dateutil.parser import parse as date_parse
import operator
import json
from user_me... |
"""
Fixup that walks through the movie, show and episode items of the configured
library sections, and syncs the "sort title" field of each item by setting it
to the value of its "title" field. Optionally, non-ASCII characters can be
normalized to corresponding ASCII characters, and special characters can be
removed.
"... |
from statistics import mode
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import pandas as pd
import warnings
warnings.filterwarnings('ignore')
class Reshape(nn.Module):
def __init__(self, *args):
super(Reshape, self).__init__()
self.shape = args
def... |
"""
Created on Thu Jan 10 10:01:56 2019
@author: <NAME>
"""
from typing import Callable, List, TypeVar, Tuple
from jax import jit
from functools import partial
import jax.numpy as np
import jax.scipy as sp
import jax.scipy.stats as stats
from jax.numpy import exp, log, sqrt
from jax.scipy.special import logsumexp
f... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" make_help_fmter.py
Colorizes `make help/targets` output, because.
-<NAME> 08-11-2019
"""
import os
import re
import sys
from colr import (
codes,
Colr as C,
Preset as ColrPreset,
auto_disable as colr_auto_disable,
docopt,
enable as co... |
import struct
import models.helpers as helpers
import math
schema = "{http://www.collada.org/2005/11/COLLADASchema}"
animation_channels = []
animation_source_semantics = ["TIME", "TRANSFORM", "X", "Y", "Z", "ANGLE", "INTERPOLATION"]
animation_source_types = ["float", "float4x4", "Name"]
animation_targets = ["transfo... |
# Based on https://github.com/awslabs/aws-apigateway-lambda-authorizer-blueprints/blob/master/blueprints/python/api-gateway-authorizer-python.py # noqa
import re
class HttpVerb:
GET = "GET"
POST = "POST"
PUT = "PUT"
PATCH = "PATCH"
HEAD = "HEAD"
DELETE = "DELETE"
OPTIONS = "OPTIONS"
A... |
from base64 import b32encode
import logging
import gzip
from hashlib import sha1
import json
import os
import os.path as osp
import re
import urllib.request
import numpy as np
from scipy.spatial import cKDTree
import flamedisx as fd
export, __all__ = fd.exporter()
@export
class InterpolateAndExtrapolate(object):
... |
import sys
import os
import math
import random
import yaml
import argparse
import time
import pprint
import pickle
import numpy as np
from pdb import set_trace
from transformer import Transformer
from code_data_reader import CodeDataReader
from metrics import MetricsTracker
from log_saver import LogSaver
from code_com... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
from __future__ import absolute_import, division
import cv2
import numpy as np
import numbers
import torch
from . import ops
__all__ = ['SiamRPNTransforms']
class Compose(object):
def __init__(self, transforms):
self.transforms = transforms
def __call__(self, img , need_gt = False , gt_size = No... |
import itertools
import operator
import warnings
from collections.abc import Iterable
from copy import deepcopy
from functools import reduce
from typing import Type
from typing import Union
from numpy import prod
from numpy import unravel_index
import json_settings as js
def custom_formatwarning(msg, *args, **k... |
import argparse
import os
import argcomplete
import numpy as np
import pandas as pd
from tensorflow.python.keras.layers import Concatenate, Add
from tensorflow.python.keras.layers import Embedding, LSTM, Bidirectional, Input, Dense, Dropout
from tensorflow.python.keras.models import Model
from tensorflow.python.keras.... |
"""
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
"""
import binascii
from dataclasses import dataclass, field
import logging
import sqlite3
import os
from typing im... |
"""Intent recognition methods."""
import argparse
import dataclasses
import gzip
import io
import json
import logging
import os
import subprocess
import sys
import typing
from pathlib import Path
import pydash
from .core import Voice2JsonCore
from .utils import print_json
_LOGGER = logging.getLogger("voice2json.reco... |
#!/usr/bin/env python3
"""Test typeshed's third party stubs using stubtest"""
import argparse
import functools
import subprocess
import sys
import tempfile
import venv
from glob import glob
from pathlib import Path
from typing import NoReturn
import tomli
EXCLUDE_LIST = [
"pyaudio", # install failure locally
... |
# Copyright (c) 2021, CRS4
#
# 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, publish, distribu... |
# configs
import json
import os
import sys
from argparse import ArgumentParser
from datetime import datetime
import tensorflow as tf
from src.config import (
BATCH_SIZE, COL_NAME, EMBEDDING_SIZE, JOB_DIR, L2_REG, LEARNING_RATE, NEG_FACTOR, NEG_NAME, OPTIMIZER, POS_NAME,
ROW_NAME, STEPS_PER_EPOCH, TARGET_NAME,... |
# Author: <NAME>
import torch
import torch.nn.functional as F
from einops import rearrange, repeat
# models
from clynmut.utils import *
# from alphafold2_pytorch.utils import *
# (e-)swish activation(s)
# https://arxiv.org/abs/1801.07145
class e_Swish_(torch.nn.Module):
def forward(self, x, beta=1.):
re... |
import os
import cv2
import csv
import numpy as np
import sklearn
import keras
from keras.models import Sequential, Model
from keras.layers import Lambda, Conv2D, MaxPooling2D, Dropout, Dense, Flatten, Activation, BatchNormalization, Cropping2D
from keras.callbacks import ModelCheckpoint, EarlyStopping
# use external... |
from typing import Dict, List
import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
from .module import Module
from ..utils import PositionalEncoding
from ..networks import choose_architecture
def build_VocabularyGroundingLossModule(id:str,
config:Dict[s... |
# Copyright 2015 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
import numpy as np
import cv2
from enum import Enum
from amd.rali.plugin.pytorch import RALIClassificationIterator
from amd.rali.plugin.pytorch import RALI_iterator
from amd.rali.pipeline import Pipeline
import amd.rali.ops as ops
import amd.rali.types as types
import sys
class HybridTrainPipe(Pipeline):
def __... |
import glob
import os
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.fields import GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models import Q
from common.util... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.