text
stringlengths
3.07k
22.1k
# Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Modifications made by Cloudera are: # Copyright (c) 2016 Cloudera, 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. A cop...
# GPUtil - GPU utilization # # A Python module for programmically getting the GPU utilization from NVIDA GPUs using nvidia-smi # # Author: <NAME> (anderskm) # Date: 16 January 2017 # Web: https://github.com/anderskm/gputil # # LICENSE # # MIT License # # Copyright (c) 2017 anderskm # # Permission is hereby granted...
import torch import torch.utils.data as data import os import pickle5 as pk import matplotlib.pyplot as plt from pathlib import Path import numpy as np from torchvision import transforms as A import torch.nn.functional as F from tqdm import tqdm, trange from jaad_data import JAAD class DataSet(data.Dataset): def...
import sys import argparse import glob import vaex import pylab as plt import matplotlib from decimal import * #import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator import numpy as np from math import sqrt from matplotlib import rcParams rcParams.update({'figure.autolayout': True}) ...
""" To run these tests 1. start the web server locally via python -u -m conda_forge_webservices.webapp --local 2. Make sure you have a github token in the GH_TOKEN environment variable. 3. Make sure you have the STAGING_BINSTAR_TOKEN and PROD_BINSTAR_TOKEN environment variables defined. 4. Run these tests vi...
# -*- coding: utf-8 -*- # # Tencent is pleased to support the open source community by making QT4C available. # Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. # QT4C is licensed under the BSD 3-Clause License, except for the third-party components listed below. # A copy of the BSD ...
from functools import reduce import pandas as pd import glob import numpy as np import matplotlib.pyplot as plt from sklearn.ensemble import IsolationForest from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import ExtraTreesClassifier from sklearn.neighbors import KNeighborsClassifier from sklea...
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, The QuTiP Project # 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. Redistributi...
# -*- coding: utf-8 -*- """ Created on Sun Apr 12 10:40:00 2020 @author: Genocs @description: In this exercise we are going to use images dataset stored in a local drive - Check following packages - TensorFlow - Pillow - matplotlib ...
# coding: utf-8 from __future__ import unicode_literals from django.contrib import messages from django.db.transaction import atomic from django.forms.models import modelform_factory, modelformset_factory from django.shortcuts import redirect from django.utils import timezone, translation from django.utils.timezone im...
""" The purpose of this module is to implement the graphical user interface for the face recognition application. For that, we use the kivy library. """ ################################################################################ # Imports. #########################################################################...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Script Name: ToolBoxV.py Author: <NAME>/Jimmy - 3D artist. Description: """ # ------------------------------------------------------------------------------------------------------------- """ Import """ import logging from functools import partial import mtoa.util...
from bgflow.nn.flow.stochastic.snf_openmm import BrownianPathProbabilityIntegrator, OpenMMStochasticFlow import copy import pickle import pytest import numpy as np import torch try: from simtk import openmm as mm from simtk import unit from openmmtools.integrators import ThermostatedIntegrator _OPE...
import json import copy import logging import re from urllib.parse import urljoin, urlparse, urlunparse # create logger logger = logging.getLogger('linkto_report') def list_diff(l1, l2): # using deepcopy to avoid modifying the original list l1 = copy.deepcopy(l1) for i in l2: if i in l1: ...
""" Here we code our model. This may include feature engineering. """ import typing as t from functools import partial import numpy as np import pandas as pd from sklearn.base import BaseEstimator, RegressorMixin, TransformerMixin from sklearn.preprocessing import PolynomialFeatures, KBinsDiscretizer from sklearn.com...
import numpy as np import pybnesian as pbn import util_test SIZE = 10000 df = util_test.generate_normal_data(SIZE) def test_cv_disjoint_indices(): cv = pbn.CrossValidation(df) for (train_df, test_df), (train_indices, test_indices) in zip(cv, cv.indices()): nptrain = np.asarray(train_indices) ...
''' Author: <NAME> Date Created: March 11, 2022 ''' from globals import * import pandas as pd import numpy as np import os import download import glob from networks import ghcn from networks import ushcn from networks import uscrn country_code_df = False land_mask = {} # Arctic Circle, i.e., 66° 33′N. ARTIC_CI...
""" models.py Contains models for the coinex API """ from decimal import * import coinex_api from datetime import datetime # set the decimal precision to 8 getcontext().prec = 8 class Balance: """ A container for a balance of a given currency Attributes: currency: the Currency amount: a...
import numpy import pymp from matplotlib import pyplot as plt from PIL import Image import copy from . import toolbox CPU_COUNT = toolbox.CPU_COUNT def unit_vectors(directions): """ Calculate the unit vectors (UnitX, UnitY) from a given direction angle. Parameters ---------- directions: 3D NumPy...
""" Generic data loading routines for the SEN12MS dataset of corresponding Sentinel 1, Sentinel 2 and Modis LandCover data. The SEN12MS class is meant to provide a set of helper routines for loading individual image patches as well as triplets of patches from the dataset. These routines can easily ...
import es import gamethread import playerlib import random import usermsg import vecmath info = es.AddonInfo() info.name = 'Bombsite Limiter' info.version = '1.0.4' info.url = 'http://forums.mattie.info/cs/forums/viewtopic.php?t=23340' info.basename = 'bombsite_limiter' info.author = 'Sc0pE' #####################...
import os import random import math import shutil import re from collections.abc import Sequence ## Constants MOVE_DISTANCE = 30 MOVE_VARIANCE = 5 MOVE_STEP = 5 OVERWORLD_REGION = "region" POI_REGION = "poi" ENTITIES_REGION = "entities" def filename_to_coords(filename) : name_parts = filename.split(".") ret...
#!/usr/bin/python ## My first python code ##imports: import checkExoplanet as cEx from astroquery.simbad import Simbad import numpy as np from astroquery.vizier import Vizier from astropy import units as u import os from astropy.table import Table ## My functions: def custumized_Simbad(): customSimbad = Simbad() ...
from flask import Blueprint, request, url_for, make_response, jsonify, render_template, redirect from flask import abort, flash from flask_login import login_required, current_user from flask_mail import Message from data import User, Tournament, Post, create_session from config import config from app import send_messa...
import os import requests import json import pandas as pd import time from datetime import datetime # Make sure the environment variable is already set up bearer_token = os.environ.get("BEARER_TOKEN") def extract_public_metrics(df_tweets): ''' Pulls out the `public_metrics` object and appends this to the Pa...
#!/usr/bin/env python import os import io import time import sys from skimage import io import signal import struct import subprocess import threading import numpy as np import argparse ################################################################ # Initialise the Raspberry Pi video ###############################...
import cv2 import glob import os import matplotlib.pyplot as plt import numpy as np import torch as t from skimage import io from torchvision.utils import make_grid def weights_init(m): classname = m.__class__.__name__ if classname.find('Conv') != -1: m.weight.data.normal_(0.0, 0.02) elif classna...
# -*- coding: utf-8 -*- """ Created on Sat Jul 01 19:34:50 2017 @author: Matt """ from scipy.sparse import lil_matrix import numpy as np from scipy.optimize import linprog from os import listdir, getcwd, system class problem: def __init__(self, filename): self.name = None self.rows = {} ...
import plotly.graph_objects as go import plotly as pl import dash import dash_core_components as dcc import dash_html_components as html import pandas as pd import numpy as np import io import xlsxwriter import flask import base64 from flask import send_file fig = go.Figure() external_classNamesheets = ['assets/custo...
import itertools from bisect import bisect_right # import matplotlib.pyplot as plt import torch import torch.nn as nn from torch.optim.lr_scheduler import ( CosineAnnealingLR, CosineAnnealingWarmRestarts, ExponentialLR, LambdaLR, ReduceLROnPlateau, StepLR, CyclicLR, _LRScheduler, Re...
from django.views.generic.list import ListView from django.conf import settings from django.http import HttpResponse, HttpResponseRedirect from django.db import transaction from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator, EmptyPa...
import numpy as np from sds.distributions.lingauss import StackedLinearGaussiansWithPrecision from sds.distributions.lingauss import StackedLinearGaussiansWithDiagonalPrecision from sds.distributions.lingauss import LinearGaussianWithPrecision from sds.distributions.lingauss import LinearGaussianWithDiagonalPrecision...
import asyncio from math import ceil import discord from discord import Colour from discord.ext import commands from classes.classic_solver import ClassicSolver from classes.repeat_solver import RepeatSolver from classes.detective_solver import DetectiveSolver from classes.custom_solver import CustomSolver from class...
# Copyright 2015 Hewlett-Packard Corporation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
import numpy as np import matplotlib.pyplot as plt from simple_GAN.utils import sample_data, relu, sigmoid, tanh, DataChunk EPSILON = 1e-8 class GANSubnet: def __init__(self, batch_size=32, layer_sizes=(64, 32, 2), output_activation_func=None): self.batch_size = batch_size if output_activation_fu...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
#================================================================ # Functions to show the evolutions of omega in function of t #================================================================ # Load modules import numpy as np import matplotlib.pyplot as plt # Personal modules from stellapy.plot.utils import l...
import math import warnings import matplotlib.pyplot as plt import numpy as np import pandas as pd import xgboost from scipy.stats import pearsonr from sklearn.linear_model import Ridge, LinearRegression, Lasso from sklearn.metrics import mean_squared_log_error from sklearn.model_selection import KFold from sklearn.pi...
import pandas as pd import numpy as np import random import matplotlib.pyplot as plt import cv2 import matplotlib.image as mpimg plt.switch_backend('agg') import math import json import h5py import keras from keras.models import Sequential, Model from keras.layers import Convolution2D, Flatten, MaxPooling2D...
from base64 import b64decode import json import logging import os import requests from pymongo import MongoClient, DESCENDING from prom_lib.prometheus_client import PrometheusClient import datetime from importlib import import_module import uuid logger = logging.getLogger("AI-Agent v8") stream_handler = logging.Str...
# pylint: disable=C0103, R0902 # $Filename$ # $Authors$ # Last Changed: $Date$ $Committer$ $Revision-Id$ # Copyright (c) 2003-2011, German Aerospace Center (DLR) # All rights reserved. # # #Redistribution and use in source and binary forms, with or without # #modification, are permitted provided that the fol...
try: from urllib2 import urlopen, quote except: from urllib.request import urlopen, quote, Request import json import shutil import os from glob import glob class VeneerRetriever(object): ''' Retrieve all information from a Veneer web service and write it out to disk in the same path structure. T...
import time import numpy as np import pandas as pd import torch import torch.nn as nn import itertools import collections import matplotlib.pyplot as plt # Read in data # df = pd.read_csv("Chinese_Names_Corpus_Gender(120W).txt", header=2) df = pd.read_csv("English_Cn_Name_Corpus(48W).txt", header=None, name...
from __future__ import print_function import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms from torch.optim.lr_scheduler import StepLR import csv from tensorboardX import SummaryWriter from datetime import datetime im...
""" Module to plot and save the results of the experiments on HCP data """ #Author: <NAME> (<EMAIL>) #Date: 22 February 2021 import numpy as np import matplotlib.pyplot as plt import pickle import pandas as pd import xlsxwriter import os import sys from scipy import io def find_relfactors(model, res_dir, BestMod...
""" This code is adapated from https://github.com/google-research/fixmatch and https://github.com/kekmodel/FixMatch-pytorch. """ import logging import random import numpy as np import PIL import PIL.ImageOps import PIL.ImageEnhance import PIL.ImageDraw from PIL import Image from torchvision import datasets from tor...
# ungoogled-chromium: A Google Chromium variant for removing Google integration and # enhancing privacy, control, and transparency # Copyright (C) 2016 Eloston # # This file is part of ungoogled-chromium. # # ungoogled-chromium is free software: you can redistribute it and/or modify # it under the terms of the GNU Gen...
#!/usr/bin/env python # encoding: utf-8 import json import csv import os import numpy as np import matplotlib.pyplot as plt import pandas as pd import matplotlib.patches as mpatches from itertools import combinations from scipy.optimize import curve_fit from scipy.spatial.distance import cosine, euclidean, pdist, sq...
import numpy as np from scipy.interpolate import interp1d from scipy.integrate import cumtrapz as cumtrapz from scipy.constants import c as c_luz #metros/segundos c_luz_km = c_luz/1000 import sys import os from os.path import join as osjoin from pc_path import definir_path path_git, path_datos_global = definir_path() ...
# coding: utf-8 import numpy as np from itertools import product from collections import Counter import pandas as pd import os import re import json import openslide from matplotlib import pyplot as plt import cv2 #cell# from extract_rois_svs_xml import extract_rois_svs_xml from slideutils import (plot_contour, get_...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Apr 24 09:38:22 2019 @author: phunh """ import os from argparse import Namespace, ArgumentParser from osgeo import ogr, osr import json from submodules.pythonXdmfReader.pythonXdmfReader import ReadGeometry, ReadConnect, LoadData, ReadNdt from Unstructur...
from abc import ABCMeta, abstractmethod from tensorflow.python.util import nest import tensorflow as tf from collections import OrderedDict from enum import Enum import json from typing import List, Dict, Any, Collection, NoReturn, Set, Union class PlaceholderType(Enum): Text = 1 TargetInt = 2 TargetFloat...
import numpy as np import threading import time from PyQt5 import QtCore, QtWidgets from tqdm import tqdm from pydynamo_brain.model import IdAligner from pydynamo_brain.ui.baseMatplotlibCanvas import BaseMatplotlibCanvas # Configuration: These can be played around with if you know what you're doing. # Max distance ...
import numpy as np import ast import plotly.graph_objects as go from scipy.signal import medfilt, detrend from abc import ABCMeta, abstractmethod from importlib import import_module from ..signals.bvp import BVPsignal from ..utils import filters, printutils from ..utils import detrending def methodFactory(methodName, ...
"""Modified from SqueezeDet Demo. In image detection mode, for a given image, detect objects and draw bounding boxes around them. In video detection mode, perform real-time detection on the video stream. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function ...
#!/usr/bin/python3 __version__ = "2.0" import websocket import _thread import time import json import sys import web3 from web3 import Web3, HTTPProvider from operator import itemgetter from collections import OrderedDict ################# # CONFIGURATION # ################# # Your Ethereum wallet's public key #...
from __future__ import print_function import argparse import gzip import io import os import sys from collections import defaultdict from consplice.constraint.utils import get_alternative_gene_symbols from interlap import InterLap # ------------------------------------------------------------------------------------...
########################################################################## # # This file is part of Lilith # made by <NAME> and <NAME> # # Web page: http://lpsc.in2p3.fr/projects-th/lilith/ # # In case of questions email <EMAIL> # # # Lilith is free software: you can redistribute it and/or modify # it under ...
import socket, os, time, threading, sys from queue import Queue #Banner def banner(banner): File = open(banner, "r") banner = File.read() File.close() return banner print("\033[93m" + banner("banner.txt") + "\033[0m") print("\n\nWelcome to Pheonix handler!") #Threadings variables Threads = 2 #nb of t...
#!/usr/bin/env python3 # TODO: Update interface usage. import sys sys.path.append("..") # Ignore warnings. import warnings warnings.filterwarnings("ignore") import pickle import logging import numpy as np import pandas as pd from os import listdir from sklearn.model_selection import train_test_split from sklearn....
""" Derived module from dmdbase.py for higher order dmd. Reference: - <NAME>, <NAME>, Higher Order Dynamic Mode Decomposition. Journal on Applied Dynamical Systems, 16(2), 882-925, 2017. """ from past.utils import old_div import numpy as np import scipy as sp from scipy.linalg import pinv2 from mosessvd imp...
""" Mood module Name: mood.py Description: responds to common ways of asking "How are you?" determines mood based on weather, stock market, and wording of top news stories Dependencies: Weather Underground API (requires key) USA Today API (requires key) ...
import sys sys.path.insert(0,'./') from argparse import ArgumentParser import pytorch_lightning as pl import json from typing import Iterator, List, Dict, Optional import torch import torch.optim as optim import torch.nn.functional as F import numpy as np # for dataset reader from allennlp.data.data_loaders import M...
# ------------------------------------------------------------------------------ # Copyright (c) Microsoft # Licensed under the MIT License. # Written by <NAME> (<EMAIL>) # ------------------------------------------------------------------------------ """ Modified by <NAME> <EMAIL> July 14, 2020 """ import sys, os pat...
''' Created on May 5, 2017 @author: anthony ''' # compact import sys if sys.version_info < (3,): import urllib2 else: import urllib import urllib.request import urllib.parse import math import re from bs4 import BeautifulSoup from threading import Thread from collections import deque from time import ...
from mtg.utils.display import print_deck import numpy as np import tensorflow as tf import pickle import pathlib import os def importance_weighting(df, minim=0.1, maxim=1.0): rank_to_score = { "bronze": 0.01, "silver": 0.1, "gold": 0.25, "platinum": 0.5, "diamond": 0.75, ...
###Exemple of conditional structures with the STICK paradigm from neurons_and_synapses import * from memory import * def generate_modulator_synapse(G,mod = 5,idx_start=0,name=''): """ Synapse to create a network which only returns spike which are emitted at a time which is a multiple of mod :param G: ...
# Copyright(c) 2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the followi...
#!/usr/bin/env python3 import sys import sqlite3 from base64 import b64encode from urllib.parse import quote PROD_ID = '-//Apple Inc.//Mac OS X 10.15.7//EN' ITEM_COUNTER = 0 class ABCDDB(object): @staticmethod def load(db_path): db = sqlite3.connect(db_path) cur = db.cursor() records...
""" Utility functions for creating Python scripts that expect to turn one file into another, or use stdin/stdout as part of a pipeline. Copyright 2018 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the Li...
import sys from pymodaq.daq_utils.gui_utils.custom_app import CustomApp from pymodaq.daq_utils.gui_utils.dock import Dock import pymodaq.daq_utils.gui_utils.layout from qtpy import QtWidgets, QtGui, QtCore from pymodaq.daq_utils import config as config_mod from pymodaq.daq_utils.daq_utils import ThreadCommand, set_log...
import os import sys c_folder = os.path.abspath(os.path.dirname(__file__)) p_folder = os.path.abspath(os.path.dirname(c_folder)) sys.path.append(c_folder) sys.path.append(p_folder) import cv2 import json import time import torch import argparse import torch2trt import numpy as np import trt_pose.coco import trt_pose.m...
""" simple Go environment: legal moves, game score RBH 2019 * based on a subset of M Mueller's Go0 Go1 programs * allow rectangular boards, so with columns != rows 1 <= R <= 9 rows 1 <= C <= 9 columns working * legal moves (Tromp-Taylor, no suicide, positional superko) ...
import utils (debug, info, error) = utils.Echo.echo() class BabylonMesh: """JSON Mesh format defined by Babylon.js""" def __init__(self, mesh): from unitypack.export import MeshData if mesh.mesh_compression: # TODO handle compressed meshes raise NotImplementedError("(%s) compressed meshes are not suppor...
""" Calculating SNR of the GC candidates """ import os import numpy as np import astropy.units as u import astropy.constants as const from astropy.table import Table, vstack import matplotlib.pyplot as plt from spectres import spectres from tqdm import tqdm import context import misc def der_snr(flux, axis=1, full_o...
from common_fixtures import * # NOQA import jinja2 import os if_upgrade_testing = pytest.mark.skipif( os.environ.get("UPGRADE_TESTING") != "true", reason='UPGRADE_TESTING is not true') pre_upgrade_namespace = "" post_upgrade_namespace = "" pre_port_ext = "" post_port_ext = "" @pytest.fixture(scope='session...
from __future__ import print_function import os import sys import argparse import torch import torch.backends.cudnn as cudnn import numpy as np from data import cfg_mnet, cfg_re50 from layers.functions.prior_box import PriorBox from utils.nms.py_cpu_nms import py_cpu_nms import cv2 from models.retinaface import RetinaF...
# Copyright 2018 Canonical 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 in writing, s...
# All content Copyright (C) 2018 Genomics plc import datetime import gzip import re from wecall.genomics.chromosome import chromosome_comp from wecall.utils.tabix_wrapper import TabixWrapper import os import wecall.vcfutils.schema import wecall.vcfutils.record from wecall.utils.interval import WHOLE_GENOME ADAPTER_K...
import fnmatch import inspect import os from importlib.util import spec_from_file_location import logging import sys __dirname, __init_python_script = os.path.split(os.path.abspath(__file__)) logger = logging.getLogger("SimplePlugins") formatter = logging.Formatter('%(asctime)s %(name)-12s %(levelname)-8s %(message...
from collections import OrderedDict import pandas as pd import torch from torch import nn from torch.autograd import Variable def get_names_dict(model): """ Recursive walk over modules to get names including path. """ names = {} def _get_names(module, parent_name=''): for key, module in ...
import h5py import numpy as np import uuid import logging from typing import Union, Dict, Any, List, Tuple from nexus_constructor.common_attrs import CommonAttrs from nexus_constructor.instrument import Instrument from nexus_constructor.json.helpers import object_to_json_file from nexus_constructor.nexus.nexus_wrapper...
import json import frappe from frappe.utils.logger import get_logger from spine.spine_adapter.redis_client.redis_client import submit_for_execution from spine.spine_adapter.kafka_client.kafka_producer import get_kafka_config from frappe.utils import cint from confluent_kafka import Producer from datetime import timede...
import os import subprocess import shutil import re import tarfile import tempfile import configparser from utils.model_evaluation import calculate_simple_average, make_pub_simple_avg_df, generate_frequentist_comparison, generate_posterior_comparison _properties = None def get_properties(config_file = "config.propert...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import os from cifar10_utils import get_cifar10 from vgg import VGG from vgg_support import load_pretrained_VGG16_pool5 from support import get_run_var, save_accuracy_curve_in_a_file from tenso...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Get the best dialect with our data consistency measure. This is the base package that contains common functions. Author: <NAME> Copyright (c) 2018 - The Alan Turing Institute License: See the LICENSE file. """ import itertools import re from collections import Coun...
''' Perform a correlation analysis to find z values the coincide with a feature on the output In particular, find z values that correspond with sentence-initial consonants ''' import matplotlib as plt import numpy as np import re from sklearn.linear_model import LinearRegression from sklearn.linear_model import Logisti...
import codecs,pickle,traceback,sys,re from nltk.corpus import stopwords import nltk.data tokenizer = nltk.data.load('tokenizers/punkt/turkish.pickle') from nltk.tokenize import word_tokenize # alternative word tokenizer #from nltk.tokenize import PunktWordTokenizer #punkt_word_tokenizer = PunktWordTokenizer() from nl...
# /* # * Copyright (c) 2021 Xilinx Inc. All rights reserved. # * # * Author: # * <NAME> <<EMAIL>> # * # * SPDX-License-Identifier: BSD-3-Clause # */ from collections import OrderedDict from operator import ior from functools import reduce nodes = dict() debug = False # Constants NS_CHECK_TYPE = False # Region...
from os import path import numpy as np import torch import torch.utils.data as td import torchvision.datasets as dsets import torchvision.transforms as tt import vsrl_utils as vu from faster_rcnn.datasets.factory import get_imdb import faster_rcnn.roi_data_layer.roidb as rdl_roidb import faster_rcnn.fast_rcnn.config a...
""" Provides the definitions for `build_gui` and `load_gui`, as well as the code for loading the app element and children thereof. """ from .gui import Gui, GuiContainer from .exceptions import * from .load_common import * from .load_windows import * from lxml import etree import wx import wx.aui import imp...
# -*- coding: utf-8 -*- from django.views.generic import CreateView, ListView, DeleteView, DetailView, RedirectView from django.template.loader import render_to_string from django.core.mail import EmailMessage from django.contrib import messages from django.core.urlresolvers import reverse from django.contrib.admin.vie...
import quandl import pandas as pd import numpy as np def get_data(daysahead=20): # import data # USDCAD= quandl.get("FED/RXI_N_B_CA", authtoken="mmpvRYssGGBNky8<PASSWORD>") # US overnight rates EffFedRate = quandl.get("FED/RIFSPFF_N_D", authtoken="<PASSWORD>", start_date='1980-01-01') FedUppTarRange= quandl.get...
import math import time, sys from bresenham import bresenham from enum import Enum class Direction(Enum): RIGHT = 0 UP = 1 LEFT = 2 DOWN = 3 class State(Enum): STRAIGHT_LINE = 0 SURROUND = 1 BEST_SURROUNDED = 2 class PathPlanning: def __init__(self, start, goal, map): self.s...
#!/usr/bin/env python3 from timfuz import simplify_rows, loadc_Ads_b, index_names, A_ds2np, run_sub_json, print_eqns, Ads2bounds, instances, SimplifiedToZero, allow_zero_eqns, corner_s2i, acorner2csv from timfuz_massage import massage_equations import numpy as np import sys import math def check_feasible(A_ub, b_ub)...
# -*- coding: utf-8 -*- # Copyright (c) 2020 Nekokatt # # 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, me...
"""pg_mvt.factory: router factories.""" import json from typing import Any, Callable, Dict, List, Optional, Tuple, Type from urllib.parse import urlencode from morecantile import Tile, TileMatrixSet from pg_mvt.dependencies import ( LayerParams, TileMatrixSetNames, TileMatrixSetParams, TileParams, ) ...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Mon Feb 19 10:10:22 2018 @author: dalonlobo """ from __future__ import absolute_import, division, \ print_function, unicode_literals import os import sys import argparse import logging import shutil import json import re from azure....
import datetime import logging import cherrypy import core import os import time import hashlib from core import searcher, postprocessing from core.rss import imdb, popularmovies from lib.cherrypyscheduler import SchedulerPlugin from core import trakt from core.library import Metadata, Manage logging = logging.getLo...
def find_mod(path, dic): """用字典中的词发现文本模式""" file_list = os.listdir(path) word_list = read_dict(dic) word_count = {} #用一个字典保存, key为发现的文本模式, 键值为匹配该模式的词典中的词的数目 mod_list = [] #文本模式以列表形式保存 word_match = {} p = 5 q = 5 for file in file_list: with open(os.path.joi...