text
stringlengths
3.07k
22.1k
""" Functions for visualizing grid search results """ import collections from functools import reduce import matplotlib.pyplot as plt import numpy as np from six import string_types from sklearn_evaluation.plot.matplotlib.bar import BarShifter from ..util import (_group_by, _get_params_value, _mapping_to_tuple_pairs,...
from typing import List, Tuple, Optional # IMPORTS import requests from CommonServerUserPython import * from CommonServerPython import * # Disable insecure warnings requests.packages.urllib3.disable_warnings() class Client(BaseClient): """Client for AutoFocus Feed - gets indicator lists from Daily threat feeds...
import logging import math from dataclasses import dataclass from typing import List, Optional, Tuple, Union from .chunks import ChunkIHDR # from .image import Image # from .pixel import Pixel from .utils import BitArray _adam7 = ((0, 0, 8, 8), (4, 0, 8, 8), (0, 4, 4, 8), (2, 0, 4, 4), ...
import torchaudio import torch import torch.utils.data as data import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import os import csv import math def getDFTFeature(filepath,win_size=1024,win_shift=512,preemphasis=False,channel_first=True,drop_dc=True,cut_len=5160,normalize=False): ''' ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import ctypes import numpy as np from ..modeling.core import FittableModel, custom_model __all__ = ['discretize_model'] class DiscretizationError(Exception): """ Called when discretization of models goes wrong. """ class KernelSizeError(E...
"""Deep Q Network.""" import argparse from collections import OrderedDict from typing import Dict, List, Optional, Tuple import numpy as np import torch from pytorch_lightning import LightningModule, Trainer, seed_everything from pytorch_lightning.callbacks import ModelCheckpoint from torch import Tensor, optim from t...
import abc import json import os.path import pathlib import sqlite3 import typing import fiepipelib.localuser.routines.localuser T = typing.TypeVar("T", bound=object) class AbstractLocalTypeManager(typing.Generic[T]): """An abstract class with which to make managers of static data. Currently backed by sqlite. ...
from enum import Enum from Data import get_uids from Data.Areas import CompositeArea, EdgeLoopArea, AreaType, Edge from Data.Edges import EdgeType from Data.Events import ChangeEvent from Data.Objects import IdObject, NamedObservableObject from Data.Parameters import Parameters from Data.Point3d import KeyPoint clas...
# adapted from @blei-lab onlineldavb import numpy as np from scipy import special from sklearn.decomposition import NMF from sklearn.base import BaseEstimator, TransformerMixin ITER_STMT = 'Iter: {0:d}, Bound: {1:.2f}, Change: {2:.5f}' EPOCH_STMT = 'Epoch: {0:d}' MINIBATCH_STMT = 'Minibatch: {0:d}, Bound: {1:.2f}' E...
import discord, json, datetime, concurrent, random, asyncio, math from conf import * from discord.ext import commands from data import db_users, db_helper from utils import msg_utils from objects.user import User refund_dict = {} current_tickets = {} stored_messages = {} # Logging functions here: def log(string): ...
#!/usr/bin/env python3 import sys import codecs import requests import time import getconf import psycopg2 import time import enc import pgio userdb = 'authentication_oracle' def create_oracle(chain, houndname, user_id): result = getconf.oraclescreate_rpc(chain, houndname, username+"'s Dragonhound Tr...
import logging from .cursor import Cursor __all__ = ("AQLQuery", "F", "V", "S") logger = logging.getLogger(__name__) class Variable(object): """ AQL Variable """ def __init__(self, value): self.value = value self.invert = False def __invert__(self): self.invert = True ...
from ..mesh import * from ..model import * import inspect import numpy as np from scipy.integrate import ode import copy global Nt Nt = 10e5 # HELPER FUNCTIONS -------------------------------------------------------- def tryexponential(rate): """ Trys to compute exponential. """ try: return np.rand...
"""Django command for seeding the DB with match & prediction data.""" from typing import Tuple, List, cast, Optional, Dict, Any, Union from urllib.parse import urljoin from django.core.management.base import BaseCommand from django.db import transaction from django.conf import settings import requests from server.mo...
import random import numpy as np import time import pickle import matplotlib.pyplot as plt import scipy.stats def mean_confidence_interval_bootstrap(data, confidence=0.95, nb_iterations=1000): # Compute the mean and confidence interval of the the input data array-like using a bootstrap method. data = 1.0 * n...
""" Contains functions and classes to aid in the unit testing process within Maya. The main classes are: TestCase - A derived class of unittest.TestCase which add convenience functionality such as auto plug-in loading/unloading, and auto temporary file name generation and cleanup. TestResult - A derived cla...
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You may not # use this file except in compliance with the License. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
import json from rest_framework.generics import get_object_or_404 from django.contrib.auth.models import User from rest_framework import exceptions from rest_framework import serializers from rest_framework.exceptions import APIException from django.db import ( transaction, IntegrityError, models ) from api...
from __future__ import annotations import asyncio from datetime import datetime from typing import TYPE_CHECKING, Union, Optional, List, Any, Dict import nextcord import nextcord.utils from .base import DatabaseChecker from .punishments import Punisher if TYPE_CHECKING: from nextcord.ext import commands fro...
__all__ = [ 'AssignmentsObserver', 'BaseObserver', 'PoolStatusObserver', ] import asyncio import attr import datetime import inspect import logging from typing import Any, Awaitable, Callable, Dict, Iterable, List, Optional, Tuple, Union from ..client.primitives.base import autocast_to_enum from ..client...
#!/usr/bin/env python3 """ This script compiles all the bounding boxes in the training data and clusters them for each convout resolution on which they're used. Run this script from the Yolact root directory. """ import os.path as osp import json, pickle import sys from math import sqrt from itertools import product...
# -*- coding: utf-8 -*- import torch from torch import nn import torch.nn.functional as F from models import backbone from utils_Deeplab import SyncBN2d from modules import SCSEBlock class BasicBlock(nn.Module): expansion = 1 def __init__(self, in_channels, out_channels, stride=1, downsample=None): s...
# coding=utf-8 # Copyright 2015 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 unittest fro...
from os import stat from typing import Union from django.contrib.auth import authenticate from django.http.request import HttpRequest from drf_yasg.utils import swagger_auto_schema from rest_framework import response from rest_framework.authtoken.models import Token from rest_framework.response import Response from re...
"""Classes and functions for rendering run graphics """ import abc from typing import Sequence, Optional, Dict, Any, Iterable, Set, List import matplotlib from matplotlib import cm import matplotlib.pyplot as plt import networkx as nx from networkx.drawing.nx_agraph import graphviz_layout import intmcp.model as M fro...
from datetime import datetime from collections import UserDict class ClinvarRecord(UserDict): """Instances of this class hold data on individual ClinVar records. It is a subclass of UserDict rather than a regular dict in order to use attributes. """ # A score for the review status of the assigned cli...
#!/usr/bin/env python3 import argparse import contextlib import functools import http.server import os import os.path import pathlib import shutil import subprocess import sys import threading import types import webbrowser # Sphinx' command scripts, as defined by sphinx' own setup.py # # Unfortunately we cannot jus...
"""filtering.py Temporal filtering for Jagular. We assume that the original data is in (multiple) files and that they are annoyingly large. So all the methods here work on buffered input, using memory maps. This work is based loosely on similar work by <NAME>. The original work can be found here: https://githu...
from __future__ import absolute_import from functools import partial from collections import defaultdict from six import string_types from ..hubstorage.frontier import Frontier as _Frontier from ..hubstorage.utils import urlpathjoin from .proxy import _Proxy from .utils import update_kwargs class _HSFrontier(_Fron...
import numpy as np import os from sparse import COO from kaldo.helpers.logger import get_logger logging = get_logger() import pandas as pd import h5py LAZY_PREFIX = '_lazy__' FOLDER_NAME = 'data' # TODO: move this into single observables DEFAULT_STORE_FORMATS = {'physical_mode': 'formatted', ...
""" ESAME DI STATO 2020 @Author: <NAME> CLasse 5^AI Simulazione sistema di sensoristica basato su protocollo publisher/subscriber multithreading, in formato json con monitoraggio di CO2 e radioattività tramite doppia dashboard: una fornita da Thingboard, un cloud MQTT, e una implemetata da me senza utilizzo di ...
import sys import os from urllib.parse import urlparse, urlunparse import pkg_resources from pyspark import SparkContext import hail from hail.genetics.reference_genome import ReferenceGenome from hail.typecheck import nullable, typecheck, typecheck_method, enumeration, dictof from hail.utils import get_env_or_defaul...
import asyncio import itertools from datetime import timedelta from typing import Coroutine, Dict, List, Union import pandas as pd from celery.utils.log import get_task_logger from celery.utils.time import humanize_seconds import calc.prod # noqa import config as conf import cq.signals # noqa import cq.util import ...
# -*- coding: utf-8 -*- """ BGP Finder ========== .. versionadded:: 2017.7.0 Runner to search BGP neighbors details. Configuration ------------- - Minion (proxy) config The ``bgp.neighbors`` function must be appened in the list of ``mine_functions``: .. code-block:: yaml mine_functions: ...
import logging from collections import deque import pandas as pd from ixmp.utils import as_str_list, maybe_check_out, maybe_commit from . import ItemType log = logging.getLogger(__name__) #: Maximum number of rows supported by the Excel file format. See #: :meth:`.to_excel` and :ref:`excel-data-format`. EXCEL_MAX_...
import sys import os import math import numpy as np import glob import argparse import math import subprocess from os import path import unicodedata from string import printable import ftfy import jsonlines import json import pickle import fasttext import hashlib import sys import shutil from datetime import date,date...
import itertools import multiprocessing as mp import warnings from typing import Any, Callable, Iterable, List, Optional, Sized, Tuple, Union from dataclasses import dataclass, field from tqdm import tqdm from mpire.context import RUNNING_WINDOWS, DEFAULT_START_METHOD # Typedefs CPUList = List[Union[int, List[int]]]...
import pandas as pd, numpy as np import os,random,pickle,time,glob,gc import seaborn as sns import matplotlib.pyplot as plt from tqdm.auto import tqdm import tsai from tsai.all import * from sklearn.model_selection import KFold,StratifiedKFold import sklearn.metrics as skm from sklearn import preprocessing DATA_DIR...
import tensorflow as tf def scaled_dot_product_attention(query, key, value, mask): """Calculate the attention weights.""" matmul_qk = tf.matmul(query, key, transpose_b=True) # scale matmul_qk depth = tf.cast(tf.shape(key)[-1], dtype=tf.float32) logits = matmul_qk / tf.math.sqrt(depth) ...
# Copyright 2017, 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You may not # use this file except in compliance with the License. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fi...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'mainUI.ui' # # Created by: PyQt5 UI code generator 5.13.0 # # WARNING! All changes made in this file will be lost! import os import sys import threading import time import numpy import addFont import cv2 import numpy as np from PIL import Im...
from scapy.all import * import dpkt from subprocess import call import sqlite3 import datetime import time import json import upload_to_db from colorprint import ColorPrint as color from iptable_controller import obtainMudProfile from update_ip import update_device_domains from IoT_Classification import get_device_dhcp...
import json import sys from pathlib2 import Path from logging import LogRecord, getLogger, basicConfig, getLevelName, INFO, WARNING, Formatter, makeLogRecord, warning from logging.handlers import BufferingHandler from six.moves.queue import Queue as TrQueue from threading import Event as TrEvent from .development.work...
############################################################# # # Property of Eagle Eye. # # Authors: # <NAME> # ############################################################# import serial.tools.list_ports import serial import time import threading import globals as g from tkinter import * from tkinter.ttk...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import logging import sys import pyppeteer import pytest from pyppeteer.errors import ElementHandleError from syncer import sync from .utils import attachFrame class TestBoundingBox: @sync async def test_bounding_box(self): await self.page.setViewport(...
import random import numpy as np import math from time import perf_counter import os import sys from collections import deque import gym import cntk from cntk.layers import Convolution, MaxPooling, Dense from cntk.models import Sequential, LayerStack from cntk.initializer import glorot_normal env = gym.make("Break...
"""Support for Vera devices.""" from __future__ import annotations import asyncio from collections import defaultdict import logging from typing import Any, Generic, TypeVar import pyvera as veraApi from requests.exceptions import RequestException import voluptuous as vol from homeassistant import config_entries fro...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from...
import datetime import hashlib import json from bson.objectid import ObjectId try: from django.urls import reverse except ImportError: from django.core.urlresolvers import reverse from django.http import HttpResponse from django.shortcuts import render from crits.core.class_mapper import class_from_id, class_...
from tkinter import * from tkinter.filedialog import askopenfilename, asksaveasfile import threading import time '''from ctypes import * sum = CDLL('/home/manjunath/libsum.so') #UTF-8 to UNICODE sum.our_function.argtypes = [c_int, c_char_p] sum.our_function.restype = c_char_p ''' undo_list = None def about(): file...
""" LPA_star 2D @author: <NAME> """ import os import sys import math import matplotlib.pyplot as plt sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../../Search_based_Planning/") from Search_based_Planning.Search_2D import plotting, env class LPAStar: def __init__(self, s_start,...
from pygments.lexer import RegexLexer, bygroups, include, words, bygroups from pygments.token import * def setup(Sphinx): pass class ZeekLexer(RegexLexer): """ For `Zeek <https://www.zeek.org/>`_ scripts. .. versionadded:: 2.5 """ name = 'Zeek' aliases = ['zeek'] filenames = ['*.zeek'...
# Author: <NAME> <<EMAIL>> # # This module was developed with funding provided by # the ESA Summer of Code (2011). # The template can be found in tools/hektemplate.py """ This script is used to generate sunpy.net.hek.attrs. The rationale for using code-generation in lieu of dynamic magic is that code-generation ensur...
# 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...
import streamlit as st import streamlit.components.v1 as components import pandas as pd st.set_page_config(layout="wide") # constants CASH_RETURN = 0.005 def invest_strat_chosen_widget(dict): selection = st.radio('Select your investment strategy', [ dict[0], dict[1], dict[2]]) re...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. """UC Merced dataset.""" import os from typing import Any, Callable, Dict, Optional, cast import matplotlib.pyplot as plt import numpy as np import pytorch_lightning as pl import torch import torchvision from torch import Te...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F # @torch.jit.script def gaussian_analytical_kl(mu1, mu2, logsigma1, logsigma2): return -0.5 + logsigma2 - logsigma1 + 0.5 * (logsigma1.exp()**2 + (mu1 - mu2)**2) / (logsigma2.exp()**2) # @torch.jit.script def draw_gaussian_dia...
""" Access to IFCB raw data files, including directory operations. """ import os from functools import lru_cache import pandas as pd from .identifiers import Pid from .adc import AdcFile, AdcFragment from .hdr import parse_hdr_file from .roi import RoiFile from .utils import BaseDictlike, CaseInsensitiveDict from .b...
import yaml import importlib import numpy as np from util.pipeline import DataLoader import os import pickle import sys DRIVER_KEYS = set(['data', 'force_process', 'tasks', 'global_task']) def main(config_file, force_compute, config_name=None): config_path, config_dict = load_config_file(config_file) if conf...
#!/usr/bin/env python # Copyright <NAME> 2016 import math import rospy import tf from bullet_server.msg import Anchor, Body, Constraint, Face, Link from bullet_server.msg import Material, Node, SoftBody, SoftConfig, Tetra from bullet_server.srv import * def make_rigid_box(name, mass, xs, ys, zs, wd, ln, ht, ...
# -*- coding: utf-8 -*- """ Created on Sun Jun 26 10:54:18 2016 @author: adahl Script to execute example ggp multisite forecasting model. Inputs: Data training and test sets (dictionary pickle), link data (ndarray pickle - same used for all groups) Input order for model: output_dim, ...
#!/usr/bin/python2 import BaseHTTPServer import base64 import hashlib import logging import struct import threading log = logging.getLogger(__name__) class WebSocketError(Exception): pass class ProtocolError(WebSocketError): def __init__(self, message): self.message = message self.code = 100...
# -*- coding: utf-8 -*- # This is a Low High Guess game Alexa Skill. # The skill serves as a simple sample on how to use the # persistence attributes and persistence adapter features in the SDK. import random import logging from ask_sdk.standard import StandardSkillBuilder from ask_sdk_core.utils import is...
from sympy import Symbol file = open("veriler.txt", "r") veriler = [] # Değerleri veriler dizisine atiyorum for i in file: veriler.append(int(i)) # dizinin eleman sayisi elemanSayisi = len(veriler) toplam_y = 0 # dizideki elemanlarin toplamini buluyorum for i in range(elemanSayisi): toplam_y += ve...
from django.db.models.query import QuerySet from .io import read_frame import django from django.db import models class PassThroughManagerMixin(object): """ A mixin that enables you to call custom QuerySet methods from your manager. """ _deny_methods = ['__getstate__', '__setstate__', '__getinitargs__...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import math import argparse import pprint import tqdm from collections import defaultdict import torch import torch.nn.functional as F from tensorboardX import SummaryWriter from kaggle_humpback.dat...
#!/usr/bin/env python # encoding: UTF8 """ .. module:: window_functions :synopsis: Calculate the window functions of the multipole bands .. moduleauthor:: <NAME> <<EMAIL>> Collection of functions needed to construct the window functions of the multipole band powers. This module defines the class :class:`WindowFu...
from rasa.shared.nlu.training_data.features import Features from typing import Dict, Optional, Text, List, Any import json import numpy as np from rasa.shared.nlu.training_data.message import Message from rasa.shared.core.domain import Domain from rasa.engine.storage.resource import Resource from rasa.engine.graph imp...
from kivy.properties import StringProperty, BooleanProperty from kivy.event import EventDispatcher from kivy.clock import Clock from kivy.logger import Logger from kivy.app import App from jnius import autoclass, PythonJavaClass, java_method, cast from android import activity from android.runnable import run_on_ui_thre...
import tensorflow as tf import numpy as np #import mnist_data batch_size = 128 test_size = 256 img_size = 28 num_classes = 10 def init_weights(shape): return tf.Variable(tf.random_normal(shape, stddev=0.01)) def model(X, w, w2, w3, w4, w_o, p_keep_conv, p_keep_hidden): conv1 = tf.nn.conv2d(X, w,\ ...
from enum import Enum import numpy as np from copy import deepcopy def bitboard(board, player_index): """ Generate the board feature vector from an np.array. This function assumes that the game contains exactly one type of piece and exactly two players. """ player = player_index opponent ...
""" PYthon implementation of the HK algorithm. Based upon algorithm and code described at https://www.ocf.berkeley.edu/~fricke/projects/hoshenkopelman/hoshenkopelman.html This is restricted to 2D and doesn't allow for periodic boundary conditions. Seems fairly easy to generalise though Currently involved two ...
from poetry.core._vendor import six from poetry.core._vendor.pyrsistent._checked_types import (InvariantException, CheckedType, _restore_pickle, store_invariants) from poetry.core._vendor.pyrsistent._field_common import ( set_fields, check_type, is_field_ignore_extra_complaint, PFIELD_NO_INITIAL, serialize, check_g...
import pyodbc import time import random import string import datetime import urllib.request import speech_recognition as sr from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer # DB Credentials dsn = 'rpitestsqlserverdatasource' user = '' password = '' database = '' server = '' # Un-comment the next t...
import contextlib import logging import os import psutil import re import shutil from packaging import version import pandas as pd import h2o from h2o.automl import H2OAutoML from frameworks.shared.callee import FrameworkError, call_run, output_subdir, result from frameworks.shared.utils import Monitoring, Namespac...
# Local imports import mongo_queue_helper import parse_schema # System imports import click import functools import logging import pyjson5 import re import traceback QUEUE_PROCESSING_TIMEOUT = 60 """Max seconds a parser might be active. This should be several standard deviations out. """ @functools.wraps(click.opti...
import os os.environ['CUDA_VISIBLE_DEVICES'] = '1' import pickle as pkl import torch import torch.nn as nn import torch.optim as optim import pandas as pd import torch.nn.functional as F from torch.autograd import Variable from model import AttentionLSTMClassifier from torch.utils.data import Dataset, DataLoader from e...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2020, <NAME> (@kbreit) <<EMAIL>> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '...
import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import numpy as np import argparse from dataset import DataSet import sys import os import heapq import math def main(): parser = argparse.ArgumentParser(description="Options") parser.add_argument('-dataName', action='store', dest='...
# Module data import requests from bs4 import BeautifulSoup import pandas as pd from datetime import timedelta,date,datetime import matplotlib.pyplot as plt import seaborn as sns import os def wrangle(wd, cache): print("Wrangling data ...") print(str.format('wd={}',wd)) data_path = wd + '/data/data.csv' ...
########################################################################## # # Copyright (c) 2016, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
#!/usr/bin/python3 """ Adds icon to notification tray that allows for connecting and disconnecting to NordVPN """ import os import signal import threading import gi gi.require_version('Gtk', '3.0') gi.require_version('AppIndicator3', '0.1') from gi.repository import Gtk as gtk from gi.repository import AppIndicator3...
from __future__ import print_function from datetime import datetime import errno import json import logging import os from requests.auth import HTTPBasicAuth import warnings from onecodex.exceptions import OneCodexException from onecodex.lib.auth import BearerTokenAuth from onecodex.utils import get_raven_client, coll...
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import io import os from collections import abc, defaultdict from typing import Dict, Iterable, List, Optional, Set, Tuple, cast from pkg_resources import Requirement from pants.backend....
import os import pathlib from typing import Dict import pickle import pandas as pd import torch from torch import nn import torch.nn.functional as F from skorch import NeuralNetRegressor from skorch.callbacks import LRScheduler from torch.optim.lr_scheduler import CyclicLR from tune_sklearn import TuneSearchCV from skl...
# coding=utf-8 # Copyright 2019 The Tensor2Tensor 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...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 23 09:51:50 2019 @author: hu """ import numpy as np class TrackState(object): New = 0 Tracked = 1 Lost = 2 Invalid = 3 Removed = 4 class Trajectory(): count = 0 def __init__(self, node, ID = None, config = None, seqInfo...
# coding=utf8 # -*- coding: utf8 -*- # vim: set fileencoding=utf8 : from __future__ import unicode_literals from django.conf import settings from django.db import models from django.db.models import Count, Max from django.db.models.signals import post_save from django.utils.encoding import python_2_unicode_compatible ...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import platform import numpy as np from chumpy import Ch, depends_on from opendr.renderer import BaseRenderer, ColoredRenderer, TexturedRenderer from opendr.renderer import draw_edge_visibility, draw_boundary_images, draw_boundaryid_image if platform.system() == 'Darwin...
import asyncio import base64 import datetime import dateutil.parser import pytz import flask from flaskext.csrf import csrf_exempt import hmac import os import sqlalchemy from sqlalchemy.dialects.postgresql import insert import urllib.parse from www import server from www import login from common.config import config f...
# 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 the Li...
from copy import deepcopy import numpy as np import optuna import pandas as pd import plotly.express as px import plotly.graph_objects as go import streamlit as st from optuna.study import Study from sklearn.metrics import ( accuracy_score, auc, f1_score, log_loss, roc_auc_score, roc_curve, ) f...
# coding: utf-8 from __future__ import annotations import os import operator import wx import wx.lib.sized_controls as sc import wx.lib.filebrowsebutton as filebrowse from bookworm import speech from bookworm.reader import EBookReader from bookworm.resources import sounds from bookworm.gui.components import ( Simp...
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\away_actions\away_actions.py # Compiled at: 2018-08-14 02:03:23 # Size of source mod 2**32: 20099 by...
# img.py #-*-coding:utf-8-*- from datetime import datetime from logging import getLogger from loris_exception import LorisException from os import path,sep,symlink,makedirs,unlink from parameters import RegionParameter from parameters import RotationParameter from parameters import SizeParameter from loris_exception i...
import asyncio import logging import signal import sqlite3 from pathlib import Path from secrets import token_bytes from typing import AsyncGenerator, Optional from chia.cmds.init_funcs import init from chia.consensus.constants import ConsensusConstants from chia.daemon.server import WebSocketServer, daemon_launch_loc...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import dataclasses import logging import time from typing import Dict, Optional import torch from reagent.core.parameters import NormalizationData from reagent.core.tensorboardX import summary_writer_context from reagent.da...
""" Utility classes --------------- """ from collections import namedtuple from collections.abc import Set __all__ = ['NameTitle', 'LabeledEnum', 'InspectableSet', 'classmethodproperty'] NameTitle = namedtuple('NameTitle', ['name', 'title']) class _LabeledEnumMeta(type): """Construct labeled enumeration""" ...
"""Service to monitor for new snapshots and create disk & flush if so.""" import argparse import datetime import logging import os import socket import subprocess import sys import time import threading import urllib import uuid import flask import retrying APP = flask.Flask(__name__) logging.basicConfig( level=...
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Poller and support classes for git repositories with a gitiles interface. This module can poll git repositories for commit activity without requiring a l...