text
stringlengths
3.07k
22.1k
import hashlib import logging from pandas import DataFrame from pm4py.objects.log.log import EventLog from src.encoding.boolean_frequency import frequency, boolean from src.encoding.complex_last_payload import complex, last_payload # from src.encoding.declare.sequence import sequences from src.encoding.declare.declar...
import networkx as nx from networkx.algorithms import bipartite from graphing.special_graphs.neural_trigraph.path_cover \ import min_cover_trigraph, min_cover_trigraph_heuristic1 from graphing.special_graphs.neural_trigraph.rand_graph import neur_trig_edges, rep_graph from graphing.special_graphs.directed_g...
#!/usr/bin/python # (c) 2018-2019, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
# avax-python : Python tools for the exploration of the Avalanche AVAX network. # # Documentation at https://crypto.bi """ Copyright © 2021 ojrdev Support this Open Source project! Donate to X-avax1qr6yzjykcjmeflztsgv6y88dl0xnlel3chs3r4 Permission is hereby granted, free of charge, to any person obtaining a copy of...
""" Excerpt from https://github.com/jkiesele/caloGraphNN/blob/6d1127d807bc0dbaefcf1ed804d626272f002404/caloGraphNN_keras.py """ import tensorflow.keras as keras K = keras.backend try: from qkeras import QDense, ternary, QActivation class NamedQDense(QDense): def add_weight(self, name=None, **kwargs):...
#!/usr/bin/env python3 '''Script that runs a single O2O for SiStrip DAQ. @author: <NAME> ''' import os import atexit import logging import socket import argparse import subprocess from functools import partial import CondTools.SiStrip.o2o_helper as helper from CondTools.SiStrip.o2o_db_cfgmap import DbManagerDAQ from C...
import math from .core import VGDLSprite #from tools import logToFile class AStarNode(object): def __init__(self, index, vgdlSprite): self.vgdlSprite = vgdlSprite self.sprite = vgdlSprite self.index = index class AStarWorld(object): def __init__(self, game): self.game = game #ghost_sprites = game.getSp...
# -*- coding: utf-8 -*- """ Copyright [2009-2020] EMBL-European Bioinformatics Institute 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...
# Copyright (c) 2013-2014 Rackspace, 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 to ...
# This source code is part of the Hydride package and is distributed # under the 3-Clause BSD License. Please see 'LICENSE.rst' for further # information. __name__ = "hydride" __author__ = "<NAME>" from os.path import splitext import sys import argparse import warnings import numpy as np import biotite.structure as s...
import asana import json from six import print_ from datetime import date, datetime, timezone import argparse import sys, os sys.path.append(os.path.dirname(os.path.dirname(__file__))) # OAuth Instructions: # # 1. create a new application in your Asana Account Settings ("App" panel) # 2. set the redirect URL to "urn:...
""" """ import csv import inspect import json import html import logging import os import sys from datetime import datetime from tqdm import tqdm from yattag import Doc __location__ = os.path.join( os.getcwd(), os.path.dirname(inspect.getfile(inspect.currentframe())) ) class Serializer: """This class provid...
import math import numpy as np #import matplotlib.pyplot as plt import scipy.interpolate as ip from scipy.ndimage import gaussian_filter1d from utils.helpers import crossings_nonzero_all, find_index, peakdet, replace_nan from params import spring_params as def_spring_params from utils.helpers import set_user_params d...
# 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 or agreed to in writing, ...
import copy from collections import OrderedDict import six from django.core.validators import EMPTY_VALUES from django.db import models from django.db.models import DurationField as ModelDurationField from django.utils.functional import cached_property from rest_framework.serializers import ValidationError # noqa: F4...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Test basic application.""" from __future__ import absolute_import, print_function...
""" Set of bot commands designed for general leisure. """ import textwrap from itertools import cycle from random import choice, randint from string import ascii_lowercase from typing import AsyncGenerator from urllib.parse import urlencode from aiohttp import ClientSession from discord import Embed, File, Message fro...
# ***************************************************************************** # © Copyright IBM Corp. 2018. All Rights Reserved. # # This program and the accompanying materials # are made available under the terms of the Apache V2.0 # which accompanies this distribution, and is available at # http://www.apache.org/...
#!/usr/bin/env python # coding: utf-8 # Copyright 2020 <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 applic...
import sys import enum from antlr4.Token import CommonToken from antlr4 import ParserRuleContext from antlr4.tree.Tree import TerminalNodeImpl import colorama from colorama import Fore, Style from .parser.sa_systemrdl import SA_ErrorListener # Colorama needs to be initialized to properly work in Windows # This is ...
# Copyright 2021 The ProLoaF Authors. All Rights Reserved. # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the...
from re import split import postgres import requests import string import json from datetime import datetime import base64 import urllib.parse as urlparse from urllib.parse import parse_qs from xml.dom import minidom import xml.etree.ElementTree as ET import xmltodict import smtplib from email.mime.multipart import MIM...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import si...
#!/usr/bin/python import manatee import os import itertools import random import time import sys import re from time import gmtime, strftime def isplit(iterable, splitters): return [list(g) for k,g in itertools.groupby(iterable, lambda x: x in splitters)] flatten = lambda l: [item for sublist in l for item in subl...
import numba import numpy as np from numba import jit from scipy.optimize import minimize from scipy.special import gammainc, gammaincc, gammaln as gamln from scipy.stats import rv_continuous from scipy.stats._discrete_distns import nbinom_gen from scipy.stats._distn_infrastructure import argsreduce class negbinom_ge...
import logging import math import random import numpy as np import pygame from overrides import overrides from planners.baseSampler import Sampler from planners.randomPolicySampler import RandomPolicySampler from randomness import NormalRandomnessManager """ IDEAS / TODOS: - Physics engine to bounce off wal...
# Copyright 2021 Adobe. All rights reserved. # This file is licensed to you 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 ...
# Built-in imports import logging import re import os from urllib.parse import quote as url_quote, urlencode from functools import wraps from html.parser import HTMLParser from urllib.parse import unquote_plus, urlparse, parse_qsl, quote_plus, urlunparse, urlencode # Pygments, for reporting nicely formatted Python s...
from __future__ import print_function import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms import numpy as np from torch.autograd import Variable import sys from model import ConcreteDropout, Linear_relu, Linear_softm...
import pandas as pd import streamlit as st import matplotlib.pyplot as plt from binance.client import Client import joblib from urllib.request import urlopen # this function will retrieve our stored csv files def get_csvs(): predictions = pd.read_csv('https://raw.githubusercontent.com/shmaze/LHL-Final-Proje...
from datetime import timedelta, datetime from django.test import TestCase from django.contrib.auth import get_user_model from rest_framework.exceptions import ValidationError from django.conf import settings from django.utils import timezone from model_mommy import mommy from ..models import ( Contact, County...
""" All the locators that is required to create/cancel/closing a CR. written by: jiaul_islam """ from selenium.webdriver.common.by import By class LoginPageLocators: """ Login Page related XPATH class Variable are declared here """ LOGO_IMG = (By.XPATH, "//img[@src='images/login_logo.gif']") USERNAME_TEX...
from multiprocessing import Process, Event, Array, Value, Lock, log_to_stderr import logging import numpy as np from numpy.typing import ArrayLike, DTypeLike from dataclasses import dataclass from typing import Any, Sequence, Tuple import mediapipe from enum import Flag, IntEnum import mediapipe as mp import cv2 import...
"""Abstract base classes for RL algorithms.""" import io import inspect import pathlib import time import copy import warnings from abc import ABC, abstractmethod from collections import deque from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Type, Union import gym from gym.wrappers.monitoring....
""" Script for applying RWR to GraphMCF Input: - GraphMCF instance (pkl) Output: - GraphMCF with the result of RWR added as a new prop """ __author__ = '<NAME>' # ################ Package import import sys import time import getopt from graph import GraphGT from globals import * from factory import...
import click import logging import numpy as np import pandas as pd from os import path from pathlib import Path from dotenv import find_dotenv, load_dotenv from typing import Tuple import matplotlib.pyplot as plt from matplotlib.axes import SubplotBase import seaborn as sns sns.set() from sklearn.decomposition impor...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import subprocess import re import os import six import numpy as np import pandas as pd from .region import parse_region from ._process import tsv def atoi(s): return int(s.replace(',', '')) def natsort_key(s, _NS_REGEX=r...
import sys import cv2 import platform import numpy as np import matplotlib.pyplot as plt from openvino import inference_engine #################################################################################################### class VINO(object): def __init__(self): self.ie = inference_engine.IECore() ...
import numpy as np from models.RCNN import config as pose_config def pose_dist(p1, p2): s = [] for i in range(pose_config.N_KPTS): if np.sum(p1[i]) > 0.1 and np.sum(p2[i]) > 0.1: s.append(np.sqrt(np.sum(np.square(p1[i] - p2[i])))) return np.mean(s) # oks metric, sigma sigmas = np.arr...
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai import re import os # import time import json import argparse import datetime import requests import schedule import httplib2 import concurrent.futures import magsname from functools import reduce from apiclient.discovery import build from oauth2client.file import S...
import json import os import sys import time import zlib from socket import * import tj try: dirname = os.path.dirname(sys.argv[0]) os.chdir(dirname) except: pass DIRECTORY = 'Send' os.makedirs(DIRECTORY, exist_ok=True) c = tj.color_text # Making c as tj.color_text last_speed = '0 MB/s' def full_exit...
# coding=utf-8 # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
import io import os import django from PIL import Image from django.db import models from django.db.models import fields from django.utils.crypto import get_random_string from django.core.files.storage import default_storage from django.utils.module_loading import import_string from django.core.files.uploadedfile imp...
# Copyright 2020 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, ...
from datetime import datetime import discord import math import typing from discord.ext import commands from cogs.boards import MockPlayer from cogs.utils.db_objects import SlimDummyBoardConfig from cogs.utils.paginator import ( SeasonStatsPaginator, StatsAttacksPaginator, StatsDefensesPaginator, StatsGainsPagina...
#!/usr/bin/env python import codecs import datetime import dateutil.parser import dateutil.tz import json import mimetypes import os import re import platform import sys import shutil if sys.version_info[0] > 2: from urllib.parse import urlparse from urllib.parse import parse_qs else: from urlparse import...
''' ------------------------------------------------------------------------ This script contains functions common to the SS and TP solutions for the OG model with S-period lived agents, exogenous labor, and M industries and I goods. get_p get_p_tilde get_c_tilde get_c get_C get_K get_L ...
import warnings import numbers import numpy as np import geopandas as gpd from sklearn.cluster import MiniBatchKMeans from .base_classes import BaseSpatialCV from .grid_builder import construct_blocks, assign_pt_to_grid from .utils import geometry_to_2d, convert_geodataframe, load_custom_polygon __all__ = [ "HBLO...
import torch import torch.nn as nn import torch.nn.init as init import torch.nn.functional as F from TorchSUL import Model as M from torch.nn.parameter import Parameter from torch.nn.parallel import replicate, scatter, parallel_apply, gather import numpy as np import torch.distributed as dist import os def accu...
""" This program demonstrates how to use a single camera for depth sensing. It uses the triangle similarity method to calculate the distance between a detected face and the camera. To use the program, the focal length of the camera must first be calibrated. Then, the facial detection algorithm can be run...
import sys import glfw import OpenGL.GL as gl from pathlib import Path from pyrr import Vector3, Matrix44 from ctypes import c_float, sizeof, c_void_p CURDIR = Path(__file__).parent.absolute() sys.path.append(str(CURDIR.parent)) from shader import Shader from camera import Camera, CameraMovement # -- settings SRC_WI...
# wwwhisper - web access control. # Copyright (C) 2012-2017 <NAME> <<EMAIL>> """Views that handle user authentication and authorization.""" from django.conf import settings from django.contrib import auth from django.core.cache import cache from django.core.mail import send_mail from django.core.urlresolvers import r...
import slimplectic_GGL as ggl, numpy as np ########################################### # Interface class for the nonconservative # # variational integrator # ########################################### class GalerkinGaussLobatto(object): def __init__(self, t, q_list, v_list, mod_list = False): ...
from datetime import datetime import os import models.ModelAdapter from checkmate import get_all_checkpoint from models import SegmentModel import tensorflow as tf from process import data_processor import numpy as np from prepare import prepare_form_config flags = tf.flags FLAGS = flags.FLAGS flags.DEFINE_intege...
#!/usr/bin/env python from enum import Enum class RouteMode(Enum): """Modes which is used in routing api functions.""" fastest = "fastest" shortest = "shortest" balanced = "balanced" bicycle = "bicycle" car = "car" car_hov = "carHOV" traffic_enabled = "traffic:enabled" traffic_di...
# -*- coding: utf-8 -*- # Copyright 2014 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """File type decoding class for Chromium OS rootfs file bucketing. This file decodes the type of file based on the contents, file...
# Copyright 2020, <NAME>, mailto:<EMAIL> # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
# -*- coding: utf-8 -*- # Copyright (c) 2017 <NAME> <<EMAIL>> # Author: <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 t...
import load_data import time import copy #dictionary hack def get_key(val,dic): for key, value in dic.items(): if val == value: return key #data is loaded into arrays train = "diabetes_train_features.csv" train_label = "diabetes_train_labels.csv" test = "diabetes_test_features.csv" test_l...
""" Este script extrae información de los campos del HTML del cvlac a partir de una base de datos inicial de los perfiles """ # Importar librerias/Modulos import pandas as pd import numpy as np import requests from bs4 import BeautifulSoup from lxml import html import scrapy import time # Extrae metadatos de la ...
# Press the green button in the gutter to run the script. import struct from unicorn import * from unicorn.arm_const import * import unicorn import inspect import itertools import logging from unicorn.x86_const import UC_X86_REG_RIP logger = logging.getLogger(__name__) class JavaClassDef(type): next_jvm_id = i...
# -*- coding: utf-8 -*- # pragma pylint: disable=unused-argument, no-self-use """Function implementation""" import time import datetime import logging from resilient_circuits import ResilientComponent, function, handler, StatusMessage, FunctionResult, FunctionError from resilient_lib import ResultPayload, get_workflow_...
from scipy.spatial.distance import cdist import heapq import numpy as np import random from hashlib import sha1 from itertools import zip_longest def batch_unit_norm(b, epsilon=1e-8): """ Give all vectors unit norm along the last dimension """ return b / np.linalg.norm(b, axis=-1, keepdims=True) + eps...
from django.shortcuts import get_object_or_404, render, redirect from django.db.models import Count from django.db.utils import OperationalError from django.core.exceptions import ObjectDoesNotExist from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from django.core.files import File from datetime...
# Reading School 2018, Snake Game by Student Name, Year 8 # import the pygame library and a random number generator import pygame, random # import time for wait state import time # initialize pygame pygame.init() ''' colour setup ''' # declare colours - (r,g,b) WHITE = (255,255,255) BLACK = (0,0,0) RED = (255,0,0) ...
class Model: def __init__(self): import tensorflow as tf self.graph = tf.Graph() self.session = tf.Session(graph=self.graph) def load(self): import tensorflow as tf tf.saved_model.loader.load(self.session, ["serve"], "model-checkpoint") self.inputs = self.grap...
import json import logging import types from collections import OrderedDict from typing import Any import sys import pytest from stp_core.common.log import getlogger from plenum.common.constants import STEWARD_STRING from plenum.common.util import randomString from plenum.common.messages.node_messages import Commit ...
# flake8: noqa # Disable Flake8 because of all the sphinx imports # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you un...
# -*- coding: utf-8 -*- """ oss2.iterators ~~~~~~~~~~~~~~ 该模块包含了一些易于使用的迭代器,可以用来遍历Bucket、文件、分片上传等。 """ from .models import MultipartUploadInfo, SimplifiedObjectInfo from .exceptions import ServerError from . import defaults, http class _BaseIterator(object): def __init__(self, marker, max_retries): sel...
# (C) <NAME> and Carnegie Mellon University, 2016 # # support for running experiments # import sys import time import logging import collections import traceback from tensorlog import comline from tensorlog import config from tensorlog import dataset from tensorlog import declare from tensorlog import learn from ten...
import argparse import csv from collections import Counter from pathlib import Path import numpy from pyhash import city_64 from .util import docs_tokens, temp_test_corpus import nltk def get_wordnet(): wordnet = None try: from nltk.corpus import wordnet return wordnet except ImportErro...
import re import bz2 import json import time import pickle import requests import pandas as pd from bs4 import BeautifulSoup as bs MAX_API_REQUESTS = 5 API_REQUESTS_INTERVAL = 1 MIN_CONTESTS = 5 def GetRequestStatusOk(res): if res["status"] != "OK": return False return True def GetRequestBody(res):...
import numpy as np import scipy.stats import scipy.special from .density import density from .methods import get_func def density_fit(xx, nbins, k, edge = None, sq = True, alpha = None): #this function attempts to fit a density having a power law behavior to eigenvalues supplied by xx # xx should be decreasi...
# Copyright 2021 solo-learn development team. # 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, publ...
""" Port of import_proseco_data.py that uses the JSON format """ from pathlib import Path from typing import Any, Dict, Union import numpy as np from proseco.utility.io import load_data def convert_rad_to_deg(radiants: float) -> float: """Converts radiants to degrees. Parameters ---------- radiants...
"""Calculate dynamic aperture.""" import numpy as _np import matplotlib.pyplot as _mpyplot import matplotlib.gridspec as _mgridspec import matplotlib.colors as _mcolors import matplotlib.text as _mtext import pyaccel.tracking as _pytrack from .base import BaseClass as _BaseClass class DynapEXParams(): """."""...
#!/usr/bin/python # Copyright (c) 2018, 2019 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
#!/usr/bin/env pytest ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR ODBC driver. # Author: <NAME> <even dot rouault at spatialys.com> # ###############################################################...
#!/usr/bin/env python3 from playground import item_id_name, mythics from dataclasses import dataclass champion_id_to_name = { "266": "Aatrox", "103": "Ahri", "84": "Akali", "166": "Akshan", "12": "Alistar", "32": "Amumu", "34": "Anivia", "1": "Annie", "523": "Aphelios", "22": "...
#!/usr/bin/python # # Copyright (c) 2017, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. # # All rights reserved. # # The Astrobee platform is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file except in comp...
# coding=utf-8 # Create your views here. import datetime import urllib.parse from django.contrib.auth.mixins import ( LoginRequiredMixin, PermissionRequiredMixin, UserPassesTestMixin, ) from django.core.exceptions import PermissionDenied from django.db.models import Q from django.forms import BaseForm fro...
# Create circular plot of network based on sensitivity. # Draw edges to show set membership and damage. import argparse from graphics import * from math import * from csv import DictReader from collections import defaultdict import edge_sorter # calculate position of node centers in circular ordering def calc_centers...
# Copyright 2014 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """Functions to produce and verify RSA+SHA256 signatures. Based on app_identity.sign_blob() and app_identity.get_public_certificates() functions,...
# createDeviceTypes.py # Python script to transform the JSON Device Types to # header file # # Just add the tag $DEVICETYPES$ in your template file # and this script will replace this tag with all the # property found in the deviceTypes.json file # # NOTE: IMPORTANT INFORMATION ABOUT BRANCH # When a device type has a b...
import json from discord.ext.commands import check from lib.bot import My_Bot from random import choice from numpy import average, e from lib.helper.constants import BONI, NoPerms from lib.cogs.help import is_guild_owner from lib.db.db import ( getElo, getGameToEvaluate, getRoleID, getRoleTeam, get...
""" Module contain discord cog with name `Admin`. Provide server admin commands """ from datetime import datetime, timedelta from discord import NotFound, Role from discord.ext import commands from discord.ext.commands import Bot, Context from core.commands.admin import remove_notification_role, set_notification_role...
#! /usr/bin/env python3 # coding: utf-8 import numpy as np import pandas as pd import scipy as sp import scipy.fftpack import scipy.signal np.set_printoptions(formatter={'float': '{: 0.2f}'.format}) from keras.models import Sequential, model_from_json, load_model, Model from keras.layers import Dense, Activation, Dro...
# Copyright (C) 2016 The Android Open Source Project # # 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 ...
import time from datetime import datetime import pandas as pd import lxml # crawling libraries import urllib.request from urllib.error import URLError, HTTPError, ContentTooShortError import itertools # scraping libraries from bs4 import BeautifulSoup from lxml.html import fromstring, tostring import re ...
#!/usr/bin/env python # # Copyright 2018 Google 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 b...
# Lint as: python3 # Copyright 2020 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 requ...
""" twimport.py - obtain and render TiddlyWikis and create TiddlyWiki note objects from them This module's public interface is find_notes(), which, given information about a wiki, returns a set of TwNotes that it found in this wiki. """ import os from pathlib import Path import requests import subprocess from tempfile...
import pytest from UQpy.utilities.MinimizeOptimizer import MinimizeOptimizer from beartype.roar import BeartypeCallHintPepParamException from UQpy.surrogates.kriging.Kriging import Kriging import numpy as np from UQpy.surrogates.kriging.regression_models import LinearRegression, ConstantRegression from UQpy.surrogates...
# -*- encoding: utf-8 -*- """ HubbleStack Nova module for using stat to verify ownership & permissions. This audit module requires yaml data to execute. It will search the local directory for any .yaml files, and if it finds a top-level 'stat' key, it will use that data. Sample YAML data, with inline comments: stat...
""" Reference implementation for the standard PMCFG exchange format. Two functions are defined: - read_grammar(input-files or -lines) reads a grammar into a Python dict - write_grammar(**grammar) writes a grammar to standard output """ from __future__ import print_function import re import warnings import fileinpu...
"""TcEx Framework Service module""" # standard library import logging import os import threading import time from typing import Optional # third-party from requests import Session, exceptions from requests.adapters import HTTPAdapter from urllib3.util.retry import Retry # first-party from tcex.input.field_types.sensi...
from __future__ import annotations import sys from abc import ABC, abstractmethod from typing import Optional import numpy import numpy as np from household_contact_tracing.network import Network, Household, Node from household_contact_tracing.parameterised import Parameterised class NewInfection(ABC, Parameterised)...
import tensorflow as tf import numpy as np import os import sys sys.path.append('./utils') sys.path.append('./models') import dataset as dataset import model_shape as model FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_string('train_dir', './train_shape', """Directory where to write summar...
# coding=utf-8 from grakn.client import GraknClient ''' to add a new query implementation: 1. add the question and function to the approriate list of dictionaries: current lists are: get_query_examples, aggregate_query_examples and compute_query_examples example: get_query_examples = [ ...
from itertools import groupby from datetime import date, timedelta from operator import itemgetter from sqlalchemy import func from .utm_db import session_utm from .models import PaymentTransaction, BalanceHistory, User from .helpers import get_timestamp_from_date def group_pays_by_date(pays_raw): if not pays_r...