text stringlengths 8.04k 46.5k |
|---|
# -*- mode: python; coding: utf-8 -*-
# Copyright 2018 the HERA Collaboration
# Licensed under the 2-clause BSD license.
"""Methods for handling locating correlator and various system aspects."""
from sqlalchemy import func, and_, or_
import numpy as np
from . import mc, cm_partconnect, cm_utils, cm_sysdef, cm_hooku... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
from misc.utils import obj_edge_vectors, load_word_vectors
from torch.nn.utils.rnn import PackedSequence, pack_padded_sequence, pad_packed_sequ... |
################################################################################
# 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... |
"""main challenge: navigate a boat in unknown waters so that it does not fall of a cliff for as long as possible"""
# DO NOT CHANGE!
import numpy as np
from numpy import abs, sin, cos, pi
from scipy.integrate import odeint
from numba import njit
from gym import core, spaces
from gym.utils import seeding
# PARAMET... |
import logging
from django import forms
from django.contrib.auth.models import Group
from django.core.exceptions import SuspiciousOperation, ValidationError
from django.db.models import Q
from django.forms.models import BaseInlineFormSet
from django.forms.widgets import CheckboxSelectMultiple
from django.http.request ... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2021 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://trac.edgewall.org/wiki/TracLicense.
#
# This software cons... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
###########################################################################
# #
# Copyright 2020 INTERSEC SA #
# ... |
#!/usr/bin/env python
# Copyright (c) 2020 Siemens AG
#
# 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 ... |
#!/usr/bin/env python
################################################################################
#
# Copyright (c) 2017 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
################################################################################
#
# Description: Graphs nfv-vim histogram data... |
""" EconDB Model """
__docformat__ = "numpy"
# pylint: disable=no-member
import logging
from typing import Dict, Any, Tuple, Union
from urllib.error import HTTPError
from datetime import datetime
import pandas as pd
import pandas_datareader.data as web
import requests
import yfinance as yf
from pandas import DataFra... |
#!/usr/bin/env python3
import argparse
import os
import shutil
import subprocess
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import List
try:
from tqdm import tqdm
except ImportError:
tqdm = None
ROM_ENTRIES_TEMPLATE = """
const retro_emulator_file_t {name}[] = {{
{body}
}};
c... |
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
import os
import math
class AdditiveAttention(nn.Module):
''' AttentionPooling used to weighted aggregate news vectors
Arg:
d_h: the last dimension of input
'''
def __init__(self, d_h, hidden_size=200):
... |
import telegram
import colorama
import pyautogui
import time
import threading
import configparser
import random
from colorama import Fore
from datetime import datetime
import glob
import cv2
import requests
from cv2 import cv2
import numpy as np
import mss
import sys
import yaml
if __name__ == '__main__':
stream... |
import os
import re
import sys
import time
from pathlib import Path
from tqdm import tqdm
from collections import defaultdict
from copy import copy, deepcopy
import numpy as np
import pandas as pd
import torch
import torch.utils.data as D
from .datasets import *
from .snapshot import *
from .logger import *
from .tem... |
import argparse
import math
import os
import sys
sys.path.append(os.path.dirname(sys.path[0]))
import time
import torch
import torch.distributed as dist
from numpy import finfo
from torch.utils.data import DataLoader
from torch.utils.data.distributed import DistributedSampler
from distributed import apply_gradient_al... |
# Copyright (c) 2018 - 2021 <NAME>.
#
# 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 wr... |
"""Objects representing internal or interwiki link in wikitext.
..note::
`Link` objects defined here represent a wiki-page's title, while
:class:`pywikibot.Page` objects represent the page itself, including
its contents.
"""
#
# (C) Pywikibot team, 2008-2022
#
# Distributed under the terms of the MIT license.
#
... |
import airsim
import cv2
import numpy as np
import os
import pprint
import setup_path
import tempfile
import time
import matplotlib.pyplot as plt
import math
numUAV = 4; name = []; s = []
tout = 10; spd = 2; alt = -10
min_dist = 2
pos0 = np.zeros((numUAV,3)) # Assigning Global Position
for i in range(numUAV):
p... |
# Huawei-TCX-Converter.py
# <NAME>, 2019 - github.com/aricooperdavis/Huawei-TCX-Converter
# Import resources from Standard Library
import xml.etree.cElementTree as ET # TCX (type of XML) construction
import math, operator, sys # Distance calcs, sorting by timestamp, arguments
from datetime import datetime as dt # Time... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright 2019.12.19 <NAME>
# Distributed under terms of the MIT license.
"""
the functions of input/output processes
Available functions:
importlist: import data file(fname) and return the list of data
exportlist: export data list to file(... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Red Hat, Inc.
# Copyright (C) 2013-2014 eNovance 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
#
# ... |
r"""
Constructors for polynomial rings
This module provides the function :func:`PolynomialRing`, which constructs
rings of univariate and multivariate polynomials, and implements caching to
prevent the same ring being created in memory multiple times (which is
wasteful and breaks the general assumption in Sage that pa... |
from __future__ import print_function
import json
import os
import subprocess
import sys
import shutil
import pwd
import grp
import socket
DEBUG = True
DEBUG = False
legacy_key_map = {}
should_be_integers = []
def print_debug(*args, **kwargs):
if DEBUG:
print(*args, **kwargs)
def print_error(*args, **... |
import sys
import re
import random
import os
from tkinter import *
from functools import partial
class Player:
"""
The Player class is the default structure used for keeping information
strictly related to a player (like score, name, rack etc.) in one place.
"""
def __init__(self, name="scrabble"):... |
from ryu.app.rest_cdn_router import *
UINT16_MAX = 0xffff
UINT32_MAX = 0xffffffff
UINT64_MAX = 0xffffffffffffffff
ETHERNET = ethernet.ethernet.__name__
VLAN = vlan.vlan.__name__
IPV4 = ipv4.ipv4.__name__
ARP = arp.arp.__name__
ICMP = icmp.icmp.__name__
TCP = tcp.tcp.__name__
UDP = udp.udp.__name__
MAX_SUSPENDPACKET... |
import re
import zipfile
import os
import bs4
import shared_utils
from shared_utils import warn_tex as warn
def get_raw_tex_contents(source_zip_path: str, extracted_dir: str) -> str:
"""Return the LaTeX contents of a source zip file as a string. Assumes there is only 1 .tex file
in the zip file root, or tha... |
from . import GlobalConstants as GC
from . import configuration as cf
from . import Counters, Engine
from . import BaseMenuSurf
from . import ClassData, TextChunk
class HelpGraph(object):
def __init__(self, state, unit, gameStateObj):
self.help_boxes = {}
self.unit = unit
self.cur... |
from typing import Any, Dict, Optional, Type
import argparse
import asyncio
import itertools
import multiprocessing
import pickle
import pprint
import signal
import sys
import traceback
from concurrent.futures import ProcessPoolExecutor
from copy import deepcopy
from dataclasses import dataclass, make_dataclass
from e... |
import copy
import random
import gym
from gym.utils import seeding
from gym.spaces.discrete import Discrete
from gym.spaces import Box
from gym_sokoban import logger
from .room_utils import SokobanRoomGenerator
from .render_utils import room_to_rgb, room_to_tiny_world_rgb, room_to_one_hot, room_to_binary_map
import n... |
import math
import numbers
import warnings
import json
from functools import reduce
from enum import IntEnum, auto
import numpy as np
import torch
from backpack import backpack, extend
from backpack.extensions import BatchGrad
from numpy import float32
from torchvision import datasets, transforms
from dacbench import ... |
# -*- coding: utf-8 -*-
import os
import re
import sqlite3
import tempfile
from decimal import Decimal
# Schema:
# +----------------+ +=================+
# +================+ | cell_label | | hierarchy |
# | cell | +----------------+ +==========... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
def last_zero_init(m):
if isinstance(m, nn.Sequential):
nn.init.constant_(m[-1].weight, val=0)
m[-1].inited = True
else:
nn.init.constant_(m.weight, val=0)
m.inited = True
class ContextBlock... |
import csv, json, pickle, platform, re
from collections import defaultdict
from tkinter import *
from tkinter.ttk import Button, Entry, Label, Scrollbar, Separator, Style
# A list of widget types that take ARGS instead of KWARGS
# (ie. widgets that must take multiple positional variables on initialisation)
COMPLEXWIDG... |
import random
import itertools
import cv2
import math
import numpy as np
from operator import add, sub, mul
#sudo apt install python3-pyqt4
#sudo pip3 uninstall matplotlib
#sudo pip3 install matplotlib --no-binary :all: --no-cache-dir
import matplotlib
from mpl_toolkits.mplot3d import Axes3D
matplotlib.use('Qt4Agg')
... |
import numpy as np
import sys
sys.path.append('psy')
from manimlib import *
class Neuron(VGroup):
CONFIG = {
'neuron_radius': 1.6,
'neuron_stroke_color': WHITE,
'neuron_stroke_width': 8,#3.5,
'neuron_fill_color': BLUE_C,
'edge_color': WHITE,
'edge_... |
"""
Math 560
Project 2
Fall 2020
p2Maze.py
"""
# Import math, other p2 files, plotting, and Wilson's.
import math
from project2 import bdfs
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.colors import ListedColormap, LinearSegmentedColormap
import numpy as np
from p2wilson im... |
#!/usr/bin/env python
# -*- coding: utf-8
#
# Copyright 2017 <NAME> (<EMAIL>)
#
# 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 3 of the License, or
# (at your option) any later v... |
"""This module defines utility functions used to organize hyperparameter optimization, specifically
the gathering of saved Experiment files in order to identify similar Experiments that can be used as
learning material for the current OptimizationProtocol. Additionally, :class:`AskingOptimizer` is
defined here, which i... |
import configparser
import importlib
import os
import os.path as osp
import sqlite3 as sq
import warnings
import yaml as ya
from io import StringIO
from pandas import concat, DataFrame, Series, read_sql_query, read_csv
from sqlite3 import Error
import numpy as np
from numba import jit
... |
import chainer
from chainer import functions as F
from chainer import links as L
from chainer import cuda
from PIL import Image
from inpaint_ops import GenConv, GenDeconv, DisConv
from inpaint_ops import random_bbox, bbox2mask, local_patch, free_form_mask
from inpaint_ops import spatial_discounting_mask
from inpaint_o... |
#!/usr/bin/env python3
import sys
import subprocess
from .kast import *
from .kast import _notif, _warning, _fatal
def buildAssoc(unit, join, ls):
"""Build an associative binary operator term given the join and unit ops.
- Input: unit, join, and list of elements to join.
- Output: cons-list style co... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2020-2021 <NAME> and <NAME>
#
# Distributed under terms of the BSD 3-Clause license.
"""Classes representing parameters for geoclaw-landspill runs.
"""
import os
from functools import reduce as _reduce
from gclandspill import clawutil as ... |
"""
Copyright (C) <2010> <NAME>
This file git_upy/colors.py is part of upy.
upy 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 3 of the License, or
(at your option) any l... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from utils.dist_utils import all_gather
from utils.lovasz_losses import lovasz_softmax
class ProbOhemCrossEntropy2d(nn.Module):
def __init__(self, ignore_label, reduction='mean', thresh=0.6, min_kept=256,
down_... |
import os
import zipfile
import shutil
from flask import render_template, flash, request, redirect, url_for, make_response, send_file, current_app, \
send_from_directory
from flask_login import login_required, current_user
from . import student
from ..auths import UserAuth
from ..models.models import *
from .forms ... |
import numpy as np
import texttable as tt
from scipy import linalg
import sys
import random
def is_close(float1, float2, epsilon=1e-6):
return abs(float1 - float2) <= epsilon
def f1(x):
return 100 * (x[1] - x[0] ** 2) ** 2 + (1 - x[0]) ** 2
def f2(x):
return (x[0] - 4) ** 2 + 4 * (x[1] - 2) ** 2
def... |
import sys
import json
import re
from neuron_html_snips import *
###########################################################
# SETUP, FILE LOADS
print(f"* MindMap: Save your Brain.RAM")
print(f"- Neuron Offload to JSON: {sys.argv[0]}")
print(f"- Argc: {len(sys.argv)}")
print(f"- Args: {str(sys.argv)}")
# switches
loa... |
from collections import defaultdict, deque, namedtuple
from dataclasses import is_dataclass
from datetime import datetime, time, date, timedelta
from decimal import Decimal
from enum import Enum
from typing import (
Any, Type, Dict, List, Tuple, Iterable, Sequence, Union,
NamedTupleMeta, SupportsFloat, AnyStr, ... |
"""
(*)~---------------------------------------------------------------------------
Pupil - eye tracking platform
Copyright (C) 2012-2019 <NAME>
Distributed under the terms of the GNU
Lesser General Public License (LGPL v3.0).
See COPYING and COPYING.LESSER for license details.
----------------------------------------... |
'''
The purpose of this script is to test the ALIF cell model and
provide a basic tutorial.
Out of the box you should get good performance (it uses a 20%
rewiring), please report any bug or unexpected performance.
One should get approximately:
- 40% accuracy in 100 iterations
- 60% in 200 iterations (about 30 minutes... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import copy
from functools import partial
import hashlib
import json
from ansible_collections.spatiumcepa.truenas.plugins.module_utils.common import HTTPCode, HTTPMethod, HTTPResponse, \
TruenasServerError, TruenasModelError, Tr... |
import re
import json
import logging
import weakref
import datetime
from ipaddress import IPv4Network, IPv4Address
from typing import Iterable, Iterator, Dict, Any, List, Union, Tuple, Optional
import numpy
import dataclasses
from cephlib.units import ssize2b
from cephlib.storage import AttredStorage, TypedStorage
f... |
# Copyright 2017-2020 typed_python Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
# Copyright 2017 Covata Limited or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
#!/usr/bin/env python
import pandas as pd
import numpy as np
import os
from datetime import datetime, timedelta
import math
import logging
from pathlib import Path
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import jinja2
import pdfkit
import sys
sys.path.append('../../')... |
'''
#################################################################################################
AUTOR: <NAME>
TRABALHO ACADEMICO: VIGILANCIA SOCIOASSISTENCIAL: MONITORAMENTO DE RISCOS E VULNERABILIDADES EM
TEMPO REAL POR MEIO DE MINERAÇÃO DE TEXTO NO TWITTER
UNIVERSIDADE: PONTIFÍCIA UNIVERSIDADE CATÓLICA DE... |
import torch
import torch.nn as nn
from torch.nn import init
import functools
from torch.autograd import Variable
from torch.optim import lr_scheduler
import numpy as np
from collections import OrderedDict
import torch.nn.functional as nnF
###############################################################################... |
"""Defines a polyhedron."""
import numpy as np
import rowan
from scipy.sparse.csgraph import connected_components
from .base_classes import Shape3D
from .convex_polygon import ConvexPolygon, _is_convex
from .polygon import Polygon, _is_simple
from .sphere import Sphere
from .utils import _generate_ax, _set_3d_axes_eq... |
import struct
class _BUILDER:
'''Virtual base helper class for structured file scanning'''
def _get_struct_fmt(self,info):
fmt = '<'
for f, _, _ in info:
fmt += f
return fmt
def _scan_from_file(self,f,info):
fmt = self._get_struct_fmt(info)
size = struct.calcsize(fmt)
T = struct.unpack(fmt,f.read(siz... |
import argparse
import torch
import os
from torch.utils.data import DataLoader
from utils import *
from process.data import *
from timeit import default_timer as timer
from process.triplet_sampler import *
from loss.loss import softmax_loss, TripletLoss, focal_OHEM, l2_norm, euclidean_dist
import numpy as np
import pan... |
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
from __future__ im... |
# Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import sys
from mixbox.binding_utils import *
from . import cybox_common
class SharedResourceType(cybox_common.BaseObjectPropertyType):
"""SharedResourceType specifies Windows shared resource types via a
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 23 15:04:32 2018
@author: maximoskaliakatsos-papakostas
"""
'''
Classes for:
- Tonality
- Grouping
- Phrases
Functions for:
- getting offsets of tonality and grouping objects
'''
# import music21 as m21
import numpy as np
im... |
"""
DOCSTRING
"""
import argparse
import enum
import json
import logging
import math
import os
import random
import sys
import tensorflow
class Device:
"""
DOCSTRING
"""
def __call__(self):
print(self.get_available_gpus())
print(self.get_available_cpus())
def get_available_cpus(se... |
import concat.visitors
from concat.astutils import get_explicit_positional_function_parameters
from concat.level0.lex import Token
import concat.level0.parse
import concat.level0.transpile
import concat.level1.parse
import concat.level1.transpile
import unittest
import ast
from typing import Iterable, Iterator, List, S... |
from flask import Flask, render_template, request, redirect, url_for
# import threading
# from PyQt5.QtCore import QUrl
# from PyQt5.QtWidgets import QApplication
# from PyQt5.QtWebEngineWidgets import QWebEngineView
import sqlite3
import os, time
import xlwt, zipfile, xlrd
abs_path = os.getcwd()
app = Flask(__name__)... |
import mmap
import multiprocessing
import os
from tqdm import tqdm
from .codes import (Action, ComparisonResult, CreationResult,
ExceptionsResults, ValidationResult)
from .defaults import *
from .email import send_email
from .hashing import hash_file
from .paths import fix_path
from .results impor... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: GPL-3.0
#
# GNU Radio Python Flow Graph
# Title: Bpsk Mod
# Author: <NAME>
# Copyright: MIT
# GNU Radio version: 3.8.3.1
from distutils.version import StrictVersion
if __name__ == '__main__':
import ctypes
import sys
if sys.platf... |
"""Creates the QualityControlDiagnosticSuite and specific data-based subclasses."""
from abc import abstractmethod
from typing import List, Tuple, Union
from datetime import time, datetime
import pytz
import h5pyd
import numpy as np
import pandas as pd
import dateutil
import matplotlib.pyplot as plt
from pyproj impor... |
"""Summary"""
from __future__ import division
from PyQt5.QtCore import QPointF, QRectF
from PyQt5.QtWidgets import QGraphicsItem, QGraphicsRectItem
from cadnano import getBatch, util
from cadnano.proxies.cnenum import HandleType
from cadnano.gui.palette import getBrushObj, getPenObj, getNoPen # newPenObj
from cadnan... |
#!/usr/bin/python3
# --------------------------------------------------------------------------
print('### Script:', __file__)
# --------------------------------------------------------------------------
import math
import sys
import time
import pickle
# import cv2 as cv
import numpy as np
import sim
from collecti... |
import os
os.environ['CUDA_VISIBLE_DEVICES']='0'
from common import *
from dataset import *
from model import *
from train_b0 import *
######################################################################################
from metric import *
TEMPERATE=0.5
#####################################################... |
'''Train ISL on small datasets with PyTorch.'''
from __future__ import print_function
import sys
import torch
import torch.nn as nn
import torch.utils.data
import torch.optim as optim
import torch.backends.cudnn as cudnn
import torchvision.transforms as transforms
import os
import argparse
import time
... |
#!/usr/bin/env python
from __future__ import print_function
import numpy as np
from scipy.stats import norm
import utils
from config import *
try:
xrange
except NameError:
xrange = range
def likelihood(tag):
"""
Construction of likelihood function after (Le Bris et al, 2013 eq (2))
using daily ... |
import pdb
import subprocess
import argparse
import os
import json
import shutil
import pyDOE
import numpy as np
import time
import pyproj
import glob
import sys
import signal
import rasterio
from tqdm import tqdm
from typing import Union, Tuple
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
USER_HOME = os.p... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
from os import listdir
import numpy as np
from pygad import GA as ga
from numpy.lib.function_base import append, average
from statsmodels.distributions.empirical_distribution import ECDF
import AR6_CDS_GCM
import SDmodel_Sim1yr
from importlib.machinery import ... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import division
import os
import time
import sys
import argparse
import numpy as np
import tables
from astropy.table import Table
import logging
import warnings
from Chandra.Time import DateTime
import agasc
from kadi import events
from Sk... |
#-------------------------------------------
#
# FILENAME: IFI_compare_RadIA_PIREP.py
#
# CREATED: 12.15.2021 - dserke
#
# PURPOSE: 1) ingest matched RadIA and PIREPs csv file, 2) manipulate and plot the data
#
#-------------------------------------------
#-------------------------------------------
# IMPORT LIBR... |
import copy
import math
import queue
import random
import numpy as np
from PIL import Image
from enum import IntEnum
from datetime import datetime
import gym
from gym import error, spaces, utils
from gym.utils import seeding
from pettingzoo.utils.env import ParallelEnv
"""
New MEDA Environment for the MARL work
Use P... |
"""
Train BERT-based models for each of the three cQA StackExchange topics: Apple, Cooking and Travel. Make predictions
for the corresponding test sets and save to a CSV file.
Steps for each topic:
1. Load training data.
2. Load validation data.
3. Initialise and train a model. <SKIP>
4. Sanity check by testing on the... |
"""
Author: Anonymous
Description:
Data generation using MAP-Elites
- parameter space
- latent space
- mixing strategies
"""
import time
import os
import csv
import logging
import itertools
import inspect
import numpy as np
from functools imp... |
# SPDX-FileCopyrightText: 2014-2020 <NAME>
#
# SPDX-License-Identifier: MIT
import abc
import sys
from collections import namedtuple, Counter, OrderedDict
from scipy.optimize import (
minimize, differential_evolution, basinhopping, NonlinearConstraint,
least_squares,
)
from scipy.optimize import BFGS as soBFG... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018 SMHI, Swedish Meteorological and Hydrological Institute
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
'''
Created on 30 jun 2016
@author: a001985
'''
import codecs
import re
import os
import datetime
import time
import sys
try:
impo... |
# Copyright 2018 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
#!/usr/bin/env python
import sys
sys.path.append('../neural_networks')
import numpy as np
import numpy.matlib
import pickle
import copy
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.pyplot as plt
import os
import time
import copy
from gym_collision_avoidance.envs.policies.CADRL.s... |
"""
Mask R-CNN
Common utility functions and classes.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by <NAME>
"""
import math
import random
import warnings
import numpy as np
import scipy.misc
import scipy.ndimage
import skimage.transform
import torch
import torc... |
# coding=utf-8
from sqlalchemy import (
Column,
Date,
DateTime,
ForeignKey,
Integer,
String,
Float,
Index,
)
from sqlalchemy.orm import relationship, backref
from .with_offsets import WithOffsets
from unidecode import unidecode
from wtforms import StringField, TextAreaField, validators,... |
import streamlit as st
import pandas as pd
import base64
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import SessionState
import altair as alt
# Title Text
st.title('NFLfastR Explorer')
st.markdown("""
This app performs simple filtering of NFLfastR data.
* **Upcoming features... |
import os
import json
import threading
import logging
import flask
import datetime
from werkzeug.serving import make_server
from attributedict.collections import AttributeDict
from flask_babel import Babel, _
from ..utils import broadcast, common, config, img_utils, time_utils
from .. import heating, sensing, forecasti... |
import mmcv
import numpy as np
import os
from collections import OrderedDict
from nuscenes.nuscenes import NuScenes
from nuscenes.utils.geometry_utils import view_points
from os import path as osp
from pyquaternion import Quaternion
from shapely.geometry import MultiPoint, box
from typing import List, Tuple, Union
fro... |
from os.path import exists, join
import pandas as pd
import torch
import logging
from transformers import AutoModelForSequenceClassification
from train_bert import compute_negative_entropy, LMForSequenceClassification
from dataset import get_dataset_by_name, TokenizerDataModule
from torch.utils.data import DataLoader
... |
"""
This module contains all the array handling code for TVTK.
The most important functions provided by this module involve the
conversion of numpy arrays/Python lists to different VTK data arrays
and vice-versa.
Warning: Numpy Character arrays will not work properly since there
seems no unique one-to-one VTK data ar... |
'''
This module provides functions to reify programs.
This includes a `Reifier` implementing clingo's `clingo.backend.Observer`
interface that can be registered with a `clingo.control.Control` object.
Additionally, the module provides a `ReifiedTheory` class that provides a
similar interface as clingo's theory atoms ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from ..utils import download_from_url, load_darknet_weights
model_urls = {
'darknet19': 'https://pjreddie.com/media/files/darknet19.weights',
'darknet19_448': 'https://pjreddie.com/media/files/darknet19_448.weights',
'dar... |
import numpy as np
from multiprocessing.dummy import Pool as ThreadPool
import time
import numba as nb
@nb.jit(nopython=True)
def allocate(idx, idx_end_id, start_id, cnts, seq):
for i in range(len(start_id)):
idx[idx_end_id[i] - cnts[i]:idx_end_id[i]] = seq[start_id[i]: start_id[i] + cnts[i]]
def multi_... |
import argparse
import re
import os
import string
import sys
from enum import Enum
from lxml import etree
import yaml
from yaml import scanner
from jinja2 import Environment
from jinja2.loaders import FileSystemLoader
import sys
from yaml import load
from collections import OrderedDict
from io import StringIO
... |
import logging
from core.configuration import config
logging.basicConfig(level=config.VERBOSITY)
import glob
import traceback
import time
from datetime import datetime
from os import path
from json import load, dump
from typing import Optional, Dict, List, Any, Tuple, Union
from mutagen import File, FileType, Mutagen... |
#!/usr/bin/env python
# coding: utf-8
# # Analysis of Cryptocurrency Investments
#
# In this analysis report, I will perform exploratory data analysis and build machine learning models to predict market prices in future 30 days for the above 7 cryptocurrencies.
# [1. Prepare Data Set](#1)
# - [Load Python Packages]... |
# -*- coding: utf-8 -*-
from random import Random
#from core.dataloader import DataLoader
from torch.utils.data import DataLoader
import numpy as np
from math import *
import logging
from scipy import stats
import numpy as np
from pyemd import emd
from collections import OrderedDict
import time
import pickle, random
fr... |
import numpy as np
import ndcube
import astropy.wcs
import astropy.units as u
import astropy.coordinates
from astropy.coordinates import SkyCoord, SpectralCoord
from astropy.wcs.wcsapi import SlicedLowLevelWCS, HighLevelWCSWrapper
import matplotlib.pyplot as plt
from . import plotting
from matplotlib.widgets import S... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.