text
stringlengths
3.07k
22.1k
""" Functions for scraping the TransportUP site """ # General packages import requests import json import time import datetime import random import os import sys # data / numerical handling import pandas as pd import numpy as np # data visualization import seaborn as sb import matplotlib as mp # Scraping librari...
# -*- coding: utf-8 -*- """ Created on Tue Aug 07 23:05:36 2018 @author: Aake """ # Pythn 2/3 compatibility from __future__ import print_function import numpy as np import dispatch #import types def aver(s,iv=0): f=0.0 v=0.0 p=s.patches[0] data=p.var(iv) for p in s.patches: dv=np.product(...
# # License: https://creativecommons.org/licenses/by/4.0/ https://creativecommons.org/licenses/by/4.0/legalcode # © 2020 https://github.com/Oops19 # # import os import time from weakref import WeakKeyDictionary import routing import sims4.commands import sims4.hash_util import sims4.resources import s...
# ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ # MIT License # # Copyright (c) 2021 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without res...
# -*- coding: utf-8 -*- import os import decimal import datetime from pyramid.view import view_config from pyramid.renderers import render_to_response import pyramid.httpexceptions as exc from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound from chsdi.lib.validation import BaseLayersValidation from c...
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 import struct from typing import Any from typing import Dict from typing import Iterator from typing import List import lldb # this is an LLDB pretty printer for libtorrent types. To use in LLDB run: # # command script import tools/libtorrent_lldb.py # # or add...
import os import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from mpl_toolkits.mplot3d import Axes3D from matplotlib import gridspec import skimage.transform as transform from tqdm import tqdm from utils import quaternion_distance, inv_log_quaternion def reverse_preproces...
import open3d as o3d import numpy.random as onpr import numpy as onp import data_prep from procustes import procrustes import pickle from tqdm import trange import os import os.path as osp # Set the seed for the sampling in RANSAC # We need to put these here because the FlowDataset class # has stochasticity in it NPO...
from sklearn.cluster import KMeans, AgglomerativeClustering from sklearn.manifold import TSNE from sklearn.mixture import GaussianMixture from sklearn.metrics import adjusted_rand_score, adjusted_mutual_info_score from sklearn.metrics.cluster import contingency_matrix from sklearn.decomposition import PCA import matplo...
import os import numpy as np import torch from PIL import Image from torch.utils import data import misc as ms from torchvision import transforms from scipy.ndimage.morphology import distance_transform_edt from pycocotools.coco import COCO from pycocotools.cocoeval import COCOeval import numpy as np import skimage.io ...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2021, <NAME> <<EMAIL>> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = """ module: ansible_galaxy_install author: - "<N...
import os import json from django.db import transaction import requests from django.db.models.signals import post_save from django.http import HttpResponse from django.utils.http import urlquote from django.contrib.auth.models import User from analytics.models import Algorithm, Category from linda_app.models import g...
from contextlib import contextmanager import trio from trio.socket import getaddrinfo, SOCK_STREAM, socket __all__ = ["open_tcp_stream"] # Implementation of RFC 6555 "Happy eyeballs" # https://tools.ietf.org/html/rfc6555 # # Basically, the problem here is that if we want to connect to some host, and # DNS returns mu...
import xml.etree.ElementTree as ET import xml.dom.minidom as MD import sys, os from sys import platform as _platform import shutil PROJECT_NAME = 'minecrift' def createIdeaProject(project_root_dir, version, mcpDirName, are32bitNatives): # generate IML xml # VIVE - removed #os.path.join(project_root_dir, ...
''' The MIT License (MIT) Copyright (c) 2014 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publi...
# Copyright (c) 2018-2020 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distrib...
# 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 l...
# Copyright (c) 2019-2020 <NAME> # License: MIT License from typing import TYPE_CHECKING, Iterable, Dict, Tuple import logging import array from ezdxf.lldxf import validator from ezdxf.lldxf.const import DXF2000, DXFStructureError, SUBCLASS_MARKER from ezdxf.lldxf.tags import Tags from ezdxf.lldxf.types import dxftag, ...
# 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 -*- # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ eval_faiss.py """ import os import sys import time import glob import click import curses import numpy as np sys.path.append(os.path.dirname(os.path.abspath(os.path.d...
"""A module providing selection strategies for the Kaczmarz algorithm.""" from collections import deque import numpy as np from scipy import sparse import kaczmarz from ._utils import scale_cols, scale_rows, square class Cyclic(kaczmarz.Base): """Cycle through the equations of the system in order, repeatedly....
from __future__ import annotations from itertools import product from typing import Optional, List, Tuple from dataclasses import dataclass import math from nglview import NGLWidget, show_pymatgen from pymatgen.core import Structure from pymatgen.core.periodic_table import Element from pymatgen.core.sites import Perio...
from __future__ import annotations from typing import Optional, TYPE_CHECKING import logging import time import struct import asyncio try: import queue except ImportError: import Queue as queue if TYPE_CHECKING: from .network import Network logger = logging.getLogger(__name__) # Command Specifier (CS) CS...
from app import datetime, parse_date from app.sheets.models import Sheet from app.sheets.server_sides import ServerSides from StringIO import StringIO import feedparser import json import re def all_nones(row): if type(row) is not list: return True return row.count(None) == len(row) def remove_empty_rows(rows...
# protocol-server # # a reference implementation of the Web Annotation Protocol # # Developed by <NAME> (@bigbulehat) and <NAME> (@halindrome). # Sponsored by Spec-Ops (https://spec-ops.io) # # Copyright (c) 2016 Spec-Ops # # for license information, see http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.ht...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Produces a repo-atomic snapshot of every repo in the specified `yum.conf` (details on the atomicity guarantee in th...
import doctest import warnings from django.test import SimpleTestCase from couchdbkit import BadValueError import corehq.motech.value_source from corehq.motech.const import ( COMMCARE_DATA_TYPE_DECIMAL, COMMCARE_DATA_TYPE_INTEGER, COMMCARE_DATA_TYPE_TEXT, ) from corehq.motech.value_source import ( Ca...
""" Copyright (c) Facebook, Inc. and its affiliates. """ import time import queue from droidlet.perception.robot.handlers import ( InputHandler, DetectionHandler, FaceRecognitionHandler, HumanPoseHandler, TrackingHandler, MemoryHandler, LaserPointerHandler, ObjectDeduplicationHandler, )...
from bs4 import BeautifulSoup from datetime import datetime from nflsite import db from nflsite.models import * from requests_html import HTMLSession def getSource(): session = HTMLSession() r = session.get('https://www.nfl.com/schedules/') r.html.render() source = r.html.html r.close() return...
# Ahjo - Database deployment framework # # Copyright 2019, 2020, 2021 ALM Part<NAME> # SPDX-License-Identifier: Apache-2.0 """Module for updating database extended properties. Global variable EXCLUDED_SCHEMAS holds list of schemas that should be excluded from update. Global variable DOCS_DIR holds the documentation ...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import math from enum import Enum from typing import List, Optional import torch from pytext.config import ConfigBase from pytext.config.component import Component, ComponentType from torch.optim.lr_scheduler import ( Co...
#!/usr/bin/env python """ Downloads FaceForensics++ and Deep Fake Detection public data release Example usage: see -h or https://github.com/ondyari/FaceForensics """ # -*- coding: utf-8 -*- import argparse import os import urllib import urllib.request import tempfile import time import sys import json import random...
# https://github.com/ethereum/go-ethereum/wiki/Blockpool import time from ethereum.utils import privtoaddr, sha3 import rlp from rlp.utils import encode_hex from ethereum import processblock from synchronizer import Synchronizer from ethereum.slogging import get_logger from ethereum.chain import Chain from devp2p.servi...
#!/usr/bin/env python3 import random import argparse import time from collections import namedtuple location = namedtuple("location",['x','y']) #===== COMMAND-LINE ARGUMENTS =====# def get_args(): parser = argparse.ArgumentParser( description="A Python maze generator", epilog="Usage: generator.py [...
"""This module handles :ref:`reddening laws and extinction <pysynphot-extinction>` calculations. """ from __future__ import absolute_import, division, print_function from astropy.io import fits as pyfits from .spectrum import ArraySpectralElement from . import Cache from . import extinction #temporary(?) backwards co...
import torch import torchvision import torchvision.transforms as transforms import matplotlib.pyplot as plt import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader import torch.optim as optim import time transform = transforms.Compose( [transforms.ToTensor(...
import sys from tornado.web import authenticated from jupyterhub.handlers.base import BaseHandler from jupyterhub.orm import Group from ..orm import Dashboard from .base import DashboardBaseMixin, check_database_upgrade from ..util import DefaultObjDict, url_path_join from .. import hookimpl from ..pluggymanager imp...
""" Most of codes are "COPIED" from saliconeval.auc, etc. just because, the salicon interfaces sucks :-( and https://github.com/herrlich10/saliency/blob/master/benchmark/metrics.py """ import numpy as np from skimage.transform import resize import numpy.random as random from functools import partial import scipy.spar...
from __future__ import division from __future__ import print_function import matplotlib.pyplot as plt from pylab import * import numpy as np import tensorflow as tf from random import choice, shuffle from pymongo import MongoClient from bson.objectid import ObjectId from tensorflow.tensorboard.tensorboard import FLAGS...
import logging import enum import dataclasses import typing import cryptography.x509 import uuid import datetime import base64 import urllib.parse import certvalidator import requests import json import binascii import cryptography.hazmat.primitives.hashes import cryptography.hazmat.primitives.asymmetric.rsa import cry...
""" Module to build a team utlization report in csv from the Tock API data and csv list of users """ import csv import os import datetime import urllib.request from urllib.error import HTTPError as HTTPError import json import tock_blocks TOCK_API_KEY = os.environ['TOCK_API_KEY'] MONTH_NAME_LIST = ["January", "Februa...
# Copyright (c) Facebook, Inc. and its affiliates. from copy import deepcopy from typing import Any, Dict, List, Type import torch from mmf.common.registry import registry from mmf.common.typings import DictConfig from mmf.models.transformers.base import ( BaseTransformer, BaseTransformerConfigType, BaseT...
""" Implementation of "Attention is All You Need" """ import os import random from typing import Any, Dict, List, Optional, Tuple import fairseq import torch.nn as nn import torch from fairseq.models.bart import BARTModel from onmt.encoders.encoder import EncoderBase import logging class BARTEncoder(EncoderBase): ...
import numpy as np __all__ = ['read_3col_pendf','write_pendf_xs',"endf_float_str", "update_file2","setupdict","update_pardict","strip_line_num"] def read_3col_pendf(file,start,finish): """ Read part of a PENDF format file. PENDF format files have sections of the file where the cross...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import fnmatch import json import numbers import sys import threading import traceback import _frida class DeviceManager(object): def __init__(self, impl): self._impl = impl def __repr__(self): return repr(self....
# -*- coding: utf-8 -*- """Download documents from the Plymouth County Registry of Deeds (ROD) The system used by the ROD to uniquely identify documents is Book and Page, which stems from a historic practice of physically appending pages to an archival book each time a new document was added to the record. By providi...
# -*- coding: utf-8 -*- from __future__ import division, print_function import unittest import numpy as np from nufft import nufft1d1, nufft1d2, nufft1d3 def _error(exact, approx): return np.sqrt(np.sum(np.abs(exact - approx) ** 2) / np.sum(np.abs(exact)**2)) class NUFFT1DTestCase(unittest.TestCase): """Te...
from django.core.urlresolvers import reverse from django.contrib import admin from django.conf import settings from django import forms from django_conference.models import (DonationType, ExtraType, Meeting, MeetingDonation, MeetingExtra, MeetingInstitution, Paper, PaperPresenter, Registration, RegistrationDon...
import torch import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as F from torch import optim import numpy as np NUM_CLASSES = 21 class SimpleClassifier(nn.Module): def __init__(self): super(SimpleClassifier, self).__init__() self.conv1 = nn.Conv2d(3, 64, 5) ...
# Copyright 2015 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...
""" <NAME> 14010627X COMP1001 Assignment 8-9 11-14-14 """ from random import shuffle import os """ getKey() PseudoCode function definition: def genkey(length): check if length is less than 1: if(length<1): if so raise value error: raise ValueError otherwise: ...
# -*- coding: utf-8 -*- from setup import * def plot_signal_location(report, plot_width=900, plot_height=200): fig = bplt.figure(title='Signal location', plot_width=plot_width, plot_height=plot_height, tools='xpan,xzoom_in,xzoom_out,xwheel_zoom,reset', ...
from sagas.ofbiz.services import OfService as s, oc, track from sagas.ofbiz.entities import OfEntity as e, get_package_entities from sagas.ofbiz.date_time import DateTime from sagas.util.str_converters import to_camel_case, to_snake_case type_mappings = {"string": ["object", "id", "id-long"...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import os import sys import unittest import torch import torch.distributed as dist import torch.multiprocessing as mp import torch.nn as nn import torch.optim as optim from opacus import PrivacyEngine from opacus.distributed ...
#!/usr/bin/env python3 # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 import argparse from distutils.version import StrictVersion import logging as log import os import re import shlex import subprocess import sys # Di...
import os from time import time import pathlib from typing import Dict, Union import glob import numpy as np import xarray as xr from pyschism.mesh.base import Gr3 def combine(var, shape, l2g, name): values = np.full(tuple(shape), np.nan) local_ids = list(l2g.keys()) for i, data in enumerate(var): ...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # Modifications copyright (C) 2020 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # auth: <NAME> import requests from bs4 import BeautifulSoup from IPython.core.display import clear_output from random import randint import pandas as pd import csv import time as t import sqlite3 import sys import os def is_digit(check_input): """ function to check...
# Copyright 2019 Contributors to Hyperledger Sawtooth # # 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 ...
import os import random from pathlib import Path import time import datetime from collections import defaultdict import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.tensorboard import SummaryWriter from model import Model from dataset import ...
import glob import json import os import time import dask import numpy as np import pandas as pd from dask import delayed from distributed import LocalCluster, Client from joblib import parallel_backend from scipy.stats import zscore from sklearn.cluster import DBSCAN, OPTICS from sklearn.covariance import EllipticEnv...
from pprint import pformat import datetime import random from time import sleep import uuid from collections import Counter import tator from ._common import assert_close_enough def wait_for_parity(tator_api, project, patch, expected_ids): attribute_filter = [f"test_string::{patch['attributes']['test_string']}"]...
# -*- coding: utf-8 -*- """ deepsurvk.py Defines the actual DeepSurvK network. """ import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Dropout, ActivityRegularization from tensorflow.keras.optimizers import SGD, Nadam from tensorflow.keras.regularizers impor...
import argparse import time import scipy from scipy import ndimage import cv2 import numpy as np import sys import json import torch from torch.autograd import Variable import torchvision.models as models import torch.nn.functional as F from torch.utils import data from networks.basenet import Res_Deeplab from datase...
# -*- test-case-name: twisted.web.test.test_xmlrpc -*- # # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """Test XML-RPC support.""" try: import xmlrpclib except ImportError: xmlrpclib = None class XMLRPC: pass else: from twisted.web import xmlrpc from twisted.web...
"""Definitions of screw axes and space groups for Laue classes.""" from __future__ import absolute_import, division, print_function from dials.algorithms.symmetry.absences.screw_axes import ( ScrewAxis21a, ScrewAxis21b, ScrewAxis21c, ScrewAxis31c, ScrewAxis41a, ScrewAxis41b, ScrewAxis41c, ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from absl import app as absl_app from absl import flags import tensorflow as tf # pylint: disable=g-bad-import-order import resnet_model import resnet_run_loop from official.utils.flags import core...
from spikeextractors import RecordingExtractor from spikeextractors.extraction_tools import check_get_traces_args from .basepreprocessorrecording import BasePreprocessorRecordingExtractor import numpy as np from scipy.interpolate import interp1d class RemoveArtifactsRecording(BasePreprocessorRecordingExtractor): ...
""" Utility methods for manipulating variant sets. """ from collections import defaultdict import re from django.core.exceptions import ObjectDoesNotExist import pyinter from main.constants import UNDEFINED_STRING from main.models import ExperimentSample from main.models import Variant from main.models import Varian...
# Copyright 2018 NTT 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...
import numpy as np from .ec import ECMeasurement from ..data_series import ValueSeries, TimeSeries from ..exceptions import BuildError, SeriesNotFoundError from .analysis_tools import ( tspan_passing_through, calc_sharp_v_scan, find_signed_sections, ) from ..plotters.ec_plotter import CVDiffPlotter from ..t...
# -*- coding: utf-8 -*- from __future__ import absolute_import # Copyright 2019 Open End AB # # 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 CPG_core.CPG_Sin_osillator import sin_oscillator from CPG_core.CPG_Sin_osillator import CPG_Sinneutron class CPG_network(object): def __init__(self, CPG_node_num, position_vector): kf = position_vector[0] self.CPG_node_num = CPG_node_num # 不包括placemarker if len(pos...
"""Python wrappers around TensorFlow ops. This file is MACHINE GENERATED! Do not edit. Original C++ source file: gen_tensor_forest_ops.cc """ import collections as _collections import six as _six from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow from tensorflow.python.eager import context as _con...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = ''' --- module: linode_v4 short_descripti...
# Copyright 2021 The BladeDISC Authors. 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 ...
# -*- coding: utf-8 -*- import requests import json from datetime import datetime import logging import os import datetime import argparse def setup_log(): dir_path = os.path.dirname(os.path.realpath(__file__)) logpath = os.path.join(dir_path, "..","logs") if not os.path.exists(logpath): os.makedir...
""" Runner. """ from __future__ import annotations from dataclasses import dataclass from datetime import datetime from pathlib import Path from typing import Any, Mapping, MutableMapping, Optional, Sequence, Type, Union import pandas as pd import typer from pocketutils.core.exceptions import InjectionError, PathExi...
from tensorflow.keras.applications.imagenet_utils import preprocess_input from utils.augmentations import * AUTO = tf.data.experimental.AUTOTUNE @tf.function def data_augment(image, boxes, labels): if tf.random.uniform([]) > 0.5: image = tf.image.random_saturation(image, lower=0.5, upper=1.5) # 랜덤 채도 i...
#https://github.com/llSourcell/How_to_simulate_a_self_driving_car/blob/master/utils.py import cv2, os, random import numpy as np import matplotlib.image as mpimg #Rosey2 IMAGE_HEIGHT, IMAGE_WIDTH, IMAGE_CHANNELS = 66, 200, 3 INPUT_SHAPE = (IMAGE_HEIGHT, IMAGE_WIDTH, IMAGE_CHANNELS) def load_image(data_dir, image_fil...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python import core from functools import partial from hypothesis import given from caffe2.python import workspace import caffe2.python.hypothesis_test_util as...
from math import floor import numpy as np import functools from warnings import warn import sys from scipy.optimize import root_scalar from numpy.polynomial.polynomial import Polynomial as npPoly exponent_to_letter = { -18: 'a', -15: 'f', -12: 'p', -9: 'n', -6: 'u', -3: 'm', 0: '', 3: '...
from fastai.basics import * from fastai.text.learner import LanguageLearner, get_language_model, _model_meta from .model import * from .transform import MusicItem from ..numpy_encode import SAMPLE_FREQ from ..utils.top_k_top_p import top_k_top_p from ..utils.midifile import is_empty_midi _model_meta[MusicTransformerXL...
from django.shortcuts import render,redirect,reverse from django.contrib.auth.decorators import login_required from project.models import ProjectDetail from project.issueSolution.models import Issue,Solution,IssueComment,SolutionComment from accounts.models import UserProfile from django.http import HttpResponseRedirec...
# Copyright Contributors to the Rez project # # 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 ...
import nonebot import json import time from matplotlib.font_manager import FontProperties from nonebot import on_command, require from nonebot.adapters.cqhttp import Event, Message from nonebot.adapters.cqhttp.bot import Bot from .coingecko_api import exchange_list, get_exchange_rates import matplotlib.pyplot as plt i...
#!/usr/bin python3 from os import environ, getcwd, mkdir, system from apt import Cache def get_codename(): return "focal" class NginX(): """This class will define several methods which will interact with NginX.""" def add_key(self, current_working_directory): # This method will add NginX signing key to the ap...
""" Implement the entire mechanism to build λ-abstractions from a few magic tricks provided here and a lot of operator overloading. Be reassured: while you're not using the public stuff exposed here, no operator is overloaded and everything is working as usual. Importing this module has no side-effect. """ import abc ...
import panzee.nmfe class MockView(object): def __init__(self): self.dialogue = "" self.speaker = None self.background_path = None self.displaying_background = False self.background_transition = None self.audio_path = None self.playing_audio = False ...
from cornice.resource import resource, view from cornice import Service from pyramid.httpexceptions import HTTPServerError, HTTPNotFound from pyramid.response import FileResponse from pyramid.security import Everyone import os import shutil import magic from naki.lib.auth import RIGHTS from naki.lib.cors import NAKI_C...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: lapis-hong # @Date : 2018/3/19 """A client that talks to tensorflow_model_server loaded with SavedModel. Typical usage example: client.py --num_tests=100 --server=localhost:9000 """ from __future__ import print_function from os.path import dirname, abspat...
from configparser import ( ConfigParser, InterpolationError, ExtendedInterpolation, MAX_INTERPOLATION_DEPTH, InterpolationDepthError, InterpolationSyntaxError, NoSectionError, NoOptionError, InterpolationMissingOptionError, DuplicateSectionError, DuplicateOptionError, ) import os import re import shlex impo...
''' Code for comparing the algorithmic outputs in an MDS and hierarchical clustering analysis. ''' import pickle import numpy as np import matplotlib.pyplot as plt import matplotlib.transforms as transforms from sklearn.manifold import MDS from scipy.spatial import distance from scipy.cluster import hierarchy import e...
import argparse import os import csv import random import logging from tqdm import tqdm, trange import numpy as np import torch from torch.utils.data import (DataLoader, RandomSampler, SequentialSampler, TensorDataset) from pytorch_pretrained_bert import (OpenAIGPTDoubleHeadsModel, OpenA...
#!/usr/bin/python3 from threading import Lock, Event from queue import Queue from seleniumwire import webdriver, request as selenium_request class Data: def __init__(self): """ Constructor of the Data class. Responsible of storing each process information. """ self.ip = Non...
#!/usr/bin/env python3 from flask import Flask, render_template, request from flask import redirect, jsonify, url_for, flash from sqlalchemy import create_engine, asc, desc from sqlalchemy.orm import sessionmaker from database_setup import Base, Sport, MenuItem, User # Session Import from flask import session as logi...
""" To save time, debug, coding; have everything be in terms of iterations, but control the frequency of logging with the log frequency parameter. When calling the epochs function, automatically set that in that function, else set some defaults in the argparse. # - halt when converged ref: - https://forums.pytor...
# -*- coding: utf-8 -*- # # Copyright (C) 2008 <NAME> (john -at- paulett.org) # Copyright (C) 2009, 2011, 2013 <NAME> (davvid -at- gmail.com) # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. import sys import jsonpick...
#!/usr/bin/env python """ The Computer Language Benchmarks Game http://benchmarksgame.alioth.debian.org/ regex-dna Python 3 #5 program: contributed by <NAME> 2to3 modified by <NAME> fasta Python 3 #3 program: modified by <NAME> modified again by <NAME> modified by <NAME> Modified by <NAME> """ import bisect import r...