text
stringlengths
3.07k
22.1k
#pyttsx3 is a text-to-speech conversion library in Python. #The pyttsx3 module supports two voices first is female and # the second is male which is provided by “sapi5” for windows. import pyttsx3 #pip install pyttsx3 and see the exp.txt import datetime import speech_recognition as sr # pip install Speech...
import os import json from helios.core.engine import MatchObject, CustomRequestBuilder, RequestBuilder from helios.core.utils import has_seen_before, response_to_dict import sys import logging try: import urlparse except ImportError: import urllib.parse as urlparse class ScriptEngine: scripts_active = [] ...
from typing import Dict, List, Tuple, Any import copy import json import pickle import pytest from metadict import MetaDict from metadict.metadict import complies_variable_syntax @pytest.fixture def config() -> Dict: dropout = [[0.1, 0.2]] special_tokens = [['<NUM>', '<YEAR>']] tokenizer_...
# Copyright 2021 Canonical Ltd. # See LICENSE file for licensing details. """ This module takes care of the juju-stack CLI commands. For more information, execute `juju-stack --help` """ from functools import wraps import logging import click from stack import CHARMHUB_CHANNELS, juju, StackData from stack.charmhub i...
# Copyright 2016-2022 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
import sys import argparse import numpy as np from sympy.utilities.iterables import multiset_permutations import pandas as pd from tqdm import tqdm import matplotlib.pyplot as plt import scipy.sparse import scipy.sparse.linalg import time import pickle as pkl import os def main_lin_eq(args): if Tru...
""" Copyright (c) 2018 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writin...
from kivy.config import Config Config.set('input', 'mouse', 'mouse,multitouch_on_demand') import kivy.uix.boxlayout import kivy.uix.floatlayout from kivy.uix.button import Button import kivy.uix.image from kivy.uix.label import Label import kivy.uix.scatter from kivy.uix.widget import Widget from kivy.uix.behaviors im...
#!/usr/bin/env python3 # Copyright 2016 Google 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...
# -------------------------------------------------------- # Multi-Epitope-Ligand Cartography (MELC) phase-contrast image based segmentation pipeline # # # Written by <NAME> # -------------------------------------------------------- import numpy as np import re from xml.dom import minidom import xml.etree.ElementTree...
""" Copyright (c) Microsoft Corporation. Licensed under the MIT license. Training VideoCaption Model copied/modified from HERO (https://github.com/linjieli222/HERO """ import os from os.path import join from time import time import torch from torch.nn.utils import clip_grad_norm_ from apex import amp from horovod i...
from __future__ import unicode_literals from contextlib import contextmanager from itertools import product import os import shutil import pytest from pre_commit_hooks.insert_license import main as insert_license, LicenseInfo from pre_commit_hooks.insert_license import find_license_header_index # pylint: disable=too...
"""Common widgets""" import os.path from PyQt5.QtCore import * from PyQt5.QtGui import QPainter, QBrush, QPen from PyQt5.QtWidgets import (QFrame, QLabel, QPushButton, QLineEdit, QFormLayout, QFileDialog, QCheckBox, QHBoxLayout, QVBoxLayout, QGridLayout, QProgressBar, ...
""" Support for Xiaomi Philips Lights (LED Ball & Ceiling Lamp, Eyecare Lamp 2). For more details about this platform, please refer to the documentation https://home-assistant.io/components/light.xiaomi_miio/ """ import asyncio from functools import partial import logging from math import ceil from datetime import tim...
#encoding=utf-8 ''' @Time : 2020/12/07 15:40 @Author : Inacmor @File : train.py @Noice : @Modificattion : @Author : @Time : @Detail : ''' import torch import matplotlib.pyplot as plt import numpy as np from apex import amp import os import time import sys fro...
import functools import math from math import sqrt import torch import torch.nn as nn import torch.nn.functional as F from einops import rearrange from torch import einsum from models.gpt_voice.dvae_arch_playground.discretization_loss import DiscretizationLoss from models.vqvae.vqvae import Quantize from trainer.netw...
"""Support for KNX/IP lights.""" from enum import Enum import voluptuous as vol from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR, ATTR_WHITE_VALUE, PLATFORM_SCHEMA, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, SUPPORT_COLOR_TEMP, SUPPORT_WHITE_VALU...
# Copyright 2017 Huawei, 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 appli...
import os import jieba import logging from typing import List, Dict from pytorch_transformers import BertTokenizer # self file from deepke.vocab import Vocab from deepke.config import config from deepke.utils import ensure_dir, save_pkl, load_csv jieba.setLogLevel(logging.INFO) Path = str def _mask_feature(entities...
from __future__ import unicode_literals import logging import os from contextlib import contextmanager from functools import wraps from itertools import chain from funcy import cached_property from .graph import check_acyclic from .graph import get_pipeline from .graph import get_pipelines from .graph import get_sta...
import os import re import subprocess import xml.etree.cElementTree as ET import signal from collections import deque, namedtuple Ok = namedtuple('Ok', ['val', 'msg']) Err = namedtuple('Err', ['err']) Inl = namedtuple('Inl', ['val']) Inr = namedtuple('Inr', ['val']) StateId = namedtuple('StateId', ['id']) Option = ...
__author__ = "sstober" import numpy as np import matplotlib.pyplot as plt from itertools import cycle from mne.io.pick import channel_type from six import string_types from mne.defaults import _handle_default from mne.viz.utils import tight_layout def plot_ica_overlay_evoked(evoked, evoked_cln, title, show): """...
import graphene from commons.keycloak.abstract_models import KeycloakResource from commons.keycloak.users import UserHandler from django.shortcuts import get_object_or_404 from graphene_django.forms.mutation import DjangoModelFormMutation from graphql import GraphQLError, ResolveInfo from projects.forms import Cluster...
#!/usr/bin/env python # Copy-paste from https://github.com/openslide/openslide-python/blob/master/examples/deepzoom/deepzoom_tile.py # # deepzoom_tile - Convert whole-slide images to Deep Zoom format # # Copyright (c) 2010-2015 Carnegie Mellon University # # This library is free software; you can redistribute it and/o...
import argparse import os import pathlib import typing from pycspr import factory from pycspr.api import NodeConnectionInfo from pycspr.client import NodeClient from pycspr.types import PublicKey from pycspr.types import UnforgeableReference USR1_PUB_KEY_HEX = pathlib.Path(os.getenv("NCTL")) / "assets" / "net-1" /\ ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2002-2018 <NAME> (C) 2019-2021 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). import wx import wx.html2 from psychopy.localization import _translate from psychopy.projects impo...
from __future__ import print_function, division, absolute_import import sys from collections import defaultdict from cutadapt import align, colorspace from cutadapt.seqio import ColorspaceSequence from cutadapt.compat import str_to_bytes, PY3 # Constants for the find_best_alignment function. # The function is called w...
#!/usr/bin/env python3 # Note from/to Dan. This driver appears to take a premade transfer function for # each mixer. The trick is then to load in the transfer function and perform the # actual predistortion. We therefore need to find the correct transfer function # and save this transfer function to file. These transf...
"""Utility functions.""" import contextlib import datetime import glob import os import random import shutil import string import subprocess import sys try: import configparser except ImportError: import ConfigParser as configparser from . import config_dict_template ENV = {} BLACK, RED, GREEN, YELLOW, BLUE...
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for coverage.py's improved tokenizer.""" import os.path import re import textwrap import warnings import pytest from coverage import env from coverage.p...
#!/usr/bin/python ## # Copyright 2010-2017 JetBrains s.r.o. # # 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 l...
import json import logging from time import time, sleep import core import os import re from core.helpers import Comparisons, Url _k = Comparisons._k logging = logging.getLogger(__name__) class TheMovieDatabase(object): tokens = 30 # int initial amount of tokens for TMDB rate limiting last_token_...
#!/usr/bin/env python # Copyright 2018 <NAME> # License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) """ Dataloader of the raw waveform in enhancement/separation tasks """ import random import numpy as np import torch.utils.data as dat import aps.distributed as dist from torch.utils.data.dataloader import...
#!/usr/bin/env python3 """ For a number of years now, work has been proceeding in order to bring to perfection the crudely-conceived idea of a machine that would not only supply the easy re-routing of traffic for load-balanced services, but would also be capable of automatically synchronizing single-homed LibreNMSes an...
# Copyright 2020 The DDSP 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 or agreed to in wri...
# Copyright 2017-2019 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...
import json import math import os import numpy as np from torch.utils.data import Dataset from text import symbols, text_to_sequence from utils.tools import pad_1D, pad_2D class Dataset(Dataset): def __init__( self, filename, preprocess_config, train_config, sort=False, drop_last=False ): se...
from contextlib import contextmanager import os import pytest import re import subprocess from subprocess import PIPE import sys import tempfile from typing import Tuple, List, Generator import mypy.api from mypy.test.config import package_path from mypy.util import try_find_python2_interpreter from mypy....
#!/usr/bin/env python3 """ Defines various package-level constants and helper functions. """ import argparse import os import shutil import sys from pathlib import Path from typing import Set, Union, List, Tuple from rich.console import Console from rich.text import Text from rich.theme import Theme from natsort impo...
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2012, <NAME>, 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: # # * Redistributions of source code must r...
from .numerical_utils import gaussian_kde import pandas as pd import scipy.optimize as opt import networkx as nx from copy import deepcopy import numpy as np def find_fes_fixed_points(centers, bandwidth, init_points, tol=1e-5, return_kde = False, logweights=None): #Ok only for 1d data. Not checking for saddle poin...
# -*- coding: utf-8 -*- ''' Copyright (C) 2012-2018 <NAME> Created on oct 30, 2014 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LI...
# -*- coding: utf-8 -*- class Graph: def __init__(self, edges=[]): self.vertexList = VertexList(edges) for e in edges: self.addEdge(e) self.addEdge((e[1], e[0])) def addEdge(self, edge): vertex = self.vertexList.locate(edge[0]) edgelist = vertex.edges ...
# -*- coding: utf-8 -*- """DataFrame client for InfluxDB.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import math from collections import defaultdict import pandas as pd from .client import InfluxDBClient fro...
#################################################################################################### ## ## Project: Embedded Learning Library (ELL) ## File: buildtools.py ## Authors: <NAME>, <NAME> ## ## Requires: Python 3.x ## ##################################################################################...
from hyperopt import fmin, tpe, hp, STATUS_OK, space_eval, Trials, anneal from hyperopt.fmin import generate_trials_to_calculate import pandas as pd import numpy as np import random as random from random import choice import pickle as pk from pickle import load from itertools import product from multiprocessing impor...
# Copyright (c) 2020 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...
# -*- coding: utf-8 -*- #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ The Real Gaussian Mixture VAE [1] <NAME> 2016. http://ruishu.io/2016/12/25/gmvae/ Generative Model ---------------- p(x,y,z) = p(y)*p(z|y)*p(x|z) y ~ Cat(1/K) z ~ N(mu(y), var(y)) x ~ B(mu(z)) Inference Model ---------------...
import glob import importlib import os import sys import numpy as np import scipy.io import tensorflow as tf from PIL import Image from skimage import transform # Define command line args tf.app.flags.DEFINE_string('style_image', 'starry_night.jpg', 'style image') tf.app.flags.DEFINE_string('content_dir', '.', 'conte...
#!/usr/bin/env python3.9 """t is for people that want do things, not organize their tasks.""" import hashlib import re import sys from operator import ( itemgetter, ) from optparse import ( OptionGroup, OptionParser, ) from pathlib import ( Path, ) from typing import ( Optional, ) class InvalidT...
# -*- coding: utf-8 -*- # File: tower.py import tensorflow as tf import six from six.moves import zip from abc import abstractproperty, abstractmethod, ABCMeta from ..utils import logger from ..utils.argtools import call_only_once from ..utils.naming import MOVING_SUMMARY_OPS_KEY from ..utils.develop import HIDE_DOC...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apach...
import argparse import os import posixpath import sys from docker_cookiecutter import pathmap from docker_cookiecutter.templates import ( TemplateSourceInfo, decode_template_sources, encode_template_sources, ) # Work around python's lack of consts class CONST(object): __slots__ = () DOCKER_PREAMB...
""" Author: <NAME> """ import sys import io import json import base64 from PIL import Image import numpy as np from PyQt5.QtWidgets import * from PyQt5.QtCore import * from pyqtgraph.Qt import QtCore, QtGui import pyqtgraph as pg from pyqtgraph.parametertree import Parameter, ParameterTree class DragDropLabel...
# Copyright 2020 Huawei Technologies Co., Ltd # # 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...
"""Callbacks for loss monitoring and checkpoints saving""" import os import stat import time import numpy as np from mindspore.train.callback import LossMonitor, Callback from mindspore.train.summary import SummaryRecord from mindspore import Tensor from mindspore import save_checkpoint from mindspore import log as lo...
# Copyright (c) 2019, CRS4 # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, modify, merge, publish, distribu...
import sc2 from sc2 import Race import os from sc2.constants import * from sc2.position import Pointlike, Point2 from sc2.player import Bot import torch from interpretable_ddts.agents.ddt_agent import DDTAgent from interpretable_ddts.agents.mlp_agent import MLPAgent from interpretable_ddts.opt_helpers.replay_buffer im...
import base64 import gzip import json import textwrap import uuid from collections.abc import KeysView, ValuesView from typing import Any from box import Box def lowercase_first_letter(s: str) -> str: """ Given a string, returns that string with a lowercase first letter """ if s: return s[0]....
# # Solution class # import copy import numbers import numpy as np import pickle import pybamm import pandas as pd from collections import defaultdict from scipy.io import savemat class _BaseSolution(object): """ (Semi-private) class containing the solution of, and various attributes associated with, a Py...
import json import os import shutil from datetime import datetime from dateutil.tz import gettz from contextlib import contextmanager from six.moves.urllib.parse import urlparse from conans import load from conans.client import tools from conans.client.cache.remote_registry import load_registry_txt, migrate_registry...
from torch.utils.data import SubsetRandomSampler from models.regressors import CelebaRegressor, VGGLatentDataset, LandMarksRegressor import torch from tqdm import tqdm import numpy as np from models.latent_optimizer import VGGFaceProcessing from models.vgg_face2 import resnet50_scratch_dag import matplotlib.pyplot as p...
# Copyright (C) 2021, <NAME> <<EMAIL>> from selenium import webdriver from datetime import datetime, timedelta import time import enquiries import os import platform """CONFIGS""" # Basic Info email="<EMAIL>" name = "<NAME>" floor = "C17" commitee = "Snapshot" # "IGC Committee", "Hangout", "Pop Up", "Re-Building" #...
import cv2 import numpy as np import time import threading import queue from xavier_config import qsize class VideoStream(threading.Thread): def __init__(self, url, pos, frame_q, resolution=(360, 640), threaded=False): super(VideoStream, self).__init__() self.cam = cv2.VideoCapture(url) se...
""" Tests for content parsing, and form-overloaded content parsing. """ from __future__ import unicode_literals import json from io import BytesIO import django import pytest from django.conf.urls import url from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import User from d...
# Imports here import matplotlib.pyplot as plt import numpy as np import time import json import torch from torch import nn from torch import optim import torch.nn.functional as F from torchvision import datasets, transforms, models from collections import OrderedDict import PIL from PIL import Image import argparse ...
# -*- test-case-name: twisted.test.test_compat -*- # # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Compatibility module to provide backwards compatibility for useful Python features. This is mainly for use of internal Twisted code. We encourage you to use the latest version of Python di...
import time import random import math import numpy as np import cv2 import torch from torchvision.transforms import Normalize def distanceL2(point1, point2): return math.sqrt((point1[0] - point2[0])**2 + (point1[1] - point2[1])**2) def sleep(prediction, ground_truth, frame_number): time.sleep(0.3) def c...
# coding=utf-8 # ebb_serial.py # Serial connection utilities for EiBotBoard # https://github.com/evil-mad/plotink # # Intended to provide some common interfaces that can be used by # EggBot, WaterColorBot, AxiDraw, and similar machines. # # See below for version information # # Thanks to <NAME> for bug fixes and helpfu...
#!/usr/bin/env python # encoding: utf-8 from __future__ import print_function import argparse import enum import importlib import inspect import types from pprint import pprint class Parameter(object): """ A placeholder object, used for the moment in the inline tests """ pass QUALIFIER = '.' def dotpath_jo...
# coding: utf-8 from __future__ import unicode_literals, print_function, division from dateutil import parser import datetime from campbot import utils def _format_delta(delta): if delta < 0: return "<del>{:+d}</del>".format(delta) if delta > 0: return "<ins>{:+d}</ins>".format(delta) ...
#! /usr/bin/env python # -*- coding: iso-8859-15 -*- ############################################################################## # Copyright 2003 & onward LASMEA UMR 6602 CNRS/Univ. Clermont II # Copyright 2009 & onward LRI UMR 8623 CNRS/Univ Paris Sud XI # # Distributed under the Boost ...
from __future__ import division from __future__ import print_function import argparse import math import numpy as np import scipy.sparse as sp import torch import torch.nn as nn import torch.nn.functional as F from torch import optim from torch.nn.parameter import Parameter class GCN(nn.Module): # dropout_rate ...
# Copyright 2017 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
import torch import torch.optim as optim import os import argparse import time import datetime import numpy as np import obs_configs import csv from torch.utils.data import DataLoader from amortized_assimilation.data_utils import ChunkedTimeseries, L96, TimeStack, gen_data from amortized_assimilation.models import Mul...
import pytest from pytest import param as p from jschon import JSON, JSONSchema from tests import metaschema_uri_2020_12 schema_valid = { "$id": "http://example.com", "if": { "prefixItems": [{"const": 1}] }, "then": { "contains": {"multipleOf": 2} }, "else": { "contains...
""" Tests for the `show platform ...` commands in SONiC """ # TODO: All `show` commands should be tested by running as a read-only user. # This will help catch any permissions issues which may exist. # TODO: Add tests for `show platform psustatus <PSU_NUM>` # TODO: Add tests for `show platform firmware updates`...
# 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...
# Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates # # 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 appl...
import json from django.contrib import messages from django.contrib.auth.mixins import UserPassesTestMixin from django.contrib.gis.geos import GEOSGeometry from django.contrib.gis.geos.error import GEOSException from django.db import IntegrityError, transaction from django.db.models import Q from django.forms import m...
import logging from pychonet.HomeAirConditioner import ( ENL_STATUS, ENL_FANSPEED, ENL_AIR_VERT, ENL_HVAC_MODE, ENL_HVAC_SET_TEMP, ENL_HVAC_ROOM_TEMP, ) from pychonet.EchonetInstance import ENL_GETMAP from pychonet.lib.eojx import EOJX_CLASS from homeassistant.components.climate import Climat...
# # Copyright 2019 <EMAIL> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
from .neocsvwriter import NeoCSVWriter from .verticals_parser import * from .ner_wikidata import * from .file_io import * import spacy from spacy.tokens import Doc import pickle import os import io from os.path import isfile from article_parser.coref import * from bs4 import BeautifulSoup as bs from .extract_wikidataen...
try: import requests except ImportError: from botocore.vendored import requests import json def getIndexPage(): indexPage = """ <html> <head> <meta charset="utf-8"> <meta content="width=device-width,initial-scale=1,minimal-ui" name="viewport"> <link rel="styl...
#!/usr/bin/env python3 """ Crusher is an in-memory database with configurable failure rates. Crusher is intended to simulate data failures for reliable systems homework assignments and projects. MIT License Copyright (c) 2016 <NAME>, <NAME> Permission is hereby granted, free of charge, to any person obt...
# -*- coding: utf-8 -*- import pytest from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from resources.models import Equipment, ResourceGroup, ResourceEquipment from django.urls import reverse from .utils import ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ mpi_run.py @author <NAME> <EMAIL> qualifier -> mpi_prep -> * mpi_run * -> mpi_read -> jackknifer Program Description: File to be queued through a slurm or other computing cluster, which utilizes MPI. Input (pickled): dictionary = {'out' ...
import sys, os from time import time import random import numpy as np from params import params import argparse from theano import config import lasagne from sklearn.decomposition import TruncatedSVD import data_io from proj_model_sim import proj_model_sim from proj_model_sentiment import proj_model_se...
''' script used for converting training and state set data into versioned data repo ready files pepareexport function provides the entry point where the training, state, and link files should be provided. The script currently requires that the user specifies the 'crank' number (index_name variable). The files should ...
import datetime import functools import re from decimal import Decimal from inspect import isfunction import json import dateutil from openpyxl.styles import numbers from corehq.apps.export.const import MISSING_VALUE, EMPTY_VALUE from dimagi.ext.couchdbkit import Property from dimagi.utils.modules import to_function ...
import logging import sys import anymarkup import reconcile.gql as gql import utils.vault_client as vault_client from utils.openshift_resource import OpenshiftResource from utils.oc import OC, StatusCodeError """ +-----------------------+--------------------+-------------+ | Current \ Desired | Present ...
import numpy as np import dlib import glob import cv2 import os os.chdir('/media/imi-yujun/579e63e9-5852-43a7-9323-8e51241f5d3a/yujun/Course_porject_fac e') def LoadBase(): predictor_path = 'Network/shape_predictor_68_face_landmarks.dat' detector = dlib.get_frontal_face_detector() predictor = dlib.shape_p...
# all credits to https://github.com/Rapptz/RoboDanny import datetime import re import parsedatetime as pdt from dateutil.relativedelta import relativedelta from discord.ext import commands from .formats import human_join, plural class ShortTime: compiled = re.compile("""(?:(?P<years>[0-9])(?:years?|y))? ...
# coding :utf-8 # # The MIT License (MIT) # # Copyright (c) 2016-2018 yutiansut/QUANTAXIS # # 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 t...
import pytest from leapp.exceptions import StopActorExecutionError from leapp.libraries.actor import library from leapp.libraries.stdlib import api from leapp.models import StorageInfo, FstabEntry, MountEntry, SystemdMountEntry, XFSPresence class run_mocked(object): def __init__(self): self.called = 0 ...
import numpy as np import pandas as pd import pandas.util.testing as tm import dask.dataframe as dd from dask.dataframe.utils import (shard_df_on_index, meta_nonempty, make_meta, raise_on_meta_error) import pytest def test_shard_df_on_index(): df = pd.DataFrame({'x': [1, 2, 3, 4...
"""Utility functions.""" from __future__ import annotations import dis import sysconfig import argparse import cheap_repr import gc import inspect import jsonpickle import more_itertools import os import re import subprocess import sys from functools import lru_cache from pathlib import Path from pprint import pform...
from datetime import datetime, timedelta import numpy as np import pandas as pd import matplotlib.pyplot as plt from .util import ( complete_df_1loc_1age, shift_date_str, default_first_day_in_plot, estimate_Reff, ) from .load_data import load_dataframe_dep, DEPARTMENTS, population fmt = "%Y-%m-%d" d...
""" Copyright 2019 <NAME>. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distribut...
# coding: utf-8 from __future__ import unicode_literals, print_function, division, absolute_import import os import re from django.db import models from django.db.models.signals import post_save from django.utils.encoding import smart_text from guardian.shortcuts import assign_perm, get_perms_for_model from pyxform im...