text stringlengths 3.07k 22.1k |
|---|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
test_cq.py:
Testing module used to easily test answers to Code Quest
challenges through the use of unittest. When run, this will
go through the working directory looking for a group of files
that follow the naming scheme:
'Prob(xx).in.txt' - Input to solut... |
#!/usr/bin/env python
# -*- coding: windows-1251 -*-
# Copyright (C) 2005 <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:
#
# 1. Redistributions of source code must retain the ab... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Python 3 script
# Author : <NAME>
import xml.etree.ElementTree as etree
import uuid, subprocess, os.path, argparse, sys, logging
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format='%(asctime)s|%(levelname)s|%(funcName)s: %(message)s', datefmt='%H:%M:%S... |
import json
import os
import time
from dataclasses import dataclass
from pathlib import Path
from tempfile import gettempdir
from typing import Any, List
from uuid import uuid4
from talon import Context, Module, actions
# How old a request file needs to be before we declare it stale and are willing
# to remove it
STA... |
# 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/... |
# -*- coding: utf-8 -*-
'''
.. _module_mc_nagvis:
mc_nagvis / nagvis functions
============================================
You can add your own key/values in backends,
rotations and actions subdictionaries.
'''
# Import python libs
import logging
import copy
import mc_states.api
import hashlib
__name = 'nagvis'
... |
from django.conf import settings
from django import template
from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import smart_unicode
from django.template.loader import render_to_string
from classytags.core import Tag, Options
from classytags.arguments import Argument
import reviews
"... |
import itertools
import copy
import streamlit as st
import plotly
import plotly.graph_objects as go
import plotly.express as px
from plotly.subplots import make_subplots
import logging
import config
@st.cache(show_spinner=False)
def normalisation(data, population, rule):
if config.RULE_MAP[rule] == 'percentage'... |
from aimacode.logic import PropKB
from aimacode.planning import Action
from aimacode.search import (
Node, Problem,
)
from aimacode.utils import expr
from lp_utils import (
FluentState, encode_state, decode_state,
)
from my_planning_graph import PlanningGraph
from functools import lru_cache
class AirCargoPro... |
import argparse
import csv
from math import cos, sqrt
import matplotlib
import numpy as np
# Matplotlib export settings
matplotlib.use("pgf")
import matplotlib.pyplot as plt
matplotlib.rcParams.update({
"pgf.texsystem": "pdflatex",
"font.size": 10 ,
"font.family": "serif", # use serif/main font for text... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... |
"""
Various utilities for recording and embedding state in a rendered app.
"""
import os
import json
import uuid
import param
import sys
from collections import defaultdict
from contextlib import contextmanager
from itertools import product
from bokeh.core.property.bases import Property
from bokeh.models import Custo... |
import sark
import idc
import idautils
MAX_VALID_ADDRESS = 0xf11111111
def search_for_sequence(address_start, binary_sequences, max_address, max_offsets):
if len(max_offsets) != len(binary_sequences):
raise ValueError("expected the sequences to have the same len as max_offsets")
ea1 = idc.find_binar... |
import html
import os
import sublime
import sublime_plugin
try:
from typing import Any, List, Dict, Tuple, Callable, Optional
assert Any and List and Dict and Tuple and Callable and Optional
except ImportError:
pass
from .core.settings import settings, PLUGIN_NAME
from .core.protocol import Diagnostic, Di... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# LICENSE
#
# Copyright (C) 2010-2018 GEM Foundation, <NAME>, <NAME>,
# <NAME>.
#
# The Hazard Modeller's Toolkit is free software: you can redistribute
# it and/or modify it under the terms of the GNU Affero General Public
# License as published by... |
import gensim
import gensim.downloader as gloader
import numpy as np
import tensorflow as tf
from typing import List, Callable, Dict
import tqdm
from hyper_param import *
import collections
def extract_numpy_structures(train_set, val_set, test_set):
# train
x_train_question = train_set['question'].values
... |
from django import forms
from django.db.models import Q
from django.utils import timezone
from django.utils.text import slugify
from zentral.contrib.inventory.models import MetaBusinessUnit, Tag
from zentral.contrib.inventory.conf import PLATFORM_CHOICES, TYPE_CHOICES
from zentral.core.incidents.models import Severity
... |
# 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 agreed to in... |
import os, sys, titlecase, datetime, tabulate
import json, re, urllib, time, glob, multiprocessing
from docutils.examples import html_parts
from bs4 import BeautifulSoup
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
#
from howdy import resourceDir
from howdy.core import core, QDialo... |
from roboSocketCom import RoboSocketCom
from websocket import create_connection
from jsonController import jsonController
from pygameJoystick import pyGameJoystick
from shapeDetectionClass import ShapeDetection
import pygame,base64,cv2,threading,json,rov_distance_paint,asyncio,jsonControllerConsole
import concurrent.f... |
# -*- coding: utf-8 -*-
"""
shepherd.sysfs_interface
~~~~~
Provides convenience functions for interacting with the sysfs interface
provided by the shepherd kernel module
:copyright: (c) 2019 Networked Embedded Systems Lab, TU Dresden.
:license: MIT, see LICENSE for more details.
"""
import logging
import time
from p... |
import operator
import numpy as np
from chebpy.core.bndfun import Bndfun
from chebpy.core.settings import userPrefs as prefs
from chebpy.core.utilities import (Domain, check_funs, generate_funs,
compute_breakdata)
from chebpy.core.decorators import (self_empty, float_argument,
... |
#!/usr/bin/env python3
import math
import numpy as np
import sympy as sp
from selfdrive.locationd.kalman.helpers import ObservationKind
from selfdrive.locationd.kalman.helpers.ekf_sym import EKF_sym, gen_code
i = 0
def _slice(n):
global i
s = slice(i, i + n)
i += n
return s
class States():
# Vehicle m... |
#!/usr/bin/env python3
import json
import os
import re
import sys
from argparse import ArgumentParser
import jsonschema
import yaml
# Path to JSON schema file:
SCHEMA_FILE = "util/schema/registry_schema.json"
# The metadata grid to be generated:
metadata_grid = {}
def main(args):
global metadata_grid
pars... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensing
#
# Dynamic Iteration Data structures
# Copyright (C) 2018 <NAME> <https://github.com/evandrocoan>
#
# Redistributions of source code must retain the above
# copyright notice, this list of conditions and the
# following disclaimer.
#
# Redistributions in... |
import numpy as np
import pytest
from numpy.testing import assert_almost_equal
import nengo
from nengo.builder.neurons import SimNeurons
from nengo.builder.operator import Copy, ElementwiseInc
from nengo.builder.optimizer import (
CopyMerger,
ElementwiseIncMerger,
OpMerger,
OpsToMerge,
SigMerger,
... |
#
# 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... |
"""Given a set of website URLs, search time period, and monthly raw website
Google Analytics data:
* Search raw monthly GA data for URLs
* For each month, generate summary total report for metrics, save to file
* Generate and save an overall summary report, aggregating all monthly data
"""
import os
imp... |
import os
import subprocess
from typing import Any, Dict, List, Optional, Tuple, Union, Callable
import httpx
from httpx import Response
import logging
ENVIRON_WHITELIST = [
"LD_LIBRARY_PATH", "LC_CTYPE", "LC_ALL", "PATH", "JAVA_HOME", "PYTHONPATH",
"TS_CONFIG_FILE", "LOG_LOCATION", "METRICS_LOCATION"
]
log... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy
import torch
from draugr.numpy_utilities import Split
from draugr.random_utilities import seed_stack
# from draugr.opencv_utilities import cv2_resize
from draugr.torch_utilities import (
TorchCacheSession,
TorchDeviceSession,
TorchEvalSession,
... |
# Copyright (c) 2021, NVIDIA CORPORATION. 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... |
import tkinter as tk
import tkinter.ttk as ttk
import re
import tkinter.filedialog
import tkinter.simpledialog
import os
import shutil
import random
import math
import PIL.Image as PILImage
import PIL.ImageTk as PILImageTk
from PIL.ExifTags import TAGS
class Image():
def __init__(self, filename):
image = P... |
#!/usr/bin/env python
#
# Copyright 2015 British Broadcasting 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 require... |
'''
API for the laws app
'''
import logging
from django.core.urlresolvers import reverse
from tastypie.constants import ALL
import tastypie.fields as fields
from agendas.templatetags.agendas_tags import agendas_for
from apis.resources.base import BaseResource
from mks.models import Member, Party
from mks.api import M... |
# Copyright 2008 <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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and th... |
'''
Project:
Author: <NAME>
Function Definition: Extract .nrrd CT images and metadata from the CT images.
'''
# libraries and dependencies
# --------------------------------------------
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import SimpleITK as sitk
import pandas as pd
import numpy as np
im... |
from functools import partial
from itertools import islice
from typing import List, Optional, Union, Callable, Tuple, Iterable, TYPE_CHECKING
from ..oauth import set_required_scopes
from ..http import HTTPUserClient, HTTPClient
from . import AsyncIterable, URIBase, Track, PlaylistTrack, Image
if TYPE_CHECKING:
im... |
#!/usr/bin/env python3
# Copyright 2021 Efabless 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 applic... |
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import tensorflow as tf
import sys
sys.path.append("..") # Adds higher directory to python modules path.
# local python modules
from poke_env.player_configuration import PlayerConfiguration
from poke_env.player.env_player import Gen7EnvSinglePlayer
from p... |
from .numbers import Number, Integer, Rational
from .symbol import Symbol
from .expr import Expression
from .function import Function
from .symbol import Undefined
from .common import convert_type
class Eq(Expression):
symbol = '='
commutative = True
precedence = 5
def __new__(cls, lhs... |
# Copyright 2020 The Cirq Developers
#
# 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 ... |
import torch
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from torch.utils.data import DataLoader, Dataset
import torch.nn as nn
import torch.nn.functional as F
import sys
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
r = 4
#loading dat... |
# A part of NonVisual Desktop Access (NVDA)
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
# Copyright (C) 2015-2021 NV Access Limited, Babbage B.V.
import winVersion
from logHandler import log
import eventHandler
import controlTypes
import textInfos
import... |
# -*- coding: utf-8; -*-
#
# @file establishment.py
# @brief coll-gate organisation establishment model REST API
# @author <NAME> (INRA UMR1095)
# @date 2017-01-03
# @copyright Copyright (c) 2017 INRA/CIRAD
# @license MIT (see LICENSE file)
# @details
from django.contrib.contenttypes.models import ContentType
from dj... |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
from torch.autograd import Variable
import numpy as np
import torch.nn.functional as F
class STN3d(nn.Module):
def __init__(self):
super(STN3d, self).__init__()
self.conv1 = to... |
######################################################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... |
'''This module contains coordinate transformations on the WGS 84 ellipsoid.'''
import numpy as np
__classification__ = "UNCLASSIFIED"
__email__ = "<EMAIL>"
# WGS 84 defining parameters
a = 6378137.0 # Semi-major radius (m)
f = 1/298.257223563 # Flattening
GM = 3986004.418E8 # Earth's gravitational... |
u"""Static type checking helpers"""
from abc import ABCMeta, abstractmethod, abstractproperty
import collections
import inspect
import sys
import re
import functools
__all__ = [
# Type system related
'Any',
'AnyStr',
'Dict',
'Callable',
'Generic',
'GenericMeta',
'IO',
'List',
... |
import json
import sys
import os
import random
import ruamel.yaml as yaml
from hurry.filesize import size
from ldt.helpers.exceptions import ResourceError
from ldt.load_config import config
def get_object_size(obj, seen=None):
"""
A function that recursively finds size of objects,
from https://goshippo... |
import numpy as np
import datetime as dt
import sys
import matplotlib.path as mpath
import xarray as xr
import six
import psyplot.project as psy
def ind_from_latlon(lats,lons,lat,lon,verbose=False):
"""Find the nearest neighbouring index to given location.
Args:
lats (2d array): Latitude gr... |
__all__ = ['BinaryLabelsClassifier', 'MultiLabelsClassifier', 'MulticlassLabelsClassifier', 'filter_labels']
import logging
import numpy as np
from sklearn.preprocessing import MultiLabelBinarizer
from .base import BaseClassifier
logger = logging.getLogger(__name__)
class LabelsClassifierMixin(BaseClassifier):
... |
import logging
import os
import warnings
import json
from pathlib import Path
from datetime import datetime
import numpy as np
from ScanImageTiffReader import ScanImageTiffReader
with warnings.catch_warnings():
warnings.simplefilter('ignore', category=FutureWarning)
import caiman as cm
from caiman.source_... |
import logging
import math
import time
from enum import Enum
import typing
import numpy as np
from smac.configspace import Configuration
from smac.stats.stats import Stats
from smac.utils.constants import MAXINT
if typing.TYPE_CHECKING:
from smac.runhistory.runhistory import RunHistory # noqa F401
__author__ =... |
# -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2019 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""Testing environment setup and teardown for pytest."""
import os
import pytest
from astropy.utils import iers
from astropy.time import Time
from astropy.coordinates import EarthLocatio... |
from configs import PruneCartpoleConfig as student_config
from configs import CartpoleConfig as dense_config
from model import CartPoleDQNTarget, StudentCartpole
from utils.plot_utils import plot_graph
from utils.logger_utils import get_logger
from Cartpole.evaluate_cartpole import evaluate_cartepole as evaluate
from t... |
"""
This file contains the single entry functions to upload data that are called via the command line and the gui
These functions return exit codes that get passed up the chain to whatever function calls the uploader (i.e. bash)
It also contains the functions for starting/stopping logging to a directory
"""
import lo... |
from __future__ import print_function
from __future__ import with_statement
import errno
import logging
import os
import sys
from collections import defaultdict, namedtuple
import fuse
import pandas as pd
import yaml
from fuse import FUSE, FuseOSError, Operations
from watchdog.events import FileSystemEventHandler
fro... |
#!/usr/bin/env python
from nose.tools import *
import networkx
import networkx as nx
from networkx.algorithms import find_cycle
FORWARD = nx.algorithms.edgedfs.FORWARD
REVERSE = nx.algorithms.edgedfs.REVERSE
class TestCycles:
def setUp(self):
G=networkx.Graph()
nx.add_cycle(G, [0,1,2,3])
n... |
import json
import time
from datetime import datetime
from io import StringIO
from typing import Tuple, List, Dict, Optional
from OpenSSL import crypto
from jsonpath_ng.ext import parse
from kubernetes import client, config
from kubernetes.client.models import V1Node, V1Pod, ExtensionsV1beta1Deployment, ExtensionsV1be... |
"""
Reads in a Graphviz .dot file and generates a Verilog state machine based
on some simple rules.
1) Format the dot file to ...
1. Remove the comment (Single line and Multi lines)
2) Sort the state types
1. Create the type list
2. ...
"""
import sys
import os
import re
import time
import logging
import ... |
from __future__ import print_function, division
import torch
import numpy as np
import torch.nn as nn
import os
import shutil
from sklearn.metrics.pairwise import euclidean_distances
import torch.nn.functional as F
from Options import Config
config = Config().parse()
def to_np(x):
return x.data.cpu().numpy()
de... |
""" This module is responsible to create Tree View where save wifi in the
system of user will displayed with other data like (SSID name, Authentication,
Key) and also having functionality to delete the Wi-Fi profile from the system
and refresh the content of the TreeView."""
import os
import subprocess
import t... |
import serial
from serial.tools import list_ports
from serial import rs485
# Telegram special characters
SOT = 0x0D # Start of telegram
EOT = 0x0A # End of telegram
SOE = 0x5e # Start of subsitituion
ECC = 0x40 # Value to shift for subsitution
# Response Message Types
NACK = 0x00
CRC_ERR = 0x01
BUSY = 0x02
... |
#!/usr/bin/env python
# Copyright (c) 2019 Trail of Bits, 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 applic... |
# -*- coding: utf-8 -*-
"""Various functions for MQ channels."""
import re
import time
import datetime
from log.logger_client import set_logger
from modules.mq_api import (
run_mq_command,
add_annotation)
logger = set_logger()
def get_metric_name(metric_label):
"""Returns pushgateway form... |
from opentrons.legacy_api.containers import load as containers_load
from opentrons import robot, instruments, labware
from opentrons.trackers import pose_tracker
from opentrons.util import vector
from numpy import isclose
from unittest import mock
import pytest
# TODO: Modify all calls to get a Well to use the `wells` ... |
import discord
import random
import aiohttp
import os
import arrow
import asyncio
import datetime
import humanize
import csv
import json
import async_cse
from bs4 import BeautifulSoup
from discord.ext import commands
from modules import exceptions, util
GCS_DEVELOPER_KEY = os.environ.get("GOOGLE_KEY")
class Kpop(com... |
import numbers
import logging
import uuid
from ottoengine import helpers
from ottoengine.fibers import clock
from ottoengine.model import dataobjects
_LOG = logging.getLogger(__name__)
# _LOG.setLevel(logging.DEBUG)
ATTR_PLATFORM = "platform"
ATTR_ENTITY_ID = "entity_id"
class ListenerTrigger(object):
def __... |
from datetime import datetime, timedelta
from urllib.parse import urlencode
import colander
import kinto.core
from cornice.validators import colander_validator
from kinto.authorization import RouteFactory
from kinto.core import resource
from kinto.core import utils as core_utils
from kinto.core.storage import Filter, ... |
# Copyright (c) 2022 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 applic... |
#!/usr/bin/env python
#
# parttool is used to perform partition level operations - reading,
# writing, erasing and getting info about the partition.
#
# Copyright 2018 Espressif Systems (Shanghai) PTE LTD
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
"""Provide common mysensors fixtures."""
from __future__ import annotations
from collections.abc import AsyncGenerator, Callable, Generator
import json
from typing import Any
from unittest.mock import MagicMock, patch
from mysensors import BaseSyncGateway
from mysensors.persistence import MySensorsJSONDecoder
from my... |
import yfinance as yf
import numpy as np
import pandas as pd
from . import utils
def ensureNormal ( df, **kwargs ):
if kwargs.get('isLog',True):
# print("transforming")
dx = np.diff(np.log(df))
else:
# print('skipping')
dx = df
return dx
def basketVariance ( samples, weights, **kwargs ):
"""Returns the ... |
import os
import re
import pickle
from numpy import argmax
import pandas as pd
class LodeStarData():
STANDARD_SIGNALS = {
'torque' : ['tob'],
'rpm' : ['rpmacc'],
'wob' : ['wob'],
'moment' : ['bobmag']
}
MAX_TIME_DEC = 4
def __init__(self, filename, stack_order=Non... |
"""
Author: huangyz0918
Author: <NAME>
Dec: Abstract class for data pre-processing, implement this class and try to meet
the data format that model requires here.
Date: 26/04/2020
"""
import datetime
import time
from abc import ABCMeta, abstractmethod
from threading import Thread
from typing import Any
import GPU... |
import argparse
import os
import random
import sys
import json
import numba
import numpy as np
import time
sys.path.append(os.getcwd())
__all__ = ['evaluate']
output_dir = 'output_plant'
color_map_file = 'part_color_mapping.json'
color_map = json.load(open(color_map_file, 'r'))
def output_color_point_clou... |
#!/usr/bin/python3
#
# MIT License
#
# Copyright (c) 2018 <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,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2017 <NAME>
""" Module for optical surface related classes
Surface
Container of profile, extent, position and orientation information of
the surface
DecenterData
Maintains data and actions to support 4 types of position and
... |
import pyos
def onStart(s, a):
global state, app, hub
state = s
app = a
hub = Hub()
MainScreen().activate()
def readJSON(path):
try:
f = open(path, "rU")
jsd = pyos.json.loads(str(unicode(f.read(), errors="ignore")))
f.close()
return jsd
except:
... |
#
# 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
# distributed under... |
import contextlib
import functools
import inspect
import os
import socket
import tarfile
from io import StringIO
from typing import (
TYPE_CHECKING,
Any,
Callable,
ContextManager,
Dict,
Generic,
Iterator,
Optional,
Tuple,
Type,
TypeVar,
Union,
overload,
)
from urllib.... |
import streamlit as st
import datetime
import pandas as pd
import numpy as np
import altair as alt
import plotly.express as px
from typing import Sequence, List, Optional, Dict
from sklearn.cluster import KMeans
from collections import defaultdict
from enum import Enum
st.set_page_config(page_title='Covid data analysi... |
# Copyright (c) 2020 IBM Corp. 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
#
# Authors: <NAME>
# Licensed under the CC BY-NC 4.0 license (https://creativecommons.org/licenses/by-nc/4.0/)
import os
import cv2
import imageio
import numpy as np
import json
import torch
import scipy.io as sio
from utils.utils import get_output, mkdir_if_missing
class PerformanceMeter(object):
""" A general... |
import yaml
import os
import shutil
import re
import toml
import subprocess
import requests
from typing import Dict, List, Set, Tuple, Pattern, Match
from urllib.parse import urlparse
from pathlib import Path
CHECKOUT_DIR = "checkouts"
GIT_CLONE_CMD = "git clone {{}} ./{}/{{}}/{{}}".format(CHECKOUT_DIR)
GIT_CHECKOUT_C... |
from collections import OrderedDict
from typing import Any, Dict, IO, Iterable, Optional, Set, Type, Union
import altair as alt
from altair_saver.savers import (
Saver,
BasicSaver,
HTMLSaver,
NodeSaver,
SeleniumSaver,
)
from altair_saver._types import JSONDict, Mimebundle
from altair_saver._utils ... |
import os
import sys
import glob
import time
import copy
import random
import numpy as np
import torch
import utils
import logging
import argparse
import torch.nn as nn
import torch.utils
import torch.nn.functional as F
from torch import Tensor
import torchvision.datasets as dset
import torchvision.transforms as transf... |
#!/usr/bin/env python
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All ... |
import logging
from django.views.decorators.csrf import csrf_exempt
from oidc_provider.lib.endpoints.introspection import TokenIntrospectionEndpoint
try:
from urllib import urlencode
from urlparse import urlsplit, parse_qs, urlunsplit
except ImportError:
from urllib.parse import urlsplit, parse_qs, urluns... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from django.db import models as m, transaction
from django.utils import timezone as tz
from django.utils.translation import ugettext_lazy as _
from django.utils.functional import cached_property
from wechatpy.constants import WeChatErrorCode
fr... |
# Setup enviroment for using Indigo both for Python, Jython and IronPython
import sys
import os
import shutil
import inspect
import threading
from math import sqrt
from util import isIronPython, isJython, getPlatform, REPO_ROOT
if isIronPython():
import clr
import System
clr.AddReference("System.IO.FileS... |
"""A home for constants."""
# Python modules
from __future__ import division
# 3rd party modules
# Our modules
# import vespa.common.ordered_dict as ordered_dict
from collections import OrderedDict as ordered_dict
# We could also use numpy.pi in place of 3.14..., but it's useful to limit
# this module's dependencie... |
"""
weasyprint.css.descriptors
--------------------------
Validate descriptors used for some at-rules.
"""
import tinycss2
from ...logger import LOGGER
from ..utils import (
InvalidValues, comma_separated_list, get_custom_ident, get_keyword,
get_single_keyword, get_url, remove_whitespace, single... |
#!/usr/bin/env python3
"""" Script to automatically upload file to media server on download completion. """
__author__ = "manticode"
__version__ = "0.1.4"
import argparse
import configparser
import os
import re
import smtplib
import subprocess
import sys
import tarfile
import tempfile
import rarfile
import uuid
from... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from __future__ import division
from __future__ import print_function
import numpy as np
import pandas as pd
import warnings
from ..log import get_module_logger
from .backtest import get_exchange, backtest as backtest_func
from .backtest.backtes... |
import json
import logging
import os
# from botocore.vendored import requests
import random
import string
import time
import boto3
import requests
from botocore.exceptions import ClientError
logger = logging.getLogger()
logger.setLevel(logging.INFO)
SUCCESS = "SUCCESS"
FAILED = "FAILED"
def cfnresponse_send(event,... |
# -*- coding: utf-8 -*-
"""
Exact solvers for the 1D Wasserstein distance using cvxopt
"""
# Author: <NAME> <<EMAIL>>
# Author: <NAME> <<EMAIL>>
#
# License: MIT License
import numpy as np
import warnings
from .emd_wrap import emd_1d_sorted
from ..backend import get_backend
from ..utils import list_to_array
def qu... |
"""
(test) fprime.build:
Tests the current F prime build module. Ensures that the selected singleton defines the minimum set of functions and
that they function as expected.
@author mstarch
"""
import os
import shutil
import tempfile
import pathlib
import pytest
import fprime.fbuild.cmake
import fprime.fbuild.build... |
from threading import Thread, Condition
import socket
import struct
from .enums import OutboundMessageTypes
from .structs import (
RegistrationResult,
RealtimeUpdate,
RealtimeCarUpdate,
EntryList,
EntryListCar,
TrackData,
BroadcastingEvent,
)
__all__ = ["AccClient"]
class EndOfStreamErro... |
from typing import List
from typing import Tuple
from unittest.mock import patch
import uuid
import _pytest.capture
import pytest
import optuna
from optuna._study_direction import StudyDirection
from optuna.testing.storage import StorageSupplier
def test_create_study() -> None:
study = optuna.multi_objective.cr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.