text
stringlengths
6.04k
39.5k
from __future__ import absolute_import import sys import os import itertools from qmla.exploration_strategies.exploration_strategy import ExplorationStrategy import qmla.shared_functionality.experiment_design_heuristics import qmla.utilities from qmla import model_building_utilities __all__ = ["NVCentreNQubitBath"] ...
import collections import time from enum import Enum from typing import ClassVar, DefaultDict, Dict, List, Optional, Sequence, Tuple, Type, Union import h2.config import h2.connection import h2.errors import h2.events import h2.exceptions import h2.settings import h2.stream import h2.utilities from mitmproxy import h...
import pytest import sys import jabs.utils as ut class TestStr2List(object): 'test str2list' def test_str2list(self): 'should split a string on <space> or <comma>' str2list = ut.str2list assert str2list('') == [] assert str2list('a b') == ['a', 'b'] assert str2list('a...
# Copyright (c) 2012, 2020 <NAME> # Copyright (c) 2016 <NAME> # Copyright (c) 2020 <NAME> # ======================================================================= # Distributed under the MIT License. # (See accompanying file LICENSE or copy at # http://opensource.org/licenses/MIT) # ================================...
import random import warnings from typing import ( Callable, Iterable, List, Mapping, Optional, SupportsFloat, Union, cast, ) import dask import dask.dataframe as dd import numpy as np import pandas as pd from kartothek.core.common_metadata import empty_dataframe_from_schema from karto...
# Lint as: python3 # Copyright 2019, The TensorFlow Federated Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
# 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...
#Implementing the lex2opt on the dual arm laser contouring task import sys from lexopt_mosek import lexopt_mosek from hqp import hqp import robot as rob import casadi as cs from casadi import pi, cos, sin import numpy as np import matplotlib.pyplot as plt import math import time import json import os # import tkinte...
""" Basically a contains parser that is faster, because it tries to parse only parts and if anything changes, it only reparses the changed parts. It works with a simple diff in the beginning and will try to reuse old parser fragments. """ import re import difflib from collections import namedtuple import logging from...
# coding=utf-8 # Copyright 2021 The Uncertainty Baselines Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
from ..abb_data_pipeline import abb_clouddrl_read_pipeline as abb_rp from ..abb_data_pipeline import abb_clouddrl_constants as abb_c import cvxpy as cvx import numpy as np import pandas as pd from concurrent.futures import ThreadPoolExecutor import time import random import math import matplotlib.pyplot as plt import ...
# This is like part 2 of read_db. Now, you can actually add to the database FROM THE WEBSITE. PogU! # It starts off with all the code from read_db, with a few extra imports. """ read from a SQLite database and return data to templates """ from flask import Flask, render_template, request, flash from flask_sqlalchemy ...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import os import sys import fire import time import glob import yaml import shutil import signal import inspect import tempfile import functools import statistics import subprocess from datetime import datetime from pathlib import Path from ope...
import flask import os import collections import hashlib import time import datetime import jwt # the whole fence_create module is imported to avoid issue with circular imports import fence.scripting.fence_create from authutils.errors import JWTError from authutils.token.core import get_iss, get_kid from cdislogging ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Analysis.py Summary: Functions and classes that implement the analysis of a portfolio of assets whose properties are provided by an appropriate data source (typically, an instance of Datasource class). The core parts of the analysis are based on Monte-...
from __future__ import division, print_function import sys sys.path.append("../lib") import logging import theano import theano.tensor as T from theano import tensor from blocks.bricks.base import application, lazy from blocks.bricks.recurrent import BaseRecurrent, recurrent from blocks.bricks import Random, Initia...
# # BearLibTerminal # Copyright (C) 2013-2017 Cfyz # # 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...
# -*- coding: utf-8 -*- import sys import mmh3 import numpy as np # see also https://stackoverflow.com/a/1375939 def u32_to_s32(v): if(v & 0x80000000): return -0x100000000 + v else: return v # Note that MurmurHash3 is endian-sensitive. # In big-endian environments, these tests may fail. def t...
import time from gensei.base import np, output, Object, pause, assert_, _dashes, \ ordered_iteritems, dict_from_keys_init from gensei.any_object import AnyObject from gensei.utils import get_random, format_dict def reduce_to_fit(obj_conf, box): """ Adjusts obj_conf parameters of object so that the circum...
""" Tango makes heavy use of the :mod:`logging` module from the standard library to convey information to users. When you're writing your own :class:`~tango.step.Step` implementations we encourage you to also use standard Python logging as opposed to :func:`print` or other functions that write directly to ``stdout`` or...
from __future__ import print_function import copy from collections import OrderedDict from ipywidgets import Layout from ipywidgets import GridspecLayout from IPython.display import clear_output from IPython.core.interactiveshell import InteractiveShell from gym import spaces from rlzoo.common.env_list im...
# Author: <NAME> (<EMAIL>) 08/25/2016 """Train""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import os.path import shutil import sys import time from datetime import datetime import tempfile import json import cv2 import numpy as np import...
"""Create road OD matrices matched to network nodes in Argentina """ import csv import os import types import fiona import pandas as pd import geopandas as gpd import numpy as np import igraph as ig import copy import unidecode from scipy.spatial import Voronoi from atra.utils import * import datetime from tqdm import ...
#Embedded file name: ACEStream\Core\SessionConfig.pyo import sys import copy import pickle from ACEStream.env import TS_ENV_PLATFORM from ACEStream.Core.simpledefs import * from ACEStream.Core.defaults import sessdefaults from ACEStream.Core.Base import * from ACEStream.Core.BitTornado.RawServer import autodetect_socke...
#!/usr/bin/env python # coding: utf-8 # # Desafio 6 # # Neste desafio, vamos praticar _feature engineering_, um dos processos mais importantes e trabalhosos de ML. Utilizaremos o _data set_ [Countries of the world](https://www.kaggle.com/fernandol/countries-of-the-world), que contém dados sobre os 227 países do mundo...
#!/usr/bin/env python3 import json import math import random from inspect import currentframe # Import from custom utilities from util.mockStudents import getSampleStudents from util.generateCourses import getSampleCourses ''' Block 1-5 is first semester while block 6-10 is second semester schedule example: ...
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Copyright (c) 2013, Intel Corporation. # All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jul 4 14:48:07 2020 @author: chlo """ import numpy as np import spiceypy as sp mu_sun = 1.32712440018e+11 def DCM313(a1,a2,a3): c1 = np.cos(a1) c2 = np.cos(a2) c3 = np.cos(a3) s1 = np.sin(a1) s2 = np.sin(a2) s3 = np.si...
__author__ = 'lucabasa' __version__ = '1.0.0' __status__ = 'development' import pandas as pd import numpy as np import matplotlib.tri as tri import matplotlib.pyplot as plt import seaborn as sns from sklearn.model_selection import learning_curve from sklearn.inspection import partial_dependence from sklearn.pipeline ...
#!/usr/bin/env python3 from __future__ import print_function import requests import argparse import os import time import json import sys ################################################ ### FUNCTIONS ################################################ def get_url(args, path): host = args.host or os.environ.get("F...
""" config_utils.py --------------- Utility functions for parsing manim config files. """ __all__ = [ "_run_config", "_paths_config_file", "_from_command_line", "finalized_configs_dict", ] import argparse import configparser import os import sys import colour from .. import constants from ..util...
#!/usr/bin/env python3 import uuid import oscal """ Skipper Data Processing This file is used to generate Skipper related Data (c) 6 NOV 2021 - <NAME> // Sniper7Kills LLC """ def generateModules(root, project, Namespaces): for rootNS in Namespaces: module = root.createElement('module') module.s...
# -*- coding: utf-8 -*- import asyncio import datetime as dt import json from os import path, remove import re from logger import sys from asyncio import get_event_loop, ensure_future import requests import toml from aiohttp import ClientSession from gitTokenHelper import GithubPersonalAccessTokenHelper from config im...
import vtk import slicer import logging from slicer.util import NodeModify __all__ = ['EditUtil'] ######################################################### # # comment = """ EditUtil holds utility functions required by the other editor classes Note: this needs to be a class so it can be reloaded # TODO : ""...
# # Copyright (c) 2018 Intel Corporation # # 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...
# -*- coding:utf-8 -*- """ This is a search program! Create by qincy, April 17,2019 """ import os import logging import time import more_itertools import torch from pyteomics.mgf import read from torch.utils import data import torch.nn.functional as F import torch.nn as nn import pandas as pd import numpy as np from...
from mongoengine import * import databaseConn import datetime import csv import os # The directory where the training CSV's are located TRAINING_DIRECTORY = "training_data/symbol_csvs/" LIVE_DIRECTORY = "live_data/symbol_csvs/" # Deletes all of the CSV files in the training directory def clean_data_direc...
# Copyright 2012 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 ...
import matplotlib from matplotlib import pyplot as plt import csv # Function to extract measures from csv files def retrieve_data(ptn, measure): root_path = "../fragmentations-test/results/" x = [] y = [] with open(root_path + ptn + "/results.csv", 'r') as csvfile: data = list(csv.reader(csvfi...
# Copyright (c) 2013-2021 khal contributors # # 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, publi...
# Copyright 2021 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, ...
# 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 a...
# -*- coding: utf-8 -*- # File: refine.py # Copyright 2021 Dr. <NAME>. 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...
from __future__ import division, unicode_literals, print_function """ Utility classes for retrieving elemental properties. Provides a uniform interface to several different elemental property resources including ``pymatgen`` and ``Magpie``. """ import os import json import six import abc import numpy as np import pan...
import os import torch import numpy as np from torch.utils.data import Dataset, DataLoader import torch.nn as nn import pickle from tqdm import tqdm import argparse import operator from torch.nn import functional as F from dataloader import DatasetMetaQA, DataLoaderMetaQA from model import RelationExtractor from torch....
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from future.utils import with_metaclass import re from flexget.config_schema import process_config # TODO: rename all validator.valid -> validator.accepts / accepted / a...
"""Fabfile for the ``webfaction-django-boilerplate``. Make sure to setup your ``fabric_settings.py`` first. As a start, just copy ``fabric_settings.py.sample``. """ from __future__ import with_statement import os from fabric.api import ( cd, env, lcd, local, run, settings, ) from fabric.cont...
# =================================================================== # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of condi...
# Copyright 2013, <NAME>, NTT I3, 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 req...
from .util import here, tic, toc import numpy as np from os.path import join import pandas as pd import gzip, base64, io, sys, warnings import torch """ Data loading utilities TODO: - create getters and setters for all object members - rename entities to nodes - rename datatype to annotation """ _XSD_NS = "http:/...
import json import copy from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm from django.contrib.auth.tokens import default_token_generator from django.contrib.gis.gdal import GDALException from django.contrib.gis.geos i...
# -*- coding: utf-8 -*- import audioop import collections import contextlib import logging import math import os import sqlite3 import sys import tempfile import threading import wave from datetime import datetime from . import paths if sys.version_info < (3, 0): # NOQA import Queue as queue else: # NOQA im...
import logging import os import re from datetime import date, datetime, timedelta from typing import List import mechanize # automated web browsing: get, post import redis from rq import Connection, Queue, Worker import dict2 as d logging.basicConfig( format="%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:...
"Supporting objects and functions to convert Matplotlib objects into Bokeh." #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENCE.t...
#!/usr/bin/env python3 """This is a wrapper script around the Saxon command line interface. It attempts to make sure that the classpath is correct and that third party and other libraries are available.""" import os import sys import json import shutil import subprocess from pathlib import Path from xml.dom.minidom i...
from gym_minigrid.minigrid import * from configurations import config_grabber as cg import math import operator from functools import reduce import traceback import numpy as np config = cg.Configuration.grab() AGENT_VIEW_SIZE = config.agent_view_size EXTRA_OBSERVATIONS_SIZE = 5 OBS_ARRAY_SIZE = (AGENT_VIEW_SIZE, A...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import print_function import os import sys import json import numpy import pandas as pd from elasticsearch_dsl import Search, Q from elasticsearch import Elasticsearch import spacy try: nlp except NameError: nlp = spacy.load('en_c...
# Fast large file synchronization inspired by rsync. # # Author: <NAME> <<EMAIL>> # Last Change: March 6, 2020 # URL: https://pdiffcopy.readthedocs.io """Parallel, differential file copy client.""" # Standard library modules. import functools import os import pipes import subprocess # External dependencies. import r...
# -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function from collections import deque import itertools import logging from multiprocessing import ( Manager, Process, ) import os import random import numpy as np import pytoml as toml import six from six.m...
import torch from torch import optim from first_stage import FFNN_word_alignment import torch.nn as nn import utils.get_tensor as gt import pickle import numpy as np import random import time model = FFNN_word_alignment(440,120,10) model.load_state_dict(torch.load('./first_stage_state/statefe37.pth')) mode...
# Author: <NAME>, PhD # # Email: <EMAIL> # # # Ref: https://scikit-learn.org/stable/modules/generated/sklearn.manifold.TSNE.html # Ref: https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.jaccard.html#scipy.spatial.distance.jaccard # Ref: https://docs.scipy.org/doc/scipy/reference/generated/scip...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import io from typing import Dict, List, Optional, Tuple import torch # ===== the following section should be replaced once JIT provide native support @torch.jit.script def list_max(l: List[int]): max_value = l[0] # f...
from __future__ import print_function, division, absolute_import import sys import numpy as np import torch as th import torch.nn as nn import torch.nn.functional as F try: # absolute import from models.priors import ReverseLayerF except: # relative import from ..models.priors import ReverseLayerF fr...
# -*- coding:utf-8 -*- import os import torch import torch.nn as nn import torch.nn.functional as F import torchvision.models as models import pytorch_lightning as pl from pytorch_lightning.callbacks import Callback from torch import optim from torchvision import transforms import torchvision from PIL import Image, Im...
import time import threading import xbmcgui import kodigui import opener import windowutils from lib import util from lib.kodijsonrpc import rpc from plexnet import plexapp class SearchDialog(kodigui.BaseDialog, windowutils.UtilMixin): xmlFile = 'script-plex-search.xml' path = util.ADDON.getAddonInfo('path...
# oci-utils # # Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved. # Licensed under the Universal Permissive License v 1.0 as shown # at http://oss.oracle.com/licenses/upl. """ Helper module around network information. """ import os import os.path import socket import subprocess import signal...
# BERTBASEUNCASED LMXERT from copy import deepcopy import copy import json import logging import math import os import shutil import tarfile import tempfile import sys from io import open import torch from torch import nn from torch.nn import CrossEntropyLoss, SmoothL1Loss from torch.nn.functional import relu from ...
import unittest import re from archimedean_tilings import PermutationSymbol, Orbifold class TestBadPermutationSymbols(unittest.TestCase): def test_invalid_half_band_1(self): with self.assertRaises(ValueError): PermutationSymbol('<1,3>[0][2]*') def test_invalid_half_band_2(self): w...
import bleach import csv from decimal import Decimal from textwrap import dedent from django.http import HttpResponse from django.db.models import Avg, Max, Min, Count, StdDev from django.utils.safestring import SafeString from markdown import markdown from rest_framework import serializers from rest_framework.respon...
""" The main component of OpenFlow client_server. - Handle connections from switches - Generate and route events to appropriate entities like Ryu applications """ import contextlib import csv import ipaddress import logging import random import ssl from socket import IPPROTO_TCP from socket import SHUT_WR from socke...
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI 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 ...
import sys import argparse from statistics import mean from statistics import median import binascii from humanfriendly import format_size from humanfriendly import parse_size from elftools.elf.elffile import ELFFile from .create import create_patch from .create import create_patch_filenames from .apply import apply_...
# coding: utf-8 """ Content conversion into Elasticsearch compatible JSON. """ import xml.etree.ElementTree as ET import re import structlog log = structlog.getLogger() class PubMed_XML_Parser: """ """ def __init__(self, xml_chunk): pass def get_pmid(self, xml_record): """ ...
# # # Copyright (C) 2007, 2008, 2010, 2012 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright notice, # this list ...
from functools import reduce, wraps from inspect import Parameter, signature from logging import getLogger import operator from types import FunctionType, GenericAlias, MethodType import typing as t from abc import ABC, ABCMeta, abstractmethod from collections import abc from enum import Enum from typing_extensions im...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 20...
# -*- coding: utf-8 -*- # vim:set expandtab tabstop=4 shiftwidth=4: # # The MIT License (MIT) # LdapCherry # Copyright (c) 2014 <NAME> import cherrypy import ldap import ldap.modlist as modlist import ldap.filter import logging import ldapcherry.backend import sys from ldapcherry.exceptions import UserDoesntExist, \ ...
import numpy as np from pathlib import Path import re from itertools import islice class ParseInfoTNA: def __init__ (self, *argv): if not len(argv): self.set_list=True self.rdcs=True self.SECONDA=True self.het_csum=True self.qfactor=True self.chiral_vol=T...
#!/usr/bin/env python # __BEGIN_LICENSE__ # Copyright (c) 2009-2013, United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. All # rights reserved. # # The NGT platform is licensed under the Apache License, Version 2.0 (the # "License"); you may not use ...
# -*- coding: utf-8 -*- from __future__ import absolute_import from datetime import datetime from itertools import groupby from vilya.libs.store import store, mc, cache, bdb from vilya.libs.signals import codereview_signal from dispatches import dispatch from vilya.libs.props import PropsMixin from vilya.models.user...
#!/usr/bin/env python """ feffdat provides the following function related to reading and dealing with Feff.data files in larch: path1 = read_feffdat('feffNNNN.dat') returns a Feff Group -- a special variation of a Group -- for the path represented by the feffNNNN.dat group = ff2chi(pathlist) creates a group t...
# test_katcp.py # -*- coding: utf8 -*- # vim:fileencoding=utf8 ai ts=4 sts=4 et sw=4 # Copyright 2009 SKA South Africa (http://ska.ac.za/) # BSD license - see COPYING for details """Tests for the katcp utilities module. """ import unittest2 as unittest import logging import katcp from katcp.core import Sensor from...
import discord from discord.ext import commands, tasks import keep_alive import inspect import io import textwrap import traceback from contextlib import redirect_stdout import os from itertools import cycle from re import match from dotenv import load_dotenv load_dotenv() intents = discord.Intents.default() client = ...
# -*- coding: utf-8 -*- r""" Crystal Of Mirković-Vilonen (MV) Polytopes AUTHORS: - <NAME>, <NAME> (2015-05-11): initial version """ #***************************************************************************** # Copyright (C) 2015 <NAME> <muthiah at ualberta.ca> # 2015 <NAME> <tscrimsh at ...
# Copyright 2021 Universität Tübingen, DKFZ and EMBL for the German Human Genome-Phenome Archive (GHGA) # # 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...
from functools import wraps, partial import logging import json from ratelimit.decorators import ratelimit from urllib import request as builtin_request # import requests from urllib.parse import urlencode from datetime import datetime, timedelta from urllib.parse import quote from django.core.cache import cache from ...
import collections import numpy import six from chainer import cuda import chainer.link as link_module def _sum_sqnorm(arr): sq_sum = collections.defaultdict(float) for x in arr: with cuda.get_device(x) as dev: x = x.ravel() s = x.dot(x) sq_sum[int(dev)] += s ...
import datetime, urllib, math from operator import attrgetter from django.db.models import Q from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.core.cache import cache from django.db.models import Count from piston.handler import BaseHandler from piston.u...
#!/usr/bin/env python # Copyright (C) 2006-2010, University of Maryland # # 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 us...
"""Plotting utilities.""" import bisect from textwrap import wrap import numpy as np from scipy.ndimage import binary_dilation from scipy.spatial.distance import cdist import matplotlib.pyplot as plt from matplotlib import gridspec from matplotlib.patches import Patch import crism_ml.preprocessing as pre import cris...
import glob import sys import os import io import itertools from functools import partial import numpy as np from paddle.io import BatchSampler, DataLoader, Dataset def create_infer_loader(args): dataset = TransformerDataset( fpattern=args.predict_file, src_vocab_fpath=args.src_vocab_fpath, ...
import numpy as np import cv2 import re import imutils from imutils import contours import pandas as pd import json import os from shapely.geometry import Polygon from shapely.geometry import Point from shapely.geometry import MultiPolygon from shapely.ops import cascaded_union import math from scipy.spatial import Con...
#!/usr/bin/env python3 import logging logging.basicConfig(level=logging.WARN) import csv import glob import math import multiprocessing import os import sys import time from fuzzywuzzy import fuzz import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.base...
# coding=utf-8 """ Some helper functions to parse text-based files with more or less no well-defined format """ import os as os import re as re import csv as csv import collections as col import functools as fnt import io as io from crplib.auxiliary.file_ops import text_file_mode from crplib.auxiliary.constants impo...
import numpy as np from numpy.linalg import svd from scipy import sparse class SparseRepresentation(object): """Abstract class for all sparse representations.""" def error_profile(self, data): pass class GridDatabase(SparseRepresentation): """Class containing the grid database sparse representati...
from __future__ import division, print_function import copy import numpy as np import operator import matplotlib.pyplot as plt try: import spams except: print("Cannot import spams! You won't be able to optimize!") try: from cvxopt import matrix as cvxopt_matrix, solvers as cvxopt_solvers except: prin...
import functools import logging from contextlib import AsyncExitStack from functools import wraps from decimal import Decimal from sqlalchemy import exc from sqlalchemy.orm.session import make_transient import db, settings from economy import models, repositories, parsers, util, dataclasses from economy.rewards_poli...
import datetime import hashlib import hmac import json import logging import pathlib import re import urllib import xml.etree.ElementTree as ET import fire import requests import xmltodict CANONICAL_URI = '/' CONFIGURATION_FILE = 'config.json' CONFIGURATION_FOLDER = '.osc_sdk' DEFAULT_METHOD = 'POST' DEFAULT_PROFILE ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This file is part of the Wapiti project (http://wapiti.sourceforge.net) # Copyright (C) 2008-2018 <NAME> # # 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 Fo...
#/usr/bin/env python # -*- coding: utf-8 -*- import uuid import re import sys import warnings import fileinput import getopt try: xrange except NameError: xrange = range def GetUUID(): UU = uuid.uuid1().__str__(); UU = re.sub(r"\-", "_", UU) return UU def GetG(matchobj): return g[matchobj.gro...