text stringlengths 3.07k 22.1k |
|---|
import atexit
import http.client
import json
import logging
import re
import ssl
import time
from contextlib import contextmanager
from keystoneauth1.session import Session
from keystoneauth1.identity.v3 import Password
from keystoneauth1.exceptions.connection import ConnectionError
from keystoneauth1.exceptions.http ... |
from __future__ import annotations
import os
import sys
from numpy import unravel_index
from nncg.writer import Writer
from nncg.nodes.expressions import *
from nncg.traverse.tree import TreeNode
from nncg.nodes.expressions import Variable
class Writable(TreeNode):
"""
Base class for nodes that can be written... |
#! /usr/bin/env python
from stretch_body.device import Device
import importlib
import urdfpy
import numpy as np
import os
# #######################################################################
class RobotCollisionModel(Device):
"""
The RobotCollisionModel is a base class to provide simple self-collision ... |
from brian2 import *
import inspect
#from collections import namedtuple
#__all__ = ["echo", "surround", "reverse"]
class AttrDict(dict):
"""
dict subclass which allows access to keys as attributes: mydict.myattr
"""
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kw... |
"""
Copyright 2019 Stanford University
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, sof... |
import deimos
import numpy as np
import pandas as pd
from scipy.interpolate import UnivariateSpline
from scipy.spatial.distance import cdist
def get_1D_profiles(features, dims=['mz', 'drift_time', 'retention_time']):
'''
Extract 1D profile for each of the indicated dimension(s).
Parameters
----------... |
""" Miscellaneous helper functions
These functions fulfill small numerical tasks used in several places in the
package.
"""
import numpy as np
# make numba jit an optional dependence
# see https://github.com/numba/numba/issues/3735
try:
from numba import jit
except ImportError:
def jit(pyfunc=None, ... |
#Embedded file name: wp_login_crack.py
import re
import urllib
import time
if 0:
i11iIiiIii
def assign(service, arg):
if service == '''wordpress''':
return (True, arg)
if 0:
O0 / iIii1I11I1II1 % OoooooooOO - i1IIi
def o0OO00(url):
oo = url + decode('\x90\x0eM\xc3\x8b\x05\x18\x... |
import re
import json
import math
import time
import random
import pandas as pd
import bs4
import requests
from tqdm.notebook import tqdm
from .formatting.text_tools import title_to_snake_case
from .pandas.data import dict_to_col
pd.set_option('mode.chained_assignment', None)
# Objects included in this file:
# grade... |
"""
schema for asyncpg sessions is "asyncpg_telethon"
"""
from typing import List, Optional, Dict, Any, Union, Callable, Tuple
import asyncio
import uuid
from abc import ABC
import datetime
import logging
import asyncpg
from telethon import utils
from telethon.crypto import AuthKey
from telethon.tl import types
from... |
import os
import sys
import shutil
import hashlib
import tarfile
import StringIO
from cuddlefish import packaging
from cuddlefish import Bunch
from cuddlefish.docs import apiparser
from cuddlefish.docs import apirenderer
from cuddlefish.docs import webdocs
import simplejson as json
DOCS_DIR = "doc"
DIGEST = "status.m... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from graphene.types.resolver import dict_resolver
import graphene
import sys
import os
import json
import re
from pprint import pprint
# Articut Result 檔案路徑
resultFilePath = ''
"""
Articut GraphQL Schema
"""
class Persons(graphene.ObjectType):
class Meta:
de... |
# -*- coding:utf8 -*-
# !/usr/bin/env python
# Copyright 2017 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... |
"""ResNetV1bs, implemented in Gluon."""
# pylint: disable=arguments-differ,unused-argument,missing-docstring
from __future__ import division
from mxnet.context import cpu
from mxnet.gluon.block import HybridBlock
from mxnet.gluon import nn
from mxnet.gluon.nn import BatchNorm
__all__ = ['ResNetV1b',
'resne... |
import argparse
import utils
import pathlib
import collections
from pprint import pprint
from nltk import word_tokenize
from nltk import sent_tokenize
from scipy import stats
import matplotlib.pyplot as plt
import seaborn as sns
import random
import tarfile
import os
from newsroom.analyze import Fragments
def read_wc... |
import pytest
grblas = pytest.importorskip("grblas")
from metagraph.core.resolver import Resolver
from metagraph.core.dask.resolver import DaskResolver
from metagraph.core.multiverify import (
MultiVerify,
MultiResult,
UnsatisfiableAlgorithmError,
MultiVerifyError,
)
from .util import default_plugin_r... |
import copy
import matplotlib
matplotlib.use("Agg") # NOQA
import matplotlib.pyplot as plt
import numpy as np
import os
import re
import sys
import threading
# OpenCV import for python3.5
sys.path.remove('/opt/ros/{}/lib/python2.7/dist-packages'.format(os.getenv('ROS_DISTRO'))) # NOQA
import cv2 # NOQA
sys.path.app... |
# encoding: utf-8
"""
Class for reading data from from Tucker Davis TTank format.
Terminology:
TDT hold data with tanks (actually a directory). And tanks hold sub block (sub directories).
Tanks correspond to neo.Block and tdt block correspond to neo.Segment.
Note the name Block is ambiguous because it does not refer t... |
from __future__ import absolute_import
# from builtins import object
# Copyright (c) 2015, Disney Research
# All rights reserved.
#
# Author(s): <NAME> <<EMAIL>>
# Disney Research Robotics Group
from . import pydart2_api as papi
import numpy as np
class Shape(object):
"""
"""
def __init__(self, _shapenode... |
from pathlib import Path
import os
import sys
import time
import shutil
from pysmFISH.utils import free_space, create_dir, copytree
from pysmFISH.logger_utils import selected_logger
def transfer_experiment(flagged_file_path:str, path_destination:str, flag_file_key:str, completion_fpath:str):
"""
Function to ... |
from IPython import display
from torch.utils.data import DataLoader
from torchvision import transforms, datasets
from utils import Logger
import tensorflow as tf
import numpy as np
DATA_FOLDER = './tf_data/VGAN/MNIST'
IMAGE_PIXELS = 28*28
NOISE_SIZE = 100
BATCH_SIZE = 100
def noise(n_rows, n_cols):
return np.... |
from kivy.app import App
from kivy.lang import Builder
from kivy.clock import Clock
from kivy.properties import ListProperty
from kivy.animation import Animation
from kivy.uix.boxlayout import BoxLayout
from kivy.metrics import dp
from timeit import default_timer as timer
from threading import Thread, Event
from run_t... |
import os
import uuid
import base64
import datetime
import asyncio
from email import policy
from email.parser import BytesParser
from email.headerregistry import Address
from email.errors import InvalidHeaderDefect
import arrow
from tinydb import TinyDB, Query
from tinydb_serialization import Serializer, Serializati... |
import motley
import numpy as np
from motley.table import Table
from numpy.lib.stride_tricks import as_strided
from scipy.stats import binned_statistic_2d
def table_coords(coo, ix_fit, ix_scale, ix_loc):
# TODO: maybe add flux estimate
# create table: coordinates
ocoo = np.array(coo[:, ::-1], dtype='O')
... |
from __future__ import division
import math as mt
from copy import copy
from exotk.priors import PriorSet, UP, NP
from exotk.utils.likelihood import ll_normal_es
from exotk.utils.orbits import as_from_rhop
from numpy import zeros, sqrt, isfinite, inf
from pytransit import MandelAgol as MA
from pytransit.orbits_f impo... |
"""Preprocessing methods and the utilities to automagically run them in single-thread/multiprocess modes"""
import multiprocessing
from multiprocessing.shared_memory import SharedMemory
import queue
import time
import os
import shutil
import netCDF4 as nc
import numpy as np
from podaac.merger.path_utils import resolv... |
from dash.dependencies import Output, Input, State, ALL, MATCH
import dash
from dash.exceptions import PreventUpdate
import dash_html_components as html
from tisane.gui.gui_components import GUIComponents, separateByUpperCamelCase
import json
import logging
def createRandomEffectsCallbacks(app, comp: GUIComponents = ... |
import csv
import os
import pandas as pd
import re
import sys
import time
from .atom import Atom
from .periodic_table import PeriodicTable as PT
__all__ = [
"cd",
"check_user_input",
"consecutive",
"df_from_namedtuples",
"eof",
"get_files",
"get_log_type",
"list_of_dicts_to_one_level_di... |
###DETERMING MASS OF MILKY WAY GALAXY VIA POTENTIAL ENERGY FITTING & OPTIMIZATION
###GIVEN ROTATIONAL SPEED DATA FOR MILKY WAY, FIT THREE COMPONENTS WITH THE SAME FUNCTIONAL FORM OF THE POTENTIAL
#PACKAGE IMPORTS
import numpy as np
import math as m
import scipy
import matplotlib.pyplot as plt
from scipy import optimiz... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
# Allow everything in there to access the DB
pytestmark = pytest.mark.django_db
import copy
from django.core.urlresolvers import reverse
from django.conf import settings
import json
import logging
from rest_framework import status
from .... |
from flask_cors import CORS
from flask import Flask, escape, request, render_template, Response
from flask import jsonify
import MySQLdb
import csv
from geojson import Feature, FeatureCollection, Point
import datetime
from decimal import Decimal
import json
import os.path
app = Flask(__name__)
if app.config["ENV"] == ... |
import numpy as np
np.set_printoptions(suppress=True)
import torch
import torch.nn as nn
import torch.optim as optim
import torch.backends.cudnn as cudnn
import argparse
import pathlib
import os
import sys
from lib.solver import train_epoch, val_epoch, test_epoch
from network.v2v_model import V2VModel
from network.u... |
# -*- coding: utf-8 -*-
"""
Python utilities used for converting csv files to binary format
"""
import os
import warnings
import shutil
import subprocess
import pandas as pd
from .exceptions import OasisException
# List of all the oasis files and relevant conversion files
CONVERSION_TOOLS = {
'items': 'itemt... |
# -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - <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 Licen... |
#!/usr/bin/env python
'''
Predict Server
Create a server to accept image inputs and run them against a trained neural network.
This then sends the steering output back to the client.
Author: <NAME>
'''
from __future__ import print_function
import os
import argparse
import sys
import numpy as np
import h5py
import json
... |
# encoding: utf-8
#
#
# self Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with self file,
# You can obtain one at http:# mozilla.org/MPL/2.0/.
#
# Author: <NAME> (<EMAIL>)
#
from __future__ import absolute_import, division, unicode_literals
... |
import re
import nltk
from polyglot.text import Text
PRONOUNS = ['dia', 'ia', 'beliau', 'mereka', 'kami', 'kita', 'aku', 'saya', 'kamu', 'anda', 'kalian']
PRONOUN_SINGULAR = ['dia', 'ia', 'beliau', 'aku', 'saya', 'kamu', 'anda']
PRONOUN_PLURAL = ['mereka', 'kami', 'kita', 'kalian']
CLITICS = ['mu', 'ku', 'nya']
APPOSI... |
# -*- coding: UTF-8 -*-
"""
Copyright 2021 Tianshu AI Platform. 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
... |
""" Creates training, validation, and test data. """
import math
from os import path
import numpy as np
from numpy.lib import recfunctions
import torch
import defaults
import features
import models
import utils
def get_dataloaders(args, net):
"""
Builds training, validation, and test sets, which are return... |
import csv
import json
import os
import sys
import threading
from datetime import datetime
import boto3
from boto3.exceptions import S3UploadFailedError
from boto3.s3.transfer import TransferConfig
from botocore.exceptions import ClientError, ProfileNotFound
from enum import Enum, unique
from .asset import Asset
fro... |
import SimpleITK
import numpy as np
import csv
import os
from PIL import Image
import matplotlib.pyplot as plt
import scipy.ndimage
import math
# Constants
INITIAL_PATCH_WIDTH = 92 # This is the width in pixels need to allow for 64 pixel patch after 45 deg rotation
FINAL_PATCH_WIDTH = 64 # This is the ... |
from bson import ObjectId
from dataclasses import field
from jembatan.core.spandex import Span
from jembatan.core.spandex import constants as jemconst
from jembatan.core.spandex import json as spandex_json
from jembatan.readers.textreader import text_to_jembatan_doc
from jembatan.typesys import Annotation, AnnotationSc... |
#!/usr/bin/env python3
# krakenctl.py: cli for viewing and manipulating running kraken instances
#
# Author: <NAME> <<EMAIL>>
#
# This software is open source software available under the BSD-3 license.
# Copyright (c) 2021, Triad National Security, LLC
# See LICENSE file for details.
# from argument_manager import A... |
# -*- coding: utf-8 -*-
"""
Utilities for generating static image and line plots of near-publishable quality
Created on Thu May 05 13:29:12 2016
@author: <NAME>, <NAME>
"""
from __future__ import division, print_function, absolute_import, unicode_literals
from numbers import Number
import sys
import matplotlib as mp... |
import matplotlib.pyplot as plt
from numpy import loadtxt
import argparse
import numpy as np
def handleArguments():
"""Handles CLI arguments and saves them globally"""
parser = argparse.ArgumentParser(
description="Switch between modes in A2C or loading models from previous games")
parser.add_argum... |
from gcn.layers import *
from gcn.metrics import *
from gcn.inits import *
from time import time
import scipy.sparse as sp
from gcn.utils import sparse_to_tuple, np_dropout, np_sparse_dropout
import numpy as np
flags = tf.app.flags
FLAGS = flags.FLAGS
# History -> History_mean -> Loss, gradient -> History
class Mode... |
import os
import json
import pytest
import pprint
import tempfile
import random
import string
from flask import request, current_app, g
from .app_example import db, app, stateless_auth_manager, User, ApiToken
from flask_stateless_auth import current_stateless_user, _get_stateless_user
class TestConfig:
# DEFAUL... |
import os
import argparse
from datasets import load_dataset, ClassLabel
from hetseq.bert_modeling import (
BertConfig,
BertForPreTraining,
BertForTokenClassification,
)
from transformers import (
BertTokenizerFast,
DataCollatorForTokenClassification,
)
import torch
from torch.utils.data.dataload... |
_VERSION_ = "1.0.8"
_ENABLE_HACKS_ = False
_ENABLE_HACKS_ADMIN_ = True
_THE_CN_WIN_ = False
import random
import socket
import time
class player:
def __init__(self, connection, num):
global deck
self.connection = connection[0]
self.num = num + 1
self.name = "Player ... |
import chess
import chess.svg
import random
import matplotlib.pyplot as plt
from minimax import *
import functools
import theorical_position_advantage as ENGINE_ADV_POSITION
from LichessComparator import LichessComparator
pieceTypes = [
'PAWN',
'KNIGHT',
'BISHOP',
'ROOK',
'QUEEN',
'KING'
]
SC... |
import sys, glob, os
sys.path.insert(1, '/data/s2675544/git/neural_deprojection/')
import tensorflow as tf
import sonnet as snt
import numpy as np
from neural_deprojection.graph_net_utils import vanilla_training_loop, batch_dataset_set_graph_tuples, \
TrainOneEpoch, AbstractModule, get_distribution_strategy, build... |
import os
import tldextract
from flask import Flask, request, jsonify
from . import features
import re
regex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.(
25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.(
25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.(
25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)... |
### Google Ngram Data Tools
## <NAME>
## Created: 9/13/2017
## Updated: 1/31/2018
import os
import re
import sys
import math
import errno
import numpy as np
import subprocess as sb
# savitzky golay smoothing function
def savitzky_golay(y, window_size, order, deriv=0, rate=1):
try:
window_size = np.abs(np.int(wind... |
import base64
from flask import Response
from flask_jwt import current_identity, jwt_required
from flask_restx import Namespace, Resource, fields
from jarr.api.common import (EnumField, parse_meaningful_params,
set_clustering_options, set_model_n_parser)
from jarr.controllers import (Feed... |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
### Welcome to the Noah's Black Jack Game
'''
Create a deck of 52 cards
Shuffle the deck
Ask the Player for their bet
Make sure that the Player's bet does not exceed their available chips
Deal two cards to the Dealer and two cards to the Player
Show only one of the De... |
# Copyright (c) 2015 Huawei Technologies India Pvt.Limited.
# 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-... |
from bead.exceptions import InvalidArchive
import os
import sys
from bead import tech
from bead.workspace import Workspace
from bead import layouts
import bead.spec as bead_spec
from .cmdparse import Command
from .common import assert_valid_workspace, die, warning
from .common import DefaultArgSentinel
from .common i... |
from functools import partial
from actstream import action
from annoying.functions import get_config, get_object_or_None
from django.contrib.auth.models import User
from django.db import models
from django.db.models import Avg, Sum
from django.template.defaultfilters import slugify
from django.urls import reverse
from... |
"""
Copyright 2021 Tsinghua University
Apache 2.0.
Author: <NAME>, <NAME>
In this file, we define universal models
"""
import numpy as np
import six
import utils
import _layers as nnlayers
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
def get_vgg2l_odim(idi... |
"""Tests of Fortran language support."""
import logging
import operator
import shutil
import types
import unittest
from encrypted_config.json_io import json_to_file
import numpy as np
import timing
from transpyle.general.code_reader import CodeReader
from transpyle.general.binder import Binder
from transpyle.fortran... |
import torch
import torch.nn as nn
from torch import tensor
import torch.nn.functional as F
from models.pt_model import PyTorchModel
class PlasticLayer(nn.Module):
"""
PlasticLayer implements hebbian basic and OJA's rules for learning in a fully connected manner.
This class is mostly based on the differen... |
"""
Growing Neural Gas class
$Id: gng.py,v 1.17 2006/03/20 21:13:24 jp Exp $
"""
from plastk.base import BaseObject
from plastk.vq import VQ
from plastk.utils import matrixnorm,norm,inf,gaussian
from Numeric import argsort,argmin,dot,sqrt,take,zeros,average,array,concatenate as join
from plastk.params import Paramete... |
# ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... |
# -*- coding: utf-8 -*-
import logging
import json
import datetime
import re
from django.http import HttpResponse, HttpResponseRedirect
from django.core.exceptions import ObjectDoesNotExist
from django.http import Http404
from django.template import Template, Context, loader
from django.views.decorators.csrf import cs... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Bridges between controller interface and wheeled robots
"""
from abc import ABCMeta
import numpy as np
from pyrobolearn.tools.interfaces.controllers.controller import GameControllerInterface
from pyrobolearn.tools.bridges.bridge import Bridge
from pyrobolearn.robots.wh... |
import numpy as np
import cv2
import math
import euler
def getSmallestRotMatBetweenTwoDirections(w_directionBefore,w_directionAfter): #rotate frame (to keep the point constant)
w_rotVec=getSmallestRotVecBetweenTwoDirections(w_directionBefore,w_directionAfter)
return rotVecToRotMat(w_rotVec) #oldFrame_newFrame... |
import random
from abc import ABC, abstractmethod, abstractproperty
from pathlib import Path
import util
import open3d as o3d
import numpy as np
from termcolor import cprint
random.seed(0)
class Renderer(ABC):
def __init__(
self,
n_primitives=50,
width=256,
he... |
import time
import os.path
import logging
import urllib.parse
from werkzeug.utils import cached_property
from piecrust import (
RESOURCES_DIR,
CACHE_DIR, TEMPLATES_DIR, ASSETS_DIR,
THEME_DIR, PLUGINS_DIR,
CONFIG_PATH, THEME_CONFIG_PATH)
from piecrust.appconfig import PieCrustConfiguration
from piecrust.... |
#!/usr/bin/env python3
"""
CLI implementation to communicate with a connected Arduino based EEPROM Programmer
"""
import argparse
import time
import sys
from difflib import context_diff as diff_func
from io import BytesIO
from typing import Sequence, Union, BinaryIO
from serial import Serial
from tqdm import tqdm
... |
# Instead just add darknet.py to somewhere in your python path
# OK actually that might not be a great idea, idk, work in progress
# Use at your own risk. or don't, i don't care
import xml.etree.ElementTree as ET
import os
import cv2
import sqlite3 as db
import argparse
import matplotlib as mpl
if os.environ.get('DISP... |
"""
##############################################
Clustering analysis module
##############################################
All functions related to the clustering of poles for automatic OMA.
"""
import numpy as np
import hdbscan
from . import modal
def crossdiff(arr, relative=False, allow_negatives=False):
"""... |
# Copyright 2014 Rackspace
# 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 app... |
import snack
ACTION_NONE = 0
ACTION_SET = 1
ACTION_INC = 2
ACTION_DEC = 3
more_hotkeys = {
"+": ord('+'),
"-": ord('-'),
"LEFT": 0x8000 + 4,
"RIGHT": 0x8000 + 5,
}
for n in more_hotkeys.keys():
more_hotkeys[more_hotkeys[n]] = n
snack.hotkeys.update(more_hotkeys)
TEXT_WI... |
# Copyright (c) 2014 <NAME> <https://github.com/waigani>
# Copyright (c) 2016 <NAME> <https://github.com/alvarolm>
# This program is Free Software see LICENSE file for details.
"""
GoGuru is a Go guru plugin for Sublime Text 3.
It depends on the guru tool being installed:
go get golang.org/x/tools/cmd/guru
"""
import... |
from IPython.core.display import HTML
HTML("""
<style>
.output_png {
display: table-cell;
text-align: center;
vertical-align: middle;
}
</style>
""")
# remove warnings
import warnings
warnings.filterwarnings('ignore')
# ---
from matplotlib import pyplot as plt
import matplotlib
matplotlib.style.use('ggplo... |
## HAND discretised and visualised
## <NAME>
import fiona
import rasterio
import rasterio.features
from shapely.geometry import shape, mapping
from shapely.geometry.multipolygon import MultiPolygon
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import numpy.ma as ma
import argparse
def ar... |
import graphene
import base64
from gtmcore.dispatcher import Dispatcher
from gtmcore.labbook import SecretStore
from gtmcore.environment.componentmanager import ComponentManager
from gtmcore.container import container_for_context
from gtmcore.logging import LMLogger
from gtmcore.environment.bundledapp import BundledAp... |
from typing import Union, Iterable
import logging
import numpy as np
import pandas as pd
from sklearn.pipeline import Pipeline
import tensorflow as tf
from flowcat.utils import URLPath
from flowcat.types.fcsdata import FCSData, join_fcs_data
from flowcat.types.som import SOM
from flowcat.preprocessing import scaler... |
from dotenv import dotenv_values
from pymongo import MongoClient
from pathlib import Path
import dash
from dash import dcc
from dash import html
from dash.dependencies import Input, Output, State, MATCH, ALL
import plotly.express as px
import pandas as pd
"""LOAD ENVIRONMENT VALUES"""
path = Path().absolute()
config =... |
from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7
import os
# importing the Kratos Library
import KratosMultiphysics
import KratosMultiphysics.SolidMechanicsApplication as KratosSolid
from KratosMultiphysics.deprecation_management imp... |
"""
Weak Supervision Dataset for Topic Classification in Yorùbá
This is based on the paper
Hedderich, <NAME>, Alabi, Markus & Klakow:
Transfer Learning and Distant Supervision for Multilingual Transformer Models: A Study on African Languages
EMNLP 2020, https://aclanthology.org/2020.emnlp-main.204/
It is a topic cla... |
__author__ = "<NAME>"
import numpy as np
import json
import dill as pickle
import warnings
import inspect
from .model_parameters import ModelParameterArray, ModelParameter
from .spectral_shapes import SED
from .data_loader import ObsData
from .utils import get_info
from .plot_sedfit import PlotSED
from .cosmo_... |
from __future__ import division
from __future__ import print_function
import os
import glob
import time
import random
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from torch_geometric.nn import GCNC... |
# -*- coding: utf-8 -*-
#
# This file is part of the FspPssSubarray project
#
#
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
"""
Author: <NAME> <EMAIL>,
Herzberg Astronomy and Astrophysics, National Research Council of Canada
Copyright (c) 2019 National Research Council of Canad... |
from network import *
from gene import *
from random import randint, choice
class Genome:
def __init__(self, num_inputs, num_outputs, activation, init_network=True):
self.species = 0
self.fitness = 0
if init_network:
self.network = Network(num_inputs, num_outputs, act... |
import fnmatch
import botocore
COPY_METHODS = {"copy", "copy_object", "copy_upload_part"}
LIST_METHODS = {"list_objects", "list_objects_v2", "list_object_version"}
def _route_bucket_and_key(api_params, config, map):
for profile in config:
mapping = config[profile]
if "Bucket" in api_params:
... |
from __future__ import absolute_import
import os
import time
from collections import namedtuple
import torch as t
from torch import nn
from torch.nn import functional as F
from torchnet.meter import ConfusionMeter, AverageValueMeter
from model.utils.creator_tool import AnchorTargetCreator, ProposalTargetCreator
from ... |
import json
import os
import pickle
import time
import urllib.request
import feedparser
import redis
import requests
from slugify import slugify
import twitter
# Abbreviated party names, for 140 character convenience
PARTY_LOOKUP = {
'Labour Party': '@UKLabour',
'Labour and Co-operative Party': '@UKLabour /... |
"""
Player handling.
"""
import logging as log
import csv
from random import choice
from mono.dice import roll
from mono.board import FIELD_POSITION
_NUMSTR = {0:'zero', 1:'one', 2:'two',
3:'three', 4:'four', 5:'five'}
_NAIVE_CLR = ['blue', 'green', 'yellow', 'red', 'orange',
'pink', 'cyan', 'brown',... |
from facenet_pytorch import MTCNN, InceptionResnetV1, fixed_image_standardization, training
import torch
from torch.utils.data import DataLoader, SubsetRandomSampler
from torch import optim
from torch.optim.lr_scheduler import MultiStepLR
from torch.utils.tensorboard import SummaryWriter
from torchvision import dataset... |
"""A script to create Southwood Golf & Country Club."""
from scorecard import db
from scorecard.models.course import Course
from scorecard.models.hole import Hole
from scorecard.models.tee_color import TeeColor
from scorecard.models.tee_set import TeeSet
def create():
"""Create southwood."""
southwood = Cour... |
from __future__ import absolute_import
import os
import pytest
import wrapt
import sentry_sdk
from sentry_sdk.integrations import Integration
from sentry_sdk import Hub, capture_exception
from sentry_sdk.scope import add_global_event_processor
_ENVVARS_AS_TAGS = frozenset(
[
"GITHUB_WORKFLOW", # The na... |
"""Format module for scene info data."""
# Official Libraries
# My Modules
from stobu.formats.common import get_breakline
from stobu.formats.common import get_format_record_as_br
from stobu.formats.common import eliminated_empty_format_records_from
from stobu.syss import messages as msg
from stobu.types.info import ... |
import gym
from gym.spaces import Box
from stable_baselines import PPO2, SAC
from stable_baselines.common.vec_env import DummyVecEnv, VecNormalize
from stable_baselines.common.policies import MlpPolicy as AC_MlpPolicy
from stable_baselines.sac.policies import MlpPolicy as SAC_MlpPolicy
import matplotlib.pyplot as plt
... |
""" Dataset for 3D object detection on SUN RGB-D (with support of vote supervision).
A sunrgbd oriented bounding box is parameterized by (cx,cy,cz), (l,w,h) -- (dx,dy,dz) in upright depth coord
(Z is up, Y is forward, X is right ward), heading angle (from +X rotating to -Y) and semantic class
Point clouds are in **... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import atexit
import argparse
import os
import time
import json
import warnings
import inspect
import imageio
from atx import consts
from atx import errors
from atx import imutils
from atx.base import nameddict
from atx.ext.report ... |
# Some portiong of this code are adapted from Haiku:
# https://github.com/deepmind/dm-haiku/blob/master/haiku/_src/transform.py#L228#L300
import threading
import typing as tp
from contextlib import contextmanager
import haiku as hk
import numpy as np
from haiku._src import base
from haiku._src import transform as src... |
#!/usr/bin/env python3
# standard libraries
import sys
import time
import subprocess
import argparse
import logging
import os
import glob
# third-party libraries
from gpiozero import Button
from pump_move import PumpMove
from gpiozero import DigitalInputDevice
# self-define libraries
from config import DATA_DIR, DAT... |
import numpy as np
from abmarl.sim import PrincipleAgent, ActingAgent, ObservingAgent
# ------------------ #
# --- Base Agent --- #
# ------------------ #
class ComponentAgent(PrincipleAgent):
"""
Component Agents have a position, life, and team.
initial_position (np.array or None):
The desired... |
# -*- encoding: utf-8 -*-
import json
from builtins import str as text
from django import http, shortcuts
from django.db import transaction
from django.http import HttpResponseForbidden, HttpResponseNotFound
from django.http.response import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from djan... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.