text
stringlengths
3.07k
22.1k
import argparse import pickle import re from collections import Counter from os import walk, mkdir, makedirs from os.path import relpath, join, exists from typing import Set from tqdm import tqdm from docqa import config from docqa.config import CORPUS_DIR from docqa.data_processing.text_utils import NltkAndPunctToke...
""" A tornado web service for handling TaskQueue request from application servers. """ import argparse import json import logging import monotonic import signal import sys from kazoo.client import KazooClient, KazooState, NodeExistsError from tornado import gen, httpserver, ioloop from tornado.web import Application,...
#!/usr/bin/env python # coding: utf-8 from rouge import Rouge import torch import time import torch.nn as nn import numpy as np from torch.utils.data import TensorDataset, DataLoader, RandomSampler import torch.nn.functional as F from torch.nn import CrossEntropyLoss import datasets import logging from datasets import ...
from . import table from . import state import pymunk import numpy as np import math class Simulation: """ Has: A TableInfo A State """ def __init__(self, table_info: table.TableInfo): self.table_info = table_info self.state: state.GameState = None self.space:...
from typing import Any, Dict, Optional, Union, cast import logging from django.core.exceptions import ValidationError from django.core.validators import validate_email, URLValidator from django.core import signing from django.db import IntegrityError from django.http import HttpRequest, HttpResponse, HttpResponseRedir...
from typing import Optional import cv2 import numpy as np import torch import torch.nn.functional as F from efficientnet_pytorch.utils import MemoryEfficientSwish from timm.models.layers.activations import Swish from torch import nn from torch.nn import AdaptiveAvgPool2d, BatchNorm2d, Conv2d, Parameter def load_imag...
# Copyright The OpenTelemetry 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 ...
""" Package for processing with autoRIFT """ import argparse import json import logging import os import shutil from datetime import datetime from pathlib import Path from secrets import token_hex from typing import Tuple import boto3 import numpy as np import requests from hyp3lib.fetch import download_file from hyp...
#!/usr/bin/env python3 # r""" hierarchical_configparser.py: Like a regular configparser, but supports the INCLUDE= statement and validation.. Include Statement ----------------- If INCLUDE=filename.ini is present in any section, the contents of that section are read from filename.ini and provided as base definitions....
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import datetime import io import os import random import traceback from collections import defaultdict import numpy as np...
## @file # This file is used to define class objects of INF file [Ppis] section. # It will consumed by InfParser. # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent ''' InfPpiObject ''' from edk2basetools.UPT.Library.ParserValidate import IsVali...
from __future__ import absolute_import, division, print_function, unicode_literals import os, sys, base64, io, json, subprocess, random, string, tarfile from collections import OrderedDict from typing import Dict, Any from .. import logger from . import gzip_compress_bytes from .compat import StringIO from .crypto im...
import logging import os import re import sys import time from packaging import version from bugswarm.common.credentials import DATABASE_PIPELINE_TOKEN from python_log_parser import parse_log from bugswarm.common import log from bugswarm.common.artifact_processing import utils as procutils from bugswarm.common.log_do...
import itertools import operator from io import StringIO import pytest import semver import toml from encapsia_cli.plugininfo import PluginInfo, PluginInfos, PluginSpec, PluginSpecs # Note: these need to be both extended (in coverage) and reduced (in test data duplication). @pytest.fixture( scope="module", ...
""" """ from io import open import json import logging from functools import wraps from hashlib import sha256 from pathlib import Path import os import shutil import sys import tempfile from urllib.parse import urlparse import boto3 import requests from botocore.exceptions import ClientError from tqdm import tqdm #fro...
# This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """ Unittests for Bio.Align.Applications interface for MAFFT This code is part of the Biopython distribution and governed by its license. Please see t...
import warnings from typing import Any, Dict, List, Optional, Sequence from libddog.common.bases import Renderable from libddog.common.errors import ( RequestQueryNamesNotUnique, UnresolvedFormulaIdentifiers, ) from libddog.common.types import JsonDict from libddog.dashboards.enums import ( Comparator, ...
""" Test the lgr model """ import os import sys import shutil import numpy as np import flopy try: import pymake except: print("could not import pymake") cpth = os.path.join("temp", "t035") # delete the directory if it exists if os.path.isdir(cpth): shutil.rmtree(cpth) exe_name = "mflgr" v = flopy.which(...
#!/usr/bin/env python # Two environmental variables influence this script. # # GDAL_CONFIG: the path to a gdal-config program that points to GDAL headers, # libraries, and data files. # # PACKAGE_DATA: if defined, GDAL and PROJ4 data files will be copied into the # source or binary distribution. This is essential when...
import re """ --- Day 10: The Stars Align --- It's no use; your navigation system simply isn't capable of providing walking directions in the arctic circle, and certainly not in 1018. The Elves suggest an alternative. In times like these, North Pole rescue operations will arrange points of light in the sky to guide ...
""" Contains geometrical and graphical functions. """ import math from base import * def distance(p1, p2): return round(math.sqrt((p1[0] - p2[0])**2 + (p1[1] - p2[1])**2), 3) def middle(p1, p2, proportion = 0.5): """ proportion -> bigger is closer to the second point """ k1, k2 = 1 - proportion,...
"""Split files or tasks for distributed processing across multiple machines. This tackles parallel work within the context of a program, where we split based on input records like fastq or across regions like chromosomes in a BAM file. Following splitting, individual records and run and then combined back into a summa...
#!/opt/datadog-agent/embedded/bin/python """ Datadog www.datadoghq.com ---- Cloud-Scale Monitoring. Monitoring that tracks your dynamic infrastructure. Licensed under Simplified BSD License (see LICENSE) (C) Datadog, Inc. 2010-2016 all rights reserved """ # set up logging before importing any ...
import numpy as np from __context__ import src from src import mathutils as mu def estimateHomographies(allDetections: list): """ Input: allDetections -- list of tuples (one for each view). Each tuple is (Xa, Xb), a set of sensor points and model points respectively ...
from __future__ import absolute_import from __future__ import print_function import ujson from django.http import HttpResponse from mock import patch from typing import Any, Dict, List, Text, Union from zerver.lib.actions import ( do_change_is_admin, do_set_realm_property, do_deactivate_realm, ) from ze...
import torch import torch.nn.functional as F """ Functions for performing differentiable bilinear cropping of images, for use in the object discriminator Modified from https://github.com/google/sg2im/blob/master/sg2im/bilinear.py """ def stn(image, transformation_matrix, size): grid = torch.nn.functi...
from robot import parsing from robot.variables.filesetter import VariableFileSetter from robot.variables.store import VariableStore from robot.variables.variables import Variables from robot.libdocpkg.robotbuilder import LibraryDocBuilder from robot.utils.importer import Importer from robot.libraries import STDLI...
# -*- coding: utf-8 -*- """ Created on Mon Jun 5 13:26:37 2017 @author: rickdberg POC grid, using Seiter, then Jahnke, then Marquardt et al 2010 relationship """ import numpy as np import rasterio from rasterio import Affine from rasterio.warp import reproject, Resampling import matplotlib.pyplot as plt import car...
import click import sys import re import time import logging import json from .utils import * import elasticsearch from ..api import * logger = logging.getLogger(__name__) # Elasticsearch versions supported version_max = (2, 0, 0) version_min = (1, 0, 0) REGEX_MAP = { 'timestring': r'^.*{0}.*$', 'newer_tha...
""" Scikit-like estimators for the attack model and shadow models. """ import sklearn import numpy as np from tqdm import tqdm class ShadowModelBundle(sklearn.base.BaseEstimator): """ A bundle of shadow models. :param model_fn: Function that builds a new shadow model :param shadow_dataset_size: Siz...
import numpy as np import pandas as pd from numpy import pi from config import conf import region __doc__ = """ En este paquete se definen funciones para crear y calcular todo lo que tenga que ver con valores eigen, vectores eigen , matrices de valores eigen y refe rente. Este modulo es equivalente a: f03_Valor_Eigen...
"""Functions to evaluate the performance of the translation model during training""" import multiprocessing as mp import csv import os import numpy as np import pandas as pd import tensorflow as tf from sklearn.svm import SVC, SVR from sklearn.model_selection import LeaveOneGroupOut from sklearn.preprocessing ...
#!/usr/local/bin/python3 import shutil import pprint import zipfile import os import sys import re import requests import datetime import argparse from metar import Metar times = { 'morning': 31200, # 8:40 'afternoon': 43200, # 12:00 'evening': 55800, # 15:30 } parser = argparse.ArgumentParser(descript...
import os #limit the number of threds numpy/scipy are using #os.environ["OMP_NUM_THREADS"] = "1" import scipy.sparse import numpy as np from sklearn.metrics import pairwise_distances from plotting import * MACHINE_EPSILON = np.finfo(np.double).eps def entropy_and_prob(d2=np.array([]), beta=1.0): """ Com...
#!/usr/bin/python # -*- coding: utf-8 -*- from ansible.module_utils.basic import AnsibleModule import git import itertools import multiprocessing import os import signal import time DOCUMENTATION = """ --- module: git_requirements short_description: Module to run a multithreaded git clone options: repo_info: d...
# %% # Importing the matplotlib.pyplot from logging import PlaceHolder import matplotlib.pyplot as plt import matplotlib.ticker as mticker import numpy as np from pandas.core import base import matplotlib as mpl import seaborn as sns import pandas as pd def plotNetworPerformance(opt_sheet_name:str,rank_sheet_name:st...
# kado/store/mixin.py # =================== # # Copying # ------- # # Copyright (c) 2018 kado authors. # # This file is part of the *kado* project. # # kado is a free software project. You can redistribute it and/or # modify if under the terms of the MIT License. # # This software project is distributed *as is*, WITHOU...
from caffe2.proto import caffe2_pb2 from caffe2.python import core, workspace import caffe2.python.hypothesis_test_util as hu import caffe2.python.serialized_test.serialized_test_util as serial from hypothesis import given, settings import hypothesis.strategies as st import numpy as np def _fill_diagonal(shape,...
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """This module corresponds to the coord directory in idlutils. """ import numpy as np import astropy.units as u import astropy.coordinates as ac class SDSSMuNu(ac.BaseCoordinateFrame): """SDSS Great Circle Coordinates Att...
""" @author: <NAME> @email : <EMAIL> @date : 21/4/21 11:29 am @desc : """ import multiprocessing import os import time from decimal import Decimal import numpy as np import pandas as pd from sklearn.metrics import accuracy_score from sklearn.model_selection import KFold from fuzzytrees.fdt_base import Fuzzification...
import tensorflow as tf from datasets import dataset_utils from datasets import flowers import matplotlib.pyplot as plt import tensorflow.contrib.slim as slim from datasets import download_and_convert_flowers import numpy as np from preprocessing import inception_preprocessing flowers_data_dir = '../../data/flower' t...
######################################################################### ## Simulation of artificial bulk RNA-seq datasets from scRNA-seq data # ######################################################################## import pandas as pd import numpy as np import glob import os import argparse import gc def create...
import os; import numpy as np; from keras.models import Model; from keras.layers.embeddings import Embedding; from keras.models import Sequential,load_model; from keras.optimizers import rmsprop,adam,adagrad,SGD; from keras.callbacks import EarlyStopping,ModelCheckpoint,ReduceLROnPlateau; from keras.preprocessing.text ...
import tensorflow as tf import numpy as np from Ecoc import ECOC from sklearn.preprocessing import StandardScaler def generate_rectangles(min_area=130, max_area=170, num_points=100): points = [] for first in range(28): # make half rectangles horizontally aligned for second_hor in range(28):...
# -*- coding: utf-8 -*- import logging import json import string import socket try: from urllib.request import Request, build_opener except ImportError: # Python 2 from urllib2 import Request, build_opener try: from urllib.error import URLError, HTTPError as _HTTPError except ImportError: # Pytho...
#! /usr/bin/env python # System imports from setuptools import setup, Extension, find_packages from setuptools.command.test import test as TestCommand import os import subprocess import platform import sys import warnings import glob import tempfile import textwrap import subprocess try: from Cython.Build import c...
import sqlite3 as sql import random import datetime import tkinter as tk from tkinter import filedialog as filed from collections import OrderedDict as od from Adjusting_Rank import Main #---------------------------------------------------------- customer = ['AZ_Canning', 'Abrams_Airborne', 'Air_Liquide_Bagdad', 'Air...
# -*- coding: utf-8 -*- ########################################################################## # # pgAdmin 4 - PostgreSQL Tools # # Copyright (C) 2013 - 2017, The pgAdmin Development Team # This software is released under the PostgreSQL License # ####################################################################...
''' Direct Python port of a few functions from NSL toolbox implementing early stage auditory processing. All credits go to the original authors. The below implementation has been tested against the original Matlab code (http://nsl.isr.umd.edu/downloads.html) and yielded identical results. Implementation: <NAME> (<EMAI...
from datetime import datetime from vkwave.bots import ( DefaultRouter, SimpleBotEvent, simple_bot_message_handler, PayloadFilter, ) from sql import crud from utils import functions from keyboards.kb import menu, profile_kb from utils.constants import user_tasks_list, avatar_name, user_completed_tasks_...
#!/usr/bin/env python # From Hendrik import math, string, sys, os import scipy import scipy.integrate def norm(k_vec): # the norm of a 3d vector return math.sqrt(k_vec[0]**2+k_vec[1]**2+k_vec[2]**2) def W_k(k_vec): # the Fourier transform of the survey volume a=k_vec[0]*l[0]/2 b=k_vec[1]*l[1]/2 c=k_v...
""" Functions to create space time dataset lists Usage: .. code-block:: python import grass.temporal as tgis tgis.register_maps_in_space_time_dataset(type, name, maps) (C) 2012-2016 by the GRASS Development Team This program is free software under the GNU General Public License (>=v2). Read the file COPYI...
import glob import pandas as pd import json import os from collections import defaultdict from ast import literal_eval from pathlib import Path from settings import CRAWLING_OUTPUT_FOLDER, SCORING_OUTPUT_FOLDER, PATTERNS_PATH, YEAR, ACCEPTED_LANGUAGES # TODO noting patterns problems here # [environnement, durabilite...
import os import warnings from typing import Any, Tuple, Union from pathlib import Path import torchaudio from torch import Tensor from torch.utils.data import Dataset from torchaudio.datasets.utils import ( download_url, extract_archive, ) URL = "https://datashare.is.ed.ac.uk/bitstream/handle/10283/3443/VCTK...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Torch Lightning DataModule for KingSoopers data.""" import os from typing import Optional, List import pandas as pd import pytorch_lightning as pl from torch.utils.data import DataLoader from sklearn.pipeline import make_pipeline from glo.units import ( ureg, Un...
import datetime import json import os import shutil from pathlib import Path from django.core.exceptions import ValidationError from django.core.files import File from django.utils import timezone from django.utils.text import get_valid_filename from rest_framework import status from content_management.library_db_uti...
# -*- coding: utf-8 -*- ############################################################################### # Copyright (c), Forschungszentrum Jülich GmbH, IAS-1/PGI-1, Germany. # # All rights reserved. # # This file is part of the Masci-tools package. ...
import os import json import random import pandas as pd import torch import torchaudio import librosa import numpy as np import soundfile as sf import copy_outputs from pathlib import Path from datasets import Dataset, ClassLabel, load_dataset, load_metric, concatenate_datasets from dataclasses import dataclass, fiel...
import os import subprocess import time import yaml import configparser import re import boto3 import pprint from tabulate import tabulate pp = pprint.PrettyPrinter(indent=4) # subprocess.check_call(["aws", "ecr", "get-login", ""]) # create repository def create_ecr_repo(services): obj = {} for servic...
import sys, math import numpy as np from scipy.misc import imresize as resize from scipy.misc import toimage as toimage import gym from gym import spaces from gym.spaces.box import Box from gym.utils import seeding from gym.envs.classic_control import rendering import pyglet from pyglet import gl import tensorflow...
import numpy as np import tensorflow as tf from scipy import sparse as sp from spektral.utils import pad_jagged_array def to_disjoint(x_list=None, a_list=None, e_list=None): """ Converts lists of node features, adjacency matrices and edge features to [disjoint mode](https://graphneural.network/spektral/d...
from jax.config import config config.update("jax_enable_x64", True) import jax.numpy as np from jax import jit import functools from jax import random from jax.scipy.special import erf import neural_tangents as nt from neural_tangents import stax import itertools import tensorflow_datasets as tfds """ Load the MNI...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) """A smeagle model will load one or more Json corpora, and do a solve. This is adopted from https://github.com/buildsi/sme...
""" Benchmark different solver of the same CSC univariate or multivariate problem. This script needs the following packages: pip install pandas pyfftw pip install alphacsc/other/sporco - Use bench_methods_run.py to run the benchmark. The results are saved in alphacsc/figures. - Use bench_methods_plot.py to ...
from __future__ import print_function import argparse, csv, os, sys import numpy as np import matplotlib.pyplot as plt import rospy import baxter_interface from baxter_interface import CHECK_VERSION # from baxter_trajectory import Trajectory POSITION, VELOCITY, TORQUE = range(3) LEFT_LIMB, RIGHT_LIMB, BOTH_LIMBS = ran...
#!/usr/bin/env python3 import numpy as np np.random.seed(1) import random random.seed(1) import tensorflow as tf tf.set_random_seed(1) import os import skimage.io as io from PIL import Image import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from keras.preprocessing.image import Imag...
import logging import os import pyarrow import shutil import types from typing import Tuple, Any, List, Iterator from pyarrow import filesystem from urllib.parse import urlparse try: from s3fs import S3FileSystem # pyarrow calls mkdirs which is an alias to makedirs which is implemented as no-o...
import os import tensorflow as tf import albumentations as A os.environ["SM_FRAMEWORK"] = "tf.keras" import segmentation_models as sm from segmentation_models.base import Loss from segmentation_models.base import functional as F SMOOTH = 1e-5 class BCEJaccardLoss(Loss): def __init__( self, beta...
import os import sys import argparse import torch import numpy as np from collections import OrderedDict import continual_benchmark.dataloaders.base from continual_benchmark import dataloaders from continual_benchmark.dataloaders.datasetGen import data_split import torch.utils.data as data from vae_experiments.valida...
# -*- coding: utf-8 -*- # # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
# import tensorflow as tf import torch import numpy as np import sklearn.manifold.t_sne class TensorAxis: N = 0 H = 1 W = 2 C = 3 class CSFlow: def __init__(self, sigma=float(0.1), b=float(1.0)): self.b = b self.sigma = sigma def __calculate_CS(self, scal...
import torch import torch.nn as nn import functools from torch.autograd import Variable import numpy as np from .vgg_model import Vgg19 ############################################################################### # Functions ############################################################################### def weight...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Dec 11 16:32:58 2018 @author: """ import os import pandas as pd import numpy as np import random from collections import deque import featuretools as ft import copy def read_data_z(data_dir="/content/EloMerchantKaggle/data", version = '2',...
# Analysis module import geopandas import numpy as np import re import os import rasterstats import pandas as pd from geopandas.tools import sjoin def lookup_CHM_path(shp_path, lidar_list): """Find CHM file based on the shp filename""" #Get geoindex from shapefile and match it to inventory of CHM rifles ...
# # Jasy - Web Tooling Framework # Copyright 2010-2012 Zynga Inc. # from jasy.js.output.Compressor import Compressor # Shared instance compressor = Compressor() pseudoTypes = set(["var", "undefined", "null", "true", "false", "this", "arguments"]) builtinTypes = set(["Object", "String", "Number", "Boolean", "Array", ...
# # Copyright 2008 <NAME> <<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 wr...
from typing import ( Any, ClassVar, Dict, List, Optional, Union, Set, Type, get_type_hints, ) from enum import EnumMeta from warnings import warn from specklepy.logging.exceptions import SpeckleException from specklepy.objects.units import get_units_from_string from specklepy.trans...
"Custom macro" load("@bazelbuild_buildtools//buildifier:def.bzl", "buildifier_test") load("@build_bazel_rules_nodejs//:index.bzl", "generated_file_test") load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "js_library") load("@npm//@bazel/esbuild:index.bzl", _esbuild = "esbuild") load("@npm//@bazel/t...
import dgl import backend as F import numpy as np import unittest from torch.utils.data import DataLoader from collections import defaultdict from itertools import product def _check_neighbor_sampling_dataloader(g, nids, dl, mode): seeds = defaultdict(list) for item in dl: if mode == 'node': ...
# Copyright 2014 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 accompa...
import asyncio import codecs import hashlib import json import logging import time from abc import abstractmethod from concurrent.futures import ThreadPoolExecutor from typing import List, Optional, Tuple import aerospike from .storage import Storage logger = logging.getLogger(__name__) SHORT_MODE_EXCLUDE = ('batch...
""" Get, read, and parse data from `PVGIS <https://ec.europa.eu/jrc/en/pvgis>`_. For more information, see the following links: * `Interactive Tools <https://re.jrc.ec.europa.eu/pvg_tools/en/tools.html>`_ * `Data downloads <https://ec.europa.eu/jrc/en/PVGIS/downloads/data>`_ * `User manual docs <https://ec.europa.eu/j...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# standard libs import os, random import glob import argparse # tensorflow stuff import tensorflow as tf from tensorflow.keras import layers # math and images libs import numpy as np import matplotlib.pyplot as plt from PIL import Image def load_image( infilename) : img = Image.open( infilename ) img.load(...
import logging import pdb import numpy as np import os import pandas as pd import torch import torch.nn as nn from sacred import Experiment from sacred.observers import FileStorageObserver from tensorboardX import SummaryWriter from torch.optim import Adam from torch.optim.lr_scheduler import ReduceLROnPlateau, Cycli...
#!/usr/bin/env pytest ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal_retile.py testing # Author: <NAME> <<EMAIL>> # ############################################################################### # Copyright (c) 2010, <NAME> <e...
# Importing dependencies from math import floor, exp # Use high-quality randomness # The "secrets" library could also work (Python >= 3.6) from os import urandom from random import uniform # Upper bound on all the values of sigma MAX_SIGMA = 1.8205 INV_2SIGMA2 = 1 / (2 * (MAX_SIGMA ** 2)) # Precision...
# -*- coding: utf-8 -*- from selenium.webdriver.common.by import By class LoginPageLocators: INPUT_NANACO_NUMBER_UPPER = (By.CSS_SELECTOR, '#login_card > table:nth-child(15) > tbody > tr:nth-child(1) > td.centerCell > input') INPUT_NANACO_NUMBER_LOWER = (By.CSS_SELECTOR, '#login_password > table > tbody > tr:...
import logging import os import sys import tempfile import time import click from kluctl import get_kluctl_package_dir from kluctl.cli.command_result import output_command_result, output_validate_result, output_yaml_result from kluctl.cli.utils import build_seen_images, project_command_context from kluctl.kluctl_proj...
import hashlib import json import os import sys import requests base_url = "https://api.github.com" if os.getenv("GITHUB_TOKEN") != None: req_headers = {"Authorization": f"Bearer {os.getenv('GITHUB_TOKEN')}"} else: req_headers = {} def requests_API(method, link, datadict=None): method = method.upper() ...
""" Copyright (c) 2012 <NAME> <http://sixpinetrees.blogspot.com/> 2017 Nordic Semiconductor ASA CoAP option processing. """ import collections import struct from itertools import chain from abc import ABC, abstractmethod from piccata.constants import * class Options(object): """Represent CoAP Heade...
import functools import logging import os from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple, cast from pip._vendor.packaging.utils import canonicalize_name from pip._vendor.packaging.version import parse as parse_version from pip._vendor.resolvelib import BaseReporter, ResolutionImpossible from pip._v...
import os, re, glob import random def is_str(obj): return isinstance(obj, basestring) or isinstance(obj, str) or isinstance(obj, unicode) class Command(object): def __init__(self): self.command = None class Scene(Command): def __init__(self, sound, image): self.command = "scene" s...
# Copyright 2017 Battelle Energy Alliance, 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 t...
""" A DataNodeServer which serves APEX weather from disk. Based on the original example, which served modified APEX weather files. """ import glob import os import six import time import numpy as np from os import environ from autobahn.wamp.types import ComponentConfig from autobahn.twisted.wamp import ApplicationSe...
import utils, torch, time, os, pickle import numpy as np import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from torch.utils.data import DataLoader from torchvision import datasets, transforms class decoder(nn.Module): # Network Architecture is exactly same as in infoGAN (https:/...
#!/usr/bin/env python3 """ Cross-compiler toolchain build script Possible target platforms are: aarch64 ARM64 amd64 AMD64 (x86-64, x64) arm32 ARM ia32 IA-32 (x86, i386) ia64 IA-64 (Itanium) mips32 MIPS little-endian 32b mips32eb MIPS big-endian 32b ...
#!/usr/bin/env python3 # # Author: <NAME> <<EMAIL>> # import sys, asyncio, json, traceback, inspect from concurrent.futures import CancelledError from aio_pika import connect, Message, ExchangeType import pika.exceptions try: from task import NoFinalResult except ImportError: class NoFinalResult(Exception): ...
# -*- coding: utf-8 -*- """Utility functions for audio clip manipulation and filtering. This module defines functions for audio manipulation that are used throughout the project. """ import subprocess import numpy as np import matplotlib.mlab as mlab import util from pydub import AudioSegment import os def get_leng...
from __future__ import with_statement, print_function, unicode_literals, division from conceptnet5.util import get_support_data_filename PHONETIC_DICT = {} def _setup(): """ Read the dictionary file, creating a mapping from words to their phonetics. When multiple pronunciations are given, keep the la...