text stringlengths 3.07k 12.6k |
|---|
#! usr/bin/env python3
# -*- coding: utf-8 -*-
'''
#-------------------------------------------------------------------------------
Project : Project JaaS
Module : reddit
Purpose : Reddit API Wrapper
Version : 0.1.1 beta
Status : Development
Modified : 2020 Mar 04
Created : 2020 Mar 04
Author : <NAME>
Emai... |
"""
Most expected outcomes were obtained using Y. W. Teh's Matlab code.
Author: <NAME>
Contact: <EMAIL>
Date: 2014
"""
import numpy as np
import numpy.testing as npt
from bayes_gmm.gaussian_components import log_post_pred_unvectorized, GaussianComponents
from bayes_gmm.niw import NIW
def test_log_prior_3d():
... |
'''
Create PV-slices of the spectrally down-sampled HI cube.
'''
from spectral_cube import SpectralCube, Projection
import pvextractor as pv
from astropy.utils.console import ProgressBar
from astropy.io import fits
from astropy import units as u
import numpy as np
import matplotlib.pyplot as plt
from paths import fo... |
# -*- coding: utf-8 -*-
#
# Developed by <NAME> <<EMAIL>>
import json
import numpy as np
import os, sys
import torch
import torch.backends.cudnn
import torch.utils.data
import cv2
from shutil import copyfile
import utils.point_cloud_visualization
import utils.data_loaders
import utils.data_transforms
import utils.ne... |
from env import sudoku
## Importing personal environment for playing Sudoku
env = sudoku()
import tensorflow as tf
import os
import numpy as np
import numpy.random as rnd
## Importing Libraries
def q_network(X_state,name):## Defining a neaural network to find the q value for an observation
## a... |
"""
This module contains code to scrape coordinates for games off of espn for any given game
"""
import pandas as pd
from bs4 import BeautifulSoup
import xml.etree.ElementTree as etree
import re
import hockey_scraper.shared as shared
def event_type(play_description):
"""
Returns the event type (ex: a SHOT or... |
# -*- coding: utf-8 -*-
import utils
from utils import FullwideMapping
_to_wide = FullwideMapping()
_to_wide.addFullwideMapping(ord(' '), u'\u3000')
_to_wide.addFullwideMapping(ord('\t'), None)
to_wide = _to_wide.to_wide
class SCParserException(Exception):
pass
class SCParser:
def __init__(self):
... |
"""
An addition decreases
the number of available vertices. The leaves are last available
vertices to add to the sub-tour. When leaves are appended, sub-tour
becomes a tour.
We do not maintain space tree explicitly as a data structure. Instead,
we construct it dynamically during exploration.
The root of the tree... |
"""Monthly Sounding Averages"""
import datetime
from collections import OrderedDict
from pandas.io.sql import read_sql
from pyiem.plot.use_agg import plt
from pyiem.network import Table as NetworkTable
from pyiem.util import get_autoplot_context, get_dbconn
PDICT = {'00': '00 UTC', '12': '12 UTC'}
MDICT = OrderedDict... |
# TODO: from/to should follow inheritance even when defined outside of the class
from collections import defaultdict, deque
import inspect
_g_classmap = defaultdict(dict)
class CastError(Exception):
def __str__(self):
return self.args[0] % self.args[1:]
class CastPathError(CastError):
pass
def _bf... |
"""
Mask R-CNN
The main Mask R-CNN model implemenetation.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by <NAME>
"""
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
########################################... |
import os
import torch
from torch.utils.data import TensorDataset
from tqdm import tqdm
def read_examples(path, add_labels=True):
examples = [[]]
label_set = set()
if add_labels is True:
add_labels = 1
# Read examples from file
with open(path) as f:
for line in f:
lin... |
from wtpy import BaseCtaStrategy
from wtpy import CtaContext
import numpy as np
import statsmodels.tsa.stattools as ts
# 我们首先创建一个函数用来协整检验
def cointegration_check(series01, series02):
urt_1 = ts.adfuller(np.array(series01), 1)[1]
urt_2 = ts.adfuller(np.array(series02), 1)[1]
# 同时平稳或不平稳则差分再次检验
... |
'''
Date: 2021-04-04 16:32:10
LastEditors: <NAME>
LastEditTime: 2021-04-04 16:32:10
'''
'''
Date: 2021.04.04 15:48
Description: Omit
LastEditors: <NAME>
LastEditTime: 2021.04.04 15:48
'''
import tkinter
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.animation import FuncAnimation
from matplotlib.ba... |
from .. import ParallelSampler, sample_ellipsoid
import numpy as np
import sys
def log_probability_function(p):
r = emcee_pipeline.run_results(p)
return r.post, (r.prior, r.extra)
class EmceeSampler(ParallelSampler):
parallel_output = False
supports_resume = True
sampler_outputs = [("prior", flo... |
# Lint as: python3
# Copyright 2020 The TensorFlow 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 ... |
import socket
import random
import os
import pathlib
from datetime import datetime
from billiard import Process
from ament_index_python.packages import get_package_prefix
from launch import LaunchService, LaunchDescription
from launch.actions.execute_process import ExecuteProcess
from launch_ros.actions import Node
... |
"""
Optuna example that optimizes multi-layer perceptrons using PyTorch Lightning.
In this example, we optimize the validation accuracy of hand-written digit recognition using
PyTorch Lightning, and MNIST. We optimize the neural network architecture. As it is too time
consuming to use the whole MNIST dataset, we here ... |
#!/usr/bin/env python
"""Script and library for symbolizing MongoDB stack traces.
To use as a script, paste the JSON object on the line after ----- BEGIN BACKTRACE ----- into the
standard input of this script. There are numerous caveats. In the default mode, you need
to pass in the path to the executable being sy... |
"""
MIT License
Copyright (C) 2021 ROCKY4546
https://github.com/rocky4546
This file is part of Cabernet
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 lim... |
# 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
# d... |
"""Utility methods for Larynx"""
import getpass
import logging
import os
import shutil
import tempfile
import typing
import urllib.request
from pathlib import Path
from .constants import VocoderType
_DIR = Path(__file__).parent
_LOGGER = logging.getLogger("larynx.utils")
_ENV_VOICES_DIR = "LARYNX_VOICES_DIR"
# Forma... |
# Copyright 2021 The Blqs Developers
#
# 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 ... |
#
# train an SSD model on Pascal VOC or Open Images datasets
#
import os
import itertools
import torch
from filelock import FileLock
from torch.utils.data import DataLoader, ConcatDataset
from torch.optim.lr_scheduler import CosineAnnealingLR
import wandb
from vision.ssd.ssd import MatchPrior
from vision.ssd.mobilene... |
# Data Parallel Control (dpctl)
#
# Copyright 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... |
import csv
import sys
import pandas as pd
import plotly.express as px
import plotly.graph_objs as go
from scoring_grid.status_score import status_score_km_grid
class PlottingWeighing():
def __init__(self, population=100):
self.population = population
def create_dummy_data(self):
"""
... |
""" This module is the high-level wrapper for running a test on a list of input
datasets in order to collect statistics on alignment of each dataset to an
astrometric catalog."""
import datetime
import os
import shutil
import numpy as np
from astropy.table import Table
import pytest
from drizzlepac import alig... |
import json
import numpy as np
import benchml as bml
import benchml.transforms as btf
from benchml.hyper import GridHyper, Hyper
log = bml.log
log.setLevel("info")
bml.splits.synchronize(0)
regularization_range = np.logspace(-4, +0, 5)
def build_models():
return [
build_gylm_krr(),
]
def build_gy... |
import json
import random
import string
import argparse
import sys
def color_wrap(r, g, b):
return fR'\\color[rgb]{{ {r}, {g}, {b} }}'
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
letters = [c for c in string.ascii_letters] + [R'\phi', R'\alpha', R'\beta', R'\gamma', R'\delta', R'\... |
"""Auxiliary functions for plots in method of simulated moments lecture."""
import copy
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import respy as rp
def plot_criterion_params(params, param_names, criterion_msm, radius):
"""Plot criterion_msm for all values in params.
Plot given ... |
import argparse
import os, sys, glob
def make_dirs(prefix):
if prefix != "":
prefix += "_"
os.system(f"mkdir -p {prefix}sdf")
os.system(f"mkdir -p {prefix}mol2")
os.system(f"mkdir -p {prefix}pdb_params")
os.system(f"mkdir -p {prefix}replaced_params")
os.system(f"mkdir -p {prefix}compl... |
#! /usr/bin/env python3
import json
import argparse
import sys
import codecs
from datetime import datetime
from typing import Dict, List
def parse_timestamp(timestamp: str) -> str:
# format as 19810329T020000
# incoming as 2017-03-22T15:06:28.338Z
# first throw away .XXXZ
parsed = datetime.strptime(timestamp[:ti... |
import logging
from string import Template
from typing import Dict
from typing import List
import boto3
import neo4j
from .util import get_botocore_config
from cartography.util import aws_handle_regions
from cartography.util import run_cleanup_job
from cartography.util import timeit
logger = logging.getLogger(__name... |
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
import os
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
DISTNAM... |
from multiprocessing.sharedctypes import Value
import os
import os.path as osp
import math
import random
import pickle
import warnings
import glob
import numpy as np
import pdb
import torch
import torch.utils.data as data
import torch.nn.functional as F
import torch.distributed as dist
from torchvision.datasets.video... |
'''
#Copyright 2011-2013 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" ... |
#! /usr/bin/env python
import argparse
import json
import logging
import os
import re
import subprocess
import sys
import threading
import time
import prometheus_client as prom
import semver
try:
import Queue as queue
except ImportError:
import queue
class MultipathdExporterException(Exception):
def __... |
from machine import Pin, ADC, PWM, I2C
from time import sleep, time
import ssd1306
from hcsr04 import HCSR04
import dht
#GPIOs
PIN_LED1 = 0
PIN_LED2 = 32
PIN_RAIN = 16
PIN_MOTOR = 17
PIN_BUTTON = 5
PIN_TILT = 26
PIN_LDR = 34
PIN_POT = 36
PIN_RED = 4
PIN_GREEN = 33
PIN_BLUE = 12
PIN_DOOR = 23
PIN_W... |
import datetime
import uuid
from typing import List, Optional
import arrow
import discord
import sqlalchemy.exc
from sqlalchemy import delete, select
from sqlalchemy.ext.asyncio import AsyncSession
from project_template import config, schema
from project_template.utils.decorators import Session
from project_template.... |
# -*- coding: utf-8 -*-
import pickle
import jieba
import gensim
from sklearn.cluster import KMeans, MiniBatchKMeans
from sklearn.externals import joblib
from bert_serving.client import BertClient
def read_pickle_file(file_path):
with open(file_path, "rb") as fp:
data_lines = pickle.load(fp)
return ... |
import requests
import time
import json
import argparse
import sys
import re
from urllib.parse import urljoin
from random import randrange
from bs4 import BeautifulSoup
from pathlib import Path
from pathvalidate import sanitize_filename
def send_request_to_tululu(url, allow_redirects=True):
headers = {"User-Agent... |
import functools
import warnings
from typing import Optional, List, MutableSequence, Type, TypeVar, Any, Callable
from pydantic import BaseModel, BaseConfig, ValidationError
from pydantic.error_wrappers import ErrorWrapper
from pydantic.errors import ArbitraryTypeError
from pydantic.fields import ModelField, Undefined... |
import time
from datetime import timedelta
from flask import current_app as app
import itviec.source
from itviec.db import db
from itviec.models import Employer, Job
from itviec.time import str_to_datetime
from itviec.composers import install_employer
from itviec.update import update_employer
def download():
f... |
import numpy as np
import pandas as pd
import skimage, os
import SimpleITK as sitk
from scipy import ndimage
import matplotlib.pyplot as plt
import os
import zarr
import warnings
warnings.filterwarnings('ignore')
import tensorflow as tf
from keras import backend as K
K.set_image_dim_ordering('th')
from PIL import Ima... |
from flask import Flask,redirect, url_for, request
import pandas as pd
import scipy.stats as ss
import numpy as np
import math
from pandas import to_datetime
from collections import Counter
from sklearn import mixture
import os,gc
def get_percentage(percent, number_of_time_points):
return int(percent/100*number_of... |
from django.contrib import admin
from import_export import resources, fields
from import_export import fields
from import_export.admin import ImportExportModelAdmin
from import_export.widgets import *
from .models import Assessment, Programme
from .tasks import cleanup_old_data, import_docs, calculate_disaggregation
... |
"""
Module of functions defining program parameters
"""
import sys
import argparse
def makeArgParserCodeML(description, task = "classification"):
"""
Make program arguments parser for machine learning
for analysis of source code problems
Parameters:
- description -- string describing the parser
... |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth.decorators import permission_required
from django import forms
from datetime import datetime
from mediaman.models import ArtefactRepresentation, Document
from cat.models import MuseumObject
from parti... |
import logging
import os
import tempfile
import xml.etree.ElementTree as etree
from collections import namedtuple
from functools import lru_cache
from io import BytesIO
from shutil import copyfileobj
from shutil import move
from urllib.error import HTTPError
from urllib.error import URLError
from urllib.parse import ur... |
from collections.abc import Iterable
from django.utils.translation import gettext as _
from .actions import SubmitForm, ClearSearchInput
from .exceptions import ConfigurationError
class BaseComponent:
object_type = ''
children = None
can_have_children = True
_children_defined = False
def __init_... |
import json
import pandas as pd
import re
import pickle
from crosstab.outcomes import*
def openpickle(path_to_file):
with open(path_to_file, 'rb') as f:
data = pickle.load(f)
return data
_, had_surgery_MRNs = gold_outcomes_MRNs()
path_to_file2 = 'L:\\word_docs\\NLP\\Data Pickles\\gold_outcomes_list... |
#! /usr/bin/env streamlit run
# Copyright 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, ... |
from tqdm import tqdm
import pickle
import numpy as np
import torch
import os
import json
from copy import deepcopy
import os.path as osp
from torch.utils.data import Dataset
from pvrcnn.core import ProposalTargetAssigner
from .augmentation import ChainedAugmentation, DatabaseBuilder
# from .database_sampler import Da... |
from contextlib import closing, contextmanager
import json
import six
import time
from schematics.exceptions import ConversionError, ValidationError
from schematics.types import BaseType, StringType
class DictType(BaseType):
"""A validation type for dict properties"""
def to_native(self, value):
"""... |
# -*- coding: utf-8 -*-
import os.path
# DO NOT import non-standard modules. This module is imported by
# migrate.py which runs on fresh machines before anything is installed
# besides Python.
# THE ENVIRONMENT FILE AT /etc/mailinabox.conf
def load_environment():
# Load settings from /etc/mailinabox.conf.
r... |
import scipy.interpolate as interpolate
import matplotlib
import matplotlib.image as image
from matplotlib import rc, rcParams
import numpy as np
def get_ax_size(fig, ax):
'''
Returns the size of a given axis in pixels
Args:
fig (matplotlib figure)
ax (matplotlib axes)
'''
b... |
# -*- coding: utf-8 -*-
'''
Return data to a redis server
To enable this returner the minion will need the python client for redis
installed and the following values configured in the minion or master
config, these are the defaults:
.. code-block:: yaml
redis.db: '0'
redis.host: 'salt'
redis.port: 6379
... |
# Copyright (c) 2018-2022 NCC Group Plc
#
# 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, ... |
"""GLUT replacement for the original checker.py demonstration code
Note:
Has no navigation code ATM.
"""
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
from PIL import Image
import time
import sys
import os
def drawMessage(value, x, y):
glMatrixMode(GL_PROJECTION)
try:
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 24 00:59:26 2019
@author: edwardmwadsworth
Project: Animated Treasury Yeild Curve
"""
# Modules
import datetime as dt
from urllib.request import urlopen as uReq
from bs4 import BeautifulSoup as soup
import numpy as np
import pandas as pd
import matp... |
import glob
import pathlib
import concurrent.futures
from typing import Any, List, Tuple
from lxml import etree
import numpy as np
import rasterio
import tqdm
import click
from hillshade.hillshade import hillshade
class GlobbityGlob(click.ParamType):
"""Expands a glob pattern to Path objects"""
name = 'glob'... |
import asyncpg
import string
import random
import traceback
import re
import discord
import contextlib
import asyncio
import copy
from discord.ext import commands
from cogs.utils import Cog
from cogs.utils import OpenRobotFormatter
import traceback_with_variables as custom_traceback
class MissingButton(discord.ui.But... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
import os
from typing import Iterable, Tuple, Dict, Optional, Union
import click
from .helpers import (
lieutenant_query,
yaml_dump,
yaml_load,
)
from .component import component_parameters_key
from .config import Config
from .inventory import Inventory
class Cluster:
_cluster_response: Dict
_... |
#!/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.
import sys
import unittest
from io import StringIO
from fissix import pygram, pytree
from fissix.pgen2.driver import... |
### orbit generation for Markov networks
### all cliques are assumed to be symmetric and identical
### this file is for experimenting; it is not what was used in the paper
from sage.all import *
from my_graphs import *
import cProfile, pstats, StringIO
from collections import deque
import my_bliss
### generate all or... |
# Copyright (c) 2009-2022 The Regents of the University of Michigan.
# Part of HOOMD-blue, released under the BSD 3-Clause License.
r"""Special pair forces.
Special pair force classes apply a force and virial on every particle in the
simulation state commensurate with the potential energy:
.. math::
U_\mathrm{s... |
# -*- coding: utf-8 -*- #
# Copyright 2018 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 requir... |
"""Utilities to get call site."""
import ast
import dis
import inspect
import io
import itertools
import sys
from collections import namedtuple
from functools import lru_cache
from typing import Dict, Iterable, Optional, Set, Tuple
import bytecode as b
import uncompyle6
from . import utils
from .basis import ID
MAR... |
from alpakka.wrapper.nodewrapper import NodeWrapper
from alpakka.wrapper.nodewrapper import Listonder
from collections import OrderedDict
from alpakka.logger import LOGGER
import alpakka
WOOLS = alpakka.WOOLS
class Grouponder(NodeWrapper):
"""
Base class for node wrappers that group variables.
"""
d... |
"""AWS integration for S3."""
import asyncio
import logging
import os
import voluptuous as vol
import boto3
import botocore
import homeassistant.helpers.config_validation as cv
from homeassistant.core import HomeAssistant, callback
from homeassistant.config_entries import SOURCE_USER, ConfigEntry
_LOGGER = logging.g... |
from typing import List
from catalyst.callbacks.metric import LoaderMetricCallback
from catalyst.metrics._cmc_score import CMCMetric, ReidCMCMetric
class CMCScoreCallback(LoaderMetricCallback):
"""
Cumulative Matching Characteristics callback.
This callback was designed to count
cumulative matching ... |
# Author: <NAME>
"""Facility for checking theory files."""
import traceback2
import json
import copy
import time
from pstats import Stats
import cProfile
from kernel import theory
from logic import basic
from logic import context
from server import server
from server import method
from logic import logic
from server... |
"""
sphinx.ext.mathbase
~~~~~~~~~~~~~~~~~~~
Set up math support in source files and LaTeX/text output.
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import warnings
from typing import Callable, List, Tuple
from docutils import nodes
... |
import os, sys, sublime, signal
try:
from plugin_debugger import tools
#from plugin_debugger.thread_progress import ThreadProgress
except ImportError:
sys.stderr.write("importing tools\n")
from .plugin_debugger import tools
#from .plugin_debugger.thread_progress import ThreadProgress
ST3 = subli... |
#!/usr/bin/env python
# IntegraterFactory.py
# Copyright (C) 2006 CCLRC, <NAME>
#
# This code is distributed under the BSD license, a copy of which is
# included in the root directory of this package.
#
# A factory for Integrater implementations. At the moment this will
# support only Mosflm, XDS and the null int... |
"""HTMLer Base Classes
"""
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__license__ = 'MIT'
from typing import List, Generator, Union, Optional
from abc import ABC, abstractmethod
from copy import copy
_NODE_SINGLE_ATTRS = ('allowfullscreen', 'async', 'checked', 'hidden', 'selected', 'required')
_NODE_REPLACE_ATTRS = ... |
### Blackjack by VnPower
# This repository is distributed under MIT license.
#
# You will be free to copy and/or redistribute this code, with or without credits.
from random import shuffle
from time import sleep
import os
# Assign `input` to `raw_input` because we are re-using its name
raw_input = input
# Handle i... |
# Copyright 2022 Google
#
# 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, soft... |
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 8 14:17:25 2022
@author: void
"""
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 5 16:07:02 2022
@author: jadidi
"""
from matplotlib import pyplot as plt
import pandas as pd
import numpy as np
import datetime
from PIL import Image
from sklearn.pipeline import make_p... |
#
# Based on http://pastebin.com/8fBVpjaj
#
try:
# For Python 3.0 and later
from urllib.request import urlopen, Request
from urllib.parse import urlencode
except ImportError:
# Fall back to Python 2's urllib2
from urllib2 import urlopen, Request
from urllib import urlencode
import json
impor... |
from unittest import mock
from unittest.mock import Mock, MagicMock
import unittest
from queue import Empty as EmptyQueue
from mlagents.trainers.subprocess_env_manager import (
SubprocessEnvManager,
EnvironmentResponse,
StepResponse,
)
from mlagents.trainers.env_manager import EnvironmentStep
from mlagents... |
# Copyright 2016 The TensorFlow 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 applica... |
from torch.autograd import Variable
import torch
import torch.optim
import copy
import numpy as np
from scipy.linalg import hadamard
from skimage.metrics import structural_similarity as ssim
from .helpers import *
from .mri_helpers import *
from .transforms import *
dtype = torch.FloatTensor
#dtype = torch.FloatTenso... |
# -*- coding: utf-8 -*_
#
# Copyright (c) 2020, Pureport, Inc.
# All Rights Reserved
"""
The api module dynamically loads and binds a set of Python functions
based on the Pureport OpenAPI specification. This module will
creates an instance of `pureport.session.Session`, authenticates using
the `pureport.credentials` ... |
"""
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
Test case ID : C4982803
Test Case Title : Verify that when the shape Physics Asset is selected,
PxMesh option g... |
import json
import argparse
import random
import time
# merge entries in dict_2 into dict_1
def merge_dict(dict_1, dict_2):
for key in dict_2:
if key not in dict_1:
dict_1[key] = dict_2[key]
else:
dict_1[key] += dict_2[key]
return
def sort_dict(dct):
dct_tup = [(key, dct[key]) for key in dct]
dct_tup.... |
"""
depth_profiles_estimations.py
"""
# 3rd party imports
import matplotlib
import matplotlib.pyplot as plt
from ipywidgets import interact, fixed
def plot_depth_profiles(comp_data_old, meta_data_old, comp_data_new, meta_data_new,
density, density_merged, model, hole_index, figure_size=(20, 1... |
"""
路由处理,信号广播
"""
import aiohttp
from aiohttp import web
import asyncio
import CPlayer
dic = dict()
get_dict = False
class Dispatcher:
async def login(players, myplayer, name):
"""
:param players: player lists
:param myplayer: Player player
:param name: name to login
"... |
#!/usr/bin/env python
#
# Author: <NAME>, <NAME>
# Python Version: 3
#
# This software is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expressed or implied
import json
from Utils.Session import Session
from Utils import excel_lib
import re
# parsed the column in orde... |
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import boto3
import datetime
import logging
import time
import uuid
from botocore.exceptions import ClientError
dynamodb = boto3.client('dynamodb')
logger = logging.getLogger()
logger.setLevel(logging.INFO)
cl... |
from __future__ import print_function
import os
from sys import stderr
from flask import Flask, Response, flash, render_template, request, session
from typing import Callable, Dict
from werkzeug.datastructures import ImmutableMultiDict
from core import background, question_options
from core.listen_up_db import Liste... |
# 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
# d... |
import logging
from . import formulas
from .slipnet import slipnet
from .temperature import temperature
from .workspace import workspace
class WorkspaceFormulas(object):
def __init__(self):
self.clamp_temperature = False
def update_temperature(self):
logging.debug("update_temperature")
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... |
from __future__ import print_function
# encoding: utf-8
__author__ = '<NAME>'
"""
interactive_dashboard.py
Created by lex at 2019-08-03.
"""
import plotly.graph_objs as go
from plotly.offline import init_notebook_mode
from ipywidgets import VBox, widgets
from NetEmbs.Vis.helpers import getColors_Markers
from NetEmbs.V... |
# coding: utf-8
import gym
import numpy as np
import xtools as xt
import xtools.simulation as xs
from xaircraft.envs.base import BaseEnv
from xaircraft.models.csurface import CSurface
from xaircraft.models.lvaircraft import LVAircraft, LVAircraftEx
class LVAircraftPitchV0(BaseEnv):
def __init__(
sel... |
# -*- coding: utf-8 -*-
""" implementation of some statistical functions
This module implements some staistical tools which are not currently implemented in
any widely deployed python package.
"""
import warnings
import numpy as np
from numpy import linalg
from scipy import stats, integrate, optimize
from sklearn imp... |
import os
import discord
import requests
import json
import logging
import sys
from discord.ext import commands, tasks
from discord.ext.commands import has_permissions, MissingPermissions
from dotenv import load_dotenv
import aiohttp
import asyncio
class Linking(commands.Cog):
def __init__(self, bot):
se... |
"""
Copyright 2020 The OneFlow 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 agr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.