text stringlengths 6.04k 39.5k |
|---|
import os
import random
import shlex
import shutil
import sys
import threading
import uuid
from collections import Counter
from contextlib import contextmanager
from io import StringIO
import bottle
import requests
import six
import time
from mock import Mock
from six.moves.urllib.parse import urlsplit, urlunsplit
fro... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
"""
Generic views that provide commonly needed behaviour.
"""
from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.core.paginator import Paginator, InvalidPage
from django.http import Http404
from django.shortcuts import get_object_or_404 as _get... |
# Copyright 2017 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... |
#!/usr/bin/env python3
from os import listdir
import h5py
import numpy as np
import matplotlib.pyplot as plt
from LoLIM.utilities import processed_data_dir, v_air, even_antName_to_odd
from LoLIM.IO.raw_tbb_IO import filePaths_by_stationName, MultiFile_Dal1
class input_manager:
def __init__(self, processed_data... |
""" Tools for compiling C/C++ code to extension modules
The main function, build_extension(), takes the C/C++ file
along with some other options and builds a Python extension.
It uses distutils for most of the heavy lifting.
choose_compiler() is also useful (mainly on windows anyway)
for trying to... |
#!/usr/bin/env python3
# NOTE: using rospy library unrecommended in processor.py
import rospy
# NOTE: python 3.5^ needed to use asyncio
import asyncio
from lib_frontcam import *
from lib_fishcam import *
from lib_lidar import *
from lib_eye import *
from lib_parking import *
from turtlebot import TURTLE
from constant... |
#! /usr/bin/env python3
"""RFC 3548: Base16, Base32, Base64 Data Encodings"""
# Modified 04-Oct-1995 by <NAME> to use binascii module
# Modified 30-Dec-2003 by <NAME> to add full RFC 3548 support
# Modified 22-May-2007 by <NAME> to use bytes everywhere
import re
import struct
import binascii
__all__ = [
# Lega... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
# Copyright 2019 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... |
from ctaplot.plots import plots
import matplotlib.pyplot as plt
import numpy as np
import astropy.units as u
np.random.seed(42)
def test_plot_energy_distribution():
true_e = np.random.rand(100) * u.TeV
reco_e = np.random.rand(10) * u.TeV
mask_simu_detected = np.ones(100, dtype=bool)
mask_simu_detecte... |
from __future__ import annotations
import io
import struct
from pyzstd import ZstdFile
from ranges import Range
from ...stream import RangeStream
from ..zstd import ZstdTarFile
from .data import COMPRESSIONS, ZipData
__all__ = ["ZipStream", "ZippedFileInfo"]
class ZipStream(RangeStream):
"""
As for :class... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import logging
from concurrent.futures import Future, ProcessPoolExecutor, ThreadPoolExecutor, wait
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
from moonstreamdb.db import yield_db_session, yield_db_session_ctx
from moonstreamdb.models import (
EthereumBlock,
EthereumLabel,
E... |
import sys
import tkinter as tk
from tkinter import ttk as ttk
from tkinter import font
from threading import Thread
from time import sleep
import audio_detection
class DemonstratorGUI(ttk.Frame):
def __init__(self, master=None,number_of_results=None):
super().__init__(master)
self.master =... |
import os
import sys
import stat
import shutil
import contextlib
import pytest
from textwrap import dedent
from setuptools import Distribution
from ..setup_helpers import get_package_info, register_commands
from ..commands import build_ext
from . import reset_setup_helpers, reset_distutils_log, fix_hide_setuptools... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 16 13:29:07 2019
Min Cost Flow Association
based on mcftracker(CVPR2008 paper) https://github.com/watanika/py-mcftracker
@author: anantgupta
"""
import math, collections
from ortools.graph import pywrapgraph
import sys, time
from GAutils import ml... |
import os
import logging
import multiprocessing
from concurrent import futures
from typing import List
import numpy as np
import pandas as pd
from autumn.db.database import Database
DEFAULT_QUANTILES = [0.025, 0.25, 0.5, 0.75, 0.975]
logger = logging.getLogger(__name__)
def add_uncertainty_weights(output_name: ... |
import os
import unittest
import platform
import numpy as np
import pandas
import strax
import straxen
from matplotlib.pyplot import clf as plt_clf
from straxen.test_utils import nt_test_context, nt_test_run_id
def is_py310():
"""Check python version"""
return platform.python_version_tuple()[:2] == ('3', '10'... |
from functools import wraps
from flask import Flask, render_template, request, redirect, jsonify, url_for, flash, make_response # noqa
from sqlalchemy import create_engine, asc
from sqlalchemy.orm import relationship, sessionmaker
from collections import deque
from database_setup import Base, CategoryItem, Category, U... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import math
import operator
from pycket import values
from pycket import vector as values_vector
from pycket.error import SchemeException
from pycket.prims.expose import expose, default, unsafe
from rpython.rlib.rbigint import rbigint
from rpython.rlib import jit, ... |
import numpy as np
import lmfit as lm
import matplotlib.pyplot as plt
import inspect
def approx_FWHM(X,Y):
half_max = np.max(Y) / 2.
#find when function crosses line half_max (when sign of diff flips)
#take the 'derivative' of signum(half_max - Y[])
d = np.sign(half_max - np.array(Y[0:-1])) - ... |
# coding: utf-8
from __future__ import unicode_literals
import re
import bz2
import logging
import random
import json
from spacy.gold import GoldParse
from bin.wiki_entity_linking import wiki_io as io
from bin.wiki_entity_linking.wiki_namespaces import (
WP_META_NAMESPACE,
WP_FILE_NAMESPACE,
WP_CATEGORY_N... |
# Copyright 2018 Google. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation
#
# 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-... |
import os
import sys
import time
import networkx as nx
import numpy as np
from sklearn.metrics import roc_auc_score
import torch
import torch.nn.functional as F
import dgl
if __name__ == "__main__":
script_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(script_dir, '..', '..'))... |
import logging
from abc import ABCMeta, abstractmethod
from typing import Any
from protean.core.entity import BaseEntity
from protean.core.queryset import QuerySet
from protean.exceptions import (
ExpectedVersionError,
ObjectNotFoundError,
TooManyObjectsError,
ValidationError,
)
from protean.fields im... |
from enum import Enum
import numpy as np
from dataclasses import field, dataclass
from shapely.geometry import box, MultiPolygon, Polygon
from .typing import Dict, Float3, LayerLabel, List, Optional, Callable
from .utils import fix_dataclass_init_docs
@fix_dataclass_init_docs
@dataclass
class Material:
"""Helpe... |
#! python3
# -*- coding: utf-8 -*-
"""
################################################################################################
Implementation of 'PROGRESSIVE GROWING OF GANS FOR IMPROVED QUALITY, STABILITY, AND VARIATION'##
https://arxiv.org/pdf/1710.10196.pdf ... |
from functools import reduce
import math
class Tile:
def __init__(self, id, tile_data):
self.id = id
self.tile_data = tile_data
self.top_edge = tile_data[0]
self.bottom_edge = tile_data[-1]
self.left_edge = reduce(lambda x, y: x+y, map(lambda l: l[0], tile_data))
sel... |
from django.test import TestCase, Client
from django.shortcuts import resolve_url
from django.utils import timezone
from model_mommy import mommy
import mock
import datetime
from django.contrib.auth.models import User
from events.ipstack import IPStackResult
from events.models import *
from accounts.models import Acc... |
"""
Parser of Mapbox GL styles for QGIS vector tile layer implementation
Copyright 2020 <NAME>
Licensed under the terms of MIT license (see LICENSE file)
"""
import json
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QColor
from qgis.core import (
QgsPalLayerSettings,
QgsProperty,
QgsPropertyCollect... |
import asyncio
from datetime import datetime
import discord
from discord.ext import commands
from discord_slash import cog_ext
from discord_slash.context import ComponentContext, SlashContext
from discord_slash.utils.manage_components import (create_button,
create_act... |
# -*- coding: utf-8 -*-
"""
====================================================================================
Stratified Negation Semantics for DLP using SPARQL to handle the negation
"""
import copy
import itertools
import unittest
from rdflib.graph import Graph
from rdflib import Namespace, RDF, Variable, BNode
fr... |
#!/usr/bin/env python
from abc import ABC, abstractmethod
import argparse
import gc
import os
import warnings
from pathlib import Path
from typing import Union, Generator, Tuple
import ffmpeg
import h5py
import imageio
import numpy as np
import utils
from carla_constants import *
from utils import save_data, stitch_i... |
# Copyright 2019 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
#!/usr/bin/env python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# UVEServerTest
#
# Unit Tests for UVE Aggregation in Operational State Server
#
import logging
import os
import sys
import copy
import unittest
import pdb
import json
from opserver.uveserver import UVEServer
from opserver.... |
#!/usr/bin/env python3
# coding: utf-8
"""
ABCD-BIDS Task fMRI Pipeline
Original: template_subject_specific_pipeline_DCAN_Public_Users_V2.py
Original Author: <NAME>, PsyD, NERVE Lab, <EMAIL>
Original Created: 2020-10-27
Wrapper Author: <NAME>, DCAN Lab, <EMAIL>
Wrapper Created: 2020-12-22
Wrapper Updated: 2021-12-03
"... |
#!/usr/bin/env python
""" A python library for reading PTW mcc files
<NAME>, updated June 2016 """
import csv
from lxml import etree
import dateutil.parser
import pandas as pd
import numpy as np
class weblinedata:
"""Defines a weblinedata class with the required attributes"""
def __init__(self, date, ... |
from __future__ import with_statement
from hashlib import md5
import os
from urllib import urlopen, urlencode, quote, unquote
from django.contrib import admin
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.sites.models import Site
from django.core.files import File
from django.core.files.stor... |
# 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 writing, ... |
import sys
import pdb
import random
import logging
import json
import time, datetime
import traceback
from multiprocessing import Process
from pymilvus import Milvus, DataType
import numpy as np
import utils as util
import config
from milvus_benchmark.runners import utils
logger = logging.getLogger("milvus_benchmark.c... |
from typing import Any, Dict, List, Text, Tuple, Optional, NamedTuple
import rasa.shared.utils.io
from rasa.shared.constants import DOCS_URL_TRAINING_DATA_NLU
from rasa.shared.nlu.training_data.training_data import TrainingData
from rasa.shared.nlu.training_data.message import Message
from rasa.nlu.tokenizers.tokenize... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: BSD-2-clause
'''\
Any keystroke causes a poll and update. Keystroke commands:
'a': Change peer display to apeers mode, showing association IDs.
'd': Toggle detail mode (some peer will be reverse-video highlighted when on).
'h': Display helpscree... |
# 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 appli... |
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... |
import abc
import enum
import itertools
from typing import Any, Callable, Dict, List, Optional, TypeVar, Union, overload
import numpy as np
import determined.common.check as check
class Reducer(enum.Enum):
"""
A ``Reducer`` defines a method for reducing (aggregating) evaluation
metrics. See :meth:`~dete... |
# Copyright 2020 Pulser Development Team
#
# 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... |
"""
Python Etheroll library.
"""
import json
import requests
import requests_cache
from eth_account import Account
from eth_keyfile import load_keyfile
from eth_utils import to_checksum_address
from etherscan.client import EmptyResponse
from hexbytes.main import HexBytes
from web3 import Web3
from web3.contract import... |
##
# Script to Build Shared Crypto Driver
# Copyright Microsoft Corporation, 2019
#
# This is to build the SharedNetworking binaries for NuGet publishing
##
import os
from edk2toolext.environment import shell_environment
import logging
import shutil
from edk2toolext.environment.uefi_build import UefiBuilder
from edk2to... |
import pickle
import os
import time
import numpy as np
import sys
import shutil
from openmmlib import openmmlib
from openmmlib import polymerutils
from openmmlib.polymerutils import scanBlocks
from openmmlib.openmmlib import Simulation
from openmmlib.polymerutils import grow_rw
from looplib import looptools
import pyxi... |
import re
from collections import namedtuple, defaultdict
import unicodedata
import sublime
from sublime_plugin import TextCommand
from ..commands import GsNavigate
from ..git_command import GitCommand
from ...common import util
from .log import LogMixin
from ..ui_mixins.quick_panel import PanelActionMixin
BlamedLi... |
# -*- coding: utf-8 -*-
"""
Creates the json file used by the browse-table javascript library.
Usage...
- called by cron script in practice.
- can be called manually by cd-ing to the project directory (with virtual-environment activated) and running:
$ python3 ./disa_app/lib/denormalizer_person_original.py
"""
imp... |
#!/usr/bin/env python3
import argparse
import logging
from pathlib import Path
import sys
from typing import Any
from typing import Optional
from typing import Sequence
from typing import Tuple
from typing import Union
import numpy as np
import torch
from typeguard import check_argument_types
from typeguard import che... |
import numpy as np
import os
import torch
from isaacgym import gymutil, gymtorch, gymapi
from isaacgym.torch_utils import *
from tasks.base.vec_task import VecTask
import matplotlib.pyplot as plt
import time
class CubeBot_WheelVel(VecTask):
def __init__(self, cfg, sim_device, graphics_device_id, headless):
... |
# Lint as: python3
#
# Copyright 2020 The XLS 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... |
# mypy: allow-any-expr
# mypy: allow-any-generics
# mypy: allow-any-explicit
"""
Creates extension event API documentation.
"""
from typing import Tuple, Sequence, List, Optional
import os
import sys
import re
import argparse
import importlib
import datetime
import traceback
import collections.abc
BINDIR = os.path.d... |
from typing import Callable, List, Any, Dict, Optional
import logging
import socket
import time
import os
import random
import math
import threading
from horovod.runner.common.util import timeout, secret
from horovod.runner.http.http_server import RendezvousServer
from horovod.runner.gloo_run import (create_slot_env_... |
from tkinter import *
from PIL import ImageTk, Image
from tkinter import messagebox
def f(r, c):
return r*8+c
pieceClicked = (False, None)
class Piece(Canvas):
pics = {\
'bpawn':'pieces/bPawn.png',\
'bbish':'pieces/bBishop.png',\
'bking':'pieces/bKing.png',\... |
import io
import torch
from ._utils import _type, _cuda
from torch.types import Storage
from typing import Any, TypeVar, Type, Union, cast
import copy
import collections
from functools import lru_cache
T = TypeVar('T', bound='Union[_StorageBase, _TypedStorage]')
class _StorageBase(object):
_cdata: Any
is_cuda... |
import numpy as np
import cv2
import os
import matplotlib.pyplot as plt
#from scipy.interpolate import spline
#from scipy.interpolate import make_interp_spline, BSpline
from matplotlib import colors
# import json
class Metric(object):
def __init__(self, mode='center',iou_thresh=0,visualize = True,visualization_roo... |
import logging
import numpy as np
import scipy.spatial
import scipy.sparse.csgraph as graph
import scipy.sparse
import shapely.geometry
import matplotlib.pyplot as plt
import matplotlib.tri as tri
import cppimport.import_hook
import tectosaur.util.geometry
import tectosaur.nearfield.edge_adj_setup as edge_adj_setup
im... |
#!/usr/bin/env python
"""Cron management classes."""
import random
import threading
import time
import logging
from grr.lib import access_control
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import data_store
from grr.lib import flow
from grr.lib import master
from grr.lib import rdfvalue
fr... |
from .myqt import QT
import pyqtgraph as pg
import numpy as np
import time
from .base import WidgetBase
from .tools import TimeSeeker
_trace_sources = ['preprocessed', 'raw']
class MyViewBox(pg.ViewBox):
doubleclicked = QT.pyqtSignal(float, float)
gain_zoom = QT.pyqtSignal(float)
xsize_zoom = QT.pyqtS... |
# Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... |
# Copyright 2018 The Batfish 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 applicab... |
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the NiBabel package for the
# copyright and license terms.
#
### ### ### #... |
import hashlib
import logging
from dataclasses import dataclass
from dataclasses import field as data_field
from typing import Optional
from asn1crypto import crl as asn1_crl
from asn1crypto import ocsp as asn1_ocsp
from asn1crypto.x509 import Certificate
from pyhanko_certvalidator import CertificateValidator, Validat... |
# Copyright (c) 2019-2021, NVIDIA CORPORATION.
import warnings
from typing import Sequence, Union
import numpy as np
import pandas as pd
from pandas.core.tools.datetimes import _unit_map
import cudf
from cudf._lib.strings.convert.convert_integers import (
is_integer as cpp_is_integer,
)
from cudf.core import col... |
# Reference : https://github.com/jfzhang95/pytorch-deeplab-xception/blob/master/modeling/backbone/xception.py
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
'''
@ inplanes = the number of input channels
@ planes = the number of output... |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2018, 2019, 2020, 2021, 2022 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA Workflow Engine CWL reana pipeline."""
from __future__ impor... |
# Test code for a VB Program.
#
# This requires the PythonCOM VB Test Harness.
#
import sys
import winerror
import pythoncom, win32com.client, win32com.client.dynamic, win32com.client.gencache
from win32com.server.util import NewCollection, wrap
from win32com.test import util
from pywin32_testutil import str2memory
i... |
from __future__ import absolute_import
from __future__ import print_function
import argparse
from itertools import chain
import logging
import os
from six.moves import range, reduce
import subprocess
import sys
import datetime
import numpy as np
from sklearn import cross_validation, metrics
import tensorflow as tf
... |
from pox.openflow.discovery import Discovery
from pox.core import core
from pox.core import EventMixin
from pox.lib.addresses import IPAddr, IPAddr6, EthAddr
import pox.openflow.libopenflow_01 as of
import pox.lib.packet as pkt
import random
import pox.lib.packet.ethernet as ethernet
import pox.lib.packet.arp as arp
fr... |
import sys
import json
import os
from flask import Flask
from flask_restful import reqparse, abort, Api, Resource
from flask import request, jsonify
import base64
import yaml
import logging
from logging.config import dictConfig
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)),"../utils"))
#fro... |
from __future__ import unicode_literals
import sys
import os.path
import base64
import itertools
from datetime import datetime
from hashlib import sha1
if sys.version_info[0] >= 3:
maketrans = bytes.maketrans
else:
from string import maketrans
from unittest.case import SkipTest
from nose.tools import assert_... |
import torch
from torch.utils.data import TensorDataset
from torch.utils.data import DataLoader
from sklearn.model_selection import train_test_split
from torch import nn
import torch.nn.functional as F
import seaborn as sns
from sklearn.metrics import confusion_matrix, classification_report
import matplotlib.py... |
"""
Insert table values into database.
Tables include:
- WeaData
- Sims
- Params
- SiteInfo
- LogInit
* Note:
* Order of insert table need to depend on
* foreign key construction.
* Foreign keys can't be inserted prior to their
* linked primay keys.
"""
import os
import time
import atexit # noqa
import numpy as np... |
# # Sliding Window
# Feb 2019
#
import matplotlib.patches as patches
import seaborn as sns
import copy
import torchvision
from IPython.display import display # to display images
from PIL import Image, ImageDraw
import numpy as np
import torch
import torch.nn as nn
from skimage import io
import math
from torch.utils.... |
import os
import struct
import zlib
from typing import Any, Dict, List, Optional, Type
from steamfiles import acf
import shutil
import click
from gs_manager.command import Config, ServerCommandClass
from gs_manager.servers.generic.rcon import RconServer, RconServerConfig
from gs_manager.decorators import multi_instan... |
# Copyright (c) 2014 - 2017 StorPool
# 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... |
"""parser.py defines all classes and functions related to parsing pol/pli(z) files.
"""
import warnings
from enum import IntEnum
from pathlib import Path
from typing import Callable, Dict, Iterator, List, Optional, Sequence, Tuple, Union
from hydrolib.core.basemodel import BaseModel
from hydrolib.core.io.polyfile.mod... |
import lsh_partition
import models
import torch
import pandas as pd
import numpy as np
import math
from distributed_rep import embeding
from models import core
from lsh_partition import lsh
from torch import nn
import time
from mpi4py import MPI
from torch.autograd import Variable
comm = MPI.COMM_WORLD
size = comm.Ge... |
import asyncio
import time
import collections
import logging
import discord
import discord.ext.commands.cog
from typing import List, Dict, Tuple, Optional, Union, Any, Literal, Awaitable, Protocol, overload, cast
import util.db.kv
import discord_client
import plugins
import plugins.cogs
import plugins.commands
import p... |
import json
from collections import OrderedDict
from contextlib import contextmanager
from copy import deepcopy
from tempfile import NamedTemporaryFile
from django.contrib import messages
from django.http import (
Http404,
HttpResponseBadRequest,
HttpResponseRedirect,
JsonResponse,
)
from django.http.r... |
# Copyright (c) 2019-2020, NVIDIA 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... |
import asyncio
import sys
import traceback
import pytest
import pytest_mock
import rx
import deriv_api
from deriv_api.errors import APIError, ConstructionError, ResponseError
from deriv_api.easy_future import EasyFuture
from rx.subject import Subject
import rx.operators as op
import pickle
import json
from websockets.... |
"""
Sparse Blocks Network
Copyright (c) 2017, Uber Technologies, 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 re... |
import logging
import os
import time
import unittest
from time import sleep
from solcx import compile_files
from web3 import Web3
from web3.providers.auto import load_provider_from_uri
from web3.providers.eth_tester import EthereumTesterProvider
from web3.types import TxReceipt
from eth_typing import Address, Checksum... |
#!/usr/bin/python
# Copyright (c) 2020, 2022 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
# We will write videos to
import sys
sys.path.append('../')
from youtube_dl import YoutubeDL, DownloadError
from youtube_dl.utils import subtitles_filename, ExtractorError, encodeFilename
import io
from bs4 import BeautifulSoup
from mreserve.preprocess import video_to_segments, preprocess_video, encoder, MASK
from go... |
from __future__ import (absolute_import, division,
print_function)
import numpy as np
from collections import OrderedDict
import copy
import os
import re
from atom.api import (Atom, Str, observe, Dict, List, Int, Bool)
from skbeam.fluorescence import XrfElement as Element
from skbeam.core.fit... |
# Copyright 2018 D-Wave Systems 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... |
# from car_result import ui_MainWindow
from optparse import OptionParser
from PIL import Image
from PyQt5 import QtCore
from PyQt5 import QtGui, QtWidgets
from PyQt5.QtCore import *
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QApplication, QFileDialog, QFrame, QComboBox, QLineEdit, QLabel, QMes... |
import typing
import copy
import numpy as np
import scipy.sparse
from collections import defaultdict, OrderedDict
from typing import List, Optional, Text, Dict, Tuple, Union, Any, DefaultDict, cast
from rasa.nlu.constants import TOKENS_NAMES
from rasa.utils.tensorflow.model_data import Data, FeatureArray
from... |
#!/usr/bin/env python
#
# Copyright 2018 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 requi... |
from queue import Full
from util.agent import (BallState, CarState, GameState, Physics, Vector,
Vector3, VirxERLU, math)
COAST_ACC = 525.0
BRAKE_ACC = 3500
MIN_BOOST_TIME = 0.1
REACTION_TIME = 0.04
BRAKE_COAST_TRANSITION = -(0.45 * BRAKE_ACC + 0.55 * COAST_ACC)
COASTING_THROTTLE_TRANSITION = ... |
# coding=utf-8
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
#
# 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
#
# ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.