text stringlengths 6.04k 39.5k |
|---|
from __future__ import unicode_literals
import datetime
import logging
import os
from collections import OrderedDict, namedtuple
from dateutil.tz import gettz
from django.apps import apps
from django.db import models
from django.db.models import Aggregate, Avg, Count, F, FloatField, Q, StdDev, Value
from django.db.mo... |
# 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
# "License"); you may not u... |
#!/usr/bin/env python3
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
# DESCRIPTION:
# Python modbus driver to get and store epever 3210a values into a CSV file
#
# CALL SAMPLE:
# see this_file.py -h
#
# DOCS
# see ../../docs direct... |
# -*- coding: utf-8 -*-
import pandas as pd
import flask
import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
from plotly import graph_objs as go
from datetime import datetime, date
from dash.exceptions import PreventUpdate
from ..app impo... |
#!/usr/bin/env python2
"""
flag_gen.py
"""
from __future__ import print_function
import itertools
import sys
from _devbuild.gen.runtime_asdl import flag_type_e, value_e
from core.pyerror import log
from frontend import args
from frontend import flag_def # side effect: flags are defined!
from frontend import flag_spe... |
# encoding: utf-8
# module _bsddb
# from (pre-generated)
# by generator 1.147
# no doc
# no imports
# Variables with simple values
cvsid = '$Id$'
DB_AFTER = 1
DB_AGGRESSIVE = 1
DB_APPEND = 2
DB_ARCH_ABS = 1
DB_ARCH_DATA = 2
DB_ARCH_LOG = 4
DB_ARCH_REMOVE = 8
DB_AUTO_COMMIT = 256
DB_BEFORE = 3
DB_BTREE = 1
DB_BUF... |
import datetime
import json
import itertools
import math
from pprint import pprint
from time import time
import numpy as np
from absl import app
from absl import flags
from absl import logging
import torch
from apex import amp
from apex import optimizers as apex_optim
from apex import parallel
from dlrm import dist... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Range-Constrained multidimensional matrix profile with RC-mSTOMP (stomp based)
Parameters
----------
seq(T) : numpy matrix, shape (n_dim, seq_len)
input sequence
sub_len(l) : int
subsequence length
sea_ran(m) : int
search range
return_dimension : bool
... |
from random import randint
from slixmpp import BaseXMPP
from slixmpp.xmlstream import tostring
from .stream import min_version, StreamElement, Stream
from ..conf import settings
MAX_VER = '1.8'
NS_XBOSH = 'urn:xmpp:xbosh'
# streams handled by this process
streams = {}
def get_local_stream(id):
return streams.get... |
import sys, os
#---- dicts to be used later (should have done this from the begining)
states_dict = {}
alphabet_dict = {}
tape_val_dict = {}
line_count = 0
#---- Structs for the TM
class state():
def __init__(self, state_name: str, is_start: bool, is_accept: bool):
self.state_name = state_name
... |
import argparse
import logging
import os
import tarfile
from io import StringIO, BytesIO
from tarfile import TarFile, ExFileObject
from tarfile import TarInfo
from time import time
from typing import List, Dict, Iterable
from typing import Set
from pdfminer import settings
from pdfminer.converter import TextConverter
... |
#!/usr/bin/python
# --------------------------------------------------------
# The Cityscapes Dataset
# Written by the Cityscapes authors
# --------------------------------------------------------
# Adapted by <NAME> to work with in-memory predictions instead of reading
# from file to enable fast evaluation during trai... |
# Code adopted from https://github.com/jimmysong/pb-exercises/
import hashlib
import math
from io import BytesIO
def hash256(s):
return hashlib.sha256(hashlib.sha256(s).digest()).digest()
def read_varint(s):
"""read_varint reads a variable integer from a stream"""
i = s.read(1)[0]
if i == 0xFD:
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, ESS LLP and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe import _
from frappe.model.document import Document
from frappe.utils import cstr
from frappe import _
from hms_tz.hms_t... |
import numpy as np
from task.Schema import Schema
# import pdb
class StimSampler():
'''
a sampler of sequences
'''
def __init__(
self,
n_param,
n_branch,
pad_len=0,
max_pad_len=None,
def_path=None,
def_prob=None,
... |
import pygame
import os
import sqlite3
import string
import time
import datetime
from game.game import Game
from game.image_collection import ControlImageCollection
from map.game_map import Map
# TODO: Add map classification to database
# TODO: Change lose/win screen
# Создание таблицы
conn = sqlite3.connect("tower_... |
from platform import platform
import socket
import sys
from sys import platform
import os
import time
import string
import random
from os import walk
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
try:
server_ip = sys.argv[1]
server_port = int(sys.argv[2])
m... |
import os
import string
import tempfile
import time
import boto3
import yaml
from flashpkg import utils, logging
from flashpkg.config import config as flash_config
from flashpkg import nsxsmOps
from botocore.exceptions import ClientError, WaiterError
from kubernetes import client, config
from kubernetes.client.rest imp... |
# First import the libraries that we need to use
import pandas as pd
import requests
import json
from urllib.request import urlopen
from bs4 import BeautifulSoup
from fileDirectoryCreation import *
from tqdm import tqdm
from ta import add_all_ta_features
from ta.momentum import *
from ta.volume import *
from ta.volat... |
import numpy as np
from sklearn import metrics
import matplotlib.pyplot as plt
from cardio import EcgBatch
from cardio.core.ecg_batch_tools import load_wfdb
def get_meta(path, ann_ext):
components = ["meta"]
return load_wfdb(path, components, ann_ext=ann_ext)[0]
def show_ecg(signal, annot, labels, states, met... |
#
# BitBake Graphical GTK User Interface
#
# Copyright (C) 2008 Intel Corporation
#
# Authored by <NAME> <<EMAIL>>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This pro... |
"""Highly modified colanderalchemy core.
.. note ::
This is a temporary solution and will be replaced with something cleaner after working with the upstream author.
"""
# Standard Library
import itertools
import logging
# Pyramid
import colander
from colander import Mapping
from colander import SchemaNode
from... |
import ctypes
import mmap
import os
import stat
import time
import sys
import glob
from datetime import datetime, timedelta, timezone
from collections import OrderedDict
import numpy as np
try:
import xarray as xr
xarray_enabled = True
except ImportError:
xarray_enabled = False
from HSTB.drivers.pos_mv ... |
import math
import os
import sys
import time
import random
from collections import deque
import torch
import torch.nn.functional as F
import torch.optim as optim
from model import Comm
from torch.autograd import Variable
from torchvision import datasets, transforms
import numpy as np
from env_util.env_fixes import ini... |
import os
import numpy as np
import pytorch_lightning as pl
import torch
from matplotlib import pyplot as plt
from matplotlib.offsetbox import AnchoredText
from prototorch.utils.celluloid import Camera
from prototorch.utils.colors import color_scheme
from prototorch.utils.utils import (gif_from_dir, make_directory,
... |
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 24 15:43:16 2021
@author: Offszanka
Display energymix together with co2 - emissions and a map showing
wind power plants in germany.
"""
from collections import namedtuple
import datetime as dt
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
import n... |
import re
from datetime import date, datetime, timedelta
import scrapy
from datasets.parsers import from_str_to_datetime
from scraper.items import CityHallBidItem, CityHallContractItem, CityHallPaymentsItem
from . import BaseSpider
from .utils import extract_param, identify_contract_id, is_url, strip_accents
class ... |
import numpy as np
import xarray as xr
from scipy import sparse
from typing import NamedTuple
import os
import uuid
import datetime
from dotenv import load_dotenv
load_dotenv(dotenv_path='./.env')
from typhon.arts.workspace import Workspace, arts_agenda
from typhon.arts import xml
from typhon.arts.griddedfield import... |
import os
import copy
import time
import glob
from typing import Dict, Tuple, List
import pdb
import numpy as np
import pickle
import torch
from pathlib import Path
from allennlp.nn.util import move_to_device
from allennlp.common import Params, Tqdm
from sklearn.metrics import accuracy_score
from multiprocess_input_... |
''' show_environment.py
IOSXR parsers for the following show commands:
* 'admin show environment power-supply'
* 'admin show environment power-supply location {location}'
'''
# Python
import re
# Metaparser
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengine import Schema, Any, Op... |
from collections import namedtuple
from functools import partial
from itertools import chain
from mininet.link import Intf
from mininet.node import Node
import re
from subprocess import PIPE, STDOUT
import subprocess
from varanuspy.utils import some, is_some, AsyncProcess, as_a, as_str, as_bool
def special( mn, node... |
from keras.preprocessing.image import Iterator
from keras.preprocessing import sequence
from pyAudioAnalysis import audioFeatureExtraction
from utility import globalvars, audiosegment
from scipy import stats
from pydub import AudioSegment
from array import array
from struct import pack
from tqdm import tqdm
import num... |
from __future__ import absolute_import
from fastlmm import Pr
import scipy as sp
import numpy as NP
from numpy import dot
import scipy.integrate
from scipy.linalg import cholesky,solve_triangular
from fastlmm.external.util.math import check_definite_positiveness,check_symmetry,mvnormpdf,ddot,trace2,dotd
from fastlmm.ex... |
# First Train and then search architecture and shrink the search space by the elite individual
import os
import sys
sys.path.insert(0, './s1')
import copy
import logging
import random
import torch.nn as nn
import genotypes
import argparse
import numpy as np
import pandas as pd
import pickle
import torch.backends.cudn... |
#!/usr/bin/python3
#Hice Este Repositorio para la legion warriors of death :P
import webbrowser,os, sys, time,platform, subprocess, getpass,smtplib, email.message, imaplib, email, ssl
clean = ("cls" if os.name == "nt" else "clear")
def clear():
os.system(clean)
def restart():
python = sys.executable;os.execl(pytho... |
"""WiFi Nwtwork Manager Primitive."""
import time
import math
from datetime import datetime
from construct import Struct, Int8ub, Int16ub, Int32ub, Bytes, Array
from construct import Container
import empower.managers.ranmanager.lvapp as lvapp
from empower.core.ssid import WIFI_NWID_MAXSIZE
from empower.core.ethera... |
import json
import os
import string
import sys
import uuid
from contextlib import contextmanager
from pathlib import Path
from textwrap import dedent
from typing import Any, BinaryIO, List
import docutils.nodes
import hypothesis.strategies as st
import pytest
from docutils.io import StringOutput
from docutils.utils im... |
# -*- coding: utf-8 -*-
"""AIS operation tests.
This script presents the tests of the AIS operation. These tests are:
- Initialization of the AIS class: it is tested if the the values of the
provided parameters are correct. The allowed parameter are the star flux,
the sky flux, the gaussian distribution o... |
import torch
def vectorize(ex, model):
"""Vectorize a single example."""
src_dict = model.src_dict
tgt_dict = model.tgt_dict
code, summary, ref0, ref1, scr0, scr1 = ex['code'], ex['summary'], ex['ref0'], ex['ref1'], ex['score0'], ex['score1']
vectorized_ex = dict()
vectorized_ex['id... |
# Cloudera Airflow Provider
# (C) Cloudera, Inc. 2021-2021
# All rights reserved.
# Applicable Open Source License: Apache License Version 2.0
#
# NOTE: Cloudera open source products are modular software products
# made up of hundreds of individual components, each of which was
# individually copyrighted. Each ... |
# This script will try to return diseases based on phenotypic similarity
import os
import sys
import argparse
# PyCharm doesn't play well with relative imports + python console + terminal
try:
from code.reasoningtool import ReasoningUtilities as RU
except ImportError:
sys.path.append(os.path.dirname(os.path.dirname(... |
"""A class for manipulating label maps contained in RTSTRUCT files.
Contributors include:
<NAME>
<NAME>
<NAME>
Licensed under the MIT (LICENSE.txt) license.
"""
import copy
import math
from typing import List, Dict, Tuple
import matplotlib.cm
import matplotlib.colors
import matplotlib.pyplot as plt
import n... |
# Copyright 2014: Mirantis 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 b... |
# Data handling libraries
import numpy as np
from scipy.stats import beta
import datetime
class Region:
# Initialize a region
def __init__(self, name, dataset):
'''
- name is a string of the region's name
- dataset is a time series DataFrame:
- index is set to dates
... |
#!/usr/bin/python
# -*- coding:utf-8 -*-
import os
import sys
import random
import CorrectClass
import Python_Program
# 经纬度范围,及其循环次数
# NC的实际经纬度 [0.0, 55.0, 70.0, 140.0]
# LatLonRange = [20.0, 55.0, 75.0, 135.0, 0.04]
current_dir = os.path.dirname(os.path.abspath(__file__))
step4_dir = os.path.dirname(current_dir)
gfs... |
#!/usr/local/bin/python3
# coding: utf-8
""" Covid
Covid19 data analysis for italy.
"""
import click
import locale
import numpy as np
import pandas as pd
from scipy import stats as sps
from scipy.interpolate import interp1d
url = "https://raw.githubusercontent.com/pcm-dpc/COVID-19/master/dati-andamento-nazionale/dp... |
from os.path import join as opj
from collections import Counter
from typing import List, Dict
from pandas import DataFrame
import numpy as np
import pickle
import matplotlib.pylab as plt
from sklearn.metrics import matthews_corrcoef
from sklearn.tree import DecisionTreeRegressor
from configs.nucleus_model_configs impo... |
#Copyright (c) 2018-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, ... |
#!/usr/bin/env python3
from utils.crawler import Crawler
import pandas as pd
from pathlib import Path
import matplotlib.pyplot as plt
import seaborn as sns
class ValueCollection():
def __init__(self):
self.dfs = []
def append_value(self, df):
self.dfs.append(df)
class LinkPredictionCrawler_1(Crawler):
... |
import argparse
import math
import numpy as np
from typing import Callable, Dict, List, Optional
from sklearn.model_selection import ParameterGrid
import torch
from pytorch_lightning.loggers import LightningLoggerBase
from torch import IntTensor, Tensor, optim
from torch.utils.data import DataLoader
from mlmi.fedavg... |
# Copyright 2015 Cisco Systems, 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 requi... |
# Repository: https://gitlab.com/quantify-os/quantify-scheduler
# Licensed according to the LICENCE file on the master branch
"""
Module containing schedules for common time domain experiments such as a Rabi and
T1 measurement.
"""
from typing import Union, List
from typing_extensions import Literal
import numpy as np
... |
import copy
import util
import sys
import random
import time
from optparse import OptionParser
class GameState:
"""
Game state of 3-Board Misere Tic-Tac-Toe
You *do not* need to make any changes here, but you can if you want to
add functionality to all your search agents. Please do not remove a... |
import threading
from helpers import tools
import numpy as np
import cv2
import pygame
import pygame.freetype
import unicodedata
import io
import os
import warnings
import asyncio
import requests
os.environ['SDL_AUDIODRIVER'] = 'dsp'
pygame.freetype.init()
ALPHA_COLOR = (255, 255, 255, 255)
LINE_TYPE = cv2.LINE_AA
... |
# -----------------------------------------------------------------------------
# WSDM Cup 2017 Classification and Evaluation
#
# Copyright (c) 2017 <NAME>, <NAME>, <NAME>, <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ... |
import discord
import datetime
from discord.ext import commands
from discord import Embed
import os
from Util import logger
# import config
try:
import config
except ImportError:
print("Couldn't import config.py! Exiting!")
exit()
stream = discord.Streaming(name="Hero's channel on Twitch!", url="https://w... |
import datetime
import QUANTAXIS as QA
from QAStrategy.qastockbase import QAStrategyStockBase
import random
from strategybase import StrategyBase
import numpy as np
import pandas as pd
from func.tdx_func import tdx_dhmcl, tdx_hm, tdx_sxp, tdx_hmdr
import math
from concurrent.futures import ProcessPoolExecutor,ThreadPoo... |
#!/usr/bin/python
###########################################################################
## #
## Copyright (c) 2018 National Institute of Informatics #
## ... |
# -*- coding: utf-8 -*-
"""
Created on Thu May 24 14:31:48 2018
@author: sreimond
"""
from picasso.gui.programs import compute_grace
from picasso.utils.dates_and_time import date_functions
from picasso.utils.geometry import points
from picasso.gui import project_data_functions
import numpy as np
import os, sys
import... |
from typing import Any, Optional, OrderedDict, Union
from timeit import default_timer as timer
import numpy as np
import torch
import torch.nn.functional as F
from torch import Tensor
from torch.nn.modules import Linear
from torch.nn.common_types import _size_2_t
from torch.types import _int, _size
from torch.nn.modu... |
#!/usr/bin/env python
import os.path
import os
import sys
import pandas as pd
from schimpy.unit_conversions import *
if sys.version_info[0] < 3:
from pandas.compat import u
from builtins import open, file, str
else:
u = lambda x: x
import argparse
from vtools.data.timeseries import *
station_variables =... |
# -*- coding: utf-8 -*-
"""Advertise and collect advertisements of network services
The discovery module offers:
* A UDP broadcast socket which:
- Listens for and keeps track of service adverts from this and other
machines & processes
- Broadcasts services advertised by this process
* A ... |
# Adapted from the HuggingFace Transformers directory: https://github.com/huggingface/transformers/.
import argparse
import glob
import logging
import os
import time
import torch
from torch.utils.data import DataLoader
from lightning_base import BaseTransformer, add_generic_args, generic_train
from transformers imp... |
from decimal import Decimal, getcontext
import csv
from datetime import datetime
import datetime
import random, math
from collections import Counter
from dateutil.parser import parse
myfilepath='mm.csv'
myfilepathPB='pb.csv'
def pi_mm(n):
TERMS = [(12, 18), (8, 57), (-5, 239)] # ala Gauss
def arctan(talj, kv... |
import pandas as pd
import numpy as np
import torch
from torch.utils.data import Dataset
from sklearn.model_selection import train_test_split
from sklearn.kernel_approximation import RBFSampler
from copy import deepcopy
class PandasData:
def __init__(self,
csv_file,
dataset_id,
... |
from __future__ import annotations
from enum import unique, Enum
from typing import List, Union, Optional, Set, NamedTuple, Dict
import logging
from BaseClasses import Location
from EntranceShuffle import door_addresses
from Items import item_name_groups, item_table, ItemFactory, trap_replaceable, GetBeemizerItem
from... |
import numpy as np
import itertools
import os
import scipy.linalg
from sfepy.discrete import fem
from .algo_core import generalized_courant_fischer, spring_energy_matrix_accelerate_3D
import util.geometry_util as geo_util
import util.meshgen as meshgen
from util.timer import SimpleTimer
from visualization.model_visua... |
# Copyright © 2019 Province 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 applicable law or agr... |
"""
Functions to calculate 3x2pt Gaussian covariance.
"""
import enum
import time
import warnings
from collections import namedtuple
import gaussian_cl_likelihood.python.simulation # https://github.com/robinupham/gaussian_cl_likelihood
import healpy as hp
import numpy as np
import pymaster as nmt
warnings.filterwarn... |
# Copyright 2020 A10 Networks, 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
#
# Unless required by applicable law or... |
# -*- coding: utf-8 -*-
from __future__ import division
from collections import namedtuple
import numpy as np
from numpy import random as rng
from scipy.linalg import cho_factor, cho_solve, LinAlgError
from sklearn.base import BaseEstimator
from progressbar import ProgressBar
from copy import deepcopy
def soft_th... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2015 jaidev <<EMAIL>>
#
# Distributed under terms of the MIT license.
"""Empirical Mode Decomposition."""
import numpy as np
from numpy import pi
import warnings
from scipy.interpolate import splrep, splev
from utils import extr, boundary... |
import logging
import os
from tempfile import NamedTemporaryFile
from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple
from lxml import etree
from core import utils
from core.config import Configuration
from core.emane.nodes import EmaneNet
from core.emulator.distributed import DistributedServer
from cor... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
# from net.utils.tgcn import ConvTemporalGraphical
# from net.utils.graph import Graph
class Model(nn.Module):
r"""Spatial temporal graph convolutional networks.
Args:
in_channels ... |
# <Copyright 2022, Argo AI, LLC. Released under the MIT license.>
"""Quick tutorial on AV2 map functionality, with visualizations of various map elements."""
import logging
import sys
from pathlib import Path
from typing import Final, Sequence, Tuple, Union
import click
import matplotlib.pyplot as plt
import numpy a... |
#!/usr/bin/env python
# coding: utf-8
# # 5m - Df unification (10 calib. fn-s)
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import os
from os.path import join
import pickle
from copy import copy
def get_data_name(file):
if "resnet110" in file:
return "resnet110"
elif ... |
import argparse
import math
import time
import os
import sys
import numpy as np
import torch
import matplotlib
from tools import create_location_features_2d, factors
matplotlib.use('agg') # make sure to import this before traces and pyplot
from matplotlib.pyplot import figure, colorbar, imshow, show, plot
from to... |
import osclient
import timeout
import sys
import uuid
import socket
import time
import os
import json
import config
import ssh
import ipaddress
class TimeoutError(EnvironmentError):
pass
class InstanceError(EnvironmentError):
pass
class PreparationError(EnvironmentError):
pass
class FlavorError(Envi... |
"""
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
Ontology Engineering Group
http://www.oeg-upm.net/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
Copyright (C) 2016 Ontology Engineering Group.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# #########################################################################
# Copyright (c) 2020, UChicago Argonne, LLC. All rights reserved. #
# #
# Copyright 2020. UChicago Argonne, LLC. This ... |
from urllib.parse import urlencode
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.urls import reverse, reverse_lazy
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404... |
from rpy2 import robjects
from rpy2.robjects.packages import (importr,
WeakPackage)
import warnings
with warnings.catch_warnings():
warnings.simplefilter("ignore")
dplyr_ = importr('dplyr', on_conflict="warn")
lazyeval = importr('lazyeval', on_conflict="warn")
rlang ... |
from builtins import range
import logging
import os.path
try:
import cPickle
except ImportError:
import pickle as cPickle
from .cubiecube import CubieCube, moveCube, getURtoDF
log = logging.getLogger(__name__)
cache_dir = os.path.join(os.path.dirname(__file__), 'prunetables')
def setPruning(table, index, ... |
# Author: <NAME>, PhD
#
# Organization: National Center for Advancing Translational Sciences (NCATS/NIH)
#
#
#
# Ref: https://github.com/matplotlib/matplotlib/issues/3466/
# Ref: https://matplotlib.org/3.1.1/gallery/shapes_and_collections/scatter.html
# Ref: https://stackoverflow.com/questions/17682216/scatter-plot-and... |
"""
Copyright (c) 2017 Matterport, Inc.
Copyright (C) 2019 NVIDIA Corporation. All rights reserved.
Licensed under the CC BY-NC-SA 4.0 license
(https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
"""
import math
import numpy as np
import os
import torch
# Base Configuration Class
# Don't use this class dir... |
# <NAME>
# 1001-756-326
# 2020-03-22
# Assignment-03-02
import numpy as np
import pytest
from multinn import MultiNN
import tensorflow as tf
def test_weight_and_biases_dimensions():
input_dimension = 4
number_of_layers = 3
number_of_nodes_in_layers_list = list(np.random.randint(3, high=15, ... |
from __future__ import print_function
import wntr
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
def topographic_metrics(wn):
# Get a copy of the graph
G = wn.get_graph_deep_copy()
# Print general topographic information
print(nx.info(G))
# Plot node and edge attributes.... |
"""
Implementation of NSCoding for OC_PythonObject and friends
NOTE: this only works with a keyed archiver, not with a plain archiver. It
should be easy enough to change this later on if needed.
A minor problem with NSCoding support is that NSCoding restores
graphs recusively while Pickle does so depth-first (more of... |
import copy
from pathlib import Path
from openpecha.blupdate import Blupdate, update_ann_layer
from openpecha.github_utils import commit
from openpecha.utils import download_pecha, dump_yaml, load_yaml
from pedurma.texts import get_pecha_paths, remove_last_pages, serialize_text_obj
from pedurma.utils import from_yaml... |
import networkx as nx
from modules import modules
# Defines a node in the adder graph
class adder_node():
# Nodes have an x position (bit), y position (level),
# the module they are representing (black, grey, etc),
# and two dictionary of edges
# Pre-conditions:
# x, y are integers
# module is a valid mo... |
# -*- coding:utf-8 -*-
import time
import argparse
import pickle
import sys, os
import random
import json
import torch
sys.path.append(os.getcwd().replace("src/dialogue_system/run",""))
from src.dialogue_system.agent import AgentRandom
from src.dialogue_system.agent import AgentDQN
from src.dialogue_system.agent impo... |
from dataclasses import *
from ..base import *
from ..emitter import *
from .context import *
#
# The magic of the frontend comes from wrapping model signals with a class that
# provides Python magic functions to manipulate them easily. For example, the
# __ilshift__ magic function, which handles the "<<=" operator ... |
######################################################.
# This file stores functions related #
# to the QCORR module #
######################################################.
import os
import glob
import pandas as pd
import json
import cclib
from pathlib import ... |
import os
import time
import traceback
from pathlib import Path
from threading import Thread
from typing import Tuple
from PyQt5.QtCore import Qt, QSize
from PyQt5.QtGui import QIcon, QPixmap, QIntValidator, QCursor
from PyQt5.QtWidgets import QRadioButton, QGroupBox, QCheckBox, QComboBox, QGridLayout, QWidget, \
... |
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
from builtins import str
import os
import json
import logging
import ipaddress
import requests
import shutil
import boto3
import hcl
from jinja2 import Environment, FileSystemLoader
from pprint import pprint
log... |
import numpy as np
import sys
import os
import pprint
from collections import OrderedDict
from datetime import datetime, timezone
from HSTB.kluster.gui.backends._qt import QtGui, QtCore, QtWidgets, Signal
class KlusterExplorer(QtWidgets.QTableWidget):
"""
Instance of QTableWidget designed to display the conv... |
from typing import Dict, Mapping, List, Tuple
import itertools
import demes
import numpy as np
import matplotlib
import matplotlib.patheffects
from . import utils
class Tube:
"""
A deme represented as a tube. The tube has a length along the time
dimension and a width equal to the deme's population size,... |
try: # Maya 2016
from PySide.QtCore import *
from PySide.QtGui import *
except ImportError:
try: # Maya 2017
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
except ImportError:
raise Exception('PySide import ERROR! Please instal... |
# PROGRAM: numcombine.py
# AUTOHOR: <NAME>
# DATE: December 12, 2003
# PURPOSE: --- We want to reproduce limited imcombine functionality ---
#
# License: http://www.stsci.edu/resources/software_hardware/pyraf/LICENSE
#
# HISTORY:
# Version 0.0.0: Initial Development -- CJH -- 12/30/03
# Version... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from quixote.errors import TraversalError, AccessError
from vilya.libs.template import st
from vilya.libs.signals import issue_signal, issue_comment_signal
from dispatches import dispatch
from vilya.models.elastic import SearchEngine
from vilya.models.el... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.