text stringlengths 8.04k 46.5k |
|---|
# coding=utf-8
""" Provides the base entity class. """
#-----------------------------------------------------------
# IMPORTS
#-----------------------------------------------------------
import enigmus
import language
import logging
import messages
from session import Session
#-------------------------------------... |
# -*- coding: utf8 -*-
"""
Icecake
This module provides a simple static site builder, similar to pelican or
octopress. It is intended to be small, light, and easy to modify. Out of the box
it sports the following features:
- Markdown formatting
- Pygments source code highlighting
- Jinja templates
- Automatically reb... |
from dataclasses import dataclass, field
from datetime import timezone
from typing import Optional, Dict, List, Type, Any, Union, Tuple, Callable
from fastbt.Meta import Broker
import uuid
import pendulum
from collections import Counter, defaultdict
def get_option(spot: float, num: int = 0, step: float = 100.0) -> fl... |
"""
Converts some ActionScript syntax to C# syntax, and some C# to ActionScript.
cd as2cs
"""
import codecs
from collections import Iterable
from os import path
from pprint import pformat, pprint
from pretty_print_code.pretty_print_code import format
from simpleparse.error import ParserSyntaxError
from simplepars... |
import tensorflow as tf
# Imports from the Keras backend so we don't have to work too hard
from tensorflow.python.keras import constraints
from tensorflow.python.keras import initializers
from tensorflow.python.keras import regularizers
from tensorflow.python.keras import activations
from tensorflow.python.framework ... |
from datetime import datetime
import time, warnings
from ..utils import DataikuException
from .discussion import DSSObjectDiscussions
from .utils import DSSTaggableObjectListItem
from dateutil.tz import tzlocal
class DSSScenario(object):
"""
A handle to interact with a scenario on the DSS instance.
Do not ... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ###... |
import re
import os
import time
import typing
import difflib
import asyncio
import discord
import textwrap
from io import BytesIO
from datetime import datetime
from discord.ext import commands
from PIL import Image, ImageDraw, ImageFont
import database as db
import variables as var
from ext.permissions import has_comma... |
import os, shutil, ast, re, subprocess
from basetestcase import BaseTestCase
from cluster_utils.cluster_ready_functions import ClusterUtils, CBCluster
from bucket_utils.bucket_ready_functions import BucketUtils
from BucketLib.bucket import Bucket
from membase.api.rest_client import RestHelper, RestConnection, \
... |
import os
from enum import IntEnum
import time
import glob
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from moviepy.editor import VideoFileClip
from IPython.display import HTML
from lib import undistort
from lib import calc_persp_matr
from lib import find_linear_lines... |
"""
# TODO compute sum of log of probabilities instead of products of probabilities
Write down teh new calculi first
"""
import numpy as np
import numpy.random as nr
from setuptools.command.test import test
from utils import *
__author__ = "<NAME> <<EMAIL>>"
alphabet_ger = ["a", "b", "c", "d", "e", "f", "g", "h", ... |
# -*- coding: utf-8 -*-
#
# These test cover the Image attributes that directly map to C-API functions.
#
import io
import numbers
import warnings
from pytest import mark, raises
from wand.color import Color
from wand.compat import string_type
from wand.exceptions import DelegateError
from wand.font import Font
from w... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from functools import partial
from pprint import pprint
import re
from typing import List
import pytest
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.datasets import make_regression
from sklearn.feature_extraction.text import Tfidf... |
"""Classes used as default input for annotator functions."""
import gzip
import logging
import os
import pathlib
import pickle
import urllib.request
import zipfile
from abc import ABC, abstractmethod
from typing import Any, List, Optional, Tuple, Union
import sparv.core
from sparv.core import io
from sparv.core.paths... |
from openbabel import pybel
import getopt, sys, os
from openbabel import openbabel as ob
import subprocess
import pkg_resources
amber_solv_dict = {'water': [' ','TIP3PBOX '],
'methanol': ['loadOff solvents.lib\n loadamberparams frcmod.meoh\n', 'MEOHBOX '],
'chloroform': ['loadOff... |
"""
sys.argv:
build/bin/<run_script> --log_fmt=10 foo bar -baz
Remember: run_script func-calls our def app_run(), with these as sys.args
if we can import $app (checked in loader) -> we check app_mod for 'foo' function
if present we call it right away, via run_app(foo)
if not app_mod or not presnt than this is ... |
#
"""
Functions that define and manipulate images. Images are just data and a World Coordinate System.
"""
import numpy
import os
import copy
import warnings
from astropy.io import fits
from astropy.coordinates import SkyCoord
from astropy.wcs import WCS
from reproject import reproject_interp
from arl.data.paramete... |
import logging
import inspect
import os
import sys
import traceback
import random
import json
import time
import stat
import shutil
from os import path, pathsep
from fnmatch import fnmatch
from ast import literal_eval
from shutil import rmtree
from logging.handlers import TimedRotatingFileHandler
from configparser impo... |
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
plt.rcParams.update({'font.size':12,'text.usetex':True})
##################################### DATA #####################################
def get_data(arc_mcqa_seed=False, arc_mcqa_epoch=False,
... |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.4
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# +
import d... |
import sys
sys.path.insert(0, '/R2R-Aux/build')
import torch
import os
import time
import json
import numpy as np
from collections import defaultdict
from speaker import Speaker
from utils import read_vocab,write_vocab,build_vocab,Tokenizer,padding_idx,timeSince, read_img_features, read_obj_features, get_sync_dir
imp... |
import os
import threading
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import torch
from PIL import Image
from matplotlib.patches import Ellipse
import seaborn as sns
class AverageMeter(object):
def __init__(self, num_classes=1):
self.num_classes = num_class... |
# Copyright 2020 Toyota Research Institute. All rights reserved.
import glob
import numpy as np
import os
import packnet_sfm.datasets.sintel_io as sio
from torch.utils.data import Dataset
from packnet_sfm.datasets.kitti_dataset_utils import \
pose_from_oxts_packet, read_calib_file, transform_from_rot_trans
from... |
#! /usr/bin/env python
import logging
import warnings
from ..pep8 import old_function, old_method
from ..py2 import (
dict_keys,
dict_values,
force_text,
is_string,
ul)
from .parser import (
XMLFatalError,
XMLParser)
from .structures import (
Document,
DuplicateXMLNAME,
Elemen... |
"""
This module contains functions that generate NormalFormGame instances of
the 2-player games studied by Fearnley, Igwe, and Savani (2015):
* Colonel Blotto Games (`blotto_game`): A non-zero sum extension of the
Blotto game as studied by Hortala-Vallve and Llorente-Saguer (2012),
where opposing parties have asym... |
# -*- coding: utf-8 -*-
# Copyright 2015 www.suishouguan.com
#
# Licensed under the Private License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://github.com/samuelbaizg/ssguan/blob/master/LICENSE
#
# Unless ... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import glob
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
# get_ipython().run_line_magic('matplotlib', 'inline')
import pickle
from tqdm import tqdm
import pandas as pd
from keras.preprocessing import sequence
from keras.models import Sequenti... |
"""
Utility functions for manipulating cameras in Blender
<NAME>, MIT CSAIL
July 2017
"""
import logging
from os import remove, rename
from os.path import abspath, dirname, basename
from time import time
import bpy
import bmesh
from mathutils import Vector, Matrix
from mathutils.bvhtree import BVHTree
import numpy as... |
import time
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import gym
import pybullet as p
from pybullet_envs.bullet.kuka_diverse_object_gym_env import KukaDiverseObjectEnv
from gym import spaces
import torch
import torch.nn as nn
from torch.distributions... |
"""
Created on 10/9/17.
@author: <NAME>.
email: <EMAIL>
"""
from collections import OrderedDict
import sys
sys.path.append('../')
from stemdl import io_utils
import numpy as np
#################################
# templates for network_config #
#################################
def generate_alex_net_custom():
l... |
"""
Module for utility functionality unrelated to SWIM.
"""
from __future__ import print_function
import os
import os.path as osp
import subprocess
import warnings
import sys
import time
import datetime as dt
import codecs
import numpy as np
import pandas as pd
from modelmanager.settings import parse_settings
import ... |
import legume
from typing import Sequence, Literal, Tuple, List
import autograd.numpy as np
import matplotlib.pyplot as plt
import itertools
from chickpea.sbl import ShapeBuilder
from legume.backend import backend as bd
class CrystalTopology:
"""
Topology Constructor for optimization
"""
def __init__... |
###############################################################################
## Fabric file to bootstrap Apache Cassandra on a set of nodes
##
## Examples:
##
## Install and configure Cassandra, setup firewall, start seeds, start
## nodes:
##
## fab -f fab_dse.py configure_hostnames
## fab -f fab_dse.py configure_... |
import copy
import datetime
import uuid
from collections import defaultdict
from typing import Dict, List
from anchore_engine.common.models.policy_engine import (
CVSS,
Advisory,
Artifact,
FixedArtifact,
Match,
NVDReference,
Vulnerability,
VulnerabilityMatch,
)
from anchore_engine.db im... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (C) 2019 Red Hat Inc.
# Copyright (C) 2020 Western Telematic Inc.
#
# GNU General Public License v3.0+
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PAR... |
import gdb
import re
import sys
import traceback
# some feedback that the nim runtime support is loading, isn't a bad
# thing at all.
gdb.write("Loading Nim Runtime support.\n", gdb.STDERR)
# When error occure they occur regularly. This 'caches' known errors
# and prevents them from being reprinted over and over agai... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
from utils.utilities import safe_log, split_feature
from models.layers import MaskedConv2d, MaskedLinear, TanhNet, ReLUNet, ResidualNet, BatchNorm
class Planar(nn.Module):
"""
PyTorch implementation of planar flows as presented in... |
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 5 12:40:07 2014
@author: ispielman
This module provides an interface for saving python functions
to an h5 file and allowing these to be executed in a nice way.
One intended use of this module is embedding the function needed to generate
a plot from data withi... |
# Copyright 2021 Lawrence Livermore National Security, LLC
"""
This script is used by cmec-driver to run the ASoP-Coherence metrics.
It is based on the workflow in asop_coherence_example.py and
can be called with the aruments listed below. If no configuration file
with module settings is provided, the settings will be ... |
# -*- coding: utf-8 -*-
from telegram import (ReplyKeyboardMarkup, ReplyKeyboardRemove, InlineKeyboardMarkup, InlineKeyboardButton, Bot)
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, ConversationHandler, RegexHandler, CallbackQueryHandler
from Commons import restricted, log_it
from datetime... |
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 19 13:31:38 2019
@author: Muhammad
"""
import h5py
import mcmc.util_cupy as util
import matplotlib.pyplot as plt
import cupy as cp, numpy as np
import mcmc.image_cupy as imc
# import mcmc.measurement as mcmcMeas
from skimage.transform import iradon
import pathlib
import ... |
"""
Routines for peeling a source at a specified position
"""
# $Id$
#-----------------------------------------------------------------------
# Copyright (C) 2017-2021
# Associated Universities, Inc. Washington DC, USA.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms o... |
#! /Users/mikeyb/Applications/python3
# -*- coding: utf-8 -*-
'''
BSD 3-Clause License
Copyright (c) 2020, <NAME>
All rights reserved.
'''
# First party classes
import os,glob,shutil, platform
import sys
import re
import datetime
import math
import configparser
import requests # For API call
import zipfile
import jso... |
# -*- coding: utf-8 -*-
"""
Classes and associated helper functions to create and manipulate the data sets
used in the machine learning machinery
"""
import bisect
from datetime import datetime
import logging
import os.path
import random
import shutil
import time
import numpy as np
import PIL
import tables
from mete... |
from django.shortcuts import render
from django.http import HttpResponse
from django.views.generic.edit import CreateView, DeleteView, UpdateView
from . import models, serializers, utils
from django.db.models import Avg
from rest_framework import generics, status
from rest_framework.response import Response
from rest_f... |
"""
A python module to load zero-shot dataset of Xian (CVPR 2017).
Note that it requires altering the original directory structure of Xian.
See README.md for details.
Author: <NAME>
"""
import struct
import h5py
import pandas as pd
import numpy as np
import scipy.io
from src.utils import ml_utils
from src import de... |
import collections
import pickle
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.distributions as dists
import spatial_monet.util.network_util as net_util
class EncoderNet(nn.Module):
"""
General parameterized encoding architecture for VAE components
"... |
# TODO: reduce the dependency on panda3d
import math
import os
import utils.robotmath as rm
import pandaplotutils.pandactrl as pandactrl
import pandaplotutils.pandageom as pandageom
from direct.showbase.ShowBase import ShowBase
from panda3d.bullet import BulletDebugNode
from panda3d.bullet import BulletRigidBodyNode
... |
import requests
import pprint
import http.client
from bs4 import BeautifulSoup
from flask import Flask, render_template, url_for, request, redirect
import os
import shutil
from lexrank import STOPWORDS, LexRank
from path import Path
import fnmatch
from dateparser.search import search_dates
import datetime
# import nltk... |
"""
NAD Lab Tools
This program was written for the NAD Lab at the University of Arizona by <NAME>.
It processes intracellular calcium concentration and pH measurements (from the InCytim2 software)
as well as filters the data for outliers and spikes.
The experiment consists of placing fluorescent-stained cells... |
from typing import Callable, Dict, List, Tuple, Union
from jycm.common import (EVENT_DICT_ADD, EVENT_DICT_REMOVE, EVENT_LIST_ADD, EVENT_LIST_REMOVE, EVENT_PAIR,
EVENT_VALUE_CHANGE, PLACE_HOLDER_NON_EXIST)
from jycm.helper import make_json_path_key
from jycm.km_matcher import KMMatcher
from jyc... |
# Copyright (c) 2021 Horizon Robotics. 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 applicab... |
from typing import Optional
import math
import os
import random
import torch
import numpy as np
from torch_geometric.data import Data
from collections import Counter
import torch_geometric.utils as tu
from gpn.utils import map_tensor
def swap_features(data: Data, i: int, j: int):
"""swaps feature vectors of two n... |
'''
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.
'''
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_l... |
import pytest
import pandas as pd
import numpy as np
import itertools
from vivarium.interpolation import Interpolation, validate_parameters, check_data_complete, Order0Interp
def make_bin_edges(data: pd.DataFrame, col: str) -> pd.DataFrame:
""" Given a dataframe and a column containing midpoints, construct
... |
import json
import datetime
from collections import Counter
from collections import deque
import emoji
import threading
import time
# These characters are trimmed to make word counts.
forbidden = "!@#$%^&*()-_=+[]{{}}\\|;:'\",<.>/?`~\t\r"
# These weird characters (key) are swapped for better characters (va... |
import os
import sys
import time
import json
sys.path.append(os.path.abspath('../'))
import numpy as np
import lmfit as lm
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
from natsort import natsorted
from cytomata.model import sim_itrans, sim_idimer, ... |
class_name = 'source_update_tab'
from qtpy import QtCore, QtGui, QtWidgets, uic
import os
import sys
import copy
import re
import pathlib
import json
from logzero import logger
from modules.sumologic import SumoLogic
class AddProcessingRuleDialog(QtWidgets.QDialog):
def __init__(self):
super(AddProcessi... |
# -*- coding: utf-8 -*-
import sys
import numpy as np
import pandas as pd
import os.path as path
from collections import defaultdict
import unittest as test
import itur.models as models
from itur import atmospheric_attenuation_slant_path
pd.set_option('display.max_colwidth', -1)
test_data = path.join(path.dirname(pa... |
"""
Burst engine is responsible for the event driven behavior of the artificial brain. It facilitates the firing all the
contents of the Fire Candidate List (FCL) at the same instant.
todo: Engine modes; one the super mode used for automated training and evaluations, second one with the speed of life.
todo: figure how... |
from src.configuration import *
class Environment:
def __init__(self, env_conf):
self.action_mapping = {
'S': 0,
'L': 1,
'R': 2,
'F': 3,
'B': 4,
'T': 5
}
self.reverse_action_mapping = {
0: 'S',
... |
"""
Query strategies for feature querying setting.
Feature missing is a serious problem in many applications, which may
lead to low quality of training data and further significantly
degrade the learning performance. While feature acquisition usually
involves special devices or complex processes, it is expensive to
ac... |
"""
@author: Tim_Janke
"""
import numpy as np
import pandas as pd
#from helpers import emp_cdf
from models.igc import ImplicitGenerativeCopula, GMMNCopula, GenerativeMomentMatchingNetwork, GenerativeAdversarialNetwork
from models.mv_copulas import GaussianCopula
import statsmodels.api as sm
from sklearn.neighbors impo... |
# -*- coding: utf-8 -*-
import sys
sys.path.append('../')
import pickle
from data_util.schema import *
from data_util.reader import *
import random
import argparse
import numpy
from data_split.util import *
missing_feats = ['Possession']
######################
# Balancing datasets #
######################
# ... |
"""
Copyright (c) 2018-present. <NAME>
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
"""
from __future__ import print_function
from __future__ import division
from builtins import str
from builtins impo... |
#!/usr/bin/env python
"""This is the skeleton_to_tree.py module. This module contains code required to generate morphologically accurate tree
structures from skeletons derived from imaging.
"""
import numpy as np
from . import pg_utilities
from . import analyse_tree
from . import imports_and_exports
def create_gra... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This software is under a BSD license. See LICENSE.txt for details.
import numpy as np
import sys
def _is_string(x):
try:
basestring
except NameError:
basestring = str
return isinstance(x, basestring)
class _DTBitmap2D(type):
"""Metacla... |
"""Functions to infer ancestry and perform ancestry-stratfied sample QC"""
import logging
import pickle
from os.path import join
from typing import Optional, List, Dict
import hail as hl
import pandas as pd
from gnomad.sample_qc.ancestry import run_pca_with_relateds, assign_population_pcs
from gnomad.sample_qc.relate... |
"""
corr_plots.py
This script contains functions for plotting USI correlation analyses.
Authors: <NAME>
Date: January, 2021
Note: this code uses python 3.7.
"""
import logging
from matplotlib import pyplot as plt
import numpy as np
from util import plot_util, logger_util, math_util
from sess_util import sess_plo... |
"""
Converts a gff3 file to genePred
"""
import operator
import shutil
import stat
import subprocess
import sys
import argparse
import os
import tempfile
from shutil import copyfile
from six.moves.urllib.request import urlopen
from six.moves.urllib.error import URLError, HTTPError
import zipfile
from col... |
# -*-coding:utf-8-*-
import logging
FORMAT = '[%(asctime)s][PID:%(process)d] %(levelname)s: %(message)s (%(filename)s@line:%(lineno)d)'
LEVEL = logging.WARNING
logging.basicConfig(level=LEVEL, format=FORMAT)
import os
import codecs
from concurrent.futures import ThreadPoolExecutor
import time
import cv2
import json
im... |
#coding:utf-8
import os
import sys
import re
import getopt
import json
import csv
import subprocess
import progress
import time
FFPROBE = "/storage/INHOUSE/apps/ffmpeg-4.1.4-amd64-static/ffprobe"
FFMPEG = "/storage/INHOUSE/apps/ffmpeg-4.1.4-amd64-static/ffmpeg"
LIBREOFFICE = "/usr/bin/soffice"
OIIOTOOL = "/usr/bin/oii... |
# Copyright (c) 2016 Georgia Institute of Technology
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditi... |
"""
Miscellaneous utilities used for development.
Copyright by <NAME> (<EMAIL>).
"""
from types import FrameType
from typing import Union, Callable, Dict, List, Tuple, Any, Optional, IO, ContextManager
import logging
import signal
import numbers
import math
Handler = Callable[[int, FrameType], None]
def _cast_to_f... |
from .yeaseq_config import BaseTrans
class SeqProcessor(object):
"""
Manage one transcrpt in different transcript panel
"""
def __init__(self, transcript_data):
self._trans_data = transcript_data
self._seq_dict = self._trans_data['seq']
self._site_dict = self._trans_data['SeqSi... |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... |
import sys
from PyQt5 import QtWidgets, QtCore, QtGui
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import pandas as pd
from functools import partial
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
import numpy as np
import matplotlib.pyplot as... |
import os
import pathlib
import random
import numpy as np
import cv2
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import classification_report
from sklearn.mixture import GaussianMixture
from sklearn.svm import SVC
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
class Fac... |
#import utility libraries
import os
import sys
import argparse
import glob
import re
import numpy as np
import cv2
import csv
# using ElementTree to read PascalVOC file
import xml.etree.ElementTree as ET
from sklearn.model_selection import train_test_split
# supported models
DATA_FORMAT = ["retinanet", "pixellink"]
t... |
"""
Utility functions for PPNN.
The functions are still a little confusingly named and
structured at the moment.
Author: <NAME>
"""
import os
import platform
import copy
from scipy.stats import norm
import numpy as np
np.random.seed(42)
from netCDF4 import num2date, Dataset
from .emos_network_theano import EMOS_Netwo... |
###################################################################
import time
import re
import random
import chess
import chess.pgn
import chess.polyglot
###################################################################
import io
import chess
from chess.variant import find_variant
from chess.pgn import Game, Str... |
"""
"""
#| - Import Modules
import os
import sys
import copy
import pickle
from pathlib import Path
import json
import numpy as np
import pandas as pd
# #############################################################################
from ase import io
from pymatgen.analysis.chemenv.coordination_environments.coordina... |
import numpy as np
from rllab.algos.base import RLAlgorithm
from sandbox.vime.sampler import parallel_sampler_expl as parallel_sampler
from rllab.misc import special
from rllab.misc import tensor_utils
from rllab.algos import util
import rllab.misc.logger as logger
import rllab.plotter as plotter
# exploration import... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from pathlib import Path
import numpy as np
import math
import pickle
import cv2
import os
from collections import defaultdict
import pycocotools.coco as coco
import torch
import torch.utils.data as data
from... |
import itertools
from pathlib import Path
from arcade.gui import TextButton
import pytiled_parser
from gamer_gang.epicAssets.entities import *
from gamer_gang.epicAssets.terrainStuff import *
from gamer_gang.dumbConstants import *
def getNames(name):
name = name.split(sep='on')
frontier = [[]]
for _ in ran... |
"""
[first second third fourth fifth sixth]
2^10 2^1 2^4 2^2 2^16
10 1 4 2 16
2^10 2^1 2^4 2^2 2^16
2^1 2^2 2^3 2^4 2^5 2^6 2^7 2^8
134
0b10000110
3 2 0 4 7 5 1 6
8 12 13 29 141 173 175
"""
"""
[4, 2, 32, 128, 16, 64,... |
from fbs_runtime.application_context.PyQt5 import ApplicationContext
from fbs_runtime.application_context import cached_property, is_frozen
from fbs_runtime.excepthook.sentry import SentryExceptionHandler
import sys
import os
from datetime import datetime
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from P... |
from LPmodels import KGEModel, HAKE
import torch.nn.functional as F
# +
def p_score(vector, subsampling_weight, mode="HAKE"):
positive_score = F.logsigmoid(vector).squeeze(dim=1)
# print("positive_score : ", positive_score)
positive_sample_loss = - (subsampling_weight * positive_score).sum() /... |
import torch
import torch.nn as nn
from torch.nn import init
import functools
from torch.optim import lr_scheduler
###############################################################################
# Helper Functions
###############################################################################
def get_norm... |
#
# @file attribute_generator.py
#
# @brief Generate C code from JSON API document.
#
# Copyright (c) 2018-2021 Laird Connectivity
#
# SPDX-License-Identifier: Apache-2.0
#
import json
import jsonref
import collections
import os
import inflection
import sys
ATTRIBUTE_VERSION_ARRAY_INDEX = 93
JSON_INDENT = ' '
# Left... |
from parser import *
from scanner import tokens
from parse.expressions.expressions_math import *
from parse.expressions.expressions_base import *
from parse.expressions.expressions_trig import *
from treeGraph import *
start = 'init'
precedence = (
# Arthmetic
('left', 'MAS', 'MENOS'),
('left', 'POR', 'D... |
"""
Creates files for a Circos figure.
"""
import argparse
import colorsys
import colour
import csv
import functools
import itertools
import logging
import operator
import os
import re
import string
import yaml
import numpy as np
import pandas as pd
from sklearn.decomposition import PCA
BASE_DIR = 'figures/circos'
... |
import cv2
import numpy as np
from collections import namedtuple
from math import ceil, sqrt, pi, floor, sin, cos, atan2, gcd
from collections import namedtuple
# To not display: RuntimeWarning: overflow encountered in exp
# in line: scores = 1 / (1 + np.exp(-scores))
np.seterr(over='ignore')
# Dictionary that maps... |
"""Tests for graph_builder."""
import collections
import os.path
import numpy as np
import tensorflow as tf
from google.protobuf import text_format
from dragnn.protos import spec_pb2
from dragnn.protos import trace_pb2
from dragnn.python import dragnn_ops
from dragnn.python import graph_builder
from syntaxnet imp... |
from io import BytesIO
import re
from django.contrib import admin
from django.contrib.admin.views.main import ChangeList
from django.db import models
from django.db.models.functions import RowNumber
from django.shortcuts import redirect
from django.http import HttpResponse
from django.utils.translation import gettext_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Library of regular expression patterns.
"""
import enum
import functools
import re
from typing import Optional
from refinery.lib.patterns.tlds import tlds
from refinery.lib.tools import cached_property
class pattern:
"""
A wrapper for regular expression pat... |
# coding=utf-8
# Copyright 2008, <NAME>, inamidst.com
# Copyright © 2012, <NAME> <<EMAIL>>
# Copyright 2012-2015, <NAME>, http://embolalia.com
# Copyright 2019, <NAME> <<EMAIL>>
#
# Licensed under the Eiffel Forum License 2.
from __future__ import unicode_literals, absolute_import, print_function, division
from ast i... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
# Import the necessary packages and modules
from datetime import datetime
import sys
import matplotlib.pyplot as plt
from matplotlib import cm
import numpy as np
import csv
import math
import pandas as pd
import array
import operator
import argparse
import sys
import json
import ssl
import urllib.request
from csv impor... |
"""
==========================
Author: <NAME>
Year: 2020
==========================
This module contains pathfinding functionalities for FFAI.
"""
from typing import Optional, List
from ffai.core.table import Rules
from ffai.core.model import Player, Square, D6
from ffai.core.forward_model import Reversible
from ffai.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.