text stringlengths 6.04k 39.5k |
|---|
import requests
import pandas as pd
from bs4 import BeautifulSoup
from fake_useragent import UserAgent
# 模拟谷歌浏览器
def get_html(url):
ua = UserAgent() # 调用UserAgent库生成ua对象
header = {
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/web,image/png,*/*;q=0.8',
'user-... |
"""
Kiviat in 3D
------------
"""
import copy
import warnings
import numpy as np
from scipy.optimize import fmin
from sklearn.preprocessing import MinMaxScaler
from sklearn.neighbors import KernelDensity
from sklearn.model_selection import (GridSearchCV, cross_val_score)
from matplotlib import pyplot as plt
import matp... |
"""
Bidirectional A* grid planning
author: <NAME> (@spida_rwin)
See Wikipedia article (https://en.wikipedia.org/wiki/Bidirectional_search)
"""
import math
import matplotlib.pyplot as plt
show_animation = True
class BidirectionalAStarPlanner:
def __init__(self, ox, oy, oz, resolution, rr):
"""
... |
from __future__ import print_function, division, absolute_import
import math
import re
from . import flat_files
from cobrame.core.ProcessData import SubreactionData, PostTranslationData
from cobrame.core.Components import ProcessedProtein, TranslatedGene
from cobrame.core.MEReactions import PostTranslationReaction
f... |
import numpy as np
import cv2
def applyThresh(image, thresh=(0,255)):
"""
Apply threshold to binary image. Setting to '1' pixels> minThresh & pixels <= maxThresh.
"""
binary = np.zeros_like(image)
binary[(image > thresh[0]) & (image <= thresh[1])] = 1
return binary
def S_channel(image):
""... |
"""
Oct 12, 2020
Created by <NAME>
Network Core Functions.
"""
import numpy as np
from collections import deque
from pypower.api import ppoption, runpf, rundcpf
from pypower.idx_brch import F_BUS, T_BUS, TAP, RATE_A, BR_STATUS, PF, PT, QF, QT
from pypower.idx_gen import PG, QG, VG, QMAX, QMIN, GEN_BUS, GEN_STATUS
fro... |
import numpy
import cupy
from cupy import cublas
from cupy import cusparse
from cupy.cuda import device
from cupy_backends.cuda.libs import cublas as _cublas
from cupy_backends.cuda.libs import cusparse as _cusparse
from cupyx.scipy.sparse import csr
def eigsh(a, k=6, *, which='LM', ncv=None, maxiter=None, tol=0,
... |
import numpy as np
import matplotlib.pyplot as plt
import os
from utils.plotting_utils import plot_trajectories, plot_maze, plot_observations, plot_trajectory
def wrap_angle(angle):
return ((angle - np.pi) % (2 * np.pi)) - np.pi
def mix_data(file_in1, file_in2, file_out, steps_per_episode=100, num_episodes=1000)... |
#!/usr/bin/env python
#
# Copyright (c) 2018-2019 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
"""
icvbridge class:
Class that handle communication between CARLA and icv
"""
import sys
sys.path.append("./pyicv")
sys.path.appe... |
__all__ = ["getDefaultImporters", "extractPersonName",
"isPerson", "importPerson", "isBusiness", "importBusiness",
"importConnection", "importPositions", "importAffiliations",
"importSources", "importType", "importNotes",
"importProject", "importSource", "importBiography",
... |
'''
Text aggregation utilities
--------------------------
This module provides utility functions used in the polyton-as-line-text-reducer code from
:mod:`panoptes_aggregation.reducers.poly_line_text_reducer`.
'''
import collatex as col
from collections import OrderedDict, Counter
import copy
import numpy as np
from skl... |
""" Very heavily inspired by the official evaluation script for SQuAD version 2.0 which was
modified by XLNet authors to update `find_best_threshold` scripts for SQuAD V2.0
In addition to basic functionality, we also compute additional statistics and
plot precision-recall curves if an additional na_prob.json file is p... |
from api.api import common_api
from config import engine
from flask import jsonify , current_app
from sqlalchemy.sql import text
import requests
import time
from datetime import datetime
from api.fake_data import sl_mock_data
try:
from secrets_dict import SHELTERLUV_SECRET_TOKEN
except ImportError:
# Not runn... |
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.contrib.auth.models import Group
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils... |
readMe = '''
This is a Python 3 script to migrate crypto map based site-to-site VPN configuration to a Meraki MX
security appliance. The VPN configuration will be ported as third-party VPN tunnels in the target
Meraki Dashboard organization and associated with the chosen network tag. The script has been tested
to ... |
from datetime import datetime
HOUR_DATE = "%I:%M:%S %d/%m/%y"
class Timestamp:
def __init__(self, timestamp: str = None):
self.timestamp = datetime.strftime(datetime.fromisoformat(timestamp), HOUR_DATE)
def __str__(self):
return self.timestamp
class DanbooruAPI:
def __init__(self,
... |
# Copyright 2004-2018 <NAME> <<EMAIL>>
#
# 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,... |
from swarmform.core.swarm_dag import Node, DAG
from random import randrange
def get_tasks_at_level(workflow, level):
"""
return the tasks at given level
Args:
workflow (DAG): DAG object of workflow
level (int): level which output tasks needed to be
Returns:
list(Node)
"""... |
# This is a test scaffold for the PyPort Python template code.
# We create scaffolding so that we can build and run the Python code outside of
# ODC PyPort.
# Allows us to make sure everything works before we load it into ODC
# To support this we need an odc module to import (that simulates what odc
# offers), and a m... |
import json
import logging
import os
import pathlib
import re
import shutil
import string
import sys
import tempfile
import webcolors
import yaml
import zipfile
from argparse import ArgumentParser
from p2d._version import __version__
from p2d import (domjudge_api,
generate_domjudge_package,
... |
import glob
from pathlib import Path
import asyncio
import csv
from django.shortcuts import render, redirect
from django.template.loader import render_to_string
import traceback
from django.contrib.staticfiles import finders
from praw import Reddit
from praw.const import API_PATH
from django.urls import reverse
from d... |
import cupy as cp
def cp_rolling_window(a, window):
#https: // blog.csdn.net / brucewong0516 / article / details / 84840469
shape = a.shape[:-1] + (a.shape[-1] - window + 1, window)
strides = a.strides + (a.strides[-1],)
return cp.lib.stride_tricks.as_strided(a, shape=shape, strides=strides)
... |
import copy
import time
from typing import List
from tqdm import tqdm
import torch
import numpy as np
from clustering import Clustering
# W: num_candidates, P: num_clustering_pairs, C: num_centroids
# N: (P x C X C), a: (P x C), b: (P x C), n: (P)
# WN: (W x P x C X C), Wa: (W x P x C), Wb: (W x P x C), wn: (W x P... |
# -*- coding: utf-8 -*-
import traceback
import binascii
from http.cookies import SimpleCookie
import base64
import copy
import datetime
import json
import pytz
from pyramid.request import Request
from pyramid.response import Response
from pyramid.settings import asbool
from sqlalchemy.sql.expression import select,... |
"""
<NAME>
12/06/2019
"""
# -*- coding: utf-8 -*-
"""
Le jeu se déroule sur une grille à deux dimensions.
À chaque étape, l’évolution d’une cellule est entièrement déterminée par l’état de ses huit voisines de la façon suivante :
- une cellule morte 0 (blanche) possédant exactement trois voisines vivantes devient viv... |
import jittor as jt
from jittor import nn
__all__ = ['Inception3', 'inception_v3']
def inception_v3(pretrained=False, progress=True, **kwargs):
model = Inception3(**kwargs)
if pretrained: model.load("jittorhub://inception_v3.pkl")
return model
class Inception3(nn.Module):
""" Inceptionv3 model archit... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division
from __future__ import print_function, unicode_literals
import os
import re
import subprocess
import time
def convert_project(project, repos, svn_repos, authors_file=None,
latest_release_version=None):... |
import sys, os, json
import libvirt
from xml.etree import ElementTree as ET
from libvirt_qemu import qemuMonitorCommand
from time import time, sleep
from datetime import datetime
import Retention
from paramiko import SSHClient
from scp import SCPClient
class Connection(object):
def __init__(self, uri, sasl_user,... |
from string import Template
import numpy as np
from PuzzleLib.Compiler.Codegen.Types import half_t, float_t
from PuzzleLib.Cuda.Utils import roundUpDiv
atomicAddTmpl = """
#include <cuda_fp16.h>
__device__ __forceinline__ void atomicAddFP16(half *address, half val)
{
#if __CUDA_ARCH__ < 700
const size_t halfbit... |
"""
Module to define `Slits` classes.
The SLAC EPICS motor record contains an extra set of records to abstract four
axes into a Slits object. This allows an operator to manipulate the center and
width in two dimensions of a small aperture. The classes below allow both
individual parameters of the aperture and the Slit... |
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
from typing import List
from math import isclose
import collections.abc
import azlmbr.bus as bus
import azlmbr... |
# Copyright 2017 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import argparse
import gc
import os
import sys
import logging
from unicorn import (UC_ARCH_ARM, UC_MODE_MCLASS, UC_MODE_THUMB, Uc)
from unicorn.arm_const import UC_ARM_REG_PC, UC_ARM_REG_SP
from . import globs, interrupt_triggers, native, timer, user_hooks
from .gdbserver import GDBServer
from .mmio_models import par... |
#!/usr/bin/env python3
#
import os, sys, json
import math, argparse, random, re
from tqdm import tqdm
import pdb
"""
my:{'arrive', 'parking', 'name', 'phone', 'stay', 'time', 'type', 'depart', 'stars', 'post', 'dest', 'leave', 'addr', 'people', 'day', 'internet', 'price', 'food', 'area', 'department'}
trade: ['area',... |
#!/Users/trunks/envs/py3/bin/python3.4
from phenum import msg
"""The methods needed to take input from the user and put it in useful
forms. Also the actual executable for the code."""
# hard coded error tolerance. This will need to go away and become
# part of the input files later.
def _plot_HNFs(args,testmode=False... |
import os, sys, json, subprocess
from shutil import copyfile
from subprocess import check_output
from optparse import OptionParser
# Option parser stuff
parser = OptionParser()
parser.add_option("-c", "--config", "--c",
action="store", type="string", dest="config",
help="Will use config.json file in pytutor_wo... |
import config
import plotting
import seismosizer
import util
import logging
import re, copy
import progressbar
import numpy as num
import scipy.stats
from os.path import join as pjoin
def numpy_version():
if hasattr(num.version, 'short_version'):
return num.version.short_version
else:
return ... |
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... |
import collections
import copy
import ixmp
import itertools
import os
import warnings
import pandas as pd
import numpy as np
from message_ix import default_paths
from ixmp.utils import pd_read, pd_write
from message_ix.utils import isscalar, logger
DEFAULT_SOLVE_OPTIONS = {
'advind': 0,
'lpmethod': 2,
'... |
import multiprocessing as mp
from pathlib import Path
import astropy.units as u
import numpy as np
import pyregion
import yaml
from astropy.io import fits
from astropy.wcs import WCS
from numpy.core.defchararray import array
from scipy.stats import sem
import src.calculate_magnetic_fields
import src.helper as helper
... |
# -*- coding: utf-8 -*-
import collections
import datetime
import io
import json
import os
import re
import traceback
import six
try:
import configobj
except ImportError:
configobj = None
try:
import json5
except ImportError:
json5 = None
try:
import toml
except ImportError:
toml = None
try:
... |
# -*- coding: utf-8; py-indent-offset:4 -*-
import os
#import random
import datetime as dt
import pandas as pd
from hiquant.utils.datetime import date_from_str
from ..utils import get_file_modify_time, datetime_today, symbol_normalize, symbol_market, dict_from_df
from ..data_source import *
def get_cached_download... |
#
# scripteval.py
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import absolute_import, division, print_function, unicode_literals
import sys
bord = ord
if sys.version > '3':
long = int
bord = l... |
# -*- coding: utf-8 -*-
# Collections provide file-like access to feature data
import os
import sys
from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
from fiona.ogrext import Session, WritingSession
from fiona.ogrext import calc_gdal_version_num, get_gdal_version_num, get_gdal_release_name
from fiona.err... |
# This was based on some code from https://github.com/mirumee/saleor
# but adapted to use relay, automatic field detection and some code adjustments
import collections
import collections.abc
import itertools
from django.core.exceptions import (
NON_FIELD_ERRORS,
ImproperlyConfigured,
ValidationError,
)
fr... |
import os
import subprocess
import numpy as np
import re
from collections import OrderedDict
from example.cbnu.utils import get_interval
data_source_classes = OrderedDict()
possible_modes = ['one-file', 'multi-file', 'one-dir', 'multi-dir', 'other']
import neo
class DataSourceBase:
gui_params = None
de... |
import torch
import torch.nn as nn
import torch.nn.functional as functional
import torch.optim as optim
import collections
import os
import random
import time
import numpy as np
import json
from main.playground.model2.FeatureEmbedding import FeatureEmbedding
torch.manual_seed(1)
def print_sum(module, grad_input, g... |
import copy
import logging
from abc import ABC
from collections import namedtuple
from enum import Enum
import numpy as np
import open3d as o3d
from hydra.conf import dataclass, MISSING, ConfigStore, field
# Hydra and OmegaConf
from omegaconf import DictConfig, OmegaConf
# Project Imports
from slam.backend import Bac... |
import pytest
from ..core import BaseWWTWidget
from ..layers import SIZE_COLUMN_NAME, CMAP_COLUMN_NAME
import numpy as np
import os
import tempfile
from astropy.wcs import WCS
from astropy.table import Table
from astropy import units as u
from astropy.coordinates import SkyCoord
DEGREES_TO_HOURS = 1. / 15.
STARDARD... |
from dataclasses import dataclass
from typing import Optional
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pad_sequence
from transformers import PreTrainedModel, BertModel
from .config import LsrConfig
from .modules.attention import SelfAttention
from .modules.encoder import Encoder
from .modules... |
import datetime
import json
import logging
import os
import urllib.error
import urllib.parse
import urllib.request
import requests
from pajbot.managers.emote import EmoteManager
from pajbot.models.emote import Emote
log = logging.getLogger(__name__)
class APIBase:
def __init__(self, strict=False):
self... |
# Original file of get_SNP_list (archived)
# Step 01
# This code is to check Rsq values across all input file .info.gz
# Create two files of variants to be excluded and kept
# Below information is saved in .txt files (variant_excluded.txt and variant_kept.txt):
# - SNP, REF(0), ALT(1), and ALT_freq, MAF, Rsq (r2) per... |
# coding=utf-8
# Copyright 2019 The Tensor2Tensor 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 applicable... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#############################################################################
r"""
gaia_tools helper functions
Make constructing SQL queries for gaia_tools easier
See gaia_tools python package by Jo Bovy for details
###########################################... |
#
# Copyright 2015-2020 <NAME> <<EMAIL>>
#
# 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 t... |
"""
Created on Oct 05, 2017
@author: <NAME>
Description of the file.
"""
import os
import argparse
import time
import datetime
import numpy as np
import torch
import torch.autograd
import sklearn.metrics
import datasets
import units
import models
import config
import logutil
import utils
from datasets.HICO impor... |
import time
import numpy as np
import pandas as pd
from scipy.cluster.hierarchy import linkage, leaves_list
# amat := alignment matrix with shape (N,L,2); last dimension is
# part of an unused feature, so ignore it
# namat := list of alignment iterations; each entry is a dictionary
#... |
"""
@name: Modules/House/Family/Insteon/insteon_plm.py
@author: <NAME>
@contact: <EMAIL>
@copyright: (c) 2010-2020 by <NAME>
@note: Created on Feb 18, 2010
@license: MIT License
@summary: This module is for sending commands to and receiving responses from an Insteon Controller.
Create commands and i... |
__author__ = "<NAME>"
__license__ = 'MIT'
# -------------------------------------------------------------------------------------------------------------------- #
# IMPORTS
# Modules
import pandas as pd
import os
from matplotlib import pyplot as plt
import numpy as np
from scipy.stats import linregress
import datetim... |
import json
import sys
import torch
from sklearn import manifold
from sklearn.model_selection import train_test_split
from torch.optim import Adam
import argparse
from code_data import DataSet, DataEntry
from tqdm import tqdm
from torch import nn
import numpy as np
from sklearn.metrics import accuracy_score, f1_score, ... |
""" Split Axes object for making split grid plots
Make a single split barplot over the y-axis:
.. code-block:: python
df = pd.DataFrame({
'cat': ['A', 'A', 'A', 'A', 'A', 'B', 'B', 'B', 'B', 'B'],
'val': [0.0, 1.1, 0.0, 1.1, 1.2, 5.0, 5.1, 5.2, 5.2, 5.1],
})
with SplitAxes(ylimits=[(4.5,... |
from django.shortcuts import render
from django.shortcuts import HttpResponse
from django.shortcuts import HttpResponseRedirect
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from django.db import transaction
from django.db import connection
import os
import json
import xlrd... |
import pyodbc
import re
import pandas as pd
import geopandas as gpd
import numpy as np
import matplotlib.pyplot as plt
from shapely.wkt import loads
import folium
import folium.plugins
plt.style.use('ggplot')
def connect_to_skredprod():
conn = pyodbc.connect('Driver={SQL Server};'
'Serv... |
# Copyright (c) 2022, <NAME>
# License: MIT License
import random
import pytest
from ezdxf.addons import genetic_algorithm as ga
from ezdxf.addons import binpacking as bp
class TestFloatDNAZeroOne:
def test_init_value(self):
dna = ga.FloatDNA([1.0] * 20)
assert all(v == 1.0 for v in dna) is Tru... |
from collections import OrderedDict
from itertools import zip_longest
import json
import logging
import random
import time
from BaseClasses import World, CollectionState, Item
from Regions import create_regions, mark_light_world_regions
from EntranceShuffle import link_entrances
from Rom import patch_rom, Sprite, Loca... |
# Copyright (c) <NAME>
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import math
from typing import Any, Dict, List, Optional, Tuple, Union
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch impor... |
###################################################################
from subprocess import Popen, PIPE
import threading
import os
import time
from queue import Queue
import chess
###################################################################
from utils.logger import SystemLogItem
from utils.study import getvari... |
###############################################################################
# Summarize OSM roads lengths
# <NAME>, July 2018
# Purpose: summarize road lengths within features in defined shapefile
###############################################################################
import os, sys, time, subprocess, argp... |
# -*- coding: utf-8 -*-
import os
from functools import partial
import pyproj
import numpy
from .hatt import hatt2ggrs
from .hatt.models import Hattblock
from .htrs.grid import GridFile
class ReferenceSystem(object):
'''
Utility classed to encapsulate the used in greece reference systems.
'''
def __init__(self, ... |
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2019 Mag. <NAME> All rights reserved
# Glasauergasse 32, A--1130 Wien, Austria. <EMAIL>
# #*** <License> ************************************************************#
# This module is part of the package GTW.OMP.PAP.E164.
#
# This module is licensed under the terms of the BS... |
""""
References:
1. https://adesquared.wordpress.com/2013/06/16/using-python-beautifulsoup-to-scrape-a-wikipedia-table/
2. https://pythontips.com/2013/08/08/storing-and-loading-data-with-json/
3. https://stackoverflow.com/questions/8421922/how-do-i-convert-a-currency-string-to-a-floating-point-number-in-python
"""
# I... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Author: <NAME>
# Copyright © 2019 <NAME>
# License: MIT
# -----------------------------------------------------------------------------
"""
Data generation
===============
This script reads out the raw Cantus data... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import unittest
import numpy as np
import pandas as pd
from .context import Leitor
class TestParticaoForaDeOrdem(unittest.TestCase):
def setUp(self):
leitor = Leitor()
caminho = os.path.join(os.path.dirname(__file__), "resources", "outras-par... |
import sys, time, os, importlib, random
import numpy as np
import torch
import torch.nn.functional as F
from scipy.io import wavfile
from config.args import parser
from tools import load_yaml_config, load_speaker_model_parameters, reverb, reverb_np
args = parser.parse_args()
args = load_yaml_config(args, parser)
os.en... |
#pip install gensim
#pip install nltk
#pip install tqdm
#!/usr/bin/env python
# -*- coding: UTF-8
# Word Embedding Models: Preprocessing and Word2Vec Model Training
# Project title: Charter school identities
# Creators: <NAME> and <NAME>
# Institution: Department of Sociology, University of California, Berkeley
# Da... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import abc
import copy
import functools
import hashlib
import os
import pathlib2
from .._protos.public.modeldb.versioning import Dataset_pb2 as _DatasetService
from ..external import six
from .._internal_utils import (
_file_utils,
_request_util... |
"""Defining a full experiment of simulating recording neurons."""
import os
from time import perf_counter
from datetime import datetime
import numpy as np
import matplotlib.pyplot as plt
import tqdm
from .mpf_connection import CombProb
from .simple_graph import (
create_graph,
vis_graph,
find_connected,
... |
# Copyright (c) 2020, Salesforce.com, Inc.
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA 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 Lic... |
#!/usr/bin/env python
# coding: utf-8
import librosa
import matplotlib.pyplot as plt
import numpy as np
import librosa.display
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim.lr_scheduler import ReduceLROnPlateau
import torch.nn.functional as F
from torch.utils.data import Dataset, Dat... |
"""
version=4
author=<NAME>
last_modified=11/04/2022
python=>2.7.1
"""
import json
import logging
import os
import re
import sys
# only for documentation. (keep compatibility with py2)
try:
from typing import List, Type, Optional
except ImportError:
pass
# try for standalone testing purposes
try:
from Ka... |
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# -*- coding: utf-8 -*-
import tkinter as tk
import os
import json
conf = 'conf.json'
with open(conf) as f:
params = json.load(f)
filename_json = params['filename']
ansname_json = params['ansname']
unitary_json = params['unitary']
shuffle_json = params['shuffle']
int_plus = params['int_plus']
int_subtract = para... |
'''
Assignement Test Bed
This module holds the comparative analysis of squads of different types
playing against each other. This involves
'''
# Standard Modules
import csv
import logging
import random
# Custom Game Modules
from game import Game
from custom_games import AllocatedAgentsGame
# Custom Agents
from ag... |
#!/usr/bin/env python3
from flask import Flask
from flask import request
from flask import jsonify
import random
import traceback
'''
This is a slack slash command dicebot.
Slack slash commands can be run against this command.
And various dice can be rolled.
The following options exist:
- /roll - this rolls the nu... |
#GCNQ: Multi Q
import numpy as np
import networkx as nx
import random, io
from rl_alg.dqn import DQNTrainer
from expts.gengraph import random_sbm
from expts.change_baseline import Change
from expts.net_env import NetworkEnv
from ge.models.deepwalk import DeepWalk
import matplotlib.pyplot as plt
from PIL import Image
... |
# -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... |
import os
import random
import pickle
import math
import tensorflow as tf
import cv2
import numpy as np
import matplotlib.pyplot as plt
def random_crop(src, size):
height = src.shape[0]
width = src.shape[1]
max_right = width - size[0] - 1
max_bottom = height - size[1] - 1
x = random.randint(0, ... |
"""
Contains a user interface for the CMT testing framework.
The dialog will display all tests found in MAYA_MODULE_PATH and allow the user to
selectively run the tests. The dialog will also automatically get any code updates
without any need to reload if the dialog is opened before any other tools have been
run.
To... |
from . import ClientCaches
from . import ClientConstants as CC
from . import ClientGUIFunctions
from . import ClientGUIMenus
from . import ClientGUIShortcuts
from . import HydrusConstants as HC
from . import HydrusData
from . import HydrusExceptions
from . import HydrusGlobals as HG
import os
from qtpy import QtCore as... |
"""Cloudshell SSO
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import base64
import getpass
import json
import logging
import os
import random
import subprocess
import sys
import tempfile
import yaml
import cl... |
from __future__ import annotations
from dataclasses import dataclass
from enum import Flag, auto, unique
import logging
import re
from typing import (
Any,
Awaitable,
Callable,
Dict,
Literal,
Optional,
Match,
Tuple,
Type,
Union,
List,
)
from nuvo_serial.const import (
M... |
"""
Script to evaluate the network quality if it is trained for densities or for colors.
They are tested with world-space training and the best configuration from eval_network_configs
"""
import sys
import os
sys.path.insert(0, os.getcwd())
import numpy as np
import sys
import os
import shutil
import subprocess
impor... |
import numpy as np
import torch
from PIL import Image
def plot_imlist_to_pdf(ims, sav_name, figsize=(50, 35), dpi=250):
import matplotlib.pyplot as plt
row_num = len(plot_ims)
fig = plt.figure(figsize=figsize)
for i in range(row_num):
ax = fig.add_subplot(row_num, 1, i+1)
ax.ims... |
# See LICENSE.incore for details
import ruamel
from ruamel.yaml import YAML
import riscv_isac.parsers as helpers
import riscv_isac.utils as utils
from riscv_isac.constants import *
from riscv_isac.log import logger
from collections import Counter
import sys
from riscv_isac.utils import yaml
from riscv_isac.cgf_normali... |
from __future__ import absolute_import
from __future__ import print_function
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://etetoolkit.org
#
# ETE is free software: you can redistribute it and/or modify... |
# -*- coding: utf-8 -*-
import hashlib
import unittest
from collections import OrderedDict, Sequence
from decimal import Decimal, InvalidOperation
import six
from datetime import datetime
from simplemodels import PYTHON_VERSION
from simplemodels.exceptions import FieldError, FieldRequiredError, ImmutableFieldError, M... |
import os
import math
import random
import torch
import numpy as np
from os.path import join
from itertools import compress
from glob import glob
import SharedArray as SA
import imageio
import dataset.augmentation_2d as t_2d
from dataset.scanNet3D import ScanNet3D
# create camera intrinsics
def make_intrinsic(fx, fy... |
import argparse
import os
import pickle
from types import SimpleNamespace
from typing import OrderedDict
from torch._C import device
from utils.vocab import build_vocab, load_vocab
from utils.data_loader import get_loader
from utils import NLGEval
from torchvision.transforms import transforms
from copy import deepcopy... |
from tkinter import *
from tkinter.ttk import *
import random
# Variables:
global temp
temp = ""
global temp2
temp2 = []
def begin():
for widget in root.winfo_children():
widget.destroy()
lbl1 = Label(root, text = "What sort of names do you want to generate?").pack(side = TOP)
btn2 = Button(root,... |
#!/usr/bin/env python3
#
# Script to manage S3-stored backups
#
# Copyright (c) 2009-2013 <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 limit... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.