text stringlengths 8.04k 46.5k |
|---|
import regex as re
import sys
import os
import numpy as np
import shutil
import subprocess
import time
from .ASSO.BMF import BMF
class CombinationalLoop(Exception):
pass
class NoValidDesign(Exception):
pass
def evaluate_design(k_stream, worker, filename, display=True):
if display:
print('Evaluat... |
# Copyright 2021 Prayas Energy Group(https://www.prayaspune.org/peg/)
#
# 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... |
from collections import Counter
from random import Random
from typing import Tuple, TypeVar, Union, List, Dict, Collection
import numpy as np
from gym import spaces
from autograph.lib.envs.gridenv import GridEnv
from autograph.lib.envs.saveloadenv import SaveLoadEnv
from autograph.lib.util import element_add
class ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 <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 restriction, including without limitation the rights
#... |
#/usr/bin/python3
"""
Copyright 2019 <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 writing,... |
import pytest
from geometry_utils.three_d.edge3 import Edge3
from geometry_utils.three_d.path3 import Path3
from geometry_utils.three_d.point3 import Point3
from geometry_utils.two_d.axis_aligned_box2 import AxisAlignedBox2
from geometry_utils.two_d.edge2 import Edge2
from geometry_utils.two_d.path2 import Path2
from ... |
'''
<NAME>
'''
from __future__ import division
import torch
from torch import nn
import torch.nn.functional as F
from rigid_warp import inverse_warp_mof, pose_mof2mat, flow_warp
import math
import random
import numpy as np
from matplotlib import pyplot as plt
import pdb
device = torch.device("cuda") if torch.cuda.is... |
"""#########################################################################
Author: <NAME>
Institute: Stony Brook University
Descriptions: Tools to build an sequential VAE.
----2017.11.03
#########################################################################"""
import tensorflow as tf
from dl4s... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 15 14:20:54 2021
Efficiency pilot cell counting assistant. Based off of Pieter's cell annotator
used for the in vitro cell counting, but modified to handle images in one channel
from multiple imaging sessions'
@author: dpaynter
"""
# Imports
import tkinter as tk
from tki... |
import asyncio
import matplotlib.pyplot as plt
import os
import math
import discord
import time
import traceback
from discord import Embed, Color, File
from discord.ext import commands
from discord.ext.commands import cooldown, BucketType
from operator import itemgetter
from io import BytesIO
from data import dbconn
... |
from __future__ import annotations
import collections
import functools
import operator
from collections import Counter
from typing import Sequence
import toolz
import ibis.expr.lineage as lin
import ibis.expr.operations as ops
import ibis.expr.types as ir
from ibis import util
from ibis.common.exceptions import Expr... |
import job_helper
import click
@job_helper.job('toy2d_train', enumerate_job_names=False)
def train_toy2d(submit_config: job_helper.SubmitConfig, dataset, region_erode_radius, img_noise_std,
n_sup, balance_classes, seed,
sup_path, model, n_hidden, hidden_size, hidden_act, norm_layer,
... |
# -*- coding: utf-8 -*-
#
# This file is part of pyfesom2
# Original code by <NAME>, <NAME>, <NAME>,
# <NAME>, <NAME> and <NAME>
#
import json
import math as mt
from collections import OrderedDict
import matplotlib as mpl
import matplotlib.pylab as plt
import numpy as np
import pkg_resources
import shapely
import xa... |
#!/usr/bin/env python
'''
###############################################################################
STOCK ANALYSIS TOOL
###############################################################################
By: <NAME> (MrCerealKiller)
Date Last Updated: 29/08/2018
-----------------------------------------------... |
#!/usr/bin/env python3
#--coding:utf-8 --
"""
callCisLoops.py
2019-09-10: basically finished.
2019-09-26: due to low speed of XY object, now change the object way to function way. Do not kown why is so slow. Still same slow, change back to object method. The slow is due to blockDBSCAN called too many and too broad loop... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# @Authors: <NAME> (LM-ATC), <NAME> (OU), <NAME> (OU)
# @Description: This script models the way light diffracts in the GeoCarb instrument, and calculates the resulting Instrument Line Shape (ILS).
# @Output: None. The subsampled albedo file is modified inplace ... |
import numpy as np
import os
try:
import pybullet
import pybullet_data
pybullet_available = True
except ImportError:
pybullet_available = False
import pytransform3d.transformations as pt
# Quaternion convention: x, y, z, w
class PybulletSimulation:
def __init__(self, dt, gui=True, real_time=False... |
bl_info = {
"name": "Dagon Asset Export",
"author": "<NAME>",
"version": (1, 0),
"blender": (2, 7, 0),
"location": "File > Export > Dagon Asset (.asset)",
"description": "Export Dagon engine asset file",
"warning": "",
"wiki_url": "",
"tracker_url": "",
"category": "Imp... |
#
## this program indentifies and characterizes differentially spliced circRNAs
#
### import necessary libraries
import re,os,sys,logging,time,datetime,scipy,numpy,argparse;
#import random,
import subprocess;
#import fisher,mne; ## for p-value and FDR calculation
import pysam; ## use pysam package to acce... |
# coding: utf-8
"""
weasyprint.css
--------------
This module takes care of steps 3 and 4 of “CSS 2.1 processing model”:
Retrieve stylesheets associated with a document and annotate every element
with a value for every CSS property.
http://www.w3.org/TR/CSS21/intro.html#processing-model
T... |
import os
import ast
import unicodedata
from datetime import date, datetime, timedelta
from collections import namedtuple
from dateutil.relativedelta import relativedelta
from django.conf import settings
from django.contrib.auth.models import User
from django.db import IntegrityError, transaction
from django.shortcuts... |
import django.forms
from django.db import models
from datatableview.views import DatatableView
from datatableview import helpers
from django.forms.models import model_to_dict
import datetime
from django.contrib.auth.models import AbstractUser, Group
from simple_history.models import HistoricalRecords
import django_atla... |
"""Model initiallisation scripts
"""
import logging
from collections import defaultdict
import numpy as np
from energy_demand.basic import lookup_tables
from energy_demand.geography import spatial_diffusion
from energy_demand.read_write import read_data
from energy_demand.scripts import (s_fuel_to_service, s_generate_... |
import math
import time
import torch
from nitorch import io
from nitorch import spatial
from nitorch.core import utils, py
from nitorch.core.optionals import try_import
from .volumes import show_orthogonal_slices
# from .menu import Menu, MenuItem
# optional imports
plt = try_import('matplotlib.pyplot', _as=True)
grid... |
import datetime as dt
import itertools
import multiprocessing as mp
import pickle
import platform
import select
import socket
import sys
import time
import pytest
from mbedtls import hashlib
from mbedtls.exceptions import TLSError
from mbedtls.pk import RSA
from mbedtls.tls import *
from mbedtls.tls import _BaseConfi... |
"""
Python Navigation Abstract Class
@Author: <NAME>
@Author: <NAME>
"""
from abc import ABC
# from scipy import integrate
# from scipy.ndimage import interpolation
from spatialmath.base.transforms2d import *
from spatialmath.base.vectors import *
# from spatialmath import SE2, SE3
from matplotlib import cm
from abc... |
#! /usr/bin/env python3
import os
import json
import math
import yaml
import copy
import time
import shlex
import shutil
import random
import datetime
import subprocess
class Robot(object):
"""docstring for Robot"""
def __init__(self, n, loc, batt_level, skills, config):
super(Robot, self).__init__... |
# -*- coding:utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the ... |
#!/usr/bin/env python
"""
A pure python ping implementation using raw socket.
Note that ICMP messages can only be sent from processes running as root.
Derived from ping.c distributed in Linux's netkit. That code is
copyright (c) 1989 by The Regents of the University of California.
That code i... |
import torch
import torch.nn as nn
import time
import torch.nn.functional as F
# import hyperparams as hyp
# from utils_basic import *
class Pad(nn.Module):
# standard batchnorm, but allow packed (x,m) inputs
def __init__(self, amount):
super(Pad, self).__init__()
self.pad = nn.ConstantPad3d(am... |
#!/usr/bin/env python3
# 3dsconv.py by ihaveamac
# license: MIT License
# https://github.com/ihaveamac/3dsconv
import base64
import binascii
import glob
import hashlib
import itertools
import math
import os
import struct
import sys
import zlib
def main():
pass
def chb9(namevar):
if os.environ.get(namevar) ... |
# -*- coding: utf-8 -*-
import re
import sys
import os
from dotenv import dotenv_values
from pathlib import Path
from pathlib import PurePath
import shutil
from datetime import datetime
import frontmatter
import yaml
import argparse
import glob
sys.stdin.reconfigure(encoding="utf-8")
sys.stdout.reconfigure(encoding="... |
import time
try:
import json
except ImportError:
import simplejson as json
import MySQLdb as mysql
from MySQLdb.cursors import DictCursor
import warnings
import threading
from pegasus.metrics import app
# This is a thread local for storing the database connection. We use this
# instead of flask.g because fla... |
import numpy as np
import h5py
import copy
import pandas
import os
import imp
import pickle
import scipy.interpolate
import warnings
import time
import matplotlib.pyplot as plt
import inspect
import types
import warnings
def get_filenames(path, contains, does_not_contain=['~', '.pyc']):
cmd = 'ls ' + '"' + path + ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import copy
import io
import json
import logging
import os
import random
import re
import uuid
from collections import deque
from random import Ra... |
#!/usr/bin/env python3
import brewer2mpl
from pylab import *
from mpl_toolkits.axes_grid1 import make_axes_locatable
import scipy.ndimage
import matplotlib.pyplot as plt
import pylab
from scipy import interpolate
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
from matplotlib import colors as mcolors
... |
import numpy as np
import matplotlib
try:
# otherwise fails when trying to run in __name__ == "__main__
import matplotlib.pyplot as plt
except:
pass
from jsonextended import edict
from matplotlib import ticker
from matplotlib.axes import Axes
from matplotlib.figure import Figure
from matplotlib.cm import ge... |
import collections
from collections import Counter
import pandas as pd
import numpy as np
def main():
nanchors = 3
density = 0.471
charge_si = 0.6
atoms_per_anchor = 24
with open('final_pdb_{}.pdb'.format(density), 'r') as infile, open('data-file-sicnt-water-{}.data'.format(charge_si), 'w') as out... |
#!/usr/bin/env python3
# encoding: utf-8
# Copyright (c) 2016 <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, ... |
import os
import numpy as np
import scipy.optimize as optimize
import PyAstronomy.pyasl as pyasl
import astropy.units as units
import astropy.time as atime
import pydl.pydlutils.yanny as yanny
from .moonphase import moonphase2
from .sunpos2 import sunpos2
"""Copied from roboscheduler product for python 2 usage
Depend... |
from collections import OrderedDict
from wazimap.data.tables import get_model_from_fields, get_datatable
from wazimap.data.utils import (get_session, add_metadata, ratio, merge_dicts, group_remainder,
get_stat_data, get_objects_by_geo, percent)
from wazimap.geo import geo_data
PROFILE_SECTIONS = (
"demograph... |
'''
Copyright (c) 2021, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
'''
import torch
# from transformers import MT5ForConditionalGeneration, MT5Config, MT5EncoderModel, MT5Tok... |
#!/usr/bin/env python3
import argparse
import random
import sys
import string
import time
import numpy as np
def header(args, out=sys.stdout):
head_text = "# "+ time.ctime(time.time())
head_text += "\n# "+ ' '.join(args)
for outfile in out:
print(head_text, file=outfile)
FEATURES = 77
###FEATUR... |
'''
Due to memory constraints all operations involving the actual sequence are here.
This module contains code to: calculate energy surplus and deficit and calculate
sequence energy over a random sequence.
'''
import random
from collections import deque
# from tqdm import trange
trange = range
from collect... |
# Copyright (c) 2021 Horizon Robotics and ALF Contributors. 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... |
import os
import dgl
import dgl.ops as OPS
import backend as F
import unittest
import torch
from torch.utils.data import DataLoader
from collections import defaultdict
from collections.abc import Iterator
from itertools import product
import pytest
def _check_neighbor_sampling_dataloader(g, nids, dl, mode, collator):
... |
import os
import os.path
import sys
import tempfile
import bdeunittest
from waflib.TaskGen import feature, after_method, before_method
from waflib import Errors, Utils, Options, Task, Logs
from waflib.Build import BuildContext
class BdeWafBuild(object):
def __init__(self, ctx):
self.ctx = ctx
se... |
import torch
import torch.nn as nn
import torch.nn.functional as F
DEVICE = torch.device('cuda')
class Selection(nn.Module): # switchに関する演算を行う。
def __init__(self, in_channels, reduction, save_device=torch.device('cpu')):
super(Selection, self).__init__()
self.save_device = save_device
s... |
import os, os.path, errno, sys, traceback, subprocess
import re, html.entities
import json
import logging
import yaml
from bs4 import BeautifulSoup
from datetime import datetime
import requests
import urllib.parse
import io
import gzip
import docx
import zipfile
from urllib.parse import urljoin
import inspect
import pd... |
########## The following part is copied from Transformers' trainer (3.4.0) ##########
# coding=utf-8
# Copyright 2020-present the HuggingFace Inc. team.
#
# 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... |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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 version.
T... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
# Copyright (c) 2018, salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""run_oracle.py: calculates oracle ROUGE score by selecting oracle sentence set
greedily. The algorit... |
#!/usr/bin/env python3
"""Process includes and variable substitutions in a YAML file.
For each value ``{"INCLUDE": "filename.yaml"}``, load content from include file
and substitute the value with the content of the include file.
For each string value with ``$NAME`` or ``${NAME}`` syntax, substitute with
value of corr... |
#!/usr/bin/env python3
# Copyright 2017 Klarna Bank AB
# Copyright 2020 Qliro AB
#
# 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
#
# Unles... |
# -*- coding: utf-8 -*-
import os
import logging
import shutil
import uuid
import zipfile
import tempfile
from collections import OrderedDict
from django import forms
from django.db import models, transaction
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from dj... |
from __future__ import print_function
import sys
import os
import datetime as dt
import autowrf_classlib as WRF
from autowrf_classlib import UI
import pdb
if sys.version_info.major == 3:
raw_input = input
def MyPath():
return os.path.dirname(os.path.abspath(__file__))
def NamelistsPath():
return os.pa... |
#
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2021 PyMeasure Developers
#
# 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 limit... |
'''
Copyright (c) 2019 Memorial Sloan-Kettering Cancer Center.
This script is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
any later version.
This script is distribut... |
import os
from os.path import join
import csv
import cv2, copy
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
from PIL import Image
import torchaudio
import sys
from scipy.io import wavfile
import json
def read_sal_text(txt_file):
test_list =... |
#! python3
# -*- coding: utf-8
"""
BLASTparse.py
Created on Mon Dec 14 14:54:15 2020
Descrition:
Parse a Single-file JSON BLAST output for the best match of each sequence and
uses the fasta sequences of the samples to classify them in folder names with
the closest genus identified with the BLAST search.
Output a CSV... |
# Copyright 2020 <NAME>
nbtPath = '../lib/NBT'
import sys
import copy
sys.path.append(nbtPath+'/nbt')
import nbt
from nbt import *
# Validates structure size
def checkStructSize(structSize):
for x in range(0,3):
if int(structSize[x]) > 32 or int(structSize[x]) < 1:
return False
return True
# Validates structur... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (print_function, division)
from six.moves import range
import numpy as np
from scipy.ndimage import gaussian_filter as norm_kde
import matplotlib.pyplot as pl
from matplotlib.ticker import MaxNLocator, NullLocator
from matplotlib.ticker ... |
#!/usr/bin/env python
"""
Advent of Code 2020: Day 20
"""
import os
import sys
import itertools
from pathlib import Path
from typing import Iterator
import operator
import functools
from collections import defaultdict
DEBUG = False
SIDES = ('N', 'E', 'S', 'W')
MATCHING_CORNERS: tuple = (('E', 'S'), ('S', 'W'), ('W',... |
from __future__ import unicode_literals
from collections import namedtuple, OrderedDict
import logging
import warnings
from django.conf import settings
from django.contrib.auth import get_user_model
from django.shortcuts import get_object_or_404
from rest_framework import mixins, status as status_codes, viewsets
from ... |
import json
from itertools import product
import platform
import sys
import os
DICTIONARY = open('DICTIONARY.json')
CONF = open('CONF.json')
config = json.load(CONF)
words = json.load(DICTIONARY)
if platform.system() == 'Windows':
clr = lambda: os.system('cls')
os.system('color 04')
elif platform.system() == ... |
#!/usr/bin/env python3
#-*- coding: iso-8859-1 -*-
###############################################################################
#
# This module implements the performance graph displaying HTTP interface.
# If the "performance" interface has been started in config_interfaces.py,
# this module is called to process HTT... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : action_classification_softmax.py
# Author : <NAME>
# Email : <EMAIL>
# Date : 08/02/2021
#
# This file is part of TOQ-Nets-PyTorch.
# Distributed under terms of the MIT license.
import math
import os
import pickle
import time
import numpy as np
import torc... |
"""
the flask extension
"""
import datetime
import enum
import itertools
import logging
import time
from functools import wraps
from typing import Callable, Dict, List, Optional, Set, Tuple, Union, cast
from weakref import ref
from flask import Blueprint, Flask, Response, current_app, g, request
from limits import Rat... |
import argparse
from statistics import median_high, median_low
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from qpputils import dataparser as dt
# Define the Font for the plots
# plt.rcParams.update({'font.size': 35, 'font.family': 'serif', 'font.weight': 'normal'})
# Define the Font for ... |
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptions to ... |
# -*- coding: utf-8-*-
from tkinter import *
import threading
import logging
import argparse
from collections import namedtuple, deque
MINIMAX_GLOBINA = 3
VELIKOST = 5
MODRI = 'M'
RDECI = 'R'
PRAZNO = 'PRAZNO'
seznam = []
ZMAGOVALEC = None
NI_KONEC = "ni konec"
NEODLOCENO = "neodloceno"
radij = 20.
premik = radij*.87... |
#!#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Utility methods related to Maya deformer nodes
"""
from __future__ import print_function, division, absolute_import
import re
import logging
import maya.cmds
import maya.OpenMaya
import maya.api.OpenMaya
import maya.api.OpenMayaAnim
from tpDcc.libs.python import... |
#! /usr/bin/env python3
# -*- coding: UTF-8 -*-
#---------------------------------------------------------------------------------------------------
import sys, os, subprocess, shutil, json
#---------------------------------------------------------------------------------------------------
import makefile
import com... |
'''
Wrapper to C++ tool madym_DCE_lite
'''
import numpy as np
import warnings
from tempfile import TemporaryDirectory
import subprocess
import os
from QbiMadym.utils import local_madym_root
def run(model=None, input_data=None,
cmd_exe:str = None,
output_dir:str = None,
output_name:str = 'madym_analysis.da... |
# -*- coding: utf-8 -*-
'''
CRISPResso2 - <NAME> and <NAME> 2018
Software pipeline for the analysis of genome editing outcomes from deep sequencing data
(c) 2018 The General Hospital Corporation. All Rights Reserved.
'''
import argparse
import gzip
import os
import re
from copy import deepcopy
import string
import su... |
#!/usr/bin/env python
"""
corpus_compare.py
Generate a document similarity report.
1. Accepts a list of one or more file paths. Within those paths (recursive):
2. All text files matching pattern (*.txt by default) are described within the set using tf-idf
(term frequency--inverse document frequency)
3. The se... |
# imports
# -----------------------------------------------------------------
import json
import sys
from kivy.core import window
from costum_modules.HOLIDAYS import *
from kivymd.uix.behaviors.toggle_behavior import MDToggleButton
from costum_modules.NOTIFICATIONS import *
from kivy.lang import Builder
from kivy.pr... |
# -*- coding: utf-8 -*-
"""
Description :
Give the geolocation of a MODIS 1km pixel specified by its indices [i_1km_along_track, i_1km_cross_track] for products where the (latitude, longitude) datasets are given at 5km resolution
For the interpolation of the 1km positions, it takes care of borders of scan. In ... |
#%%
import os
import sys
try:
os.chdir('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')
print(os.getcwd())
except:
pass
# %%
import sys
sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/maggot_models/')
sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')
fr... |
from featureMan.lib.properties import glyphBase, glyphProperty
from featureMan.lib.tags import languageTags
import re
from itertools import permutations
rtlScripts = set(['arab', 'hebr', 'syrc', 'thaa'])
def wrap(string, width=70):
comment = ''
if string[0] == '#':
comment = '# '
if string:
... |
# Copyright (C) 2021, Pyronear contributors.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
"""
The following Python file is dedicated to the "Alerts and Infrastructure" view of the dashboard.
After a f... |
import cv2
import xml.etree.ElementTree as ET
from GeoPointCloud import GeoPointCloud
import json
import math
import numpy as np
import overpy
import time
import tgc_definitions
status_print_duration = 1.0 # Print progress every N seconds
spline_configuration = None
# Returns left, top, right, bottom
def nodeBoundi... |
'''
Created on Jun 16, 2017
@author: husensofteng
'''
import matplotlib
matplotlib.use('Agg')
import math
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import pandas as pd
import numpy as np
import sys, os
from scipy import stats
from multiprocessing import Pool
import seaborn as sns
from util... |
import asyncio
import enum
import random
import logging
from collections import namedtuple, deque, defaultdict
from .utils import id_generator, prefix_for_id
def get_default_logger():
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
log.propagate = False
if log.hasHandlers():
ret... |
import numpy as np
import random
import pandas as pd
from openpyxl import load_workbook
from openpyxl.styles import PatternFill, Border, Side, Alignment, Protection, Font, NamedStyle, NumberFormatDescriptor, Color
from openpyxl.styles.differential import DifferentialStyle
from openpyxl.formatting import rule
fro... |
from datetime import datetime, timedelta
import operator
import pickle
import unittest
import numpy as np
from pandas.core.index import Index, Factor, MultiIndex, NULL_INDEX
from pandas.util.testing import assert_almost_equal
import pandas.util.testing as tm
import pandas._tseries as tseries
class TestIndex(unittest... |
import cv2
import matplotlib.pyplot as plt
import numpy as np
from sklearn.mixture import GaussianMixture
import math
from scipy.ndimage import affine_transform
from scipy.signal import argrelmin, argrelmax
import concurrent.futures as cf
import time
import argparse
import sys
sys.path.insert(0, '//homer.uit.no/bpe043... |
# encoding: utf-8
# module win32security
# from C:\Python27\lib\site-packages\win32\win32security.pyd
# by generator 1.147
# no doc
# imports
from pywintypes import error
# Variables with simple values
ACCESS_ALLOWED_ACE_TYPE = 0
ACCESS_ALLOWED_OBJECT_ACE_TYPE = 5
ACCESS_DENIED_ACE_TYPE = 1
ACCESS_DENIED_OBJECT_... |
# coding=utf-8
#
# Copyright 2015-2016 F5 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 la... |
import json
import re
import textwrap
from functools import partial
import pytest
import pytestqt.exceptions
from _pytest.compat import nullcontext
from PyQt5.QtCore import QByteArray
from PyQt5.QtCore import QDataStream
from PyQt5.QtCore import QIODevice
from PyQt5.QtCore import QMimeData
from PyQt5.QtCore import QPo... |
import datetime
from collections import namedtuple
from collections import Counter
from django.contrib.auth.models import User
from django.core.cache import cache
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.db.models.signals import pre_delete, post_delete, m2m_changed... |
# Copyright 2019 <NAME>
"""
Defines the CharmmGeneral class for dealing with
CHARMM General Force Field parameters and atomic systems.
Ref: <NAME> et al., J. Comp. Chem., 2009.
"""
from files.main import File
from files.xyz import Xyz
from atoms import AtomType, BondType, AngleType, DihedralType, ImproperType
from ... |
import test_looper.core.algebraic as algebraic
import test_looper.core.algebraic_to_json as algebraic_to_json
from test_looper.core.hash import sha_hash
import threading
import logging
import uuid
import traceback
import time
_encoder = algebraic_to_json.Encoder()
_encoder.allowExtraFields = True
_cur_view = threadin... |
"""
Obtain information about IAM (policies and permissions) from cloud providers.
"""
import os
import sys
import select
import typing
import argparse
import json
import requests
import logging
from functools import lru_cache
from botocore.exceptions import ClientError
from dcplib.security import DCPServiceAccountMan... |
import torch.autograd.function as function
import torch._C
from torch import Tensor
from torch.autograd import Variable
from torch.nn import Module, ParameterList, Parameter
from torch._six import raise_from
from collections import defaultdict
from . import passes as _passes
import warnings
import itertools
import type... |
import re
import os
import ruamel.yaml as yaml
from markdown import markdown, Markdown
from .base import Command
from io import StringIO
def unmark_element(element, stream=None):
"""Markdown renderer that ignores markup and outputs only plain text.
"""
if stream is None:
stream = StringIO()
if ... |
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
def network_edge_server_random_placement(G_nodes, pos_node, T_percentage, S_percentage, L_percentage, rnd=None):
if not rnd:
rnd = np.random.RandomState(3)
assert isinstance(rnd, np.random.RandomState)
T_node = [n for n in G... |
from functools import wraps
from typing import Callable, TypeVar, cast
import numpy as np
from numba import njit
from numfun.barycentric import barycentric_interpolation
F = TypeVar('F', bound=Callable)
def complexify(g: F) -> F:
"""Decorator to apply g on real and imaginary parts and the return th... |
import glob
import pydicom
import os
import nibabel as nib
import subprocess as sp
import numpy as np
from collections import defaultdict
from nipype.interfaces.base import (
BaseInterface, TraitedSpec, Directory,
BaseInterfaceInputSpec, traits, InputMultiPath)
from nipype.interfaces.base import isdefined
impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.