text
stringlengths
3.07k
12.6k
''' Created on Sep, 2017 @author: hugo ''' import os # import re import argparse from nltk.parse.stanford import StanfordDependencyParser from ..utils.utils import * from ..utils.freebase_utils import if_filterout from ..utils.generic_utils import * def get_used_fbkeys(data_dir, out_dir): # Fetch freebase keys...
import numpy as np import sqlite3 from pathlib import Path def _detect_column_type(type_set): if any([val == str for val in type_set]): return "TEXT" if all([val in (int, np.int, np.uint) for val in type_set]): return "INT" if all([val in (int, np.int, np.uint, float, np.float, np.double) ...
from __future__ import annotations from os import PathLike, rename from os.path import exists from pathlib import Path from typing import Union, Optional import logging from tqdm import tqdm from photomanager.hasher import file_checksum, HashAlgorithm from photomanager.database import Database, sizeof_fmt def make...
import tensorflow as tf # variables def var_conv_kernel(ch_in, ch_out, k_conv=None, initialiser=None, name='W'): with tf.variable_scope(name): if k_conv is None: k_conv = [3, 3, 3] if initialiser is None: initialiser = tf.contrib.layers.xavier_initializer() return t...
import graphene import graphql_jwt from graphene_django import DjangoObjectType from graphql import GraphQLError from graphql_auth.schema import UserQuery, MeQuery from graphql_auth import mutations from graphql_jwt.decorators import login_required from .models import User, Slot, Appointment from django.utils import ti...
import os import random import quadrabot_config import time MAX_LOVE = 300 MIN_LOVE = -100 def enable(user_id): profile_name = "love_telegram_database/"+str(user_id)+".txt" if os.path.exists(profile_name): return True else: return False def isAdmin(user_id): if user_id in quadrabot_config.ADMIN: return T...
import pandas as pd import time from bs4 import BeautifulSoup from mysql_service import insert_day, get_days from sqlalchemy import create_engine def transform(): days_raw = get_days() days_list = [] for n in range(len(days_raw)): titles = days_raw[n]['titles'].split('|') t_raw = d...
"""Graphics user interfaces for topology optimization.""" from __future__ import division from matplotlib import colors import matplotlib.cm as colormaps import matplotlib.pyplot as plt import numpy from topopt.utils import id_to_xy class GUI(object): """ Graphics user interface of the topology optimization...
import os #import cv2 import torch import torch.nn as nn import torch.nn.functional as F import torchvision.transforms.functional as TF import torchvision import torchvision.transforms as transforms from torch.utils.data import TensorDataset, DataLoader, Dataset from PIL import Image import pdb from numpy import random...
import finansp.time_series as ts import click import pandas as pd @click.group() def cli(): pass @click.command() @click.option( '-v', '--value_to_predict', default="open", help='Value to predict.', show_default=True ) @click.option( '-p', '--periods_to_predict', default=90, help='Days to predict.', show_default...
# Lint as: python3 # pylint: disable=g-bad-file-header # Copyright 2020 DeepMind Technologies Limited. 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.a...
#!/usr/bin/env python # -*- coding: utf-8 -*- import enum import importlib import platform class Location(enum.Enum): """Describe the different locations that can be queried using functions such as :func:`.get_writable_path` and :func:`.get_standard_paths`. Some of the values in this enum represent a us...
from simulation.evaluator.instruction_parser import StreamingTraceIterator, TraceIterator, InstructionParser, Instruction import simulation.evaluator.instructions as ins from simulation.generator.main_zipf import EdgeNode from simulation.evaluator.statistics.file_writer import StatsFileWriter import csv import numpy as...
import pytest import torch from torch import nn import boardom as bd class TestModule: def test_can_create_module(self): mod = bd.Module() assert str(mod) == 'Module()' def test_module_registry(self): assert bd.models.module._subclass_modules.called mod = bd.Module() a...
import argparse import numpy as np import pickle import pdb import itertools import copy class FaiRRMetric: def __init__(self, collection_neutrality_path, background_doc_set): self.documents_neutrality = {} for l in open(collection_neutrality_path): vals = l.strip().split('\t') ...
import numpy as np import random as rnd import os import time from pynq import Overlay,allocate # Model's pure functions def calc_envelope(t, dots): sorted_dots = dots.copy() sorted_dots.sort(key=lambda x: x[0]) env = np.interp(t, [p[0] for p in sorted_dots], [p[1] for p in sorted_d...
from utils import mkdir_p, check_if_path, Logger from utils.path_and_folder_definition import * # import paths for databases, folders and libraries from utils.pipeline_aux import (check_img_type, im_read_greyscale, check_initial_path) from utils.clip import Clip from dlib import shape_predictor from menpo.io import e...
# # Copyright (c) SAS Institute 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 in w...
from ..types import TransformationResult from ..utils.snippet import snippet from ..utils.tree import insert_at from .. import ast from .async_for import AsyncForTransformer from .async_with import AsyncWithTransformer from .base import BaseNodeTransformer from typing import List, Tuple, Optional, Union # Handle gener...
from os.path import join from os.path import relpath from re import compile from contextlib import contextmanager from ..staging import COMMAND_VERSION_FILENAME from ..action_mapper import FileActionMapper from logging import getLogger log = getLogger(__name__) # All output files marked with from_work_dir attribute...
# Copyright (c) 2018 GitHub. # # This file is part of the `glb-director` test suite. # # This file is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any lat...
"""Testing strategy for dynamic testing via folder structure.""" import importlib import inspect import os import glob import json from unittest.mock import Mock from pyats import aetest from pyats.aetest.steps import Steps from genie.libs import parser as _parser from genie.metaparser.util.exceptions import SchemaEm...
import torch import numpy as np from collections import namedtuple from math import ceil RolloutBatch = namedtuple('RolloutBatch', ['observations', 'returns', 'actions', 'masks', 'states']) KeepTensor = namedtuple('KeepTensor', ['data']) def to_tensor(value, device): if value is None: return None eli...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' Design for 300W::68-keypoints landmark dataset ''' import os import cv2 import sys import time import random import argparse import numpy as np sys.path.append(os.getcwd()) import mtcnn.core.utils as utils import mtcnn.core.landmark_utils as lmk_utils from IPytho...
"""Handle pan files for documentation.""" import os import re import tempfile import shutil import jinja2 from vsc.utils import fancylogger from vsc.utils.run import asyncloop from lxml import etree logger = fancylogger.getLogger() namespace = "{http://quattor.org/pan/annotations}" def rst_from_pan(panfile, title, ...
from __future__ import print_function from django.shortcuts import render,render_to_response from django.template.context_processors import csrf from django.template import RequestContext from .forms import * from .models import * from wms import settings from .fiware import fiware import random , string, json from dja...
from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import get_object_or_404 from django.http import HttpResponseRedirect, JsonResponse from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_POST from django.urls import reverse, reverse_laz...
import sys import numpy as np from collections.abc import Iterable import dft_loihi.dft.util from dft_loihi.dft.util import time_steps_per_minute from dft_loihi.dft.util import gauss class PiecewiseStaticInput(dft_loihi.dft.util.Connectable): def __init__(self, name, net, shape): self.name = name ...
# Useful utilities for interactive use import angr from sys import stdout def showbbASM(proj, bbaddr, file=stdout): """ Show the x86 assembly for the basic block at the given address file: where to print the output (must be an open file object, defaults to stdout) """ file.write(str(proj.factory.b...
from sqlalchemy import Column, ForeignKey, Integer, String from sqlalchemy import func, create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, sessionmaker from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.schema import DDL import sqlalchemy impor...
import pytest from algebra.variants import Parser, Variant, reverse_complement @pytest.mark.parametrize("expression, variants", [ ("=", []), ("3del", [Variant(2, 3)]), ("3delA", [Variant(2, 3)]), ("3_4del", [Variant(2, 4)]), ("3_4delTT", [Variant(2, 4)]), ("3delinsA", [Variant(2, 3, "A")]), ...
from random import uniform, random from Rule import Size class Op(): childOps = [] childLabels = [] def __init__(self): pass # evaluate arg values def evalArgs(self, *args): evaledArgs = [self.evalArg(arg) for arg in args] return evaledArgs def evalArg(...
# After setting up the config.json, lambda-function.py, and trainer-script.sh files, # run this script to create the necessary Lambda function. Execution of the Lambda # function will be triggered manually by you from the AWS CLI or web console, a separate # program of yours via the AWS SDK, an IoT button, or whatever ...
""" paddle_train """ import os import time import sys import argparse import json import codecs import numpy as np import random import paddle import paddle.nn.functional as F from pahelix.model_zoo.protein_sequence_model import ProteinEncoderModel, ProteinModel, ProteinCriterion from pahelix.utils.protein_tools impo...
import cv2 as cv import os import pandas as pd from matplotlib import pyplot as plt from moviepy.editor import * from moviepy.video.io.bindings import mplfig_to_npimage import numpy as np from scipy import signal DATA_FOLDER = '../input/deepfake-detection-challenge' TRAIN_SAMPLE_FOLDER = 'train_sample_videos...
from keras_med_io.utils.shape_io import reshape from keras_med_io.inference.infer_utils import pad_nonint_extraction, undo_reshape_padding from capsnets_laseg.io.io_utils import isensee_preprocess, nii_to_np from sklearn.metrics import precision_recall_fscore_support import nibabel as nib import numpy as np import os ...
""" mbed CMSIS-DAP debugger Copyright (c) 2006-2013 ARM Limited 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 ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, division, print_function, absolute_import from unittest import TestCase import subprocess import os from contextlib import contextmanager import SimpleHTTPServer import BaseHTTPServer import testdata from que import Selector, Bodies class WebHandler(S...
import os, h5py import numpy as np try: os.environ['MOLINO_DIR'] except KeyError: print("please set environment variable `MOLINO_DIR`. See README.md for details") def GalaxyCatalog(cosmo, i_nbody=1, i_hod=1, z=0, apply_rsd=False, columns=['x', 'y', 'z']): ''' Read a galaxy catalog(s) from the Molin...
# 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 from...
import numpy as np import gzip import pickle import matplotlib.pyplot as plt from __init__ import project_root, density_data_root from utils.plot_utils import disp_imdata, plot_hists_for_each_dim import data_handlers.data_utils as dutils from data_handlers.base_dataset import Dataset from scipy.stats import multivaria...
import numpy as np import pandas as pd import altair as alt import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # Plot a 3d def Vis3d(X,Y,Z): fig = plt.figure(figsize=(8,8)) ax = fig.add_subplot(111, projection='3d') ax.plot_surface(X, Y, Z, color='y') ax.set_xlabel('X') ax.set...
import numpy as np import matplotlib.pyplot as plt import multiprocessing as mp from skimage.color import rgb2gray from skimage import filters # Diz quanto tempo a histรณria deve ser. # Alterar essa variรกvel tem efeitos em TODOS os mรณdulos history_length = 1 # Nรบmero de primeiros estados de cada episรณdio que devem ser ...
# Copyright (c) 2014 Red Hat, Inc. and/or its affiliates. # Copyright (c) 2015 <NAME> # Written by <NAME> <<EMAIL>> # See LICENSE file. from __future__ import print_function import requests try: from urlparse import urlparse, parse_qs except ImportError: from urllib.parse import urlparse, parse_qs try: i...
""" Expanded templates for WebQA """ import logging from os.path import dirname, join from allennlp.common import FromParams, Params, Registrable from gpv2.utils.py_utils import load_json_object TEMPLATES = {} TEMPLATES['adj'] = [ "WH ADJ_TYPE is DT_OBJ?", "What is the ADJ_TYPE of DT_OBJ?", "CMD the ADJ_TYPE ...
import argparse from datetime import date import json import logging import pathlib import sys from typing import List, NamedTuple import iso8601 logger = logging.getLogger(__name__) class SavingsGoal(NamedTuple): name: str amount: int start_date: date spend_date: date percentage: float fort...
import sys, os, time import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.image as mpimg import pickle #tensorboard --logdir=... --host localhost --port 6006 #browse: http://localhost:6006/ import tensorflow as tf from tensorflow.keras.activations import * #https://towardsdatascience...
# ============================================================================ # # Copyright (C) 2007-2016 Conceptive Engineering bvba. # www.conceptive.be / <EMAIL> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: ...
# Copyright (c) 2016-2020, University of Idaho # All rights reserved. # # <NAME> (<EMAIL>) # # The project described was supported by NSF award number IIA-1301792 # from the NSF Idaho EPSCoR Program and by the National Science Foundation. from typing import Tuple import sys import collections import os from os.path i...
from django.core.exceptions import ObjectDoesNotExist from django.db.models import Max, Min, Q from django.http import JsonResponse from django.shortcuts import render, get_object_or_404 from django.views.generic import View from beer_search_v2.models import Product, AlcoholCategory, ContainerType, SimplifiedStyle, \ ...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Make simple arithmetical calculations on pandas DataFrame columns based in entries configured in a calculations file (``calc_file``). Note: ``calc_file`` format:: # This is just a comment ########################## # Inline comments may start eith...
# -*- coding: utf-8 -*- """ ใ‚ฟใƒžใƒชใƒณใ‚ณใƒใ‚ฏใ‚ฟใฎ็”ป้ขใจAPIๅ‡ฆ็†ใ‚’ๅˆถๅพก. @author: <EMAIL> """ from django import forms from django.contrib.auth import authenticate from django.contrib.auth.forms import UserCreationForm from django.core.exceptions import ValidationError from django.shortcuts import redirect, render from django.views...
import bs import bsUtils import random import bsDeathMatch as dm from bsBomb import BombFactory from bsSpaz import _BombDiedMessage def bsGetGames(): return [FloatingDeathMatchGame] def bsGetAPIVersion(): return 4 class BallonBomb(bs.Bomb): def __init__(self, position=(0,1,0), velocity=(0...
import glob import os import warnings import numpy as np from astropy import units as u from astropy.io import ascii from astropy.io import fits from exorad.log import Logger from exorad.utils import exolib from .signal import Sed warnings.filterwarnings('ignore', category=UserWarning, append=True) class Star(Logg...
import numpy as np import datetime as dt import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func, and_ from flask import Flask, jsonify ################################################ # Database Setup ###############...
#!/usr/bin/env python # coding: utf-8 # Copyright (c) "Neo4j" # Neo4j Sweden AB [http://neo4j.com] # # This file is part of Neo4j. # # 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 # # htt...
#!/usr/bin/env vpython3 # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Test gsutil.py.""" from __future__ import unicode_literals import base64 import hashlib import io import json import os import ...
import numpy as np import pytest import pandas as pd from pandas import ( Index, MultiIndex, ) import pandas._testing as tm def test_reindex(idx): result, indexer = idx.reindex(list(idx[:4])) assert isinstance(result, MultiIndex) assert result.names == ["first", "second"] assert [level.name f...
# -*- coding: UTF-8 -*- from collections import namedtuple import logging from .mock_handler import MockHandler import os import sqlite3 import tempfile import limbo # test plugin hooks # # TODO: test init_plugins with unicode plugins # TODO: test init_plugins with invalid plugins # TODO: test init_plugins with plugi...
# Copyright 2016 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 by applicable law or agree...
""" API operations allowing clients to determine Galaxy instance's capabilities and configuration settings. """ from galaxy.web import _future_expose_api_anonymous_and_sessionless as expose_api_anonymous_and_sessionless from galaxy.web import _future_expose_api as expose_api from galaxy.web import require_admin from g...
# -*- coding: utf-8 -*- import time import json import sys import codecs from math import log import os from multiprocessing import Pool #filename = sys.argv[1] filename='hw5-data-corpus/catalan_corpus_dev_raw.txt' start_time = time.time() test_text = codecs.open(filename,"r",encoding="utf8").read() with open('hmm...
import argparse import os import json import pickle as pkl import numpy as np from pycocotools.coco import COCO dataset_annotation_mapping = { "train2017": "annotations/person_keypoints_train2017.json", "val2017": "annotations/person_keypoints_val2017.json", "COCO_val2017_detections_AP_H_56_person": "anno...
# Copyright (c) 2020 UT Longhorn Racing Solar import csv import os import fcntl # Path of file file = "BSP/Simulator/Hardware/Data/SPI.csv" class ShiftRegister: OPCODE = 0b0100000 REGISTER_DATA = { "IODIRA": 0xFF, "IODIRB": 0xFF, "IPOLA": 0x00, "IPOLB": 0x00, "GPINTEN...
# 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 Apache License, Version 2.0 (the # "License"); you may not u...
"""POWER-Up 'pup' command argument parser""" # Copyright 2019 IBM Corp. # # 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/LICENS...
#Finds music from musicbrainz based on what the user entered (Maybe move it to countries.py) import os import musicbrainzngs import random import re import urllib.request from unidecode import unidecode musicbrainzngs.set_useragent(os, "0.7.1") #Creates useragent abbreviations = {"Afghanistan": "AF", "A...
#!/usr/bin/env python3 import os import os.path import subprocess import sys import time import json import urllib import urllib.request import re import csv import io import signal import resource stored_results = [] # wrk needs enough files to make 500 connections resource.setrlimit(resource.RLIMIT_NOFILE, (2056, ...
import graphene from graphene import relay from ...core.exceptions import PermissionDenied from ...core.permissions import OrderPermissions from ...core.tracing import traced_resolver from ...payment import models from ..checkout.dataloaders import CheckoutByTokenLoader from ..core.connection import CountableConnectio...
import sys import os import json import gzip from pathlib import Path import unicodedata def parse_doc(file): if file.name.endswith(".pdf"): try: with gzip.open(str(file) + ".txt.gz", 'rt', encoding='utf-8') as f: lines = f.readlines() except: print(f"PDF pa...
""" Module to run tests on the ArchiveDir/ArchiveMetadata script. """ import pytest import os from functools import partial import filecmp from pypeit.archive import ArchiveMetadata, ArchiveDir from pypeit.tests.tstutils import cooked_required, data_path class mock_file_info: def __init__(self, path, name): ...
"""Environments using kitchen and Franka robot.""" import os import numpy as np from d4rl.kitchen.adept_envs.utils.configurable import configurable from d4rl.kitchen.adept_envs.franka.kitchen_multitask_v0 import KitchenTaskRelaxV1 from d4rl.offline_env import OfflineEnv OBS_ELEMENT_INDICES = { 'bottom burner': np...
# Copyright 2017 Calico 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, sof...
import re from typing import Optional, cast, Sequence, Dict from marshmallow import EXCLUDE, Schema, fields, post_dump, post_load from pymongo.database import Database from ebl.errors import NotFoundError from ebl.mongo_collection import MongoCollection from ebl.transliteration.application.sign_repository import Sign...
"""Ephemeral models used to represent a page and a list of pages.""" from __future__ import unicode_literals from django.template import ( loader, RequestContext, ) from django.utils.encoding import iri_to_uri from endless_pagination import ( loaders, settings, utils, ) # Page templates cache. ...
# coding: utf8 """ This file contains a set of functional tests designed to check the correct execution of the pipeline and the different functions available in Clinica """ import warnings from os import fspath from pathlib import Path from test.nonregression.testing_tools import * import pytest # Determine locatio...
from app import db author_title_table = db.Table('lnkAuthorTitle', db.Column('lat_author_id', None, db.ForeignKey('tblAuthor.aut_id')), db.Column('lat_title_id', None, db.ForeignKey('tblTitle.tit_id')) ) title_genre_table = db.Table('lnkTitleGenre', db.Column('ltg_title_id', None, db.ForeignKey('tblTitle....
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # vim:fenc=utf-8 import comnetsemu.tool as tool from time import sleep from comnetsemu.net import Containernet from mininet.link import TCLink from mininet.log import info, setLogLevel from mininet.node import Controller PING_COUNT = 1 def testTopo(): net = Conta...
# Copyright 2021 Xanadu Quantum Technologies 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 agre...
import pgsql import json from collections import OrderedDict from prettytable import PrettyTable import sys class Cannibalizer: def __init__(self, kit_id, serial_numbers, write_json=True, kit_std=True, kit_report=True): self.kit_number = kit_id self.serial_numbers = serial_numbers self.ki...
import os from calibration import read_calibration_species_constants import json def save_exptl_data_to_chemkin_simulation_format(condition_before, condition_after): """ This method tries to gether speciation results before and after experiment to generate files for downstream chemkin simulation: input: files co...
# -*- coding:utf-8 -*- from __future__ import absolute_import from django.core import checks from django.db.models import CharField, IntegerField, Lookup, TextField from django.utils import six from django.utils.translation import ugettext_lazy as _ from django_mysql.compat import field_class from django_mysql.forms ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from .. import _utilities, _tables from ...
def ne_rien_faire(noeud): pass class NoeudBin: def __init__(self, valeur, gauche=None, droit=None): self.valeur = valeur # self.parent = None self.gauche = gauche self.droit = droit def est_double(self): """Renvoie True si le noeud a deux enfants exactement, False ...
# This is such an important import, I try to make it NOT be depending on ANYTHING else... def row_from_keyed_values(keyed_values, metadata=None): """ Create a Row from a list of tuples where the first element is the field name and the second its value. :type keyed_values: iterable :type metadata:...
"""A module for sqlite database.""" import os import logging import json import datetime import aiosqlite from opsdroid.const import DEFAULT_ROOT_PATH from opsdroid.database import Database _LOGGER = logging.getLogger(__name__) # pylint: disable=too-few-public-methods # As the current module needs only one public me...
import json import random from unidecode import unidecode import gspread import redis from oauth2client.service_account import ServiceAccountCredentials from slugify import slugify class QuestionStateService: CONTEXT_PATTERN = 'projects/{}/agent/sessions/{}/contexts/{}' SOURCE = 'trivia.theneonproject.org' ...
#Plotting Tools import matplotlib.pyplot as plt import numpy as np def prGreen(prt): print("\033[92m {}\033[00m" .format(prt)) def MyBins(lower,upper,step): return np.arange(lower,upper,step).tolist() def plot_mva(df, column, bins, logscale=False, ax=None, title=None, ls='dashed', alpha=0.5, sample='',cat="Mat...
import os import platform import textwrap import time import pytest from conan.tools.env.environment import environment_wrap_command from conans.test.assets.autotools import gen_makefile_am, gen_configure_ac, gen_makefile from conans.test.assets.sources import gen_function_cpp from conans.test.functional.utils import...
""" Mappings for accepted file formats FILE-FORMAT_verification_mapping: FILE-FORMAT_cols_mapping: FILE-FORMAT_groups: list of """ import os import yaml import urllib import requests from sample_uploader.utils.parsing_utils import upload_key_format from .verifiers import * # with open("/kb/module/lib/sample_uploader/...
# To add a new cell, type '# %%' # To add a new markdown cell, type '# %% [markdown]' # %% import seaborn as sb import matplotlib.pyplot as plt import pandas as pd from pylab import rcParams import numpy as np import sklearn from sklearn import metrics from sklearn.cluster import DBSCAN from sklearn.neighbors import N...
# Copyright (c) 2019, Facebook, Inc. and its affiliates. All Rights Reserved """Official evaluation script for the MRQA Workshop Shared Task. Adapted fromt the SQuAD v1.1 official evaluation script. Usage: python official_eval.py dataset_file.jsonl.gz prediction_file.json """ from __future__ import absolute_import ...
# 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 Apache License, Version 2.0 (the # "License"); you may not u...
from decimal import Decimal import datetime from django.db import models from django.contrib.localflavor.us.models import USStateField from django.conf.urls.static import static PAYMENT_TYPES = ( ('cash', 'Cash'), ('check', 'Check'), ('credit card', 'Credit Card'), ) # Create your models here. class Cus...
"""# API""" from flask import request from sqlalchemy import Column, ForeignKey, Integer, String from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.ext.orderinglist import ordering_list from sqlalchemy.orm import backref, relationship from sqlalchemy_modelid import ModelIdBase from sqlalchemy_mutable...
#!/usr/bin/env python #-*- coding:utf-8 -*- # Author: <NAME>(<EMAIL>) from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch.nn as nn from models.tools.module_helper import ModuleHelper from utils.tools.logger import Logger as Log model_urls = { ...
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
# -*- coding: utf-8 -*- """ pyimagediet ~~~~~~~~~~~~ :copyright: (c) 2015 by <NAME> :license: MIT, see LICENSE for more details. """ import copy import filecmp import magic import os from os.path import exists, isfile from os.path import abspath, dirname, join, exists, isfile import shutil from subprocess import call,...
# pylint: disable=line-too-long, no-member, no-else-return # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals import importlib import json import random import traceback from django.conf import settings from django.contrib.gis.db import models from django.core.mail ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from .. import _utilitie...