text
stringlengths
3.07k
22.1k
import time import pandas as pd class Node: def __init__(self, nid, label, full_id, set_time = True): self.full_id = full_id self.nid = nid self.label = label if(set_time): self.start = time.time() else: self.start = pd.NA self.end = pd.NA ...
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __docformat__ = 'restructuredtext en' import os from io import BytesIO as StringIO from traceback import print_exc try: from qt...
import numpy as np from mspasspy.ccore.utility import MsPASSError, AtomicType, ErrorSeverity, ProcessingStatus from mspasspy.ccore.seismic import Seismogram, TimeSeries, TimeSeriesEnsemble, SeismogramEnsemble, TimeWindow from mspasspy.ccore.algorithms.basic import _WindowData, _WindowData3C from mspasspy.ccore.algorit...
#!/usr/bin/env python """ Implementation of basic Differential Evolution Optimisation. """ import datetime import math import random class Agent(object): """ Encapsulation of a vector of parameters and their corresponding fitness. """ def __init__(self, fitness_function): """ Initia...
''' File name: router.py Author: <NAME> Email: <EMAIL> Python Version: 3.7.6 Purpose: Router module models a Router running on a network. ''' # Standard library from dataclasses import dataclass import socket import time import threading import random # Local modules import table import ...
"""/** * @author [<NAME>] * @email [<EMAIL>] * @create date 2020-08-15 23:06:48 * @modify date 2020-08-18 15:30:07 * @desc [ Contains player class to hold player's statistics. NOTE I process the chess.com API data into a standardized form within each user profile. I select data that I may find rel...
#! /usr/bin/env python import math import optparse import os import string import sys import tempfile import fasta def format(seq, N=60): nseg = int(math.ceil(len(seq) / (N + 0.0))) return "\n".join([seq[i * N: (i + 1) * N] for i in range(nseg)]) # write into fasta format file parser = optparse.OptionPars...
# @par Thanks: # This class was written by <NAME>, 2018-19 # This work was supported by Commissariat a l'Energie Atomique # CEA, DAM, DIF, F-91297 Arpajon, France. import vtk import math TARGET_LEVEL = 4 class Circle: _center = [0.5, 0.] _rayon = 1. _rayon2 = _rayon*_rayon def test(self, x, y, z): d2 ...
#!/usr/bin/env python3 import os.path import tensorflow as tf import helper import warnings from distutils.version import LooseVersion import project_tests as tests # Check TensorFlow Version assert LooseVersion(tf.__version__) >= LooseVersion('1.0'), 'Please use TensorFlow version 1.0 or newer. You are using {}'.for...
import requests import csv import os import sys from bs4 import BeautifulSoup from time import sleep HEADERS = { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/62.0.3202.89 Chrome/62.0.3202.89 Safari/537.36', } DISTRICT = { '01': 'DIMAPUR', '12': 'KIP...
import math import operator import typing from sys import float_info import z3 from .._exceptions import UnsupportedError from ._funcs import and_expr, switch from ._proxy import ProxySort from ._registry import types from ._type_factory import TypeFactory if typing.TYPE_CHECKING: from .._context import Context...
""" @author: hugonnet stack ASTER, ArcticDEM and REMA DEMs by 1x1° tiles + fit GP time series at monthly resolution """ import os import sys os.environ["OMP_NUM_THREADS"] = "1" # export OMP_NUM_THREADS=4 os.environ["OPENBLAS_NUM_THREADS"] = "1" # export OPENBLAS_NUM_THREADS=4 os.environ["MKL_NUM_THREADS"] = "1" # e...
import logging import math import numpy as np from pyproj import CRS import rasterio logger = logging.getLogger(__name__) KM = 1000.0 MILES = 1609.34 # TODO # optional use of rasterio data ; extract proj / ellipsoid from it # TODO handle nodata (0 dans le TIFF IGN) ; # TIFF IGN EPSG:2154 - RGF93 / Lambert-93 - Pro...
import pandas as pd from metaquantome.util.check_args import function_check, tax_check from metaquantome.util.utils import MISSING_VALUES def read_and_join_files(mode, pep_colname_int, pep_colname_func, pep_colname_tax, samp_grps, int_file, tax_file=None, func_file=None, func_colname=None, ta...
# coding=utf-8 #from tkinter import * from Tkinter import * import tkFont #import tkinter.font as tkFont import os import pytalker as pyt bash_path = " ~/Documents/demo/devel/setup.bash" main_win = Tk() main_win.title("简易机器人GUI界面") main_win.geometry("200x500") def create_map(): map_win = Tk() map_win.title(...
# %%*- coding: utf-8 -*- # % matplotlib inline import matplotlib import numpy as np import pylab as plt from matplotlib.colors import ListedColormap from scipy import interpolate as interp from tomopy.misc.phantom import shepp2d from tqdm import tqdm from astra_utils import astra_recon_2d_parallel, astra_fp_2d_parall...
from collections import defaultdict from enum import Enum, auto import json import re from kgextractiontoolbox import tools from kgextractiontoolbox.backend.models import Tag, Document from kgextractiontoolbox.document.regex import TAG_LINE_NORMAL, CONTENT_ID_TIT_ABS class DocFormat(Enum): COMPOSITE_JSON = auto...
""" LED Roller Skates by <NAME> 2021 Version 1.0 RC1 HEAVILY based on the: LED Ukulele with Feather Sense and PropMaker Wing Follow the amazing tutorial here: https://learn.adafruit.com/light-up-reactive-ukulele Adafruit invests time and resources providing this open source code. Please support Adafruit and open source...
#Author: Darpan (Lines 1-304) """ MIT License Copyright (c) 2020 tdbowman-CompSci-F2020 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 right...
# -*- coding: utf-8 -*- """ Created on Tue Mar 3 11:14:24 2020 @author: alexc """ import scipy.stats as st import numpy as np from scipy.stats import chi2 from skimage import measure class HomogeneousResult(Exception): pass def _get_dist(latent, theta): if latent == 'normal': dist = st.norm(*theta)...
# -------------------------------------------- # File: byke_testapp.py # Date: 30/09/2019 # Author: <NAME> # Modified: # Desc: Test application for testing of byke systems, gps, motion sensor, and pic communication. # Setup for sql db testing. # -------------------------------------------- import tkinter as tk im...
""" An easier set of environments that involves more averaging (seed appendix) """ import matplotlib.pyplot as plt import numpy as np import pickle import seaborn as sns from collections import defaultdict from itertools import product from matplotlib.lines import Line2D from sys import argv from common import load_...
"""This is the matrix model which makes the dtm.""" from typing import Dict, NamedTuple, Optional import pandas as pd from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer from lexos.helpers import definitions from lexos.models.base_model import BaseModel from lexos.models.file_manager_model ...
# %% import numpy as np from matplotlib import pyplot as plt import copy,os import pyhsmm from pyhsmm.util.text import progprint_xrange from mpl_toolkits.mplot3d import Axes3D from matplotlib.gridspec import GridSpec, GridSpecFromSubplotSpec from matplotlib import font_manager import matplotlib as mpl zhfont1 = font...
#!/usr/bin/env python3 import isce from osgeo import gdal import argparse import numpy as np import matplotlib.pyplot as plt from isceobj.Sensor.TOPS.Sentinel1 import Sentinel1 from osgeo import gdal def cmdLineParse(): ''' Command line parser. ''' parser = argparse.ArgumentParser(description='Stitch...
# # General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall # model for 1st, 2nd and 3rd generation solar cells. # Copyright (C) 2008-2022 <NAME> r.c.i.mackenzie at googlemail.com # # https://www.gpvdm.com # # This program is free software; you can redistribute it and/or m...
# Copyright 2020 NXP Semiconductors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
# Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
#!/usr/bin/env python """ COCO validation script Hacked together by <NAME> (https://github.com/rwightman) """ import os import argparse import time import torch import torch.nn.parallel from contextlib import suppress from effdet import create_model, create_evaluator, create_dataset, create_loader, create_cots_datase...
import json import re import time import traceback import os import math import schedule from json import JSONDecodeError from os import path, environ from pyotp import TOTP from requests import ReadTimeout from vk_api.bot_longpoll import VkBotEventType, VkBotLongPoll, VkBotEvent, DotDict from vk_api.utils import get_...
#!/usr/bin/env python # # Author: <NAME> <<EMAIL>> # import numpy from pyscf import lib from pyscf import ao2mo from pyscf.cc import uccsd ''' UCCSD(T) ''' def kernel(eris, t1, t2): def p6(t): return (t + t.transpose(1,2,0,4,5,3) + t.transpose(2,0,1,5,3,4) + t.transpose(0,2,1,3,5,4) + ...
import sys import copy from. import position class BrillouinPlane(): def __init__( self, normal=position.Position() ): self.normal = normal self.distance = (-1.0)*position.Position_inner_product(self.normal,self.normal) def equation( self, atomic_position): return position.Position_in...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, division, print_function, absolute_import import os import json import logging from wsgiref.simple_server import WSGIServer as WSGIHTTPServer, WSGIRequestHandler import runpy from datatypes.url import Url from .compat import * from .threading import Thr...
#!/usr/bin/python3 #-*- encoding: Utf-8 -*- from subprocess import Popen, run, PIPE, DEVNULL, STDOUT, TimeoutExpired, list2cmdline from socket import socket, AF_INET, SOCK_STREAM from os.path import realpath, dirname from sys import stderr, platform from logging import debug from shutil import which from time import sl...
# functions to detect changes which indicate an entry point for various securities import datetime import logging import math import sys import time from market import bars from market import data from market import date from market import fatal # https://github.com/adammorley/ib/issues/7 def connectivityError(reqId,...
import numpy as np import os import torch import torch.nn as nn import time CONFIGS = [ # agent_type, env_type, game, memory_type, model_type [ "gmdqn", "atari", "alien", "shared-traj", "gmdqn-cnn" ], # 0 [ "gmdqn", "atari", "amidar", "shared-traj", "gmdqn-cnn" ], # 1...
# -*- coding: utf-8 -*- # ##################################### # ############# Imports ############### # ##################################### # Standard import os import datetime import re from tqdm.auto import tqdm import argparse # Data manipulation import torch from torch.utils.data import random_split, DataLoad...
from nltk.corpus import stopwords import re import numpy as np import math import os from nltk import word_tokenize from nltk.stem import WordNetLemmatizer from sklearn.feature_extraction.text import TfidfVectorizer from collections import defaultdict import nltk import codecs import gensim from nltk.stem import WordNe...
__all__ = [ 'GenericInitiatePaymentView', 'InitiatePaymentView', 'GenericValidateCheckoutView', 'VerifyCheckoutView', 'StatusCheckView' ] from math import ceil from random import randint from django.shortcuts import render, Http404, reverse, get_object_or_404 from django.utils.timezone import datetime from...
# -*- encoding:utf-8 -*- from server.qacnn import QACNN from server.InputCheck import Check from server.medSQL import qaSQL import tensorflow as tf import numpy as np import re import os import time import datetime import operator from server import insurance_qa_data_helpers from gensim import corpora, models, similari...
import cv2 import sys import torch import json import torchvision.transforms as transforms from lib.hrnet.lib.utils.transforms import * from lib.hrnet.lib.utils.coco_h36m import coco_h36m import numpy as np joint_pairs = [[0, 1], [1, 3], [0, 2], [2, 4], [5, 6], [5, 7], [7, 9], [6, 8], [8, 10], ...
# Copyright (c) 2021. All rights reserved. from __future__ import print_function import math import torch.nn as nn import torch.utils.data import torch.nn.functional as F from models.submodule import feature_extraction, MobileV2_Residual_3D, convbn_3d, build_gwc_volume, disparity_regression class hourglass3D(nn.Modul...
# Copyright 2018 <NAME>. All rights reserved. # # Licensed under the MIT license """ Script for panels of Figure S4 (Zebrafish phototaxis network) """ import os import numpy as np import matplotlib as mpl import matplotlib.pyplot as pl import seaborn as sns from mo_types import MoTypes import core as c import analys...
# -*- coding: utf-8 -*- import gzip from threading import Lock import yaml __all__ = ["Universe"] def _cache(func): """Wrap a no-argument method to cache its return value in the object.""" def inner(self): key = func.__name__ if key in self._cache: return self._cache[key] ...
""" This program 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 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WIT...
from common_utils import TestCase, run_tests import os import argparse import sys import shutil import time import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.optim.lr_scheduler import StepLR from torch.autograd import Variable from torchvision import datasets, tra...
#!/usr/bin/python # ----------------------------------------------------------------------------- # Name: VHDL instantiation script # Purpose: Using with VIM # # Author: BooZe # # Created: 25.03.2013 # Copyright: (c) BooZe 2013 # Licence: BSD # ----------------------------------------------------...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Written by <NAME>. MIT Licensed. Contact at www.sinclair.bio """ # Built-in modules # # Internal modules # from pacmill.reports.base_template import ReportTemplate from pacmill.reports.template import Header, Footer # First party modules # from plumbing.cache ...
#!/usr/bin/python3 # # Automated Dynamic Application Penetration Testing (ADAPT) # # Copyright (C) 2018 Applied Visions - http://securedecisions.com # # Written by Sie<NAME> - http://www.siegetechnologies.com/ # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except i...
""" Utilities for interacting with the python logging module. Mostly, this module provides functions for easily adding command line options to an `argparse.ArgumentParser` and then setting logging parameters accordingly. More details and examples for logging are given in the python documentation: * **Introduction**: ht...
import os import logging import sys from collections import OrderedDict import datetime import cartosql import requests # Constants HISTORY_URL = 'http://ucdpapi.pcr.uu.se/api/gedevents/18.1?pagesize=1000&page={page}' LATEST_URL = 'http://ucdpapi.pcr.uu.se/api/gedevents/18.1?pagesize=1000&page={page}&StartDate={start_...
#!/usr/bin/python3 import os import argparse import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np from scipy.interpolate import griddata import torch import torch.nn as nn from core.model import MNISTNet from core.dataset import dataset_fn from utils.config import load_confi...
#!/usr/bin/env python # # Copyright (C) 2011, 2012 <NAME> <<EMAIL>> # Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe 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 Founda...
""" Container structures for data that should be read or written to disk """ from astropy import units as u from ctapipe.core import Container, Field, Map from ctapipe.io.containers import * __all__ = [ 'FlatFieldContainer', 'PedestalContainer', 'PixelStatusContainer', 'MonitoringCameraContainer', ...
# Copyright 2010 New Relic, 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 writ...
# This code is licensed under the MIT License (see LICENSE file for details) import atexit import pathlib from PyQt5 import Qt from ris_widget import shared_resources from ris_widget.overlay import base from .. import load_data class ExperimentAnnotator: def __init__(self, ris_widget, experiment_name, position...
import pandas as pd import numpy as np import pkg_resources from . import models from warnings import warn def load_test_data(sites='all', variables='all'): """Pre-loaded data for model testing. This is the data used in the paper Hufkens et al. 2016 Available sites: ['freemangrass_grass'...
# Licensed under a 3-clause BSD style license - see LICENSE import tables as tb from pyrk.db import descriptions as desc import contextlib import sys import six @contextlib.contextmanager def nostderr(): """This context manager catches standard error output. It is used mostly to catch the unnecessary fileclo...
from django.shortcuts import render, redirect from django.http import HttpResponse from django.contrib.auth.hashers import make_password, check_password from django.db.models.query_utils import Q from django.contrib import messages from user.models import * from blog.models import * from user.forms import SignupForm, ...
#!/usr/bin/env python3 # Copyright (c) Microsoft Corporation # # All rights reserved. # # MIT License # # 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...
""" Copyright (c) 2018-2020 Qualcomm Technologies, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met: Redistributions of source code must retain...
## Swap training Implementation import networkx as nx import numpy as np import random as rnd from random import sample from random import randrange import tensorflow as tf from Masking import GraphMasking #import keras from tensorflow import keras from keras.models import Sequential from keras.layers import Dense, Z...
import numpy as np import xarray as xr import xarray.ufuncs as xu def all_combos(elements, max_n): """ Given a list `elements` of $n$ values, return a generator which will yield all subsets of 1, 2, ..., `max_n` combinations from that list. """ return chain(*[combinations(elements, i) for i in r...
import json import os class EANCDocReader: """ the class for converting texts from EANC format """ def __init__(self): self.filesize_limit = -1 self.meta = {} self.sentences = [] def process_text(self): """ Reads the file with the corpus, reads header separ...
# Copyright (c) 2018 <NAME> # 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, distribute, subl...
import math import time import uuid from http import HTTPStatus import redis from flask import Flask from flask import jsonify from flask import request from redlock import Redlock, Lock, MultipleRedlockException app = Flask(__name__) r = redis.StrictRedis(host='localhost', port=6379, db=0) rl = Redlock([{"host": "lo...
from __future__ import print_function import numpy as np from tractor import PointSource, getParamTypeTree, RaDecPos from tractor.galaxy import ExpGalaxy, DevGalaxy, FixedCompositeGalaxy from tractor.ellipses import EllipseESoft, EllipseE from legacypipe.survey import RexGalaxy, GaiaSource # FITS catalogs fits_type...
from dataclasses import replace import framework from models.encoder_decoder import add_eos from typing import Tuple, Dict, Any, Optional, Callable, List, Type import torch import torch.nn.functional as F import numpy as np class AccuracyCounter: def __init__(self): self.n_total = 0 self.n_ok = 0 ...
#%% import re, sys, os from io import StringIO from datetime import datetime # Primarily used to reformat datetime strings import plotly.express as px import plotly.graph_objects as go from sklearn.linear_model import LinearRegression import requests import numpy as np import pandas as pd pd.set_option("precision",...
import subprocess import logging from subprocess import PIPE import tempfile import json, os, re from github import Github, GithubException from datetime import datetime """ private-www Integration Test CI Hook for Uncle Archie This hook should be installed into all submodules of private-www. When a pull request in a...
import warnings warnings.filterwarnings("ignore") import h5py import numpy as np # import matplotlib # matplotlib.use('agg') import matplotlib.pyplot as plt from matplotlib.colors import LogNorm from openquake.hazardlib.geo import NodalPlane from openquake.hazardlib.pmf import PMF from openquake.hazardlib.imt import ...
import cv2 import time import tensorflow import detect_face import numpy as np import random from tensorflow import keras # ----tensorflow version check if tensorflow.__version__.startswith('1.'): import tensorflow as tf else: import tensorflow.compat.v1 as tf tf.disable_v2_behavior() print("Tensorflow ve...
from __future__ import print_function from simtk.openmm import app import simtk.openmm as mm from simtk import unit from sys import stdout import os import time import numpy as np import argparse import mdtraj import IPython from simtk.unit import Quantity, nanometer, angstrom parser = argparse.ArgumentParser(descript...
#!/usr/bin/env python3 """Parse OSM data """ import numpy as np import argparse #import osmium #import shapely.wkb as wkblib import xml.etree.ElementTree as ET from rtree import index import matplotlib.pyplot as plt import logging from logging import debug import random # Definitions WAY_TYPES = ["motorway", "trunk",...
# - Coding UTF8 - # # Networked Decision Making # Development Sites (source code): # http://code.google.com/p/global-decision-making-system/ # http://github.com/NewGlobalStrategy/NetDecisionMaking # # Demo Sites (Google App Engine) # http://netdecisionmaking.appspot.com # http://globaldecisionmaking.appspot.co...
""" .. moduleauthor:: <NAME> <<EMAIL>> """ # third-party libraries import pandas as pd import osmnx as ox import numpy as np # local imports import count_data import osm_download def spatial_grouping(dataframe, location_selection='1', mode='all'): """Assigns a single location to the data records. The data record...
"""本モジュールの説明 画像処理に使用する種々の関数群 """ import cv2 import numpy as np import os.path import sys import time from sklearn import preprocessing from tqdm import tqdm # グローバル変数 drawing = False complete_region = False ix, iy, box_width, box_height = -1, -1, 0, 0 box = [ix, iy, box_width, box_height] def lo...
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
#!/usr/bin/env python3 # coding=utf-8 import socket import struct import time import netifaces import zlib import threading import colorsys import argparse import random import fnmatch import winreg as wr def hsv2rgb(h,s,v): return tuple(round(i * 255) for i in colorsys.hsv_to_rgb(h/360.,s/100.,v/100.)) def sen...
from collections import OrderedDict from contextlib import contextmanager import itertools import matplotlib.pyplot as plt from artemis.general.should_be_builtins import bad_value from artemis.plotting.data_conversion import vector_length_to_tile_dims __author__ = 'peter' _newplot_settings = dict( layout='grid'...
# coding: utf-8 ############################################# # DCGAN ############################################# # Imports import os import time import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import Dataset from torch.utils.data import DataLoader fro...
import pandas as pd import numpy as np import os import seaborn as sns import pydeck as pdk import sklearn.neighbors from util import config from util import mapping def set_presets(): presets_descriptions = [ 'Chilling out in the saddle', 'Pretty relaxed, with some climbing', 'Half-day of tou...
#!/usr/bin/env python # # <NAME> # Dartmouth College # <EMAIL> # # This script finds, catalogs, and draws borders around # interesting paratextual objects and ornaments in page # images. It is used for the extraction of objects from # ECCO page images of eighteenth-century texts. import cv2 import imutils import o...
from data import DatasetFromObj from torch.utils.data import DataLoader, TensorDataset from model import Zi2ZiModel import os import argparse import torch import random import time import math import numpy as np from PIL import Image, ImageDraw, ImageFont import torchvision.transforms as transforms from torchvision.uti...
from glob import glob import matplotlib.pyplot as plt import numpy as np import os import pandas as pd import seaborn as sns from sklearn.preprocessing import QuantileTransformer from defaults import DATA_PATH, MAX_INTEGER def anova_prep(df): df = df.groupby(['subjectNo', 'condition'])['response'].mean() df ...
""" import bk_typing """ import typing as tp from typing import Union, List, Tuple, Dict, Sequence, Iterable, TypeVar, Any TV = TypeVar('TV') # __t New Number Subtypes, and functions to cast to them NonNegInt = tp.NewType('NonNegInt', int) NonNegFloat = tp.NewType('NonNegFloat', float) Probability = tp.NewType('...
from functools import reduce, lru_cache from typing import TypeVar, Optional, Union, Iterable # this base import is required in order to avoid a circular import; this module needs make_parent() # it is not possible to put make_parent() within this module, because it references Parent, and so it becomes an # internally...
import erppeek from RPA.Database import Database company_oid = '0da5cd6a-3719-48c0-a676-a7bc25ac7234' # MYSQL Settings mysql_database_name = "jolliantreopened" mysql_username = "root" mysql_password = "" mysql_host = "localhost" # odoo settings odoo_server = 'https://ibassoftware-integreationtest-demorpa-4538703....
# ------------------------------------------------------------ # Copyright (c) 2017-present, SeetaTech, Co.,Ltd. # # Licensed under the BSD 2-Clause License. # You should have received a copy of the BSD 2-Clause License # along with the software. If not, See, # # <https://opensource.org/licenses/BSD-2-Clause> # # -...
# -*- coding: utf-8 -*- # # Copyright 2021 Google LLC. 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 requir...
# function for making a robust recommendation to an agent, after observing some answered queries from gurobi_functions import create_mip_model, optimize from preference_classes import Item from utils import find_analytic_center, get_u0 from gurobipy import * import numpy as np def solve_recommendation_problem( an...
"""Utility functions for Web2Executable This module holds utility functions that are useful to both the command line and GUI modules, but aren't related to either module. """ from __future__ import print_function import os import zipfile import io import platform import urllib.request as request import tempfile import...
# Create your views here. from django.shortcuts import render from django.http.response import HttpResponse from django.template.context_processors import csrf from django.views.decorators.csrf import csrf_exempt from django.shortcuts import render, get_object_or_404 from django.http import HttpResponseRedirect from da...
import os import cv2 import glob import random def compare_pattern(token): for filepath in glob.glob("pattern/*.png"): pattern = cv2.imread(filepath, 0) diff = cv2.subtract(pattern, token) if cv2.countNonZero(diff) == 0: return filepath.split("\\")[1].split(".png")[0] return None def compare_3_8(token): p...
#!/usr/bin/env python3 import argparse import os import sys from collections import defaultdict, namedtuple from decimal import Decimal from os.path import getmtime, isfile class RateFinder(object): """A tool for finding the rate of the second lowest cost silver plan for a zipcode.""" # Exceptions. clas...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is licensed under the MIT License. License for BK-BASE 蓝鲸基础平台: ---------------------------------------------...
from __future__ import print_function import argparse import csv import datetime import glob import multiprocessing import numpy as np import os.path import pandas as pd import sys import matplotlib as mpl import pybedtools # to prevent DISPLAY weirdness when running in the cluster: mpl.use('Agg') import matplotlib.pyp...
import numpy as np import pyproj from eccodes import * class cgrib(): def __init__(self, gid, gribkeys=None): self.perturbationNumber = 0 _gribkeys = [ 'centre', 'dataDate', 'dataTime', 'unitOfTimeRange', 'year', 'month', 'day', 'hour', 'minute', ...
import argparse import json import os import random import pickle from collections import Counter def get_context(mention_id, mentions, entities, context_size): mention = mentions[mention_id] context_document_id = mention['context_document_id'] s = mention['start_index'] t = mention['end_index'] ...
"""Module to create README.md file with basic scaffold.""" import argparse import os import shutil import markdown_generator as mg from readme_generator.scaffold_options import (dbms, frameworks, serving_options, test_options,) from write_me.dep_info import parse from w...