text stringlengths 6.04k 39.5k |
|---|
import os
import cv2
import copy
import time
import json
from pprint import pprint
import numpy as np
import streamlit as st
from PIL import ImageColor
# import coco_annotation_parser as annot_parse # type:ignore
import SessionState #type:ignore
import circulation_skeletonizer as circ_skeleton #type:ignore
... |
# -*- coding: UTF-8 -*-
import re
import warnings
from datetime import datetime
from operator import itemgetter
from urllib.parse import urljoin
import pytest
from PIL import Image
from _pytest.reports import CollectReport
# Reference: http://docs.gurock.com/testrail-api2/reference-statuses
TESTRAIL_TEST_STATUS = {
... |
#!/usr/bin/env python
#
#===- git-clang-format - ClangFormat Git Integration ---------*- python -*--===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===---------... |
def setup_fs(s3, key="", secret="", endpoint="", cert="", passwords={}):
"""Given a boolean specifying whether to use local disk or S3, setup filesystem
Syntax examples: AWS (http://s3.us-east-2.amazonaws.com), MinIO (http://192.168.0.1:9000)
The cert input is relevant if you're using MinIO with TLS enabled... |
import copy
from functools import wraps, reduce
import socket
import os
from operator import mul
import sys
from statistics import mean
import time
import numpy as np
from rdkit.Chem import AllChem, RWMol
from rdkit import Chem
from rdkit.Chem.rdChemReactions import ChemicalReaction
from kgcn.data_util import dense_t... |
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import json
import os
import re
from xml.etree import ElementTree as element_tree
import lxml.etree as etree
from flask import current_app as app
from query.QueryFilters import QueryFilters
from query.Query import Query
from query.QueryDefinitions import QueryDefinitions
from query.QueryDefintion import QueryDefini... |
import re
from itertools import cycle
import lib.logger as logging
from lib.functions import wait_until, r_sleep, confirm_condition_by_time
from lib.game import ui
logger = logging.get_logger(__name__)
t3_percentage_regexp = re.compile(r"([0-9][0-9]?\.?[0-9]? ?%?)")
class BattleBot:
"""Class for working with ga... |
# Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
# This work is licensed under the NVIDIA Source Code License - Non-commercial. Full
# text can be found in LICENSE.md
import argparse
import matplotlib
import pprint
import glob
import copy
import posecnn_cuda
from pose_rbpf.pose_rbpf import *
from pose_rb... |
import json
import warnings
from enum import Enum
from typing import Any, List, Tuple, Union
import numpy as np
import torch
from mmhuman3d.core.cameras.cameras import PerspectiveCameras
from mmhuman3d.core.conventions.cameras.convert_convention import (
convert_camera_matrix,
convert_K_3x3_to_4x4,
conver... |
import copy
import datetime
import glob
import json
import os
import sys
import threading
from os import path
from urllib.parse import urlparse, urljoin, ParseResult
import xmltodict
import yaml
from bs4 import BeautifulSoup
from flask import Flask, render_template, Response, send_from_directory, request
from flask.vi... |
import bisect
import collections
import os
import queue
import random
import subprocess
import threading
import time
import traceback
from hydrus.core import HydrusData
from hydrus.core import HydrusExceptions
from hydrus.core import HydrusGlobals as HG
NEXT_THREAD_CLEAROUT = 0
THREADS_TO_THREAD_INFO = {}
THREAD_INF... |
## Copyright 2018-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
import os
from glob import glob
from collections import defaultdict
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.distributed import DistributedSampler
from config import *
from ut... |
# -*- coding: utf8 -*-
# Author: <NAME>
"""Coqtop interface with functions to send commands and parse responses."""
import datetime
import logging
import signal
import subprocess
import threading
import time
from concurrent import futures
from queue import Empty, Queue
from tempfile import NamedTemporaryFile
from typi... |
import numpy as np
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import copy
import math
import ego_utils as utils
import hydra
class Encoder(nn.Module):
"""Convolutional encoder for image-based observations."""
def __init__(self, view, obs_shape, feature_dim):
super().... |
# module
from __future__ import print_function
import argparse
from tqdm import tqdm
import torch
import torch.nn.functional as F
from torchvision import datasets, transforms
from torchvision.utils import save_image
import time
import torch.nn as nn
from SSGE import Attack,resnet18
import torchvision
from attack impor... |
from panda3d.core import *
from libotp import Nametag, NametagGroup
from libotp import CFSpeech, CFThought, CFTimeout, CFPageButton, CFNoQuitButton, CFQuitButton, CFExclaim
from otp.otpbase import OTPGlobals
from otp.otpbase import OTPLocalizer
from direct.actor.Actor import Actor
from direct.directnotify import Direct... |
# Copyright 2019 - 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 required by applicable law or ... |
# -*- coding: utf-8 -*-
"""
Orbital functions
-----------------
Functions used within multiple orbital classes in Stone Soup
"""
import numpy as np
from . import dotproduct
from ..types.array import StateVector
def stumpff_s(z):
r"""The Stumpff S function
.. math::
S(z) = \begin{cases}\frac{\sqrt... |
# coding: utf-8
from __future__ import division
import numpy as np
import pdb
import math
from . import data_generators
import copy
import cv2
import random
import keras
class_num =200
part_map_num = {'head':0,'legs':1,'wings':2,'back':3,'belly':4,'breast':5,'tail':6}
part_map_name = {}
crop_image = lambda img, x0, y0... |
# 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
# distribu... |
"""
nc2pd
~~~~~
A thin python-netCDF4 wrapper to turn netCDF files into pandas data
structures, with a focus on extracting time series from regularly
spatial gridded data (with the ability to interpolate spatially).
Copyright 2015 <NAME>
License: MIT (see LICENSE file)
"""
from __future__ import print_function
fro... |
#!/usr/bin/env python
# coding: utf-8
# #<NAME>
# ## <b> Problem Description </b>
#
# ### This project aims to build a classification model to predict the sentiment of COVID-19 tweets.The tweets have been pulled from Twitter and manual tagging has been done then. Leveraging Natural Language Processing, sentiment ana... |
"""Used for scripting
These are used in other scripts and mostly require explicit input,
such as which specific nodes they apply to.
For interactive use, see :mod:`interactive.py`
"""
import sys
from maya import cmds
from . import util, lib
if sys.version_info[0] == 3:
basestring = str
# Flags
LocalSpace = ... |
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
from __future__ import print_function
# import os
import sys
import copy
import numpy as np
from collections import Orde... |
"""Unit tests for the :mod:`networkx.generators.random_graphs` module."""
import networkx as nx
import pytest
_gnp_generators = [
nx.gnp_random_graph,
nx.fast_gnp_random_graph,
nx.binomial_graph,
nx.erdos_renyi_graph,
]
@pytest.mark.parametrize("generator", _gnp_generators)
@pytest.mark.parametrize(... |
"""Provides algorithms with access to most of garage's features."""
import copy
import os
import time
import cloudpickle
from dowel import logger, tabular
# This is avoiding a circular import
from garage.experiment.deterministic import get_seed, set_seed
from garage.experiment.experiment import dump_json
from garage.... |
import os
import re
from collections import namedtuple
from black import FileMode, format_str
from openapi import utils
from openapi.openapi import OpenAPISpec
from openapi.utils import TYPE_MAPPING
TO_EXCLUDE = ["project", "cursor"]
GEN_CLASS_PATTERN = "# GenClass: ([\S ]+)\s+class (\S+)\(.+\):(?:(?!# GenStop)[\s\S... |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from queue import Queue, Full, Empty
import threading
import numpy as np
import torch
from datetime import datetime
fr... |
# utils.py
import pandas as pd
from sklearn.preprocessing import OneHotEncoder
import numpy as np
import os
def extract_tls_info(s):
tls_key_list = ['C', 'ST', 'L', 'O', 'OU', 'CN', 'emailAddress', 'unknown', 'serialNumber']
s = s.split(',')
s = [x.split('/') for x in s]
s = sum(s, [])
res = {}
... |
# 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:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
#!/usr/bin/env python
#
# Author: <NAME> <<EMAIL>>
#
'''
Some hacky functions
'''
import os, sys
import imp
import tempfile
import shutil
import functools
import itertools
import math
import ctypes
import numpy
import h5py
from pyscf.lib import param
c_double_p = ctypes.POINTER(ctypes.c_double)
c_int_p = ctypes.POIN... |
from __future__ import absolute_import, unicode_literals
import datetime
import traceback
from decimal import Decimal, InvalidOperation
import logging
from uuid import uuid4
from enum import Enum
from django import forms
from django.conf import settings
from django.core.exceptions import ValidationError
from django.d... |
import tkinter as tk
from tkinter import Event, StringVar
from tkinter.constants import DISABLED
import tkinter.ttk as ttk
import time
from typing import Sequence
from scipy.spatial.transform import rotation
from setuptools.command.easy_install import main
import sim_hexa as simhexa
import math
main_window = tk.Tk()... |
import datetime
import threading
from django.utils.html import escape as html_escape
from mongoengine import EmbeddedDocument
try:
from mongoengine.base import ValidationError
except ImportError:
from mongoengine.errors import ValidationError
from mongoengine.base.datastructures import BaseList
from mongoengi... |
# Image-based testing borrowed from vispy
"""
Procedure for unit-testing with images:
1. Run unit tests at least once; this initializes a git clone of
pyqtgraph/test-data in ~/.pyqtgraph.
2. Run individual test scripts with the PYQTGRAPH_AUDIT environment variable set:
$ PYQTGRAPH_AUDIT=1 python pyqtgraph... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, time
import pytz
from dateutil import rrule
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.addon... |
from itertools import product
import ConvexHullMaxPairOfPoints as convHull
from Data_and_Dicts import dictOfTonnetz
from FirstNotePosition import TonnetzToString
from TrajectoryClass import TrajectoryClass
""" Import convex Hull Comparison on set of cartesian points """
""" Import function that turn a Tonnetz list to ... |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 30 10:12:34 2018
@author: kite
"""
"""
完成策略的回测,绘制以沪深300为基准的收益曲线,计算年化收益、最大回撤、夏普比率
主要的方法包括:
ma10_factor:
is_k_up_break_ma10:当日K线是否上穿10日均线
is_k_down_break_ma10:当日K线是否下穿10日均线
compare_close_2_ma_10:工具方法,某日收盘价和当日对应的10日均线的关系
backtest:回测主... |
# modify from PointGroup
# Written by <NAME>
import os
import os.path as osp
import logging
from typing import Optional
from operator import itemgetter
from copy import deepcopy
import gorilla
import torch
import numpy as np
import open3d as o3d
COLORSEMANTIC = np.array([
[171, 198, 230], # rgb(171, 198, 230)
... |
# -*- coding: utf-8 -*-
# Tests for module mosaic.immutable_model
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The Mosaic Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file LICENSE.txt, distributed as p... |
from collections import OrderedDict
class rbac:
'''
Class for Creating RBAC for CIC
'''
def __init__(self):
self.name = "citrix"
def createRbac(self):
'''
Function to create RBAC for CIC
'''
self.clusterRole = self.createClusterRole()
self.c... |
import gzip
import os
import sys
import torch
import torch.nn as nn
from torch.autograd import Variable
import math
import torch.nn.functional as F
import numpy as np
from torchtext.utils import download_from_url
from pytorch_pretrained_bert import BertTokenizer, BertModel, BertForMaskedLM
## Make the the multiple att... |
import datetime
import inspect
from io import BytesIO
import os
import pickle
import shutil
import tempfile
import unittest
from unittest.mock import patch
import asdf
import numpy
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix
from modelforge import configuration, storage_backend
fr... |
# Copyright 2016 Capital One Services, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
# Copyright (c) 2016 <NAME> <<EMAIL>>
# Copyright (c) 2016 <NAME> <<EMAIL>>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
... |
import asyncio
import os
import typing
from cgi import parse_header
from collections import namedtuple
from tempfile import SpooledTemporaryFile
from urllib.parse import SplitResult, parse_qsl, urlencode, urlsplit
from .typing import Environ, Scope
__all__ = [
"Address",
"MediaType",
"ContentType",
"U... |
import re
from collections import namedtuple
from copy import copy
from difflib import SequenceMatcher
from pprint import pformat
from bs4 import BeautifulSoup
from bs4 import NavigableString
from bs4 import Tag
logger = None
def restore_refs(old_content: str,
new_content: str,
re... |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 12 00:00:00 2021
@author: <NAME>
contact: athouvenin [at] outlook.com
"""
import requests
import json
import re
# api_url = "https://www.vinted.fr/api/v2/items?search_text=&catalog_ids=&color_ids=&brand_ids=&size_ids=&material_ids=&status_ids=&country_ids=&city_ids=&is_... |
from __future__ import absolute_import
import sys
import copy
import operator
from functools import reduce
from sqlbuilder.smartsql.compiler import compile
from sqlbuilder.smartsql.constants import CONTEXT, PLACEHOLDER, MAX_PRECEDENCE
from sqlbuilder.smartsql.exceptions import MaxLengthError
from sqlbuilder.smartsql.py... |
# vim: sw=4:ts=4:et
#
# all of the engines that do stuff need to coordinate with each other
# to make sure they don't overwhelm the resources they use
# see semaphores.txt
import datetime
import ipaddress
import logging
import multiprocessing
import os
import re
import socket
import sys
import threading
import time
... |
# Lint as: python3
# Copyright 2021 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 ... |
# Copyright 2018 Rackspace, US Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
"""
While *nussl* does not come with any data sets, it does have the capability to interface with
many common source separation data sets used within the MIR and speech separation communities.
These data set "hooks" subclass BaseDataset and by default return AudioSignal objects in
labeled dictionaries for ease of use. ... |
################################################################################
##
## BY: <NAME>
## PROJECT MADE WITH: Qt Designer and PySide2
## V: 1.0.0
##
## This project can be used freely for all uses, as long as they maintain the
## respective credits only in the Python scripts, any information in the visual
## ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# Meta-info
Author: <NAME>
Created: 05/09/2015
Updated: 28/09/2017
# Description
Ternary-search tries (or trees) combine the time efficiency of other tries with
the space efficiency of binary-search trees.
An advantage compared to hash maps is that ternary searc... |
# Copyright (c) 2021 Graphcore Ltd. All rights reserved.
from typing import Iterable, List, Mapping, Optional, Tuple, Union
import popart._internal.ir as _ir
from popart.ir.context import get_current_context, op_debug_context
from popart.ir.graph import Graph
from popart.ir.tensor import Tensor
from .utils import che... |
#!/usr/bin/env python
# This will (hopefully) be the code to extract symmetry operations
# from Hall symbols
import numpy as np
lattice_symbols = {
'P': [[0, 0, 0]],
'A': [[0, 0, 0], [0, 1./2, 1./2]],
'B': [[0, 0, 0], [1./2, 0, 1./2]],
'C': [[0, 0, 0], [1./2, 1./2, 0]],
'I': [[0, 0, 0], [1./2, 1.... |
"""
Convert between text notebook metadata and jupyter cell metadata.
Standard cell metadata are documented here:
See also https://ipython.org/ipython-doc/3/notebook/nbformat.html#cell-metadata
"""
import ast
import re
from json import dumps, loads
try:
from json import JSONDecodeError
except ImportError:
JS... |
import multiprocessing
import os
import random
import numpy as np
import sacred
import torch
from capreolus.reranker.reranker import Reranker
from capreolus.collection import COLLECTIONS
from capreolus.benchmark import Benchmark
from capreolus.index import Index
from capreolus.searcher import Searcher
from capreolus.... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 13 20:01:56 2020
@author: usingh
"""
import os
import sys
import time
import multiprocessing
from contextlib import closing
import gc
#import pyximport; pyximport.install()
import orfipy_core as oc
import subprocess
import orfipy.utils as ut
import ... |
import os
import tempfile
import shutil
import multiprocessing
import pickle
from copy import deepcopy
from enum import Enum
from typing import Optional, List, Tuple, Dict, Any
from typing_extensions import Literal
import rdkit.Chem as Chem
from ccdc.docking import Docker as DockerGold
from ccdc.io import MoleculeRea... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 8 18:55:26 2020
@author: <NAME> [ahamilos at g.harvard.edu]
This version intended for construction, testing and debugging.
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 8 17:00:42 2020
@author: lilis
"""
import pygam... |
import asyncio
import json
import time
from collections.abc import Mapping
from datetime import datetime, timedelta
from enum import IntEnum, unique
from functools import singledispatch
from logging import getLogger
from pprint import pformat
from typing import Union, Optional, Any, Callable, Dict, Iterable
from warnin... |
'''
.. note::
* These are the default auth managers. They won't perform any file io.
* If you want auth managers with file io capabilities, then you'll have to implement AbstractAuthManager's interface or inherent from any of this module's managers.
* In most cases you won't need to implement new man... |
#
# This file is part of LiteX (Adapted from Migen for LiteX usage).
#
# This file is Copyright (c) 2013-2014 <NAME> <<EMAIL>>
# This file is Copyright (c) 2013-2021 <NAME> <<EMAIL>>
# This file is Copyright (c) 2013-2017 <NAME> <<EMAIL>>
# This file is Copyright (c) 2016-2018 whitequark <<EMAIL>>
# This file is Copyri... |
import datetime
from jinja2 import Environment, Undefined
import json
import yaml
import os
import uuid
import collections
from typing import List, Tuple, Dict, Optional, TypeVar
import attr
import logging
from openlineage.client.facet import DataSourceDatasetFacet, SchemaDatasetFacet, SchemaField, \
SqlJobFace... |
# 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
# to us... |
import bpy
import numpy
import mathutils
from enum import Enum
from mathutils import Matrix, Quaternion, Vector
import xml.etree.ElementTree as ET
import os
os.system('cls')
mesh_targets = {}
controller_targets = {}
images = {}
class SourceType(Enum):
Name_array = 0
float_array = 1
class DataType(Enum):
... |
# -*- coding: utf-8 -*-
# Copyright 2015 moco_beta
#
# 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 agr... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals, division, print_function
"""
This module implements various equation of states.
Note: Most of the code were initially adapted from ASE and deltafactor by
@gmatteo but ... |
"""
All of the feedback responses generated by TIFA.
"""
from pedal.utilities.operators import OPERATION_DESCRIPTION
from pedal.core.report import MAIN_REPORT
from pedal.core.feedback import FeedbackResponse
class TifaFeedback(FeedbackResponse):
""" Base class for all TIFA feedback """
muted = False
categ... |
#####################################################
# Title: HTML parse- and analyser
# Author: <NAME> (<EMAIL>)
# Licence: GPLv2
#####################################################
#!/usr/bin/python
import sys
import sqlite3
import datetime
import timeit
import math
import re
import pandas as pd
imp... |
"""Python versions of the objects represented by the 2DM mesh."""
import abc
import functools
import warnings
from typing import (Any, ClassVar, Iterable, List, Optional, SupportsFloat,
Tuple, Type, TypeVar, Union)
from .errors import CardError, CustomFormatIgnored
from ._parser import parse_eleme... |
# Modified Flood Fill algorithm based on http://ijcte.org/papers/738-T012.pdf
# Flood Fill algorithm based on https://github.com/bblodget/MicromouseSim
# Written by <NAME>
import turtle, sys
SCREEN_HEIGHT = 512
SCREEN_WIDTH = 512
CANVAS_BUFFER = 0
BOX_SIZE = 32
turtle.colormode(255)
turtle.speed(0)
turtle.delay(0)
t... |
import pickle
from collections import defaultdict
from pathlib import Path
from typing import Optional, Callable
import numpy as np
import torch
import torch.utils.data as torchdata
from ignite.contrib.handlers import ProgressBar
from ignite.engine import create_supervised_evaluator, Events, Engine
from ignite.metrics... |
from copy import deepcopy
import json
FILTERS_KW = ["SELECT", "FROM", "WHERE", "ORDER BY", "LIMIT", "SAME", "CONTAINS_COREFERENCE"]
LIMITS = {"FIRST": "1", "SECOND": "2", "THIRD": "3"}
# name resolution for properties: DOES NOT EXIST
# that is: "triples"/"properties"/"column names" are equivalent, and a
# single mem... |
"""
Data access functions
---------------------
"""
from __future__ import absolute_import
from os.path import join as pjoin, basename, dirname
import subprocess
import tempfile
import logging
import numpy as np
import h5py
import rasterio
from rasterio.crs import CRS
from rasterio.warp import reproject
from rasterio... |
import bpy
import os
from collections import defaultdict
from Utility.Logging_Extension import logger
# http://blender.stackexchange.com/questions/8936/does-switching-from-blender-render-to-cycles-mess-things-up
# * All matierals in cycles use nodes (even if you set up the material in the Properties panel, it will c... |
from fluxrgnn import dataloader, utils
from fluxrgnn.models import *
import torch
from torch.utils.data import random_split, Subset
from torch.optim import lr_scheduler
from torch_geometric.data import DataLoader, DataListLoader
from torch_geometric.utils import to_dense_adj
from omegaconf import DictConfig, OmegaConf
... |
""" Code for fitting circles, ellipses, planes, etc.
"""
import numpy as np
from numpy.linalg import eig, inv
from stentseg.utils.new_pointset import PointSet
def fit_circle(pp, warnIfIllDefined=True):
""" Fit a circle on the given 2D points
Returns a tuple (x, y, r).
In case the three points... |
'''Vote type specifications and vote validators.
Vote types vary from system to system and are only loosely tied to the method
of evaluation (usually, the richer vote types can be reduced to use simple
evaluators but not vice versa). The following vote types are recognized by
Votelib:
- **Simple** votes - a voter v... |
# (c) 2012-2013 Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
from __future__ import absolute_import, division, print_function, unicode_literals
from argpa... |
# Copyright 2020 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 writi... |
import numpy as np
import argparse
import matplotlib.pyplot as plt
from sklearn.metrics import accuracy_score, confusion_matrix, classification_report
from torch.utils.tensorboard import SummaryWriter
import time
import torch
import random
import os
from transport import *
from models import *
import torch.nn.function... |
import pygame, sys, pygame.freetype
from pygame.locals import *
from random import randint, random, choice
from apscheduler.schedulers.background import BackgroundScheduler
from math import hypot
from copy import deepcopy
from operator import sub
import re
# Importaciones arriba
#configura apscheduler
sched = Backgrou... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six import with_metaclass
import numpy as np
import itertools
from slicerator import Slicerator, propagate_attr, index_attr
from .frame import Frame
from abc import ABCMeta, abstractmethod, abstr... |
from array import array
import os
import numpy as np
import imageio
imageio.plugins.ffmpeg.download()
from moviepy.editor import *
import pygame
import sys
import uuid
import nltk
from nltk.corpus import PlaintextCorpusReader
import random
import librosa as lib
from matplotlib import pyplot as plt
import... |
"""
Copyright (c) 2021, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import argparse
import glob
import logging
import os
import random
import sys
import timeit
from ... |
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
"""A script to evaluate test values for special functions in high precision.
This scripts looks for .csv files in /test... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import itertools
imp... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .gigya import GigyaBaseIE
from ..compat import compat_HTTPError
from ..utils import (
ExtractorError,
clean_html,
extract_attributes,
float_or_none,
get_element_by_class,
int_or_none,
merge_dicts,
... |
import math
#######
import random
import cv2
import numpy as np
import matplotlib.pyplot as plt
from tensorpack.dataflow.imgaug.geometry import RotationAndCropValid
def crop_meta_image(image,annos,mask):
_target_height=368
_target_width =368
if len(np.shape(image))==2:
image = cv2.cvtColor(image, c... |
import os
import pandas as pd
import numpy as np
import datetime as dt
import sys
from datetime import datetime
import rasterio
import geopandas as gpd
pkg_dir = os.path.join(os.path.dirname(__file__),'..')
sys.path.insert(0, pkg_dir)
from ela.textproc import *
from ela.spatial import *
from ela.classification impor... |
import sys, os
import time
import numpy as np
import torch
import torch.nn as nn
from torch.utils import data
from parsers import parse_a3m, read_templates
from RoseTTAFoldModel import RoseTTAFoldModule_e2e
import util
from collections import namedtuple
from ffindex import *
from kinematics import xyz_to_c6d, c6d_to_b... |
"""-----------------------------------------------------------------------------
sample.py (Last Updated: 01/26/2021)
The purpose of this script is to actually to run the sample project.
Specifically, it will initiate a call to file watcher that searches for incoming
dicom files, do some sort of analysis based on the... |
#!/usr/bin/python
from __future__ import division, print_function
# require python 3.5 for aiohttp
import sys
if sys.hexversion < 0x03050000:
sys.exit("Python 3.5 or newer is required to run this program.")
import numpy as np
import json
from io import BytesIO
import asyncio
from aiohttp import web, WSMsgType
fro... |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets Authors and the HuggingFace Datasets 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/LI... |
# Reverse photography
##h3D-II sensor size
# 36 * 48 mm, 0.036 x 0.048m
## focal length
# 28mm, 0.028m
## multiplier
# 1.0
from skimage import io
import matplotlib.pyplot as plt
import numpy as np
import cv2
from scipy.spatial import distance
import shapefile as shp
def buildshape(corners, filename):
"""build ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.