text
stringlengths
3.07k
12.6k
import os import sys, json from typing import List sys.path.append(os.path.join(os.path.dirname(__file__), '..')) sys.path.append(os.path.join(os.path.dirname(__file__), '../..')) from etk.etk import ETK from etk.etk_module import ETKModule from etk.csv_processor import CsvProcessor from etk.extractors.decoding_value_...
# Copyright 2012 OpenStack Foundation # # 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...
from flask import Flask, request, url_for, redirect, render_template, jsonify, make_response import json from dotenv import load_dotenv import os import redis import datetime from math import ceil # Connect to Redis load_dotenv() r = redis.from_url(os.environ.get("REDIS_URL")) r.flushdb() MAX_REQUESTS = 1000 REQUESTS...
# info_nce_loss import torch import torch.nn.functional as F import datetime # percent replicating import pandas as pd import matplotlib.pyplot as plt import random import numpy as np import utils_benchmark # heatmapCorrelation import seaborn as sns # Umap import umap import umap.plot import colorcet as cc def now...
# stdlib import pathlib from typing import Any, Dict, Iterable, List, Tuple # 3rd party from domdf_python_tools.paths import PathPlus from pytest_regressions.data_regression import DataRegressionFixture # this package from configconfig.parser import Parser from tests.configuration import ( additional_setup_args, ...
print(">>>> WARNING: THE MODULE", __name__ ,"IS MARKED FOR REMOVAL") ''' This file should contain the actual loss implementations. Losses.py should only contain the dictionary of losses, or very simple one-line calls to functions defined in this file here All energy weighting should be done with sqrt(E) and must use...
# Copyright 2022 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, ...
#! /usr/bin/env python # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) 2011-2015, Michigan State University. # Copyright (C) 2015-2016, The Regents of the University of California. # # Redistribution and use in source and binary forms, with or without # modification, are permitte...
import re import json import csv from collections import defaultdict from django.shortcuts import render, redirect from django.http import HttpResponse, HttpResponseBadRequest from django.views import generic, View from django.template import RequestContext from django.core.serializers.json import DjangoJSONEncoder f...
#!/usr/bin/python # Python script for minimal confidence testing of a PEBBL build from __future__ import print_function # Fix for Python 2.7 import subprocess import sys import os def patternMatch(inputString, pattern, outputList) : tokens = inputString.split() output = [] for matchToken in pattern : if l...
### ## * << Haru Free PDF Library 2.0.0 >> -- raw_image_demo.c ## * ## * Copyright (c) 1999-2006 <NAME> <<EMAIL>> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the above copyright notice ap...
# -*- coding: utf-8 -*- # # @author <NAME> # @date 4 April 2019 import tensorflow as tf from sklearn.model_selection import StratifiedShuffleSplit import time from datetime import datetime # Main slim library slim = tf.contrib.slim #TF model class pipeline_AE(object): def __init__(self, net_arch): ...
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.d (the "License"); # you may not use this file except in compliance with the License. # """ Módulo de userbot que contiene comandos id de usuario, id de chat y log""" from asyncio import sleep from userbot...
try: from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D # import required by matplotlib. visuals_enabled = True except ImportError: visuals_enabled = False def visualise(func): def wrapper(*args, **kwargs): if not visuals_enabled: raise ImportError("v...
# SJTU EE208 # -*-coding:utf-8-*- import os import math import re import string import sys from typing import final import urllib import requests import urllib.error import urllib.parse import urllib.request from urllib.request import Request, urlopen import hashlib import threading import queue import time from bs4 im...
import os import pickle import urllib.request import rtree # pip install Rtree; apt install libspatialindex4v5 import shapely # pip install shapely class NAIPTileIndex: '''Utility class for performing NAIP tile lookups by location ''' NAIP_BLOB_ROOT = 'https://naipblobs.blob.core.windows.net/naip/' NA...
import inspect import json import os from typing import Any, Dict, List, Union import aft_common.aft_utils as utils import boto3 import jsonschema from boto3.session import Session logger = utils.get_logger() AFT_PIPELINE_ACCOUNTS = ["ct-management", "log-archive", "audit"] def validate_request(payload: Dict[str, ...
################################################################################################################ # Author: <NAME> # <EMAIL> ################################################################################################################ import numpy as np import os import scipy.io from dotmap import Do...
# Copyright 2018 <NAME> and <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 # # Unless required by applicable l...
import urllib.request from bs4 import BeautifulSoup import os import time header = { "User-Agent":'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36', 'Accept': '*/*', 'Accept-Language': 'en-US,en;q=0.8', 'Cache-Control': 'max-age=0', ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # ec2_create_security_groups.py # # Copyright 2016 <NAME> # # MIT License # # Create security groups in VPCs without knowing the region. # # Dependencies: boto3 import sys import boto3 import botocore import collections import logging import myawscommon from mya...
# -*- coding: utf-8 -*- import torch import numpy as np import time import torch.nn.functional as F from Orthogonal_loss import OrthogonalLoss class Cluster_GPU_FAST(): """" A class for clustering feature maps. Input: 1. A set of feature maps with 2-4 dimension. 2. Number of cluster centers. ...
from datetime import datetime as dt from django.db.models import Q from django.shortcuts import get_object_or_404 from django.utils import timezone as djangotime from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework.views import APIView from tacticalrm...
""" Run to deply the changes. fab local deploy If something is wrong then you can rollback to the previous version. fab local rollback Note that this only allows you to rollback to the release immediately before the latest one. If you want to pick a arbitrary release then you can use the following, where 20...
import hashlib import time import warnings from datetime import datetime from datetime import timezone from decimal import Decimal from numbers import Real from ._json import _CompactJSON from .encoding import base64_decode from .encoding import base64_encode from .encoding import want_bytes from .exc impo...
from tkinter import * from utility import * from tkinter import messagebox import time import threading from win10toast import ToastNotifier toast = ToastNotifier() def main(root, WIDTH, HEIGHT, wu, hu): global productiveTimeEntry, breakTimeEntry, currentStatusLabel root.config(bg = "black") heading = L...
import time import re from talon import Module, Context, actions, settings, ui ctx = Context() mod = Module() mod.apps.vim = r""" title: /vim/i app.bundle: com.apple.Terminal """ ctx.matches = r""" app: vim """ mod.list("vim_arrows", desc="VIM direction keys") mod.list("vim_commands", desc="List of available command...
"""Module containing torch Dataset loader for Moments in Time video dataset.""" import skvideo.io import numpy as np import os from torch.utils.data import Dataset, DataLoader from random import shuffle import random from tqdm import tqdm class MomentsInTimeDataset(Dataset): def __init__(self, data_dir, max_times...
import math KNOTS_KMH = 1.85200 EARTH_RADIUS = 6356752.3142 RAD_CONVERSION = 180 / math.pi FEET_CONVERSION = 0.3048 F0_FRAME = () # B=byte, H=ushort, h=short, I=uint, i=int, f=float F1_FRAME = ( # {'name': 'flags', 'type': 'H'}, # {'name': 'lower_limit', 'type': 'f'}, # {'name': 'water_depth',...
#!/usr/bin/env python # pylint: disable=bad-continuation import os # Force matplotlib to not use any Xwindows backend. Needs to be imported before # any other matplotlib import. import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import yaml from maplab_evaluation.report_commo...
import base64 from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.db.models import F from django.utils.translation import ugettext_lazy as _ from users.models import Profile class UserActivity(models.Model): domain = models.CharField(max_length=2...
import numpy as np from matplotlib import pyplot as plt from matplotlib.widgets import Cursor from matplotlib.colors import cnames from multiprocessing import Process, Pipe, Event from time import time, sleep from threading import Thread class MPLRenderer(object): def __init__(self, mpl, refresh_period=(1.0/240),...
#!/usr/bin/env python3.8 # Copyright 2020 The Fuchsia Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A helper script for CTS dependency verification. The Compatibility Test Suite (CTS) has strict rules on GN dependencies. A CTS tar...
#!/usr/bin/env python3 # This file is part of the Soletta (TM) Project # # Copyright (C) 2015 Intel 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 # # ...
import numpy as np import enum from pymorton import interleave2 class Form(enum.Enum): MATRIX_FORM = 0 INDEXED_MATRIX_FORM = 1 BINARY_MATRIX_FORM = 2 class Task: def __init__(self, code, index): self.code = code self.index = index class Problem: """ A problem of finding an optimal alignment between two...
#!/usr/bin/env python3 import argparse import bisect import json import math import os import sys import matplotlib.pyplot as plt import numpy as np def plot_linear(fig, pp): bins = int(math.ceil(pp[-1]/100)) pp_less_100 = bisect.bisect_left(pp, 100) pp_less_200 = bisect.bisect_left(pp, 200) pp_less_300 = b...
import itertools import numpy as np """ MAUCpy ~~~~~~ Contains two equations from Hand and Till's 2001 paper on a multi-class approach to the AUC. The a_value() function is the probabilistic approximation of the AUC found in equation 3, while MAUC() is the pairwise averaging of this value for e...
from django.contrib import admin from voting_intentions.models import Vote, VoteTag, Choice, ChoiceTag, UrlParameter from django.utils.safestring import mark_safe from django.http.response import HttpResponse import csv from django.forms import TextInput from django.db import models from nested_admin import nested from...
# Copyright (c) 2018 Copyright holder of the paper Generative Adversarial Model Learning # submitted to NeurIPS 2019 for review # All rights reserved. from rllab.misc.instrument import run_experiment_custom from rllab.casadi.algos.parameter_estimation import ParameterEstimation from rllab.dynamic_models.cartpole_model...
# -*- coding: utf-8 -*- """ Module for command execution functions. Copyright: 2022 by <NAME> <<EMAIL>> All rights reserved. This file is part of gitcache (https://github.com/seeraven/gitcache) and is released under the "BSD 3-Clause License". Please see the ``LICENSE`` file that is included as p...
""" Content Provider: Walters Art Museum ETL Process: Use the API to identify all CC licensed images. Output: TSV file containing the images and the respective meta-data. Notes: http://api.thewalters.org/ Rate limit: 25...
import os import json import yaml import shutil import logging import tempfile import proto.python.ast_pb2 as ast_pb2 from os.path import basename, dirname, abspath, join from proto.python.ast_pb2 import AstLookupConfig, AstNode, FileInfo from proto.python.module_pb2 import ModuleResult, ModuleSummary, ModuleStatic fr...
""" Introspective Sort is hybrid sort (Quick Sort + Heap Sort + Insertion Sort) if the size of the list is under 16, use insertion sort https://en.wikipedia.org/wiki/Introsort """ import math def insertion_sort(array: list, start: int = 0, end: int = 0) -> list: """ >>> array = [4, 2, 6, 8, 1, 7, 8, 22, 14, 5...
"""Dataset preprocessing functions """ import numpy as np import skimage import skimage.exposure from random import randint import numbers from PIL import ImageMath import torch class BatchNormalizeTensor(object): def __init__(self, mean, std, invert_batchnormalized_tensors = False): self.mea...
# -*- coding: utf-8 -*- from __future__ import print_function, division import argparse import torch import torch.nn as nn import torch.optim as optim from torch.optim import lr_scheduler from torch.autograd import Variable import numpy as np import torchvision from torchvision import datasets, models, transforms imp...
from datetime import datetime, timedelta import json from django import template from django.conf import settings from django.core.urlresolvers import reverse from django.template.loader import render_to_string from django.utils.datastructures import SortedDict from django.utils.safestring import mark_safe from django....
# This file is part of Hypothesis, which may be found at # https://github.com/HypothesisWorks/hypothesis/ # # Most of this work is copyright (C) 2013-2021 <NAME> # (<EMAIL>), but it contains contributions by others. See # CONTRIBUTING.rst for a full list of people who may hold copyright, and # consult the git log if yo...
#!/usr/bin/env python import sys import argparse import csv import subprocess from six.moves import configparser import smtplib import re import datetime from email.mime.text import MIMEText DOMAIN_LIST_FILE = 'config/domains.csv' def sample_func(): return 0 class State: OK = 'OK' NotFound = 'Not found'...
#encoding=utf-8 import datetime, time import re def get_year_start_end(): import calendar day_now = time.localtime() day_begin = '%d-01-01' % (day_now.tm_year) # 月初肯定是1号 wday, monthRange = calendar.monthrange(day_now.tm_year, 12) day_end = '%d-12-%02d' % (day_now.tm_year,monthRange) return d...
#!/usr/bin/python3 import subprocess import os import sys import json from argparse import ArgumentParser class Grader: basic_case_dir = "./basic_cases" basic_cases = { 1 : "decl", 2 : "expr1", 3 : "expr2", 4 : "expr3", 5: "function1", 6: "function2", 7...
from math import ceil import tensorflow as tf def out_width(in_width, filter_width, stride): return ceil(float(in_width - filter_width + 1) / float(stride)) def inference(spectrogram, seq_length, n_syllables, batch_size=11, input_vec_size=513, ...
# 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, software # distributed under t...
# # Copyright (c) 2019 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. # ScanCode is a trademark of nexB Inc. # # You may not use...
"""Main module for identifying ableist language in job descriptions.""" from dataclasses import dataclass from typing import List, Union import click import spacy from ableist_language_detector.ableist_word_list import ABLEIST_VERBS, AbleistLanguage nlp = spacy.load("en_core_web_sm") @dataclass class AbleistLangu...
""" Utility functions that can clone lasagne network layers in a custom way. [Will be] used for: - target networks, e.g. older copies of NN used for reference Qvalues. - DPG-like methods where critic has to process both optimal and actual actions """ from copy import deepcopy import lasagne from .format import check...
"""Hardware Backend for the SR v4 motor board.""" from threading import Lock from typing import Callable, List, Optional, Set, Type, cast from serial import Serial, SerialException, SerialTimeoutException from serial.tools.list_ports import comports from serial.tools.list_ports_common import ListPortInfo from j5.back...
import requests import logging import re from urllib import urlencode as e from urlparse import parse_qsl as d from brushfire.core.types import GroupedFRange URL_LENGTH_MAX = 1024 DEFAULT = 0xDEFA17 logger = logging.getLogger('brushfire.driver.solr') class Url(object): def __init__(self, start, path, params=())...
#!/usr/bin/env python # digital_io_panel.py # Copyright (C) 2017 Niryo # 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 as published by # the Free Software Foundation, either version 3 of the License, or # (at your op...
import math # WGS-84:GPS坐标系 # GCJ-02:火星坐标系,国测局02年发布的坐标体系,高德,腾讯等使用。 # BD-09:百度坐标系,百度自研,百度地图使用。 # 谷歌用wgs84、高德(国内大多数)用火星坐标、百度用百度坐标 def bd09togcj02(bd_lon, bd_lat): """百度坐标转火星坐标""" x_pi = 3.14159265358979324 * 3000.0 / 180.0 x = bd_lon - 0.0065 y = bd_lat - 0.006 z = math.sqrt(x * x + y * y) - 0.0000...
import numpy import six from chainer.dataset import dataset_mixin class SubDataset(dataset_mixin.DatasetMixin): """Subset of a base dataset. SubDataset defines a subset of a given base dataset. The subset is defined as an interval of indexes, optionally with a given permutation. If ``order`` is gi...
import pandas as pd import streamlit as st from optimizer import Optimizer from database import PersonSettings, TaskSettings, Database def css_color_white_for_zero(float_val: float) -> str: color = "white" if float_val == 0 else "black" return f"color: {color}" def md_heading( content: str, level: ...
# 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...
# -*- coding: utf-8 -*- """ Created on Fri Dec 2 22:29:54 2016 @author: tomi """ from __future__ import division def fig_seq_positions(pOA): dict={'proOmpA': pOA} aas = {'F','W','Y','R'} for motif in aas: counter=0 for u, seq in dict.iteritems(): i=-1 #start search...
import timeit import click import random import networkx as nx import matplotlib.pyplot as plt import numpy as np import pandas as pd from config_utils import ConfigFile from graph_gen import GraphGenerator from policy import bound_policy # from seirs_extended import ExtendedNetworkModel, custom_exponential_graph fro...
import os, sys sys.path.append(os.path.dirname(os.path.realpath(__file__))) import cvxpy as cp import numpy as np from policy import Policy, PolicyWithPacking class MinTotalDurationPolicy(Policy): def __init__(self, solver, num_threads=None): self._name = 'MinTotalDuration' self._min_total_durat...
import torch import numpy as np import sys import scipy.linalg as sli import torch.nn.functional as F import torch.nn as nn from torch import optim # referred from https://github.com/penghu-cs/SDML/blob/master/utils_PyTorch.py def to_tensor(x): x = torch.tensor(x) if torch.cuda.is_available(): x = x.c...
import warnings import unittest import numpy as np import openmdao.api as om from openmdao.utils.testing_utils import use_tempdirs import dymos as dm class BrachODEStaticOutput(om.ExplicitComponent): def initialize(self): self.options.declare('num_nodes', types=int) self.options.declare('stati...
import logging import pytest import retrying import sdk_cmd import sdk_install import sdk_marathon import sdk_plan import sdk_upgrade import sdk_utils from tests import config log = logging.getLogger(__name__) @pytest.fixture(scope="module", autouse=True) def configure_package(configure_security): try: ...
# Copyright (C) 2021 Nippon Telegraph and Telephone 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/LICE...
import torch.nn as nn import numpy as np from src import helpers class Backbone(nn.Module): def __init__(self): """ Backbone base class """ super().__init__() self.layers = nn.ModuleList() def forward(self, x): for layer in self.layers: x = layer(x...
import dash import json import time import argparse import dash_cytoscape as dcy from pathlib import Path from pprint import pprint from dash.dependencies import Input, Output, State from dash.exceptions import PreventUpdate from stormspotter.dash.layout.cytoscape import NODE_LAYOUTS from stormspotter.dash.layout.ui ...
""" pysteps.blending.clim ===================== Module with methods to read, write and compute past and climatological NWP model skill scores. The module stores the average daily skill score for the past t days and updates it every day. The resulting average climatological skill score is the skill the NWP model skill ...
"""Tools for creating animations and movies.""" import base64 from tempfile import TemporaryDirectory from pathlib import Path import matplotlib as mpl from matplotlib.animation import FuncAnimation, _log, writers from matplotlib import pyplot as plt encodebytes = base64.encodebytes class MyFuncAnimation(FuncAnim...
#!/usr/bin/env python3 import json import sys import os import datetime import requests from flask import Flask, render_template from flask_socketio import SocketIO, send, emit ''' app = Flask(__name__) app.config['SECRET_KEY'] = 'secret!' socketio = SocketIO(app,cors_allowed_origins='*') socketio.connect("http://0....
from os import path from typing import Sequence, Union import torch import torch.nn as nn from medical_seg.networks.blocks import Convolution, UpSample from medical_seg.networks.layers.factories import Conv, Pool from medical_seg.utils import ensure_tuple_rep from medical_seg.networks.layers.transformer import Trans...
import argparse import ast import logging import os import sys import pandas as pd import torch from tqdm import tqdm from transformers import BartForConditionalGeneration, MT5ForConditionalGeneration, AutoTokenizer from transformers import logging as transformers_logging sys.path.append(os.path.join(os.getcwd())) ...
import pandas as pd import numpy as np from graphviz import Digraph from . import pm_extra, utils def petrinet2rg(net, init_marking, final_marking, staterep=pm_extra.default_staterep): is_inv = lambda t: t.label is None is_inv_rg = lambda t: t.name is None inv_trans = list(filter(is_inv, net.transition...
"""Code regarding the PEtab YAML config files""" import os from typing import Any, Dict, Union, Optional, List import jsonschema import yaml from .C import * # noqa: F403 import numpy as np SCHEMA = os.path.join(os.path.abspath(os.path.dirname(__file__)), "petab_schema.yaml") def validate(y...
# -*- coding: utf-8 -*- """ Created on Fri Jun 24 2017 18:57UTC @author: <NAME> (<EMAIL>) Functions for the Validation of the dimensionality of pint Quantities. Dimensions: M: Mass L: Length T: Time N: Number/Moles """ from functools import wraps import pint from pint.errors import DimensionalityErro...
import argparse import logging import pickle import os import json import numpy as np from sklearn import metrics from utils.fileprovider import FileProvider from preprocessing.reader import EvalitaDatasetReader, read_emoji_dist from keras.models import model_from_json from keras.preprocessing import sequence logging....
import csv from datetime import datetime from pathlib import Path from shutil import copyfile from typing import Any from typing import Dict from typing import List from typing import Tuple from zipfile import ZipFile import dask.dataframe as dd import pandas as pd import requests from stqdm import stqdm import stream...
import functools import signal import sys import numpy as np from core.tf_config import configure_gpu, configure_precision, silence_tf_logs from core.dataset import create_dataset from utility.utils import Every, TempStore from utility.graph import video_summary from utility.run import Runner, evaluate from utility.ti...
from marshmallow import Schema, pre_load, ValidationError, validate from marshmallow.fields import String, Dict, Url, Nested, List, Date, Integer, Boolean from api.enums.descriptor import LayerProtocol, CpRole, AddressType, IpVersion, ServiceAvailabilityLevel, AffinityType, \ AffinityScope, LcmEventType class Ad...
from tkinter import * import turtle import time import math # the tree class and everything in it class Tree: def trunk_size(self): """I base this off of the convergence value for geometric series that sums to 500 last part accounts for offset""" return 500 * (1 - self.proportion) * (3 -...
import datetime import logging from async_rediscache import RedisCache from dateutil.parser import isoparse from discord import Embed, Member from discord.ext.commands import Cog, Context, group, has_any_role from bot.bot import Bot from bot.constants import Colours, Emojis, Guild, Icons, MODERATION_ROLES, Roles from...
#!/usr/bin/env python # ----------------------------------------------------------------------------- # Turquoise - VHDL linter and compilation toolchain # Copyright (c) 2020-2021: Turquoise team # # File name: Architecture.py # # Description: Implementation of DFAs that parse through architecture syntax # # ------...
import statsmodels.api as sml import numpy as np import pandas as pd # TODO: Implement Meta Labeling def t_value_lin(sample): """ t value from a linear trend :param sample: :type sample: :return: :rtype: """ x = np.ones((sample.shape[0]), 2) x[:, 1] = np.arange(sample.shape[0]) ...
from __future__ import division, print_function import numpy as np import collections #import pyximport; pyximport.install( # setup_args={"include_dirs":np.get_include()}, # reload_support=True) from .looptools_c import get_parent_loops, get_stationary_loops def convert_loops_to_sites(loops, r_sites=None): ...
"""retrive local user settings""" from configparser import SafeConfigParser import os as __os from os.path import split as __split, join as __join, abspath as __abspath, \ isfile as __isfile from sys import modules self = modules[__name__] # define various filepaths trnlib_directory = __join(__split(__abspath(__...
""" 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 use this ...
import cv2 import numpy as np import glob import sys import os sys.path.append('C:\Program Files\Python36\Lib\site-packages\libsvm-3.22\python') from svmutil import * from datetime import datetime import matplotlib.pyplot as plt from sklearn import datasets from sklearn import svm from matplotlib.colors imp...
from django import forms from django.conf.urls import url as urls_url from django.contrib import admin from django.contrib.auth import get_user_model, login from django.contrib.auth.decorators import permission_required from django.contrib.messages import ERROR from django.http import HttpResponseRedirect from django.s...
import unittest import os import pytest import shutil import datetime from unittest import mock from parsons.etl.table import Table from parsons.utilities.datetime import date_to_timestamp, parse_date from parsons.utilities import files from parsons.utilities import check_env from parsons.utilities import json_format f...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue May 5 11:10:44 2020 @author: pengning """ import numpy as np import mpmath from mpmath import mp from .mpmatrix_tools import mp_conjdot from .spatialProjopt_Zops_mpmath import Z_TT, grad_Z_TT from .spatialProjopt_vecs_mpmath import get_Tvec, get_Tvec_...
import typing import collections import pandas as pd import glob import re from itertools import product from pycoingecko import CoinGeckoAPI from datetime import datetime, timedelta, timezone from utils import load_json, save_json, json_serialize_datetime cg = CoinGeckoAPI() symbol_id_map = {} def initialize_coingeck...
""" Models for causal set graphs. Available methods: minkowski_interval(N, D) de_sitter_interval(N, D, eta_0, eta_1) causal_set_graph(R, p) """ # Copyright (C) 2016 by # <NAME> <<EMAIL>> # All rights reserved. # BSD license. __author__ = "\n".join(["<NAME> (<EMAIL>)"]) import networkx as nx import nump...
""" Item Shop --------- This is an item shop that allows a player to purchase and sell to a shop owner. Requirements: * Inventory shall be available for both the shop and player * Random values shall be used for shop and player currency, items, item quantities, etc. * There shall be a fixed set of items that ...
# -*- coding: utf-8 -*- # Created by: Vincentzyx import os import torch from torch import nn from torch.utils.data import DataLoader from torch.utils.data.dataset import Dataset from douzero.dmc.models import model_dict_resnet import time from douzero.env.game import GameEnv from douzero.evaluation.deep_agent import De...
#!/usr/bin/env python3 # -*- encoding: utf-8; py-indent-offset: 4 -*- """ File: watch_later.py Description: Searches YouTube subscriptions for new videos (since last run), and adds any new videos to 'Water Later' playlist. """ __author__ = '<NAME>' __copyright__ = '(c) <NAME> 2020' __licence__ = 'MIT' import ar...
import argparse import logging import random import os import gzip import csv import math from collections import defaultdict, OrderedDict from datetime import datetime from typing import List, Dict import numpy as np import torch from torch.utils.data import DataLoader from sentence_transformers import SentenceTransf...