text stringlengths 6.04k 39.5k |
|---|
import torch
import numpy as np
import pybullet as pb
import matplotlib.pyplot as plt
from torch.utils.data import TensorDataset, DataLoader
def show_sample(X_sample, X_next_sample=None, clamp=False):
"""
Plots a sample (in image space) generated by the PybulletSampleGenerator
@arg X_sample tensor of dim ... |
import torch
import numpy as np
import quaternion
import os
import s2c_utils
import pickle
ShapenetNameToClass = {'chair': 0, 'table': 1, 'cabinet': 2, 'trash bin': 3, 'bookshelf': 4,'display': 5,'sofa': 6, 'bathtub': 7, 'other': 8}
ShapenetClassToName = {ShapenetNameToClass[k]: k for k in ShapenetNameToClass}
BASE_D... |
"""
Copyright (c) 2017 - <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, subli... |
# Copyright 2018 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... |
# $Id: knowledge_engine.py a8fb0b81fd85 2010-03-29 mtnyogi $
# coding=utf-8
#
# Copyright © 2007-2008 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including... |
import sys
sys.path.append('..')
import shutil
from dataset.dataloaders import UnetInput
from flerken import pytorchfw
from flerken.models import UNet
from flerken.framework.pytorchframework import set_training, config, ctx_iter, classitems, \
checkpoint_on_key, assert_workdir
from flerken.framework import train,... |
from __future__ import division
import base64
import hmac
import re
import requests
import os.path
from binascii import unhexlify
from hashlib import sha256
from io import BytesIO, IOBase
from math import ceil
from threading import Thread, Timer
from time import time
from .stream import Stream
from ..buffers import ... |
"""
Base and utility classes for tseries type pandas objects.
"""
from __future__ import annotations
from datetime import datetime
from typing import (
TYPE_CHECKING,
Any,
Callable,
Sequence,
TypeVar,
cast,
final,
)
import warnings
import numpy as np
from pandas._libs import (
NaT,
... |
# Copyright (c) 2017 The Regents of the University of Michigan.
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
"""Job class defined here."""
import errno
import logging
import os
import shutil
from copy import deepcopy
from deprecation import deprecated
from ..core import json
fro... |
from __future__ import division
import astropy.units as astropy_units
import numpy as np
from past.utils import old_div
import astromodels.functions.numba_functions as nb_func
from astromodels.core.units import get_units
from astromodels.functions.function import (Function1D, FunctionMeta,
... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
### General imports ###
from __future__ import division
import numpy as np
import pandas as pd
import time
import re
import os
from collections import Counter
import altair as alt
### Flask imports
import requests
from flask import Flask, render_template, session, request, r... |
import numpy as np
from numba import jit
from collections import OrderedDict, deque
import itertools
from utils.nms_wrapper import nms_detections
from utils.log import logger
from utils import bbox as bbox_utils
from tracker import matching
from utils.homography import Homography
from utils.kalman_filter import Kalma... |
# -*- coding: utf-8 -*-
import unittest
from bottle import SimpleTemplate, TemplateError, view, template, touni, tob
import re
import traceback
class TestSimpleTemplate(unittest.TestCase):
def assertRenders(self, tpl, to, *args, **vars):
if isinstance(tpl, str):
tpl = SimpleTemplate(tpl)
... |
#!/usr/bin/python3
# pip3 install python-dateutil
import io
import os
import gzip
import struct
import datetime
import six
from collections import namedtuple
from dateutil import tz
def open(filename, mode="rb"):
"""Open QSH file in binary mode"""
return QshFile(filename, mode)
def to_milliseconds(datetime_va... |
#!/usr/bin/env python
'''
(C) Copyright 2020 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 applica... |
# Copyright 2014 Red Hat, Inc.
#
# Author: <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
# Copyright 2021 IBM 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 in writi... |
import random
import re
from os import listdir
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import gridspec
from matplotlib.colors import Normalize
from matplotlib.ticker import LinearLocator
from pandas.core.generic import NDFr... |
"""
Base spec for Forcepoint NGFW Management Center connections. This is a session
that will be re-used for multiple operations against the management
server.
"""
import inspect
import traceback
from ansible.module_utils.basic import AnsibleModule
from distutils.version import StrictVersion
try:
from smc import s... |
from sympy import symbols, lambdify, diff, sqrt, I
from sympy import besselj, hankel1, atan2, exp, pi, tanh
import scipy.special as scp
import numpy as np
from scipy.sparse.linalg import gmres
# gmres iteration counter
# https://stackoverflow.com/questions/33512081/getting-the-number-of-iterations-of-scipys-gmres-ite... |
import os
import sys
import zlib
import json
from uuid import uuid4
from hashlib import sha1
from collections import namedtuple
try:
# python2
from urlparse import urlparse
except:
# python3
from urllib.parse import urlparse
from metaflow.datatools.s3 import S3PutObject
from metaflow.util import to_f... |
import collections
import functools
import ipaddress
import itertools
import operator
import random
import struct
from typing import (
Any,
Dict,
Iterable,
List,
Type,
TypeVar,
Tuple, Deque, Iterator)
from urllib import parse as urlparse
from cached_property import cached_property
from eth... |
# Copyright (c) 2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Provide accessors to enhance interoperability between XArray and MetPy."""
from __future__ import absolute_import
import functools
import logging
import re
import warnings
impor... |
# -*- coding: utf-8 -*-
"""
@author: mesar
"""
import pandas as pd
import json
from datetime import datetime
import numpy as np
import csv
from pathlib import Path
from progressbar import progressbar as pbar
import time
import sys
def parallel_parsing(i, key, number_of_clients, vehicle_capacity, package_data_list,... |
# Author: xyb, Diving_Fish
import asyncio
import os
import math
from typing import Optional, Dict, List, Tuple
import aiohttp
from PIL import Image, ImageDraw, ImageFont, ImageFilter
from src.libraries.maimaidx_music import total_list
scoreRank = 'D C B BB BBB A AA AAA S S+ SS SS+ SSS SSS+'.split(' ')
combo = ' FC F... |
# -*- coding: utf-8 -*-
#
# Author: <NAME>, Finland 2016-2019
#
# This file is part of Kunquat.
#
# CC0 1.0 Universal, http://creativecommons.org/publicdomain/zero/1.0/
#
# To the extent possible under law, Kunquat Affirmers have waived all
# copyright and related or neighboring rights to Kunquat.
#
from copy import ... |
"""scholarly.py"""
from __future__ import absolute_import, division, print_function, unicode_literals
from bs4 import BeautifulSoup
import arrow
import bibtexparser
import codecs
import hashlib
import pprint
import random
import re
import requests
import sys
import time
_GOOGLEID = hashlib.md5(str(random.random()).... |
import math
from random import randint, randrange
from collections import deque
from pyglet.math import Vec2
from shapely.geometry import Polygon
from collision import (
Vector as CollisionVector,
Poly,
Concave_Poly as ConcavePoly,
collide,
)
from Rectangle import Rectangle
# Marching squares algorith... |
from tkinter import *
import tkinter.font as font
import numpy as np
import random as r
board = np.zeros((4,4))
checkBoard = np.zeros((4,4))
clearSpace = []
newBlockList = []
gameEnd = 0
newBlock = 0
for i in range(4):
for j in range(4):
clearSpace.append(tuple((i,j)))
def null_space():
... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... |
import py
from rpython.rlib.objectmodel import *
from rpython.rlib import types
from rpython.annotator import model
from rpython.translator.translator import TranslationContext, graphof
from rpython.rtyper.test.tool import BaseRtypingTest, LLRtypeMixin, OORtypeMixin
from rpython.rtyper.test.test_llinterp import interpr... |
import os
import asyncio
from datetime import datetime
from functools import partial
from typing import Optional, Callable, Dict
import dateutil.parser
import dateutil.tz
from indy_node.server.node_maintainer import NodeMaintainer, \
NodeControlToolMessage
from plenum.common.txn_util import is_forced, get_seq_no,... |
# Copyright 2010 OpenStack 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 requ... |
# Author: <NAME>
# VK: vk.com/maksim2009rus
# 1) Generating a Non-Deterministic Finite Automaton by a regular expression.
# 2) Translation of NDFA to DFA.
#
import graphviz as gv
# Standard character classes
D = frozenset("0123456789")
W = D | frozenset("_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
S = fro... |
#!/usr/bin/env python3
# Copyright (c) 2020 Leedehai. All rights reserved.
# Use of this source code is governed under the MIT LICENSE.txt file.
# -----
# Generate a static site to show the test results, read from the
# result log file.
# This is the second iteration; formerly score_view.py.
import argparse
import dat... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os
import random
import sys
from functools import partial
from absl import flags
import absl.logging as _logging # pylint: disable=unused-import
import numpy as np... |
# Plotting utils
import glob
import math
import os
import random
from copy import copy
from pathlib import Path
import cv2
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import torch
import yaml
from PIL import Image, ImageDraw, ImageFont
#from utils.ge... |
import logging
import multiprocessing
from multiprocessing import Lock, Pool
multiprocessing.set_start_method("spawn", True) # ! must be at top for VScode debugging
import argparse
import glob
import json
import math
import multiprocessing as mp
import os
import pathlib
import pickle
import re
import sys
import warni... |
"""Parser for command line arguments."""
from __future__ import absolute_import
import collections
import os
import os.path
import datetime
import optparse
from . import config as _config
from . import utils
from .. import resmokeconfig
ResmokeConfig = collections.namedtuple(
"ResmokeConfig",
["list_suites... |
import logging
import os
import re
import uuid
from io import BytesIO
from json import load
from pathlib import Path
from random import randint
from time import sleep
from typing import Any, Dict, Generator, List, TYPE_CHECKING, Union
from urllib.parse import urljoin
import httpx
import jsonschema
from httpx import HT... |
'''extra statistical function and helper functions
contains:
* goodness-of-fit tests
- powerdiscrepancy
- gof_chisquare_discrete
- gof_binning_discrete
Author: <NAME>
License : BSD-3
changes
-------
2013-02-25 : add chisquare_power, effectsize and "value"
'''
from statsmodels.compat.python import lrange
im... |
#!/usr/bin/env python3
# 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... |
import pickle, glob, sys, csv, warnings
from sklearn.preprocessing import PolynomialFeatures, StandardScaler
from sklearn.metrics import accuracy_score, confusion_matrix, auc, roc_curve
from feature_extraction_utils import _load_file, _save_file, _get_node_info
from scipy.stats import multivariate_normal
from ... |
# 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... |
# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
from __future__ import division
import os
import re
import math
import hashlib
import tempfile
import PIL.Image
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
from django.utils.six.moves import filter
from django.core... |
import argparse
import logging
import os
import re
import random
import shutil
import sys
import time
from xml.etree.ElementInclude import default_loader
import numpy as np
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.d... |
#
# Copyright (c) 2021 Incisive Technology Ltd
#
# 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, pu... |
import logging
import functools
import math
import os
from typing import Callable, List, Tuple, Union
from argparse import Namespace
from sklearn.metrics import auc, mean_absolute_error, mean_squared_error, precision_recall_curve, r2_score,\
roc_auc_score, accuracy_score
import torch
import torch.nn as nn
import n... |
# Copyright 2017 <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 writing, softwa... |
from pyraf import iraf
import glob
import numpy as np
import pylab as py
import math
from astropy.io import fits as pyfits
import datetime
try:
import urllib.request, urllib.parse, urllib.error
p2 = False
except:
import urllib
p2 = True # Python 2 is running, so the urllib command is different
import os... |
import os, sys
import time
import argparse
import copy
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
sys.path.append('../..')
from shared import data, utils, models, metric
from pytorch_pretrained_bert import OpenAIGPTTokenizer, OpenAIGPTModel, OpenAIGPTLMHeadModel
from xl... |
import re
import hashlib
import time
import StringIO
__version__ = '0.8'
#GNTP/<version> <messagetype> <encryptionAlgorithmID>[:<ivValue>][ <keyHashAlgorithmID>:<keyHash>.<salt>]
GNTP_INFO_LINE = re.compile(
'GNTP/(?P<version>\d+\.\d+) (?P<messagetype>REGISTER|NOTIFY|SUBSCRIBE|\-OK|\-ERROR)' +
' (?P<encryptionAlgor... |
from couchdbkit import ResourceConflict, ResourceNotFound
from django.utils.decorators import method_decorator
from casexml.apps.stock.models import StockTransaction
from casexml.apps.stock.utils import get_current_ledger_transactions
from corehq.apps.accounting.decorators import requires_privilege_for_commcare_user, r... |
#!/usr/bin/env python
#
# Copyright (C) 2016 The Android Open Source Project
#
# 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 req... |
# -------------------------------------------------------------------------------
# Copyright 2006-2021 UT-Battelle, LLC. See LICENSE for more information.
# -------------------------------------------------------------------------------
import re
import datetime
import sys
import os
from subprocess import Popen, PIPE... |
# -*- coding: utf-8 -*-
"""Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2016, 2017, 2018, 2019, 2020 <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
... |
# Copyright 2013-2021 The Salish Sea MEOPAR contributors
# and The University of British Columbia
#
# 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/... |
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
# -*-coding:Utf-8 -*
# ====================================================================
# Packages
# ====================================================================
import configparser as cp
import copy
import glob
import muLAn
import muLAn.packages.general_tools as gtools
import muLAn.packages.algebra as alge... |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distribut... |
from __future__ import print_function
from collections import OrderedDict
def rename_fields(dictionary_object, original, alias):
if not dictionary_object:
return None
for items in dictionary_object.keys():
if original in dictionary_object[items]:
dictionary_object[items] = [
... |
#!/usr/bin/env python3
# Copyright (c) 2017 Massachusetts Institute of Technology
# 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 rig... |
"""
Transformer for computing ROI signals.
"""
import numpy as np
import warnings
from joblib import Memory
from .. import _utils
from .._utils import logger, CacheMixin
from .._utils.class_inspect import get_params
from .._utils import fill_doc
from .._utils.niimg_conversions import _check_same_fov
from .. import im... |
import gpflow
from gpflow import settings
from gpflow.params import Parameter, Parameterized, DataHolder, Minibatch
import tensorflow as tf
import numpy as np
from typing import List
from .exkern import ElementwiseExKern, ExReLU, ExErf
from .resnet import ResnetKernel
class DeepKernel(gpflow.kernels.Kernel):
"""... |
#!/usr/bin/env python3
import argparse
import asyncio
import io
import json
import logging
# Configure logging
import logging.config
import os
import sys
import threading
import time
import wave
from typing import Any
from rhasspy.audio_recorder import AudioData
from rhasspy.core import RhasspyCore
from rhasspy.profil... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
### IMPORT MODULES
# basic
import numpy as np
# torch
import torch
import torch.nn as nn
from torch import optim
import torch.nn.functional as F
# text tools
from torchtext.data import Field, BucketIterator
from torchtext.datasets import Multi30k
from nltk.translate.bleu_score import sentence_bleu,SmoothingFunction
# u... |
import logging
from collections import OrderedDict
import xarray
import dask
import distributed
import six
import os
import re
import numpy as np
from multipledispatch import dispatch
import glob
from enstools.misc import has_ensemble_dim, add_ensemble_dim, is_additional_coordinate_variable, first_element, \
has_da... |
#!/usr/bin/env python
from cogent3.core.annotation import Feature
from cogent3.core.genetic_code import GeneticCodes
from cogent3.core.info import Info
from cogent3.core.moltype import ASCII, DNA, PROTEIN
from cogent3.parse.record import FieldWrapper
from cogent3.parse.record_finder import (
DelimitedRecordFinder,
... |
#
# --------------------------------------------------------------------*/
# This file includes code from https://github.com/magicleap/SuperGluePretrainedNetwork/blob/master/models/superglue.py
# --------------------------------------------------------------------*/
#
import torch
import torch.utils.checkpoint
from ... |
# Copyright 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import abc
import errno
import json
import logging
import os
import pickle
import queue
import select
import socket
import socketserver
import sys
import ... |
import logging
import math
import hashlib
from functools import partial
from inspect import getmembers
from itertools import repeat
import numpy as np
import datajoint as dj
import scipy.stats as sc_stats
from . import lab
from . import experiment
from . import ephys
[lab, experiment, ephys] # NOQA
from . import ... |
# PuLP : Python LP Modeler
# Version 1.4.2
# Copyright (c) 2002-2005, <NAME> (<EMAIL>)
# Modifications Copyright (c) 2007- <NAME> (<EMAIL>)
# $Id:solvers.py 1791 2008-04-23 22:54:34Z smit023 $
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentatio... |
import numpy as np
from skyfield.api import PlanetaryConstants, T0, load
from skyfield.constants import AU_KM, AU_M
from skyfield.positionlib import ICRF
def test_frame_rotation_matrices():
# To produce the following matrices:
#
# import numpy as np
# import spiceypy as spice
# from skyfield.consta... |
import logging
import textwrap
import traceback
import numpy as np
from mtwaffle import mt
from mtwaffle import mtsite
logger = logging.getLogger(__name__)
EDI_TEMPLATE = ''' >HEAD
DATAID="<name>"
X=<easting>
Y=<northing>
EASTING=<easting>
NORTHING=<northing>
ZONE=<zone>
LAT=<lat>
LONG=<... |
import pyathena as pa
from pathlib import Path
from pyathena.util.units import Units
from pyathena.classic.cooling import coolftn
import numpy as np
import pandas as pd
import xarray as xr
import re
Twarm = 2.0e4
u = Units()
def find_snapshot_number(s, t0):
"""Return snapshot number that is closest to t0"""
n... |
import sys, gzip
import numpy as np
import plistlib
from tqdm.std import tqdm
from ..utils import tqdm_range, update_progress
from .io_base import DataDecoder
from pygama import lh5
from .ch_group import *
class OrcaDecoder(DataDecoder):
""" Base class for ORCA decoders.
ORCA data packets have a dataID-to-d... |
import pyglet
from random import randrange, choice
from pathlib import Path
TILES_DIRECTORY = Path("snake-tiles")
SIZE_IMG = 64 # the smallest part of game pole is 64 x 64 pixels
WIDTH = SIZE_IMG * 12
HEIGHT = SIZE_IMG * 12
class Game_status:
def __init__(self, batch):
self.lifes = 1
self.score... |
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 18 16:35:08 2017
@author: Aeolitus
"""
import Definitionen
import logging
import unicodedata
import os
import re
from Wolke import Wolke
import Objekte
class VoraussetzungException(Exception):
pass
class WaffeneigenschaftException(Exception):
pass
class Hilfsme... |
# File: ticTacToeTests.py
# from chapter 18 of _Genetic Algorithms with Python_
#
# Author: <NAME> <<EMAIL>>
# Copyright (c) 2016 <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
# ... |
import os
import sys
#sys.path.append('/mnt/hdd4T/mtz_home/code/SmoothPredictionRelease/')
sys.path.append(os.path.abspath('./'))
from utils import h36motion3d as datasets
from model import stage_4
from utils.opt import Options
from utils import util
from utils import log
from torch.utils.data import DataLoader
import... |
#!/usr/bin/env python3
"""A package-based, source code amalgamater."""
import os
import sys
import pprint
from itertools import repeat
from collections import namedtuple
from collections.abc import Mapping
from ast import parse, walk, Import, ImportFrom
__version__ = "0.1.2"
ModNode = namedtuple("ModNode", ["name", "... |
#!/usr/bin/env python
# coding: utf-8
##########################################
# # Image Retrieval From Instagram # #
##########################################
#
#
# **Goal:** collect image data from instagram and then preprocess it, extract information (image files) from a user's Instagram profile
#
# **Constr... |
import json
import re
import datetime
from itertools import groupby
import logging
from django.db import connection
from django.db.models import Prefetch, Q, Count
from django.shortcuts import get_object_or_404
from django.http import Http404
from rest_framework import viewsets
from rest_framework.pagination import P... |
from pdfminer.converter import PDFPageAggregator
from pdfminer.layout import LAParams, LTContainer, LTTextBox
from pdfminer.pdfinterp import PDFPageInterpreter, PDFResourceManager
from pdfminer.pdfpage import PDFPage
import urllib.request
from datetime import datetime as dt
import json
import os
import shutil
... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2012 <NAME>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
"""TargetScan features."""
import operator
from . import seed
def get_targetscan_ts_type(seed_length, nt1):
"""Returns the target site t... |
# Copyright 2015 OpenStack 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 requ... |
from numpy import pad
import torch
import torch.nn as nn
import torch.nn.functional as F
from base import BaseModel
import pytorch_colors as colors
from torchvision import utils as vutils
from typing import Union, List, Tuple, Callable, Any
from utils import upsample_zero_2d, backward_warp_motion, optical_flow_to_mot... |
#!/usr/bin/env python
# Teardrop for pcbnew using filled zones
# (c) Niluje 2019 thewireddoesntexist.org
#
# Based on Teardrops for PCBNEW by svofski, 2014 http://sensi.org/~svo
# Cubic Bezier upgrade by mitxela, 2021 mitxela.com
# Fixed for KiCAD 6 nightly by gymb2015 (MISC)
import os
import sys
from math import cos... |
# Licensed under MIT License.
# See LICENSE in the project root for license information.
"""AVL Tree."""
import dataclasses
from typing import Any, Optional
from forest import metrics
from forest import tree_exceptions
from forest.binary_trees import binary_tree
@dataclasses.dataclass
class Node(binary_tree.Node):
... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import abc
import sys
import copy
import time
import datetime
import importlib
from pathlib import Path
from concurrent.futures import ThreadPoolExecutor, as_completed
import fire
import requests
import numpy as np
import pandas as pd
from tqdm ... |
import copy
from PIL import Image
from PIL import ImageEnhance
from torch.utils.data import DataLoader, Dataset
import torch
import numpy as np
import glob
import torchvision
import matplotlib.pyplot as plt
import random
import cv2
from torchvision import transforms
np.seterr(divide='ignore', invalid='ignore')
def ta... |
import os
import xml.etree.ElementTree as et
import pickle
SHRUNK_RES_SUFFIX = '_shrunk'
XML_REF = 'http://www.mscsoftware.com/:xrf10'
STEPMAP_TAG = 'StepMap'
ENTITY_TAG = 'Entity'
COMPONENT_TAG = 'Component'
STEP_TAG = '{' + XML_REF + '}' + 'Step'
def get_results(result_file, reqs_to_get=None, t_min=None, t_max=None,... |
import sys
import os
import argparse
import xml.etree.ElementTree as ET
def flipBoundingBox(x_min, y_min, x_max, y_max, img_width, img_height):
'''
Flips coordinates on the vertical axis.
Assumes x_min, y_min, x_max, y_max starts from 0.
Assumes all parameters are numbers.
'''
x_min_flip = (img_width-1)... |
#!/usr/bin/env python
import torch
import torch.nn as nn
import torchvision.transforms as transforms
import torchvision.models as models
from torch.utils.data import DataLoader
from load_utils import load_state_dict_from_url
from cub_voc import CUB_VOC
from celeb import Celeb
import os
from tqdm import tqdm
import shu... |
import numpy as np
import scipy as sp
import nibabel as nib
from numpy.testing import (assert_array_equal,
assert_array_almost_equal,
assert_almost_equal,
assert_equal)
from dipy.core import geometry as geometry
from dipy.data import get_d... |
import jax.numpy as jnp
from jax import random as jrdm
from jax import jit, vmap, grad, value_and_grad, tree_multimap, lax
import numpy as np
import random
import matplotlib.pyplot as plt
import time
import pycof as pc
from .initializations import init_params
from .losses import mean_squared_error, binary_cross_entro... |
from collections import OrderedDict
from typing import Type, Tuple, Mapping, Callable
import sqlalchemy
from graphene import Field
from graphene import InputObjectType, Dynamic, Argument, Mutation, ID
from graphene.relay import Connection, Node
from graphene.types.objecttype import ObjectType, ObjectTypeOptions
from g... |
# ==================================================================================
#
# Copyright (c) 2019, <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restric... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.