text stringlengths 6.04k 39.5k |
|---|
import os
import sys
import subprocess
import signal
import string
import re
from datetime import datetime
from pathlib import Path
import random
import torch
import torch.nn.functional as F
from torch import nn
from torch.optim import Adam
from torchvision.utils import save_image
import torchvision.transforms as T
f... |
# -*- coding: utf-8 -*-
from mathics.builtin.base import Builtin, Predefined
from mathics.core.expression import Expression
from mathics.core.symbols import (
Symbol,
fully_qualified_symbol_name,
)
from mathics.core.atoms import (
String,
Integer,
)
from mathics.builtin.assignments.internals import g... |
# -*- coding: utf-8 -*-
"""
ambari_jinja2.testsuite.ext
~~~~~~~~~~~~~~~~~~~~
Tests for the extensions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import unittest
from ambari_jinja2.testsuite import JinjaTestCase, filesystem_loader
from amba... |
import math
import logging
import copy
from typing import List, Tuple, Dict
import torch
import numpy as np
from torch import Tensor
from torch import nn
import torch.nn.functional as F
from fvcore.nn import sigmoid_focal_loss, smooth_l1_loss, giou_loss
from detectron2.layers import ShapeSpec, cat, nonzero_tuple, ba... |
# Natural Language Toolkit: Collections
#
# Copyright (C) 2001-2021 NLTK Project
# Author: <NAME> <<EMAIL>>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
import bisect
from itertools import islice, chain
from functools import total_ordering
# this unused import is for python 2.7
from collection... |
# Copyright 2009-2013 by <NAME>. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
#
# This unit test attempts to locate the blastall executable and the nr
# database.
"""Tests fo... |
#!/usr/bin/env python
# encoding: utf-8
"""
gaetk2/admin/options.py
Created by <NAME> on 2011-08-22.
Copyright (c) 2011, 2014 HUDORA GmbH. All rights reserved.
"""
import cgi
import collections
import datetime
import logging
import gaetk.handler
from gaetk import compat, modelexporter
from gaetk.admin import util
fro... |
"""
Uname - command ``uname -a``
============================
The ``Uname`` class reads the output of the ``uname -a`` command and
interprets it. It also does a number of handy extra things, like deriving
the RHEL release from the kernel version.
Uname objects can also be compared by their kernel versions.
An examp... |
from threading import Thread
from extra import *
import time
import datetime
import sys
import queue
from services import services
import argparse
def local_ip():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('8.8.8.8', 1))
return s.getsockname()[0]
def dedicate_local_port():
s = s... |
import datetime
import asyncio
import gzip
import json
import urllib.parse
import bisect
from urllib.parse import parse_qs
import yarl
import pendulum
from ccxt import huobipro
from uxapi import register_exchange
from uxapi import UXSymbol
from uxapi import WSHandler
from uxapi import UXPatch
from uxapi import Queue
... |
"""
Helper methods for generating k8s API objects.
"""
import json
from urllib.parse import urlparse
import escapism
import re
import string
from kubespawner.utils import get_k8s_model, update_k8s_model
from kubernetes.client.models import (
V1Pod, V1PodSpec, V1PodSecurityContext,
V1ObjectMeta,
V1LocalObje... |
import asyncio
import collections.abc
import datetime
import enum
import json
import math
import time
import warnings
import zlib
from concurrent.futures import Executor
from http.cookies import Morsel
from typing import (
TYPE_CHECKING,
Any,
Dict,
Iterator,
Mapping,
MutableMapping,
Optional... |
# -*- coding: utf-8 -*-
from radish import world, given, when, then, step
from terraform_compliance.steps import property_match_list
from terraform_compliance.common.helper import check_sg_rules, convert_resource_type, find_root_by_key, seek_key_in_dict
from terraform_compliance.common.helper import seek_regex_key_in_... |
"""
These routines are not well-tested. They are also old.
OB says that it is not important to test them well because Scalar Ops
are rarely used by themselves, instead they are the basis for Tensor Ops
(which should be checked thoroughly). Moreover, Scalar will be changed
to use numpy's scalar routines.
If you do want ... |
# Copyright (c) 2016 PaddlePaddle 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 applic... |
import demistomock as demisto
import dateparser
import urllib3
from MicrosoftApiModule import *
urllib3.disable_warnings()
''' GLOBAL VARS '''
INTEGRATION_NAME = 'Azure Active Directory Identity and Access'
OUTPUTS_PREFIX = "AADIdentityProtection"
BASE_URL = 'https://graph.microsoft.com/beta'
REQUIRED_PERMISSIONS ... |
import numpy as np
import torch
import glob
import torch.nn.functional as F
from torch.distributions import Categorical
from envs.abb.models.model import Critic, Actor1D, ANN, add_randn
if torch.cuda.is_available():
torch.cuda.empty_cache()
# device = torch.device("cuda" if torch.cuda.is_available() else "c... |
"""
For information on the Elsevier API, see:
- API Specification: http://dev.elsevier.com/api_docs.html
- Authentication: https://dev.elsevier.com/tecdoc_api_authentication.html
"""
import os
import logging
import textwrap
import datetime
import xml.etree.ElementTree as ET
import requests
from time import sleep
fr... |
"""Provides some utilities widely used by other modules"""
import bisect
import collections
import collections.abc
import functools
import operator
import os.path
import random
import math
# ______________________________________________________________________________
# Functions on Sequences and Iterables
def seq... |
from numbers import Number
import numpy as np
from ._c99_config import _have_c99_complex
from ._extensions._pywt import Wavelet, Modes, _check_dtype, wavelist
from ._extensions._dwt import (dwt_single, dwt_axis, idwt_single, idwt_axis,
upcoef as _upcoef, downcoef as _downcoef,
... |
########################################################################################
## ##
## THIS LIBRARY IS PART OF THE SOFTWARE DEVELOPED BY THE JET PROPULSION LABORATORY ##
## IN THE CONTEXT OF THE GPU ACCELERATED FLEXIBLE RA... |
# -*- coding: utf-8 -*-
"""
Penguin Drop - Don't let the ice break!
Tip: You have to hit the penguins; hitting a parachute will do nothing!
"""
###### SETTINGS ######
### Adjust window ###
SCREEN = 1200, 700 #Canvas size in pixels.
### Adjust difficulty ###
MAX_PENGUINS = 10 #Max number of penguins bef... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Utility module that contains useful utilities functions for resources
"""
from __future__ import print_function, division, absolute_import
import os
import re
import sys
import logging
import subprocess
from xml.etree import ElementTree
try:
from cStringIO impo... |
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2018, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... |
"""
Copyright 2018, Oath Inc.
Licensed under the terms of the Apache 2.0 license. See LICENSE file in project root for terms.
This module implements a Panoptes Plugin that can poll Cisco NX-OS devices for Device Metrics
"""
import math
import re
from cached_property import threaded_cached_property
from yahoo_panopte... |
#
# distDocker.py
#
# Implements the Tango VMMS interface to run Tango jobs in
# docker containers on a list of host machines. This list of
# host machines must be able to run docker and be accessible
# by SSH. The IP address of the host machine is stored in the
# `domain_name` attribtue of TangoMachine.
#
import rand... |
"""
Solitaire clone.
"""
import random
import arcade
# Screen title and size
SCREEN_WIDTH = 1024
SCREEN_HEIGHT = 768
SCREEN_TITLE = "Drag and Drop Cards"
# Constants for sizing
CARD_SCALE = 0.6
# How big are the cards?
CARD_WIDTH = 140 * CARD_SCALE
CARD_HEIGHT = 190 * CARD_SCALE
# How big is the mat we'll place the... |
import cupy as cp
import numpy as np
from skimage import data
from cupyimg.scipy import ndimage as ndi
from cupyimg.skimage import color, transform
from cupyimg.skimage.util import img_as_uint, img_as_ubyte
from cupyimg.skimage.morphology import grey, selem
from skimage._shared._warnings import expected_warnings
from ... |
# Copyright (c) 2020 PaddlePaddle 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 app... |
import sys
import os
import pandas as pd
import kauffman.constants as c
from kauffman.data import acs, bfs, bds, pep, bed, qwi, shed
pd.set_option('max_columns', 1000)
pd.set_option('max_info_columns', 1000)
pd.set_option('expand_frame_repr', False)
pd.set_option('display.max_rows', 40000)
pd.set_option('max_colwidth'... |
#
# Copyright (C) 2013 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
# Main unittest module used by testimage.bbclass
# This provides the oeRuntimeTest base class which is inherited by all tests in meta/lib/oeqa/runtime.
# It also has some helper functions and it's responsible for actually starting the tests
... |
"""
Scrapy engine tests
This starts a testing web server (using twisted.server.Site) and then crawls it
with the Scrapy crawler.
To view the testing web server in a browser you can start it by running this
module with the ``runserver`` argument::
python test_engine.py runserver
"""
import os
import re
import sy... |
import os
import sys
import time
import glob
import numpy as np
import torch
import utils
import logging
import argparse
import torch.nn as nn
import torch.utils
import torch.nn.functional as F
import torchvision.datasets as dset
import torch.backends.cudnn as cudnn
import copy
from model_search import Network
from gen... |
# Copyright 2018 The TensorFlow Probability 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 o... |
import sys
import os
import time
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
from events import LazydogEvent
from states import LocalState
from watchdog.events import (
FileCreatedEvent,
DirCreatedEvent,
FileMovedEvent,
DirMovedEvent,
FileDeletedEvent,
DirDeletedEvent,
EVE... |
# Simple one-layer model with a drn and sfr network on top. Purpose is to
# test movement of solute between stress and advanced packages. In this case
# water from a drain is moved into the first sfr reach. The test confirms
# that the solute from the drain is moved into the sfr reach.
# There is no flow between the... |
#--------------------------------
# Name: gridmet_daily_variables.py
# Purpose: Extract GRIDMET variables
#--------------------------------
import argparse
import datetime as dt
import logging
import os
import re
import sys
import drigo
import netCDF4
import numpy as np
from osgeo import gdal
import _ut... |
#!/usr/bin/env python
# ===================================
# Copyright (c) Microsoft Corporation. All rights reserved.
# See license.txt for license information.
# ===================================
from contextlib import contextmanager
import os
import sys
import codecs
import imp
import grp
import copy
import fnma... |
# Copyright (C) 2003-2017 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... |
# [h] hTools2.modules.fontutils
"""A collection of useful functions for working with fonts."""
# imports
import os
from random import randint
try:
from mojo.roboFont import CurrentGlyph, CurrentFont, NewFont
from lib.tools.defaults import getDefault
except:
from fontParts.world import CurrentGlyph, Cu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/plugins.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this lis... |
"""
Robot blocks:
- have inputs and outputs
- are a subclass of ``FunctionBlock`` |rarr| ``Block`` for kinematics and have no states
- are a subclass of ``TransferBlock`` |rarr| ``Block`` for dynamics and have states
"""
# The constructor of each class ``MyClass`` with a ``@block`` decorator becomes a method ``MYCLASS... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import io
import re
import warnings
import astropy.coordinates as coord
import astropy.units as u
import astropy.units.cds as cds
import numpy as np
from astropy.coordinates import SkyCoord
from astropy.io import ascii
from astropy.io.votabl... |
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 23 15:00:10 2013
Copyright (c) 2013-2017, CEA/DSV/I2BM/Neurospin. All rights reserved.
@author: <NAME>
@email: <EMAIL>
@license: BSD 3-clause.
"""
import time
import hashlib
import os.path
import argparse
import warnings
import collections
import numpy as np
import ... |
# Code for "TSM: Temporal Shift Module for Efficient Video Understanding"
# arXiv:1811.08383
# <NAME>*, <NAME>, <NAME>
# {jilin, <EMAIL>, <EMAIL>
# Notice that this file has been modified to support ensemble testing
import argparse
import time
import glob
import os
import torch.nn.parallel
import torch.optim
from sk... |
import simpy
from collections import namedtuple, Counter
from itertools import count, filterfalse
import random
import math
import json
####################################################
########## CREATING THE WAFER CLASS ###############
####################################################
class wafer_box(object)... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import re
from timeit import timeit
from psutil import Process
from lxml import etree
from os.path import dirname, abspath, join as pjoin
shome = abspath(pjoin(dirname(__file__), ".."))
sys.path.insert(0, pjoin(shome, "build"))
sys.path.insert(0, pjo... |
"""
OceanSpy utilities that don't need OceanDataset objects.
"""
import copy as _copy
import numpy as _np
# Required dependencies (private)
import xarray as _xr
# From oceanspy (private)
from ._ospy_utils import _check_instance
# Recommended dependencies (private)
try:
from geopy.distance import great_circle a... |
# Copyright 2019-2021 Cambridge Quantum Computing
#
# 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 a... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from os.path import join, dirname
sys.path.insert(0, join(dirname(__file__), '..'))
sys.path.insert(0, join(dirname(__file__), '../../'))
sys.path.insert(0, join(dirname(__file__), '../../../'))
import os
import random
import argparse
import numpy as np
from dat... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) BaseDetection, Inc. and its affiliates. All Rights Reserved
import json
import os
import numpy as np
PERSON_CLASSES = ['background', 'person']
class Image(object):
def __init__(self, mode):
self.ID = None
self._width = None
... |
#!/usr/bin/env python3
# Copyright 2016 UCSC Computational Genomics Lab
# Original contributor: <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/LI... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import numpy as np
from skimage.util import view_as_windows
import warnings
import tensorflow as tf
from tensorflow.python.framework import ops
from tensorflow.python.ops import nn_grad, math_grad
fr... |
from Bio import SeqIO
import sys, os, re
import numpy as np
import pandas as pd
from os import listdir
from os.path import isfile, join
from collections import namedtuple, defaultdict
from tqdm import tqdm, tnrange
from joblib import Parallel, delayed
import multiprocessing
import gzip
from IPython.display import displ... |
# coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... |
"""
Link edge points in an image to lists.
Convert from matlab code, author is <NAME>
Please see https://www.peterkovesi.com/matlabfns/
Copyright (c) 2018- <NAME>
mingzilaochongtu at gmail com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation fi... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2022 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import numpy as np
import pandas as pd
from pandapower.auxiliary import _sum_by_group
from pandapower.pypower.idx_bus i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Fitting functions for use in The Cannon.
"""
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__all__ = ["fit_spectrum", "fit_pixel_fixed_scatter", "fit_theta_by_linalg",
"chi_sq", "L1Norm_variation"]
i... |
# SPDX-License-Identifier: MIT
# Copyright (C) 2004-2008 <NAME> and <NAME>
# Copyright (C) 2012-2014 <NAME>
# Copyright (C) 2015-2021 <NAME>
# Copyright (C) 2019-2020 <NAME>
from re import compile, escape
from ..scraper import _BasicScraper, _ParserScraper
from ..helpers import bounceStarter, indirectStarter
from ..ut... |
import tensorflow as tf
from util import readPFM
import numpy as np
import os
LEAKY_ALPHA = 0.1
MAX_DISP = 40
MEAN_VALUE = 100.
INPUT_SIZE = (384, 768, 3)
initializer = tf.contrib.layers.xavier_initializer_conv2d(uniform=False)
REPO_DIR = os.path.dirname(os.path.abspath(__file__))
shift_corr_module = tf.load_op_libr... |
import os
from shutil import make_archive, rmtree
from time import sleep
import numpy as np
import torch
from torch.utils.data import DataLoader
from PIL import Image
import segmentation_models_pytorch as sm
def get_model(args):
model = eval("sm." + args.network_name)(encoder_name=args.backbone, classes=args.n_... |
try:
import pickle as pickle
except ImportError:
import pickle
from bisect import bisect_right
from collections import defaultdict
from copy import deepcopy
from functools import partial
from itertools import chain
from operator import eq
def identity(obj):
"""Returns directly the argument *obj*.
"... |
# DRAWING PROGRAM BY saran
# main.py file (RUN THIS)
# Description: This program draws a grid of 600, 600 with a given
# pixel size/rows and cols. The user can then interact with the grid
# using a variety of tools from the menu bar on the bottom. They can draw
# by selecting a color from the pallet and clicking t... |
# -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749.parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains methods related to `Section 4`_ of the OAuth 2 RFC.
.. _`Section 4`: https://tools.ietf.org/html/rfc6749#section-4
"""
import json
import os
import time
from oauthlib.common import add_params_to_qs,... |
import json
import logging
import os
import sys
from dataclasses import dataclass, field
from typing import Callable, Dict, List, Optional, Tuple
from collections import defaultdict
import numpy as np
import torch
from seq2seq_trainer import Seq2SeqTrainer
from transformers import (
AutoConfig,
AutoModelForSe... |
from Models.initialize import *
import Models.MsWordModel as WM
import Models.ImportModel as IM
directory = project_root + '/docx_files'
filenames = os.listdir(directory)
org_sheet = IM.original()
possible_types = {'Peer-reviewed publication':
['peer-reviewed publications', 'bedömda artiklar'... |
# -*- coding: utf-8 -*-
# Coded in Python 3.8.7 64-Bit
# Use standard python package only.
import random
import math
import numpy as np
import matplotlib.pyplot as plt
# This is purely so I can actually see the damn colours
import matplotlib as mpl
mpl.style.use('seaborn')
# This is to stop Division by Zero warnings... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
from torch.optim.lr_scheduler import MultiStepLR
import shutil
import random
from numpy import linalg as LA
from scipy.stats import mode
import collections
import tqdm
import os
from architecture import *
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# ----------------------... |
import collections
import csv
import glob
import logging
import os
import random
from typing import Dict, List, Tuple
import hydra
import jsonlines
import numpy as np
import torch
from omegaconf import DictConfig
from torch import Tensor as T
from dpr.data.tables import Table
from dpr.utils.data_utils import read_dat... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Script to compute all of the Diffusion Tensor Imaging (DTI) metrics.
By default, will output all available metrics, using default names. Specific
names can be specified using the metrics flags that are listed in the "Metrics
files flags" section.
If --not_all is set,... |
import logging
LOG_FORMAT = '[%(levelname)s] %(message)s'
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
logging.disable(logging.CRITICAL)
logging.debug("Imported Logging")
from tkinter import *
logging.debug("Imported tkinter *")
import os
logging.debug("Imported os")
import sys
logging.debug("Imported s... |
# -*- coding: utf-8 -*-
from __future__ import division
__copyright__ = """
Copyright (C) 2014 <NAME>
Copyright (c) 2016 Polyconseil SAS. (the WSGI wrapping bits)
Copyright (C) 2019 <NAME>
"""
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associat... |
from typing import Tuple
from collections import deque
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from power_fist.n11_lovasz_losses import LovaszHingeLoss_elu
class FocalLoss(nn.Module):
def __init__(self, gamma=2, size_average=True):
super... |
import os
import numpy as np
from tqdm import tqdm
import argparse, time, pickle
import torch
import torch.nn as nn
import torch.optim as optim
from utils import pretrained_matrix
from dataloader import DialogLoader
from model import End2EndModel, MaskedNLLLoss
from torchnlp.encoders.text import SpacyEncoder
from sklea... |
import re
import logging
import datetime
import time
import socket
import collections
import json
import zmq.green as zmq
import pymongo
from socketio import socketio_manage
from socketio.mixins import BroadcastMixin
from socketio.namespace import BaseNamespace
from lib import config, util
onlineClients = {} #key = ... |
"""Module for the Routing System."""
import cgi
import importlib
import json
import re
from .exceptions import RouteMiddlewareNotFound, InvalidRouteCompileException, RouteException
from .view import View
class Route:
"""Route class used to handle routing."""
route_compilers = {
'int': r'(\d+)',
... |
from .global_defs import *
from .data_helpers import *
from . import config
def save_fig(fig, base_name, also_in_report_folder=True):
if also_in_report_folder:
path = f'{config.REPORT_FOLDER}/{base_name}_{config.FIGURE_CODE}.pdf'
fig.savefig(path, pad_inches=.1, bbox_inches='tight',)
print(... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#TODO : save only fig ?
#TODO : update hbond graph when changing cutoff values
#TODO : check if angle is OK.
#TODO : Hbonds, use the selection....
#TODO : analyse
# - RG
# - RDF
# - salt bridges
# - cation-pi
import io
import os
import pickle
import... |
"""
@author <NAME>
This file contains some specialized but also general purpose
functions for plotting and saving pyplots
NOTE: This currently overwrites matplotlibs default style
to show some more axes and to be less plain.
NOTE2: Needs matplotlib 3.3+ for some methods
"""
import matplotlib
import matplotlib.pyplo... |
"""
TCGPlayer 3rd party provider
"""
import enum
import json
import logging
import pathlib
from typing import Any, Dict, List, Optional, Tuple, Union
import requests
from singleton_decorator import singleton
from ..classes import MtgjsonPricesObject, MtgjsonSealedProductObject
from ..providers.abstract import Abstrac... |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... |
import os
import logging
import tempfile
from sevenbridges.errors import (
SbgError,
ResourceNotModified,
LocalFileAlreadyExists
)
from sevenbridges.meta.fields import (
HrefField, StringField, IntegerField, CompoundField, DateTimeField,
BasicListField
)
from sevenbridges.meta.resource import Resou... |
# Copyright 2015 Brocade Communications System, 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
#
# ... |
from utils.vocab import Vocab
from utils.util import initialize_weights, set_seed, count_parameters, save_params, build_vocab
import utils.constants as constants
from utils.loss import LabelSmoothing, LossCompute
from utils.optimizer import NoamOpt
from Dataloader import ParallelDataset, get_dataloader
from Translate... |
# (C) British Crown Copyright 2017, Met Office.
# Please see LICENSE.rst for license details.
"""
primavera-val
Simple data validation tests for PRIMAVERA stream 1 data files.
Requires:
Iris: http://scitools.org.uk/iris/
Tested under Iris 1.10 as installed at JASMIN
"""
from __future__ import unicode_lite... |
import copy
import json
import os
import time
import zipfile
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime
from enum import Enum
from tempfile import TemporaryDirectory
from typing import Optional
from requests.exceptions import HTTPError
from abejacli.common import convert_to_local_... |
from discord.ext import commands
from replit import db
import dns.query
import weblinks
import discord
import os
import time
import datetime
import psutil
import asyncio
import pymongo
import json
import sys
#Config
prefix = "?"
token = os.environ["DISCORD_TOKEN"]
client = commands.Bot(
command_prefix=prefix,
in... |
"""
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 numpy as np
import scipy.misc
import scipy.ndimage
import os
import random
import colorsys
from skimage.measure import find_contours
import m... |
"""metapub.pubmedarticle -- PubMedArticle class instantiated by supplying ncbi XML string."""
import time
from datetime import datetime
from collections import OrderedDict
from .base import MetaPubObject
from .exceptions import MetaPubError
from .text_mining import re_numbers
from .pubmedauthor import PubMedAuthor
f... |
import numpy as np
import subprocess
import torch
import time
import nn.train
import os
import sys
import signal
import glob
import logging
import argparse
import random
from copy import deepcopy
from bs4 import BeautifulSoup
import signal
HIDDEN_NEURONS = 100
class Evolution:
def __init__(self, model_file, exe... |
#############################################################################
##
## Copyright (C) 2013 Riverbank Computing Limited.
## Copyright (C) 2021 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the Qt for Python examples of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:BSD$
## ... |
import unittest
import random
from copy import deepcopy
from kingdombuilder import Board
from kingdombuilder import Player
from kingdombuilder import Rules
from kingdombuilder import Game, DOACTION
from kingdombuilder import CARDRULES, TERRAIN, SPECIALLOCATION, BOARDSECTIONS
board_env = """
. . W . . . . . . . . . W ... |
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.patches import Ellipse
import matplotlib.lines as lines
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
from math import pi
from scipy import linalg, ndimage
from scipy.stats import multivariate_normal
from sklearn.exceptions import... |
import nibabel as nb
import numpy as np
import cv2
import os
from skimage.measure import marching_cubes_lewiner as marching_cubes
import stl
from stl import mesh
import os
import numpy as np
from nibabel.testing import data_path
import nibabel as nb
import time
start_time = time.time()
import pandas
import h5py
import... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright Blaze 2021.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
https://www.boost.org/LICENSE_1_0.txt)
"""
from typing import Any, List, Dict, Literal, Optional, TypeVar, Union, cast, \
C... |
#! /usr/bin/env python
"""Tests for ``catalog_seed_generator.py`` module
Authors
-------
<NAME>
Use
---
These tests can be run via the command line:
::
pytest -s test_catalog_seed_generator.py
"""
from astropy.table import Table
import numpy as np
import os
import pytest
import sys
import web... |
#!/usr/bin/env python
#
# NuGet packaging script.
# Assembles a NuGet package using CI artifacts in S3
# and calls nuget (in docker) to finalize the package.
#
import sys
import re
import os
import tempfile
import shutil
import subprocess
import urllib
from string import Template
from collections import defaultdict
im... |
import sys
import six
import threading
import traceback
from queue import PriorityQueue
from collections import namedtuple
from datetime import datetime, timedelta
import pytz
import html
from sqlalchemy import Column, Integer, ForeignKey, Unicode, Enum, func
from monitorrent.db import Base, DBSession, row2dict, UTC... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.