text stringlengths 6.04k 39.5k |
|---|
def gen_mx_func_call_for_cpp(self, inds = None, PEQ_FLAG = False, SCALE_FLAG = False, updated_var_names = None):
var_names = dict(S_ind_name = "S_ind", s_dst_name = "s_dst", s_src_name = "s_src", s_scale_name = "s_scale")
if updated_var_names is not None:
for key,value in updated_var_names.items():
... |
import io
import os
import shutil
import glob
import PySimpleGUI as sg
from PIL import Image
import pandas as pd
import numpy as np
import ast
from datetime import datetime
file_types_dfs = [("CSV (*.csv)", "*.csv"),("All files (*.*)", "*.*")]
file_types_images = [("tiff (*.tiff)", "*.tif"), ("All files (*.*)", "*.*"... |
"""Project: Eskapade - A python-based package for data analysis.
Class: ReadToDf
Created: 2016/11/08
Description:
Algorithm to write pandas dataframes picked up from the datastore.
Authors:
KPMG Advanced Analytics & Big Data team, Amstelveen, The Netherlands
Redistribution and use in source and binary form... |
import os
import sys
import subprocess
import fileinput
import json
import platform
import argparse
DEBUG = False
class Utils:
system = platform.system()
columns = 100
row = 1000
def __init__(self):
if (platform.system() != 'Windows'):
try:
rows, columns = os.pope... |
from random import randrange,shuffle
from math import floor
from statistics import mean,stdev
import time
import pygame
from pygame.locals import *
#dimensions of the game grid
dimx=10
dimy=20
#colors corresponding to specific pieces
colorshape={"line":(0,255,255),"l":(0,0,255),"li":(255,125,0),"z":(255,0,0),"zi":(0,25... |
#!/usr/bin/env python3
# pylint: disable=invalid-name
"""
@TODO
- results summary
"""
"""
--- dENUMerator ---
by bl4de | <EMAIL> | HackerOne: bl4de
Enumerates list of subdomains (output from tools like Sublist3r or subbrute)
and creates output file with servers responding on port 80/HTTP
This indicates (in most ca... |
'''
Compare HI/CO line width ratio expected from a turbulent medium.
'''
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sb
import astropy.units as u
import astropy.constants as c
from paths import allfigs_path
from plotting_styles import (default_figure, twocolumn_twopanel_figure,
... |
# Copyright (c) 2018, DEMCON advanced mechatronics
# 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 c... |
#!/usr/bin/env python3
from __future__ import annotations
import argparse
import shutil
import sys
from functools import total_ordering
from pathlib import Path
from shutil import copy2
from typing import Optional, Union, Callable, overload
import yaml
MAX_FILENAME_LENGTH = 30
CONFIG_FILE_NAME = 'tabsave_c... |
def calc_the_distance(
point1, point2
):
"""Calculate the distance between two given points"""
import math
a = abs(point1[0] - point2[0])
b = abs(point1[1] - point2[1])
c2 = a ** 2 + b ** 2
c = math.sqrt(c2)
return c
def get_countries_list_for_default_shape():
return [('Zi... |
'''
Created on 06 lug 2017
@author: mantica
References:
- https://github.com/Azure/lstms_for_predictive_maintenance/blob/master/Deep%20Learning%20Basics%20for%20Predictive%20Maintenance.ipynb
- https://gallery.cortanaintelligence.com/Experiment/Predictive-Maintenance-Step-2A-of-3-train-and-evaluate-regression... |
# -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2020, <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without... |
import pandas as pd
import numpy as np
def get_axis_info(xcoordinatemin, xcoordinatemax, xpixelmax, ycoordinatemin, ycoordinatemax, ypixelmax, origin,
max_points, units):
"""
Collects information provided by the user into a convenient dictionary form to be used in the csv
conversion proc... |
#!/usr/bin/env python3
"""
Tool for comparing two STR callsets
"""
# Allow making plots even with no x-forward
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
# Allow plots to be editable in Adobe Illustrator
import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fo... |
# Copyright 2021 The FastEstimator 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 appl... |
# -*- coding: utf-8 -*-
# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U
#
# This file is part of FIWARE project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at:
#
# http://w... |
import tensorflow as tf
import tensorflow_probability as tfp
import numpy as np
from scipy.stats import entropy
import src.core.constants as constants
from src.retina_net.anchor_generator import box_utils
"""
Tensorflow Inference Utilities
"""
@tf.function
def bayes_od_inference(model,
sample_... |
"""
Parses the facebook GPDR Export
"""
# see https://github.com/seanbreckenridge/dotfiles/blob/master/.config/my/my/config/__init__.py for an example
from my.config import facebook as user_config
from dataclasses import dataclass
from .core import PathIsh
@dataclass
class facebook(user_config):
gdpr_dir: PathI... |
import numpy as np
import random
from scipy import stats
from argparse import ArgumentParser
import yaml
import os
import torch
from torch.utils.data import DataLoader
import torch.nn.functional as F
from torch.optim import Adam
from ignite.engine import Events, create_supervised_trainer, create_supervised_ev... |
r'''
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2022 <NAME> and <NAME>
# Copyright 2021 The HuggingFace Inc. team. 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
#
# ... |
from rlbot.agents.base_agent import SimpleControllerState
from rlutilities.simulation import Car, Ball
from rlutilities.mechanics import Dodge
from rlutilities.linear_algebra import *
from util.rlutilities import *
from util.drive import steer_toward_target
from mechanics.drive import *
from analysis.boost import *
fr... |
import glob
import json
import os
import shutil
import time
import traceback
from multiprocessing import Process, Queue
from queue import Empty
import matplotlib.pyplot as plt
import matplotlib.image as pltimg
import numpy as np
import torch_resizer
import torch
from PIL import Image
from imresize import imresize
from ... |
from pypy.interpreter.astcompiler import ast, consts
from pypy.interpreter.pyparser import parsestring
from pypy.interpreter import error
from pypy.interpreter import unicodehelper
from rpython.rlib.rstring import StringBuilder
from rpython.rlib.rutf8 import codepoints_in_utf8
def add_constant_string(astbuilder, join... |
# Copyright 2011-2021 <NAME> and The University of British Columbia
# 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 appli... |
import requests
import urllib3
import json
import xml.etree.ElementTree as ET
import logging
import datetime
from enum import Enum
_LOGGER = logging.getLogger('pysomneo')
WORKDAYS_BINARY_MASK = 62
WEEKEND_BINARY_MASK = 192
LIGHT_CURVES = {'sunny day': 0, 'island red': 1,
'nordic white': 2, "carribea... |
import argparse
import csv
import json
import math
import time
from sklearn.model_selection import train_test_split
import numpy as np
import torch
import torch.nn.functional as F
import torch.optim
import torch.optim as optim
import torch.utils.data as data
import torch.nn as nn
from sklearn.metrics import f1_score
f... |
#!/usr/bin/env python3
import os, importlib.util, inspect, ctypes, sys
from operator import itemgetter
from numbers import Integral
file_write = True
class data_obj():
def __init__(self, name):
self.name = name
self.structs = []
self.enums = []
self.defines = []
self.depe... |
#!/usr/bin/env python
u"""
gfz_isdc_grace_ftp.py
Written by <NAME> (05/2021)
Syncs GRACE/GRACE-FO data from the GFZ Information System and Data Center (ISDC)
Syncs CSR/GFZ/JPL files for RL06 GAA/GAB/GAC/GAD/GSM
GAA and GAB are GFZ/JPL only
CALLING SEQUENCE:
python gfz_isdc_grace_ftp.py --mission grace grace-fo... |
import html
import json
import locale
import os
import re
import sqlite3
import urllib.parse
from datetime import datetime
from uuid import uuid4
import nextcord
import requests
from astropy.table import Table
from bs4 import BeautifulSoup
from nextcord import Interaction
from nextcord.ext import commands, tasks
from ... |
# SPDX-License-Identifier: Apache-2.0
# Copyright 2019 Blue Cheetah Analog Design Inc.
#
# 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
#
# U... |
#!/usr/bin/env python3
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... |
"""
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, merge, publish, distribute, sublicense,... |
# Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
"""Module for defining cohorts in raiwidgets package."""
from typing import Any, List, Optional
import numpy as np
import pandas as pd
from responsibleai.exceptions import UserConfigValidationException
class CohortFilterMethods:
"""Define... |
import numpy
import pandas
import itertools
import os
import shutil
import sys
import time
import warnings
from csubst import combination
from csubst import foreground
from csubst import genetic_code
from csubst import omega
from csubst import param
from csubst import parser_misc
from csubst import sequence
from csub... |
# -*- coding: utf-8 -*-
import os
import re
from cookielib import LWPCookieJar
import requests
from bs4 import BeautifulSoup
""" Main url address """
URL = "https://zalukaj.com"
""" Cookie name where session is stored """
SESSION_COOKIE_NAME = "PHPSESSID"
""" Maximum wait time for response"""
REQUEST_TIMEOUT = 5
"... |
#!/bin/python
'''Helper modules'''
import vambtools as _vambtools
import collections as _collections
import os
import numpy as _np
class Contig:
"""An object representing a contig mapping to a subject at position start:end.
Mapping positions use the half-open interval, like Python ranges and slices.
Instan... |
#!/usr/bin/env python3
import os
import sys
import time
import json
import numpy as np
import os.path as osp
import logging.config
import tensorflow as tf
from datetime import timedelta
from signal import SIGINT, SIGTERM
from argparse import ArgumentParser
from importlib import import_module
# from tensorflow.contrib... |
# Written by @kentaroy47
import albumentations.augmentations.transforms as A
import numpy as np
import torch
import torch.nn.functional as F
import torchvision.transforms as T
import torchvision.transforms.functional as TF
from einops import asnumpy, rearrange
from .native import MedianPool2d, SameAvg2D
def albumen... |
# -*- coding: utf-8 -*-
"""A script to check the sanctity of the CONSO resources."""
import csv
import re
import sys
from collections import defaultdict
from typing import Iterable, Mapping, Optional, Set, Tuple
import click
import pandas as pd
from .resources import AUTHORS_PATH, CLASSES_PATH, RELATIONS_PATH, SYNO... |
import datetime
import os
import csv
from django.shortcuts import render, get_object_or_404, redirect
from django.http import HttpResponseRedirect, HttpResponse, HttpRequest, JsonResponse
from django.urls import reverse
from django.views import generic
from django.core.files import File
from .models import *
from djan... |
#!/usr/bin/env python3
"""Contains `KappaComplex`, a class to represents a list of agents chained into a larger entity, and the `embed_and_map`
function."""
import re
import networkx as nx
import numpy as np
from collections import deque
from typing import Deque, Dict, List, FrozenSet, Set, Tuple, Union
from .KappaMu... |
""" modules being used either by progenitor_parallel or induvidually to find any type (Gas/DM/BH) particles
lied within center of the z~0 DM halos and write their cordinates at higher redhsift on files"""
import h5py
import numpy as np
import time
import os
from . import mpi4py_helper
from . import illustris_pytho... |
from .plot import Plot
from .tools import show_base, save_base, is_color, format_color, is_iterable
from ..tools.color_palettes import palette_from_name_to_function
import numbers
from bokeh.models import Range1d
from bokeh.plotting import figure
from bokeh.models import ColorBar, LinearColorMapper
import numpy as np... |
#! /coupp/app/home/coupp/anaconda3/bin/python3
## <NAME>
##
import numpy as np
import scipy
import re
import sys
import time
import scipy.signal
import fcntl
import scipy.optimize
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.widgets import Button
try:
from PyQt4 import QtCore
PyQt4impor... |
from namex.models import User
import os
import requests
import json
import pytest
from tests.python import integration_solr
import urllib
token_header = {
"alg": "RS256",
"typ": "JWT",
"kid": "flask-jwt-oidc-test-client"
}
claims = {
"iss": "ht... |
# Copyright (c) 2017 "Shopify inc." All rights reserved.
# Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
from __future__ import unicode_literals
import collections
import datetime
import re
import sys
import enum
import typing # pylint: disable=unused-import
import... |
from steamapi import getmatchhistory, getmatchdetails
from displayreddit.draveragelastxgames import displayResult
import threading
import time
import queue
from reddit.botinfo import message
from steamapi.getheroes import heroDictionary
from misc.idnamedict import gameMode
#message = True
def averageLastXGames(player... |
# 改pipline中的范围参数
# 可并行跑ssr
#
from genericpath import isdir
import os
from shutil import copyfile
#from ssr.utility.logging_extension import logger
#
#from ssr.path_manager import PathManager
#from ssr.sfm_mvs_rec.vissat_pipeline import VisSatPipeline
#from ssr.surface_rec.preparation.preparation_pipeline import (
# ... |
import asyncio
import datetime
import json
import multiprocessing
import os
import pickle
import sys
import tkinter as tk
import tkinter.ttk as ttk
import webbrowser
from functools import partial
from tkinter import messagebox as tk_msgbox
import requests
from twitch_bot import main as main_bot
import factorio_rcon #... |
from fastai.basics import *
from fastai.text.learner import LanguageLearner, get_language_model, _model_meta
from .model import *
from .transform import MusicItem
from ..numpy_encode import SAMPLE_FREQ
from ..utils.top_k_top_p import top_k_top_p
from ..utils.midifile import is_empty_midi
from .is_valid import isValidPi... |
# %% IMPORT LIBRARIES
import sys
sys.path.insert(0, "..")
import time
import timeit
import numpy as np
import torch
import matplotlib.pyplot as plt
import cpab
import pandas as pd
import seaborn as sns
# %% BSPLINE
t = np.linspace(0, 1, 10)
c = np.random.normal(0, 1, 10)
f = BSpline(t, c, 3)
x = np.linspace(0, 1,... |
import numpy as np
from ase.data import vdw_radii,atomic_numbers,covalent_radii
from pymove import Structure
from pymove.io import read,write
from pymove.driver import BaseDriver_
from pymove.molecules.utils import com
import numpy as np
from scipy.spatial.distance import cdist
import scipy
from pymove.io import re... |
import json
from typing import Literal, Optional
from fastapi.testclient import TestClient
from pydantic import BaseModel, Json, ValidationError
from pydantic.utils import Obj
from dnacentersdk import DNACenterAPI
import os
dnac = DNACenterAPI(base_url=os.getenv("DNAC_ADDRESS"),
username... |
#!/usr/bin/env python
## ========================================================================= ##
## ##
## Filename: generator.py ##
## ... |
# Copyright 2020 <NAME>
# Computer-assisted Applications in Medicine Group, Computer Vision Lab, ITET, ETH Zurich
import tensorflow as tf
import numpy as np
def _get_weight(s, layer_idx, scope, gain=np.sqrt(2), lr_mul=1., eq_lr=True):
# he init
fan_in = np.prod(s[:-1]) # s is [k_s, k_s, n_chan_in, n_chan_ou... |
# coding: utf-8
'''
Author: <NAME>, <NAME>, <NAME>
Contact: <EMAIL>, <EMAIL>, <EMAIL>
'''
import tensorflow as tf
import numpy as np
from tensorflow.contrib import rnn
class LSTMNet(object):
def __init__(self, layers=1, hidden_units=100, hidden_activation="tanh", dropout=0.2):
self.layers = layers
... |
from scipy.sparse import save_npz
from scipy import optimize
from collections import deque
from optimism.JaxConfig import *
# from optimism import ScalarRootFind
# from optimism.Timer import Timer
from optimism import WarmStart
Settings = namedtuple('Settings', ['t1','t2','eta1','eta2','eta3','max_trust_iters','tol'... |
# Copyright (c) 2018 <NAME>.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Any, cast, List, Optional
from PyQt5.QtCore import pyqtProperty, pyqtSignal, QObject
from UM.Application import Application
from UM.Decorators import override
from UM.FlameProfiler import pyqtSlot
from UM.Logge... |
"""
Copyright [2020] [Two Six Labs, LLC]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... |
import collections
import os
import sys
import atexit
import subprocess
import platform
from Qt import QtCore, QtGui, QtWidgets
import openpype.version
from openpype.api import (
Logger,
resources,
get_system_settings
)
from openpype.lib import (
get_openpype_execute_args,
is_current_version_stud... |
"""
Forest of trees-based ensemble methods.
Random forests: extremely randomized trees with dynamic tree selection Monte Carlo based.
The module structure is the following:
"""
import logging as log
from collections import defaultdict
from hashlib import md5
from itertools import combinations
from random import rand... |
# -*- coding: utf-8 -*-
#
# Drawing animated GIFs with matplotlib
# https://eli.thegreenplace.net/2016/drawing-animated-gifs-with-matplotlib/
# https://github.com/maxberggren/blog-notebooks/blob/master/SweEbola.md
# 传染病 SEIR 模型
# pip install matplotlib
# pip install PIL
# pip install aabbtree
# pip install ... |
""" Determines what the AI does relies on randomness, so is impure """
from random import random, choices, sample
from copy import copy
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
from state import State
def dumb_lookahead(state):
""" Currently implementi... |
# ***********************************************************************************************************************************
# * @License Starts
# *
# * Copyright © 2015 - present. MongoExpUser
# *
# * License: MIT - See: https://github.com/MongoExpUser/Shale-Reservoir-DNN-and-Drilling-Rare-Events-Graph/blob/m... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This Python script manage_relay_tui.py implements a relay activation and deactivation
mechanism through the TUI (Text-based User Interface).
MIT License
Raspberry Pi - Access via Smart Card TS-CNS
Copyright (c) 2020 <NAME>'s Blog - https://www.dontesta.it
Permissi... |
# Standard library
import os
import sys
import json
from json import JSONDecodeError
import re
from collections import namedtuple, OrderedDict
# Libraries
import pandas as pd
import jsonschema
from colorama import Fore
import openpyxl
from openpyxl.styles import Alignment, Border, Side, PatternFill, Color
from openpy... |
"""Pol-only Wiener and inverse variance filtering module.
This module collects definitions for the polarization-only forward and pre-conditioners operations.
There are three types of pre-conditioners: dense, diagonal in harmonic space, and multigrid stage.
$$ S^{-1} (S^{-1} + Y^t N^{-1} Y)^{-1} Y^t N^{-1}$$
This no... |
import itertools
import numpy as np
import qutip as q
from pygrape import StateTransferSetup, LindbladSetup, SubspaceSetup
CONFIG = dict(
c_levels=25,
q_levels=3,
n_bits=3,
selected_bit=0,
alpha=np.sqrt(3),
n_qubits=3,
chi=-1.968e-3,
chi_prime=-1.496e-5,
kerr=-3.15e-6,
anharm=-2... |
import tensorflow as tf
import tensorflow.contrib as tf_contrib
import numpy as np
# Xavier : tf_contrib.layers.xavier_initializer()
# He : tf_contrib.layers.variance_scaling_initializer()
# Normal : tf.random_normal_initializer(mean=0.0, stddev=0.02)
# l2_decay : tf_contrib.layers.l2_regularizer(0.0001)
weight_init ... |
import numpy as np
import scipy.sparse as sp
import torch
import torch.nn.functional as F
import torch.nn as nn
import sys
import pickle as pkl
import networkx as nx
import random
def encode_onehot(labels):
classes = set(labels)
classes_dict = {c: np.identity(len(classes))[i, :] for i, c in
... |
# -*- coding: utf-8 -*-
# No License: This is free and unencumbered software released into
# the public domain.
from PIL import Image
import win32con
import win32api
import win32gui
import win32ui
import sys
import os
import datetime
import threading
import queue
import time
import tkinter
from functools import par... |
# Copyright 2014-2020 The PySCF Developers. 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 appl... |
#
# hlprrules.py
#
# Author(s):
# <NAME> <<EMAIL>>
#
# Copyright (c) 2020-2021 ETH Zurich.
#
# 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
... |
# Copyright (c) 2018, MD2K Center of Excellence
# 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 conditio... |
import logging
import json
import uareach as ua
from uareach import common, util
from uareach.templates import Template
logger = logging.getLogger(__name__)
class PassMetadata(util.Constant):
PUBLIC_URL = 'publicUrl'
PASS_ID = '<PASSWORD>_id'
TEMPLATE_ID = 'template_id'
def get_pass(reach, pass_id=Non... |
#!/usr/bin/env python2
# The MIT License (MIT)
#
# Copyright (c) 2015 <NAME> (also known as Craxic)
#
# 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 l... |
# -*- coding: utf-8 -*-
import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import flask
import plotly.plotly as py
import matplotlib.pyplot as plt
import plotly.tools as tls
import math
import os
from apps import colo... |
# --------------------------------------------------------
# UniFormer
# Copyright (c) 2022 SenseTime X-Lab
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
from collections import OrderedDict
import math
from functools import pa... |
import airsim
from jsbsim_simulator import Simulation
from jsbsim_aircraft import Aircraft, cessna172P, ball, x8
from debug_utils import *
import navigation as navigation
import jsbsim_properties as prp
from autopilot import X8Autopilot
from image_processing import AirSimImages
from typing import Dict
from rep... |
"""Task I/O specifications."""
import attr
from pathlib import Path
import typing as ty
def attr_fields(x):
return x.__attrs_attrs__
class File:
"""An :obj:`os.pathlike` object, designating a file."""
class Directory:
"""An :obj:`os.pathlike` object, designating a folder."""
@attr.s(auto_attribs=Tru... |
import os
#import cv2
import math
import time
import datetime
import random
import argparse
import numpy as np
#import pandas as pd
from tqdm import tqdm as tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
#from torch.utils.data import TensorDataset, DataLoader, Dataset
import torch.optim as opt... |
# |-----------------------------------------------------------------------------
# | This source code is provided under the Apache 2.0 license --
# | and is provided AS IS with no warranty or guarantee of fit for purpose. --
# | See the project's LICENSE.md for details. ... |
#!/usr/bin/python3
import re
import nltk
import sys
import getopt
import os
import glob
import pickle
import math
ps = nltk.stem.PorterStemmer()
def usage():
print(
"usage: "
+ sys.argv[0]
+ " -i directory-of-documents -d dictionary-file -p postings-file"
)
# Resets the disk folder.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import sys
import os
import multiprocessing
from deeptools.parserCommon import writableFile, numberOfProcessors
from deeptools._version import __version__
from deeptools import parserCommon
from deeptools import heatmapper
import deeptools.computeMatrixOpe... |
import enum
import pythonutils
import services
import sims4.log
from audio.primitive import TunablePlayAudio, play_tunable_audio
from distributor.rollback import ProtocolBufferRollback
from distributor.shared_messages import build_icon_info_msg
from distributor.system import Distributor
from interactions import Partici... |
"""
OneLab - Copyright (C) 2011-2013 ULg-UCL
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, dist... |
#!/usr/bin/python
#
# Copyright (c) 2014, 2015 NORDUnet A/S
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# ... |
"""
The MIT License (MIT)
Copyright (c) 2020 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, p... |
import datetime
import json
import os
import re
import click
from colored import fg, bg, attr
from yaml import load
try:
from yaml import CLoader as Loader
except ImportError:
from yaml import Loader
# Some path config
path = 'src/content'
changes_path = 'src/content/changes/'
crds_path = 'src/con... |
#!/usr/bin/env python3
class DSHead():
def printTemplateHead(self):
templateHeader = "".join(open('tjgwebservices/views/static/dsheader.tpl','r').readlines())
templateHeader = templateHeader.replace("{website.title}","II Data School")
templateHeader = templateHeader.replace("{website.v... |
import copy
import itertools
from typing import List, Optional, Set, Tuple
import numpy
import openmm
from openmm import unit
def lorentz_berthelot() -> str:
return "sigma = 0.5*(sigma1+sigma2); epsilon = sqrt(epsilon1*epsilon2);"
def lj_potential() -> str:
return "4.0*epsilon*x*(x-1.0); x = (sigma/r)^6;"
... |
import foolbox as fb
import eagerpy as ep
import torch
import torch.nn as nn
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
import torchvision.datasets as datasets
import numpy as np
import glob
import pandas as pd
from collections import defaultdict
from torchdiffeq._impl.rk_co... |
import torch
from collections import defaultdict
from pytorch_gleam.data.datasets.base_datasets import BaseDataModule
from pytorch_gleam.data.datasets.misinfo_stance import MisinfoStanceDataset
from pytorch_gleam.data.collators import KbiBatchCollator
import itertools
class KbiMisinfoStanceDataset(MisinfoStanceData... |
import random
import importlib
from functools import reduce
import numpy as np
import os
import re
import subprocess
import sys
from collections import defaultdict
import PIL
import psutil
import torch
import torchvision
from tabulate import tabulate
from datetime import datetime
import torch.distributed as dist
from ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) Copyright 2011-2015 HP Development Company, L.P.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at... |
import json
import logging
import queue
import re
import socket
import ssl
from concurrent.futures import ThreadPoolExecutor
from dataclasses import dataclass
from threading import Event, RLock, Thread
from time import monotonic as now, sleep
from typing import Callable, List, Dict, Match, Optional, Pattern, Tuple, Uni... |
# Be sure to run this file from the "region_of_acquisition" folder
# cd examples/region_of_acquisition
#
import yaml
import time
import os
import sys
import copy
import pickle
import pybullet as p
import numpy as np
import pandas as pd
import pathos.multiprocessing as mp
from functools import partial
from itertools... |
# mdpAgents.py
# verghese/08-Dec-2018
#
# Version 1
#
# The starting point for CW2.
#
# Intended to work with the PacMan AI projects from:
#
# https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fai.berkeley.edu%2F&data=01%7C01%7Cgregory.verghese%40kcl.ac.uk%7C13ed618722834c562ae408d659d4040e%7C8370cf... |
# Copyright (c) 2021 <NAME> and the UCI Networking Group
# <https://athinagroup.eng.uci.edu>.
#
# 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/LICEN... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.