text
stringlengths
3.07k
22.1k
# -*- encoding: utf-8 -*- import os import time import pypath from urlparse import urljoin from datetime import datetime from kivy.app import App from kivy.resources import resource_find from kivy.properties import ObjectProperty, ConfigParserProperty, AliasProperty from kivy.metrics import dp from kivy.core.window imp...
# Copyright 2013 Google Inc. All Rights Reserved. """Helper action for the gcloud --shell[=shell-path] option. """ import argparse import os import StringIO import subprocess import sys import textwrap from googlecloudsdk.core import log from googlecloudsdk.core.util import files as file_utils def EqualSpacedColmu...
# (c) copyright by Politecnico di Milano # original authors: <NAME>, <NAME>, <NAME> # # traffic_app.py # This file contains the software code for the traffic count app. import os import cv2 import sys from sys import argv # this can be removed if FARD is installed with pip sys.path.append('../../') import netifaces i...
# Author: <NAME> # This script divides a big image into smaller images using a sliding window. # It also divides corresponding bounding box annotations. # NOTE: This file is no longer needed as sub-images are generated in data-loader # read the image import numpy as np import cv2 import copy import os import sys from ...
import re import numpy as np import nltk #import spellChecker as sc from collections import Counter ''' Words to be masked ''' set_conectores_aditivos = ["más aún", "todavía más", "incluso", "así mismo", "de igual modo","igualmente", "por otro lado", "también", "tampoco", "además"] set_conectores_adversativos = ["no o...
from datetime import datetime, time, date from dateutil.rrule import weekday, rrule from django.db import models from django.db.models import Q from django.utils.functional import cached_property from django.utils.translation import ugettext_lazy as _ from ...constants import frequency, status from ...utils.slug_util...
# Copyright 1999-2020 Alibaba Group Holding 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 a...
import argparse import psutil import signal import subprocess import threading import time import uuid import tempfile import shutil import pytest import os from rebus.agent import Agent, AgentRegistry from rebus.bus import BusRegistry, DEFAULT_DOMAIN import rebus.agents import rebus.buses rebus.agents.import_all() r...
from pytocl.driver import Driver from pytocl.car import State, Command import torch import math import numpy as np import logging from pytocl.driver import Driver from nn import train import random from torch.autograd import Variable class ANNDriverVerna(Driver): def __init__(self, model_file, H, depth, record_tr...
""" Pytorch implementation of VGG models. Reference: [1] . Simonyan and <NAME>. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015. """ import torch import torch.nn as nn from net.spectral_normalization.spectral_norm_conv_inplace import spectral_norm_conv from net.spectral_normalization...
# -*- coding: utf-8 -*- """Contains utility functions for building references.""" # pylint: disable=wildcard-import,redefined-builtin,unused-wildcard-import from __future__ import absolute_import, division, print_function from builtins import * # pylint: enable=wildcard-import,redefined-builtin,unused-wildcard-import ...
import abc import logging import os import random from LAC import LAC from . import utils from .callbacks import (CallbackWrapper, EntropyCallback, IDFCallback, NgramsCallback) def read_input_files(input_files, callback=None, log_steps=1000): if isinstance(input_files, str): inpu...
""" Copyright 2014 Rackspace 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 dist...
from machine import Pin, UART import time import sys class Serial: """ 使用ESP32的串口连接外部设备 """ def __init__(self, id=2, baudrate=2000000, rx_pin=14, tx_pin=12, timeout=2000, timeout_char=10): import select self.uart = UART(id, baudrate, rx=rx_pin, tx=tx_pin, timeout=...
import framework from models.encoder_decoder import add_eos from typing import Tuple, Dict, Any, Optional, Callable, List import torch import torch.nn.functional as F class SequenceTestState: def __init__(self, batch_dim: int = 1): self.n_ok = 0 self.n_total = 0 self.batch_dim = batch_dim ...
''' Render an HTML visualization of coverage over time using SVG and Javascript. Based on the original idea from the export_svg example https://github.com/Vector35/binaryninja-api/blob/master/python/examples/export_svg.py ''' import sys from datetime import datetime from pathlib import Path from binaryninja import ...
from lxml import etree from datetime import datetime import csv import codecs import ujson import re from tqdm import tqdm import os # all of the element types in dblp all_elements = {"article", "inproceedings", "proceedings", "book", "incollection", "phdthesis", "mastersthesis", "www"} # all of the feature types in d...
# a to-bf compiler from __future__ import annotations from typing import cast, Union, List, Tuple, Set, Dict, Type, Callable import io src_extension = "txt" def split(s:str, sep=None, maxsplit=-1) -> list: if sep == None: return list(filter(len, map(str.strip, s.strip().split(maxsplit=maxsplit)))) e...
import configparser import datetime import glob import h5py import json import os import requests import smtplib import subprocess import sys import time import threading from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.image import MIMEImage config = configparser.Co...
# -*- coding: utf-8 -*- """ Created on Sun Mar 28 22:07:27 2021 Author: <NAME> Analysis Dashboard Module Part of the PETA-Bot hackathon repo. This module is called using streamlit to start a local web app analysis dashboard for viewing and interacting with current and historical price data and price edge for the DOD...
import numpy as np import gym from gym import spaces from gym.envs.registration import register from ..core import Bullet from ..scene_maker import BulletSceneMaker from ..collision_checker import BulletCollisionChecker from ..robots import Panda import pybullet as p from spatial_math_mini import * class PandaEnvBase:...
# Copyright 2019 The dm_control 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 i...
from __future__ import annotations import datetime import json import typing from decimal import Decimal from enum import Enum import pytz from pydantic import Field, PrivateAttr from alpaca_trade_api.models import aux from alpaca_trade_api.models import exceptions from alpaca_trade_api.rest import APIError from sen...
#!/usr/bin/env python3 import glob import os import re import sys import tempfile import pyinotify import argparse import shutil from subprocess import Popen, PIPE from time import gmtime, strftime, time ROOT = os.path.dirname(__file__) PDFDIR = os.path.join(ROOT, "out-pdf") OUTMD = os.path.join(PDFDIR, "ou...
from PySAM.PySSC import PySSC import requests from collections import OrderedDict from collections.abc import Iterable import tempfile import os import sys import json import tarfile import subprocess from ctypes import * """ This Script compares the SSC input variables and the defaults for these input variable...
from django.shortcuts import render, redirect, reverse, get_object_or_404, HttpResponse from django.views.decorators.http import require_POST from django.contrib import messages from django.conf import settings import stripe import json from bag.contexts import bag_contents from .forms import OrderForm from .models imp...
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
import re import requests import hashlib import datetime import uuid import time import json import sys from datetime import timedelta, timezone from urllib.request import Request, urlopen from apscheduler.schedulers.blocking import BlockingScheduler import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRe...
import ast import json import base64 import hashlib import hmac import pyDes import zeep import xmltodict from django.conf import settings from django.urls import reverse from django.apps import apps from .choices import AUTHORIZED, PREAUTHORIZED, CANCELLED, REJECTED,\ CONFIRMED, REFUNDED, ERROR # See "TPV-Virtu...
# -*- encoding: utf-8 -*- ''' @Email : <EMAIL> @Time : 02-07 2021 ''' import numpy as np import tensorflow as tf from tqdm import tqdm import tensorflow.keras.backend as K import os def is_string(s): """判断是否是字符串 """ return isinstance(s, str) def convert_to_unicode(text, encoding='utf-8', errors='ignor...
from operator import eq from typing import AbstractSet, Tuple from . import expression_walker as ew from .exceptions import NeuroLangException from .expressions import Constant, Definition, FunctionApplication, Symbol from .utils import NamedRelationalAlgebraFrozenSet, RelationalAlgebraSet eq_ = Constant(eq) class ...
import argparse import os import torch from network.coplenet import COPLENet from utils.misc import fast_hist import datasets import optimizer import numpy as np import colorsys import skimage parser = argparse.ArgumentParser(description='CopleNet for medical image segmentation') parser.add_argument('--dataset', type=...
import json from datetime import datetime from dateutil.tz import tz from redminelib.exceptions import ResourceNotFoundError import model import nexus from accessories import redmine_lib from resources import issue from resources.logger import logger TGI_TRACKER_ID = 9 def tgi_feed_postman(row): collections = ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Aug 29 14:54:12 2018 @author: maximov """ import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data from torchvision import transforms, utils from torch.utils.data.sampler import Sampler import os from os import listdi...
""" Test the model using h5 files as the input """ from data_tools import load_odom_data, load_data_multi_timestamp from networks import build_deeptio from keras import backend as K import tensorflow as tf import mdn from os.path import join import plot_util import math from eulerangles import mat2euler, euler2quat, e...
# Nonlinear regression using variational inference for parameters. # For simplicity we treat output noise variance as a fixed parameter. # Adapted from # https://brendanhasz.github.io/2019/07/23/bayesian-density-net.html import superimport from __future__ import absolute_import from __future__ import division from _...
import os import codecs import types from pathlib import Path import operator import numpy as np from ._filegen import FileGen from . import _flatten_dtype from ._readtextmodule import (_readtext_from_filename, _readtext_from_file_object) def _check_nonneg_int(value, name="argument"): ...
from ursina import * class Air(): solid = False drag = 0 animated = False def __init__(self,**kwargs): pass class Plain(Entity): solid = True drag = 0 animated = False def __init__(self,position,**kwargs): super().__init__(model="plane",rotation_x=-90,position = pos...
import os import json import seaborn as sns import matplotlib.pyplot as plt import pandas as pd # plot only the NON-redundant data def plot_additional_second_level_operator_information_about_scenarios_per_timeframe_for_OPTIONAL(timeframes, ...
# Example of solving simple linear (y(x) = mx + b) regression in Python. # # Uses only Numpy, with Matplotlib for plotting. # # <NAME> (http://eli.thegreenplace.net) # This code is in the public domain from __future__ import print_function from matplotlib import cm from matplotlib.animation import FuncAnimation import ...
#!/usr/bin/env python import os import re import sys import struct import binascii from .helpers import * TAG_RESERVED = 0 TAG_PUB_KEY_ENCR_SESS_KEY = 1 TAG_SIGNATURE = 2 TAG_SYMKEY_ENCR_SESS_KEY = 3 TAG_ONE_PASS_SIG = 4 TAG_SECRET_KEY = 5 TAG_PUB_KEY = 6 TAG_SECRET_SUBKEY = 7 TAG_COMPR_DATA = 8 TAG_SYMM_ENCR_DATA = ...
import torch from torch import nn from torch.nn import functional as F from detectron2.layers import Conv2d, ShapeSpec, cat, get_norm from detectron2.utils.registry import Registry import numpy as np import fvcore.nn.weight_init as weight_init from .cross_fetaure_affinity_pooling import CrossFeatureAffinityPooling f...
""" pgmerge - a PostgreSQL data import and merge utility. Copyright 2018-2021 <NAME> (<EMAIL>) """ import os import copy import urllib import logging import getpass from typing import Any, Dict, List, Set, Optional, Callable, cast import yaml from rxjson import Rx from appdirs import user_config_dir from .pg_pass im...
""" Lanes module for Froggit This module contains the lane classes for the Frogger game. The lanes are the vertical slice that the frog goes through: grass, roads, water, and the exit hedge. Each lane is like its own level. It has hazards (e.g. cars) that the frog has to make it past. Therefore, it is a lot easier t...
import functools import itertools from collections import (OrderedDict, abc, deque) from operator import is_not from typing import (Any, Hashable, Iterable, MutableMapping, Sequence, ...
# -*- coding: utf-8 -*- # Radproc - A GIS-compatible Python-Package for automated RADOLAN Composite Processing and Analysis. # Copyright (c) 2018, <NAME>. # DOI: https://doi.org/10.5281/zenodo.1313701 # # Distributed under the MIT License (see LICENSE.txt for more information), complemented with the following provision...
from django.conf import settings import os from celery import Celery import tempfile import json from ohapi import api import requests import bz2 import logging import re import shutil from io import StringIO from datetime import datetime import arrow from .celery_helper import vcf_header, temp_join, open_archive #...
""" Given the root of a binary tree, return the number of uni-value subtrees. A uni-value subtree means all nodes of the subtree have the same value. Example 1: Input: root = [5,1,5,5,5,null,5] Output: 4 Example 2: Input: root = [] Output: 0 Example 3: Input: root = [5,5,5,5,5,null,5] Output: 6 """ from tools.binary...
# -*- coding: utf-8 -*- """ Script to Convert .tdms to .xlsx Created on Wed Nov 25 16:09:49 2020 @author: crtjur """ #--------------------------------------------------- #----------------------imports---------------------- #--------------------------------------------------- import os import numpy as np import pandas...
# Copyright 2017 Yahoo Inc. # Licensed under the terms of the Apache 2.0 license. # Please see LICENSE file in the project root for terms. # Distributed MNIST on grid based on TensorFlow MNIST example from __future__ import absolute_import from __future__ import division from __future__ import print_function from te...
""" Assigns negative log-likelihoods to each trace in a set of trajectories. """ import argparse import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import scipy.stats import sys from data_comparison_spatial import plot_sim_and_ref sys.path.append('../') from load_paths import load_box_pat...
"""API tests. """ import sys import io import os from nose.tools import * import rarfile # # test start # @raises(NotImplementedError) def test_bad_arc_mode_w(): rarfile.RarFile('test/files/rar3-comment-plain.rar', 'w') @raises(NotImplementedError) def test_bad_arc_mode_rb(): rarfile.RarFile('test/files/r...
import numpy as np import math import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from tensorflow.keras import backend as K import gpflow import pickle from sklearn.pipeline import make_pipeline from sklearn.ensemble import RandomForestRegressor from sklearn.decomposition import N...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Aug 29 14:54:12 2018 @author: maximov """ import torch import torch.nn as nn import torch.utils.data from torch.nn import functional as F # main architecture. use concatenation class Generator(nn.Module): def __init__(self, input_nc=14, num_clas...
''' Touch Ripple ============ .. versionadded:: 1.10.1 .. warning:: This code is still experimental, and its API is subject to change in a future version. This module contains `mixin <https://en.wikipedia.org/wiki/Mixin>`_ classes to add a touch ripple visual effect known from `Google Material Design <https:...
#! /usr/bin/env python3 import pdfplumber import sqlite3 from pprint import pprint from datetime import datetime import time import sys import hashlib days = ['P O N E D E L J A K', 'U T O R A K', 'S R E D A', 'Č E T V R T A K', 'P E T A K', 'S U B O T A', 'N E D E L J A'] clas = ['Pred.', 'lab.vežbe'...
import numpy as np import tensorflow as tf import random from sklearn import feature_selection from sklearn.feature_extraction import text from tensorflow.python.util import nest from autokeras import const from autokeras.hypermodel import block class Preprocessor(block.Block): """Hyper preprocessing block base ...
import itertools import psycopg2 import psycopg2.extras import sys import requests from bs4 import BeautifulSoup import time import datetime import logging from requests.exceptions import ConnectionError import copy import re import pandas as pd import os from urllib3.exceptions import ReadTimeoutError, ConnectTimeou...
# Copyright (c) 2017-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
# -*- coding: utf-8 -*- import re import json from django.contrib import messages from django.core.urlresolvers import reverse from django.http.response import HttpResponse from django.utils.encoding import force_str from django.utils.html import format_html, strip_tags from django.utils.safestring import mark_safe f...
import struct import logging import socket import xml.etree.ElementTree as ET from irods import IRODS_VERSION from irods.message.message import Message from irods.message.property import (BinaryProperty, StringProperty, IntegerProperty, LongProperty, ArrayProperty, ...
#!/usr/bin/python # coding=utf-8 import time import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib import jieba import jieba.analyse import os from pyecharts import options as opts from pyecharts.charts import Map from pyecharts.charts import Pie from pyecharts.charts import Bar from...
from softlearning.environments.cassie.assets.cassiemujoco import CassieSim, CassieVis, cassie_user_in_t import numpy as np from gym import utils from gym import spaces import gym # CASSIE_TORQUE_LIMITS = np.array([4.5*25, 4.5*25, 12.2*16, 12.2*16, 0.9*50]) # ctrl_limit * gear_ratio # CASSIE_MOTOR_VEL_LIMIT = np.array...
# -*- coding: utf-8 -*- # 二叉树期权定价模型 # https://zhuanlan.zhihu.com/p/62031783 # https://link.zhihu.com/?target=https%3A//github.com/ququcai/option import math import numpy as np import matplotlib.pyplot as plt from scipy.integrate import quad # import matplotlib as mpl # mpl.rcParams['font.family'] = 'serif' #BSM模型定价...
import streamlit as st import pydeck as pdk import pandas as pd import numpy as np import base64 from maps import * from utils import * from annotated_text import annotated_text #Loading some dataset for beta expander categories= pd.read_csv('data/categories.csv') regions= pd.read_csv('data/regions.csv') ...
import numpy as np import copy import time import random import pickle import subprocess import json import os # from subprocess import DEVNULL from UTILS.hidden_print import HiddenPrints from config import GlobalConfig class AlgorithmConfig(): load_checkpoint = False episode_limit = 400 # int(100e3) batch...
import pyproj import numpy as np import pandas as pd def find_closest_node(G, point): """find the closest node on the graph from a given point""" distance = np.full((len(G.nodes)), fill_value=np.nan) for ii, n in enumerate(G.nodes): distance[ii] = point.distance(G.nodes[n]['geometry']) name_n...
#!/usr/bin/python """ Classes related to reading the APT repository. """ # # The following is the terminology I attempt to stick to # in the following code: # * release -- release of Debian or Ubuntu we are building for ('wheezy' or 'trusty') # * pocket -- production (''), proposed, development, staging, bleeding # *...
"""Representations of API data for HomeSeer devices as Python objects.""" import logging from typing import Callable, Optional, Union from .const import RELATIONSHIP_CHILD, RELATIONSHIP_ROOT, RELATIONSHIP_STANDALONE CONTROL_USE_ON = 1 CONTROL_USE_OFF = 2 CONTROL_USE_DIM = 3 CONTROL_USE_LOCK = 18 CONTROL_USE_UNLOCK =...
import argparse import os from pathlib import Path from collections import namedtuple import subprocess ## This script shows what fpgas have been modified. # can be run with # # make buildstatus # # USE_COLOR=no make buildstatus # # helpers # a pretty-print for hex strings def get_rose(data): ...
import hashlib import logging import subprocess import tarfile # For sending through a channel. from typing import List import gevent import pytest import os from dateutil.parser import parse as dateparse from volttron.platform.messaging.health import STATUS_GOOD, STATUS_BAD, \ STATUS_UNKNOWN from vo...
# Author : <EMAIL> # Date : 2020-12-03 from data import * from utils import * import logging import pandas as pd import os, glob, time, datetime import copy, shutil import argparse import random import torch from torch.utils.data.dataset import Dataset import torch.nn.functional as F from torch.optim import lr_sched...
#!/usr/bin/python3 # -*- coding: utf-8 -*- import copy import types import sys from django.contrib import admin from django.contrib.admin.views.main import ChangeList from django.db.models import Sum, Avg, Count, Max, Min, F from django.http import HttpResponseRedirect from django.utils import formats map_aggregates...
#!/usr/bin/env python3 # # Advent of Code 2020 - day 19 # from pathlib import Path from pprint import pprint INPUTFILE = "input.txt" CHARACTERS = "ab" MAX_REPEATS = 10 SAMPLE_INPUT = """ 0: 4 1 5 1: 2 3 | 3 2 2: 4 4 | 5 5 3: 4 5 | 5 4 4: "a" 5: "b" ababbb bababa abbbab aaabbb aaaabbb """ SAMPLE_INPUT2 = """ 42: ...
# Copyright (c) 2020, DjaoDjin 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and t...
import inspect import itertools import logging import colors import discord from discord import Embed from discord.ext.commands import Command from discord.ext.commands.errors import CommandError from discord.ext.commands.formatter import HelpFormatter from sqlalchemy.exc import SQLAlchemyError from utils.utilities i...
from datetime import date, time import pytest from tests.utils import file_response from city_scrapers.spiders.chi_ward_night import Calendar, ChiWardNightSpider test_response = file_response('files/test_chi_ward_night.json') spider = ChiWardNightSpider(start_date=date(2017, 11, 1)) parsed_items = [item for item in ...
import os # Enabled to use the CPU for training. #os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" #os.environ["CUDA_VISIBLE_DEVICES"] = "" import sys import cv2 import json import shutil import pickle import random import string import traceback import numpy as np import tensorflow as tf import matplotlib.pyplot as ...
# MIT License # # Copyright (c) 2020 <NAME> <<EMAIL>> # # 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, mod...
# -*- coding: utf-8 -*- """ @author:XuMing(<EMAIL>), <NAME> @description: A pytorch implementation of FNN Reference: [1] Product-based Neural Networks for User Response Prediction (SJTU 2016) <NAME>, <NAME>, <NAME>, <NAME>, Yong Yu Shanghai Jiao Tong University {kevinqu, hcai, kren, w<EMAIL>, <EMAIL> <NAME>, ...
#!/usr/bin/env python # # Author: <NAME> <<EMAIL>> # '''Density expansion on plane waves''' import copy import numpy from pyscf import lib from pyscf import gto from pyscf import dft from pyscf.lib import logger from pyscf.pbc import tools from pyscf.pbc.gto import pseudo, estimate_ke_cutoff, error_for_ke_cutoff from...
from openpyxl import Workbook from openpyxl import load_workbook import csv import sqlite3 as lite from DataBuffer import DataBuffer #Translator classes accept an external file as an output and #creates data buffers to be processed in batches & writes the #buffers to queues on the data stream class Translator(): ...
import tensorflow as tf from collections import namedtuple from layers import Layers SSDParams = namedtuple('SSDParameters', ['img_shape', 'num_classes', 'no_annotation_label', 'feat_la...
# coding: utf-8 # Distributed under the terms of the MIT License. """ This file implements the base class for all "fingerprints", which here refers to any object derived from purely structural features of a crystal, e.g. pair distribution functions (PDF) or simulated powder X-ray diffraction (PXRD) spectra. """ # TO...
import tvm from tvm import te, arith from tensorizer.intrinsics import INTRINSICS import numpy as np n, c, h, w = 1, 192, 18, 18 kh, kw, ic, ko = 3, 3, c, 192 a = te.placeholder((n, c // 16, h, w, 16), 'float16') b = te.placeholder((ko // 16, ic // 16, kh, kw, 16, 16), 'float16') rc = te.reduce_axis((0, c), 'rc') rh...
# -*- coding: utf-8 -*- import json from copy import deepcopy from typing import List import pandas as pd from cognite.client._api_client import APIClient, CogniteCollectionResponse, CogniteResource, CogniteResponse class EventResponse(CogniteResponse): """Event Response Object.""" def __init__(self, inter...
# 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, overload from ... import _utilities __...
""" MIT License Copyright (c) 2021 by <NAME> <<EMAIL>> 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, pu...
import os import datetime import time from collections.abc import Iterable from glob import glob import numpy as np import netCDF4 as nc import itertools from .logger import get_log from . import sario log = get_log() DATE_FMT = "%Y%m%d" def find_igrams(directory=".", ext=".int", parse=True, filename=None): """...
import unittest from time import sleep from unittest import TestCase from redisbloom.client import Client as RedisBloom from redis import ResponseError xrange = range rb = None port = 6379 i = lambda l: [int(v) for v in l] # Can be used with assertRaises def run_func(func, *args, **kwargs): func(*args, **kwarg...
"""Represent a license. Source: represents an existing license Dest: represents a new combined license (possibly for a combined work) """ from __future__ import annotations from typing import Any class License: """Represent a license. Source: represents an existing license Dest: represents a new combined licen...
import pandas as pd import numpy as np import datetime from time import time import os import json import yaml import glob from .helper import objectview from .histogram import Histogram class DatasetProcessor(): def __init__(self, name, output_filename, domain, column_names=None): self.__name = name ...
from bert_score import score from bert_score.utils import get_bert_embedding, sent_encode from collections import defaultdict from transformers import BertTokenizer, BertModel import numpy as np import torch def get_bert_model(model_type, basic_tokenize): tokenizer = BertTokenizer.from_pretrained(model_type, do_l...
from ..tweet_sentiment_classifier import Classifier import numpy as np import pickle as pkl import json import os import tensorflow_hub as hub import tensorflow as tf try: import bert FullTokenizer = bert.bert_tokenization.FullTokenizer except ImportError: raise ImportError('Issue loading bert-for-tf, ...
import string import random import os import re my_payload_url = "https://the.earth.li/~sgtatham/putty/latest/w32/putty.exe" vba_variables = dict() english_wordlist_path = os.path.join('\\'.join(os.path.realpath(__file__).split("\\")[0:-3]), "internals", "words.txt") with open(english_wordlist_path, 'r') as r: ...
# Copyright (c) 2017 FlashX, LLC # # 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, distrib...
import copy import numpy import pytest import torch from openff.interchange.components.interchange import Interchange from openff.interchange.models import PotentialKey from simtk import unit from smirnoffee.exceptions import MissingArgumentsError from smirnoffee.potentials import _POTENTIAL_ENERGY_FUNCTIONS, potenti...
import os import os.path as p import sys from datetime import datetime, timedelta import json import time import requests from google.cloud import storage from botleague_helpers.config import blconfig from botleague_helpers.db import DB from leaderboard_generator.auto_git import get_auto_git from leaderboard_generato...
import pins import os import tempfile import shutil import pathlib import sys import platform import random import requests import tarfile import hashlib import hmac import struct import base64 import yaml import json def _callback_dir_create(path): return os.makedirs(path.value) def _callback_dir_exists(path): r...
#!/usr/bin/env python3 from os.path import exists import sys import getopt import xml.etree.ElementTree as ET def findVersion(rootNode): for type in rootNode.findall('./types/type'): category = type.get('category') if category is not None and category == 'define': for name in type.fin...