text
stringlengths
6.04k
39.5k
"""Alconna 参数相关""" import re import inspect from copy import copy from collections.abc import Sequence as ABCSeq, Set as ABCSet, \ MutableSet as ABCMuSet, MutableSequence as ABCMuSeq, MutableMapping as ABCMuMap, Mapping as ABCMap from contextlib import suppress from functools import lru_cache from pathlib import Pa...
#-*- coding:utf-8 -*- import os import glob import ctypes import numpy from ctypes import c_void_p, c_bool, c_int, c_double, c_char, c_char_p from ctypes import cast, sizeof, byref, POINTER, Structure root = os.path.dirname(__file__) for suffix in ['so', 'dll']: try: cwrapper = os.path.realpath(os.path....
import pytest import algor import random import itertools import collections import re import scipy.spatial import geometer import math g1 = algor.Graph( [1, 2, 3, 4], [ ("a", 1, 2), ("b", 1, 3), ("c", 2, 3), ("d", 3, 4), ], ) ws = { "a": 3, "b": 1, "c": 7, ...
import scipy.optimize as spo import numpy as np import logging from .base import AbstractDecompositionModel from .utils import dissimilarity from ..utils import check_logger from itertools import combinations from sklearn.base import BaseEstimator from sklearn.decomposition import NMF as skNMF from sklearn.cluster i...
import random import binascii class DES(object): # Initial permutation for subkey generation (IPC) __ipc = [ 56, 48, 40, 32, 24, 16, 8, 0, 57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 4...
# Authors: <NAME> <<EMAIL>> # # License: BSD-3-Clause import errno import os from pathlib import Path import warnings import numpy as np import pandas as pd from scipy.stats import median_abs_deviation as mad from mne.io.base import BaseRaw from mne.io import read_raw_bdf from mne.filter import filter_data, notch_...
import functools import numpy as np import operator import tensorflow as tf from tensorflow.keras import layers import tensorflow.sparse as sparse from .vlayers import concat_biases, VInput, VFractal, VOutput # Functions def flatten(inputs, dims_to_flatten, dims_to_save=0): """Flatten given dimensions of tensor""...
"""CellResponse class.""" # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> from glob import glob import numpy as np from .viz import plot_spikes_hist, plot_spikes_raster class CellResponse(object): """The CellResponse class. Parameters ---------- spike_times : li...
''' For all things related to TransCom regions but, in particular, for the statistical summary of SMAP L4C (or other raster array data) by TransCom region. The TransCom project seems to be poorly documented, but Carbon Tracker [1] uses it and provides the data used here. Intended use (Example): >>> f = h5py.File(f...
import logging import uuid import configmanager as C import errors as errs import helpers import lexconfig import morphparser as mp import parseparadigms as pp import pextract as pex def add_paradigm(lexicon, pid, paradigm, paradigms, identifier, pos, classes): """ Add a new paradigm (update language model, ...
# # Copyright 2021, by the California Institute of Technology. ALL RIGHTS # RESERVED. United States Government Sponsorship acknowledged. Any commercial # use must be negotiated with the Office of Technology Transfer at the # California Institute of Technology. # """ ================== osti_web_parser.py ==========...
import argparse import random import numpy as np import torch import spacy import scispacy import json import os import logging import pandas as pd import sys from tqdm import tqdm from datasets import Dataset from functools import partial from dataclasses import dataclass, field from custom_trainer import CustomTrain...
# lint-amnesty, pylint: disable=missing-module-docstring import datetime import copy import json import logging import os from lxml import etree from lxml.etree import Element, ElementTree, XMLParser from xblock.core import XML_NAMESPACES from xblock.fields import Dict, Scope, ScopeIds from xblock.runtime import KvsF...
#!/usr/bin/python # -*- coding: utf-8 -*- """ This is sample of how you can implement a tile-based game, not unlike the RPG games known from consoles, in pygame. It's not a playable game, but it can be turned into one. Care has been taken to comment it clearly, so that you can use it easily as a starting point for you...
import functools import re import multiprocessing import json from operator import attrgetter from collections import defaultdict, Counter from functools import partial from multiprocessing import Pool from magichour.api.local.util.log import get_logger from magichour.api.local.util.namedtuples import TimedEvent, Dist...
__version__ = "0.2.0" import __future__ import ast from collections import defaultdict import functools import inspect import sys if sys.version_info < (3, 9): from astunparse import unparse ast.unparse = unparse def get_kwargs_applicable_to_function(function, kwargs): """Returns a subset of `kwargs` o...
from __future__ import print_function, division import os, sys, glob, time sys.path.append(os.path.dirname(sys.path[0])) from scripts.pattern_stat import analyse_mrcs_stack try: import cPickle as pickle # python 2 except ImportError: import pickle # python 3 import numpy as np from matplotlib import pyp...
import itertools # TODO: symbolic formatting: __add__ -> "+" BINARY_LEVELS = { "__add__": 2, "__sub__": 2, "__mul__": 1, "__matmul__": 1, "__truediv__": 1, "__floordiv__": 1, "__mod__": 1, "__divmod__": 1, "__pow__": 0, "__lshift__": 3, ...
import logging from os import path import string import operator import time import re import traceback from flask import request # import mysql.connector # from mysql.connector import errorcode # @added 20180720 - Feature #2464: luminosity_remote_data # Added redis and msgpack from redis import StrictRedis from msgp...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # saov.py - <NAME> (<EMAIL>) - Jan 2017 ''' Contains the Schwarzenberg-Czerny Analysis of Variance period-search algorithm implementation for periodbase. ''' ############# ## LOGGING ## ############# import logging from astrobase import log_sub, log_fmt, log_date_fmt ...
from __future__ import unicode_literals, print_function, division import torch import torch.nn as nn import torch.nn.utils.rnn as rnn import torch.nn.functional as F from torch.autograd import Variable import numpy as np import random from encoder import EncoderRNN class Tacotron(nn.Module): def __init__(self, ar...
import itertools import math import os import pickle import random import subprocess from time import time import networkx as nx import networkx.algorithms.bipartite import numpy as np from networkx.generators.classic import empty_graph def hrg_wrapper(g, n=5): print('Starting HRG...') nx.write_edgelist(g, '...
#!/usr/bin/env python """ Variant of pyscroll.data.TileMapData. ScrollTest was copied and modified from pyscroll/apps/demo.py. Source copied and modified from https://github.com/bitcraft/pyscroll """ from typing import List, Optional import collections import pygame import pyscroll from GameInfo import GameInfo fro...
# Agent-based Model for interactions between agents of sheep and wolf, # and environment of grassland. # Author: Anonymous160609 (Github). # Version: 10.3. # 1. # Environemnts for ABM import requests # webscrewler for initial coordinates of agents import bs4 # structuralize the screwlered for use import tkinter ...
#!/usr/bin/python3 from threading import Thread import numpy as np import time import RPi.GPIO as GPIO import Adafruit_PCA9685 from picamera import PiCamera from picamera.array import PiRGBArray #GPIO.setwarnings(False) #??? In original code GPIO.setmode(GPIO.BCM) # Set pin numbering system for board # set up a p...
# polynomial.py from math import sqrt, factorial from collections.abc import Sequence from collections import namedtuple from numbers import Number def deg2 (a, b, c): """ Generate a Degree 2 Polynomial Returns a functon, denoted as 'f(x | a, b, c)=ax^2+bx+c', where 'a', 'b', and 'c' are equal to the arguments pas...
"""This serves as a main function to run a worker.""" from qip.distributed.proto import * from qip.distributed.proto.conversion import * from qip.distributed.worker.worker_backends import SocketServerBackend from qip.distributed.worker.worker_logger import WorkerLogger, PrintLogger from qip.distributed.formatsock impor...
""" Tools for generating heatmaps from latitude and longitude data. MIT License Original work Copyright (c) 2018 <NAME> Modified work Copyright 2021 <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...
#------------------------------------------------------------------------------- # This file is part of PyMad. # # Copyright (c) 2011, CERN. 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...
from collections import defaultdict, MutableMapping import itertools import os import warnings from csmapi import csmapi import numpy as np import pandas as pd from plio.io.io_gdal import GeoDataset from plio.io.isis_serial_number import generate_serial_number from skimage.transform import resize import shapely from ...
import asyncio import math import re from datetime import datetime from typing import Any, Dict, List, Optional, TypedDict import pytz from blossom_wrapper import BlossomAPI from dateutil import parser from discord import Embed, Forbidden, Reaction, User from discord.ext import commands from discord.ext.commands impor...
"""Games or Adversarial Search (Chapter 5)""" import copy import itertools import random from collections import namedtuple import numpy as np from utils import vector_add GameState = namedtuple('GameState', 'to_move, utility, board, moves') StochasticGameState = namedtuple('StochasticGameState', 'to_move, utility,...
# Copyright 2013 OpenStack Foundation # # 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...
import argparse import filecmp import logging import os.path import unittest import sys from distutils import spawn from functools import lru_cache from pathlib import Path from subprocess import run from unittest.mock import Mock from unittest_expander import foreach, expand from py2many.cli import ( _create_cmd...
#!/usr/bin/env python3 import os import pandas as pd # LIST OF TESTS: # 1. Verify names of downloaded files def TEST_ICISAir_filenames(icis_path,log): correct_fnames = ['ICIS-AIR_FACILITIES.csv','ICIS-AIR_PROGRAMS.csv', 'ICIS-AIR_FCES_PCES.csv','ICIS-AIR_PROGRAM_SUBPARTS.csv', ...
""" Original code based on Kaggle competition Modified to take 3-channel input """ from __future__ import division import numpy as np from keras.models import Model from keras.layers import Input, merge, Convolution2D, MaxPooling2D, UpSampling2D, Cropping2D from keras import backend as K import keras ...
import logging from typing import List import discord from discord.ext import commands from naotimes.bot import naoTimesBot from naotimes.context import naoTimesContext from naotimes.helpgenerator import HelpField, HelpOption from naotimes.paginator import DiscordPaginatorUI from naotimes.showtimes import Showtimes f...
import matplotlib.image as mpimg import numpy as np import cv2 from skimage.feature import hog from scipy.ndimage.measurements import label # Define a function to return HOG features and visualization def get_hog_features(img, orient, pix_per_cell, cell_per_block, vis=False, feature_vec=True):...
''' Data loading functions during training (modified from from https://github.com/yukimasano/self-label) ''' import torchvision import torch import torchvision.transforms as tfs import models import os, glob, natsort, pdb import numpy as np import util import xarray as xr from scipy.stats import mode import pickle fro...
# -*- coding: utf-8 -*- ''' Management of APT/RPM package repos =================================== Package repositories for APT-based and RPM-based distros(openSUSE/SUSE, CentOS/Fedora/Redhat) can be managed with these states. Here is some example SLS: .. code-block:: yaml base: pkgrepo.managed: -...
from __future__ import absolute_import, division, print_function import argparse import logging import sys import numpy as np import pandas as pd from sklearn.neighbors import NearestNeighbors from sklearn.preprocessing import StandardScaler from sklearn.utils import check_random_state logger = logging.getLogger('ca...
# Copyright 2012 NEC Corporation # # 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 ag...
import time import itertools import numpy as np from . import Scene, iterative_placement from .placement import Placement from .property import * from .stats import Stats from .util import divide ERROR = np.float128(5e-6) class AngleWrapper: # arc is always >= 0 def __init__(self, angle, arc): self.a...
# -*- coding: iso-8859-1 -*- """ MoinMoin - Call the GUI editor (FCKeditor) Same as PageEditor, but we use the HTML based GUI editor here. TODO: * see PageEditor.py @copyright: 2006 <NAME>, <NAME>, 2006-2007 MoinMoin:ThomasWaldmann @license: GNU GPL, see COPYING for details. "...
import os import time import psutil import traceback import subprocess import multiprocessing from PySide6.QtCore import * from param import * from utils import * from backend import * from prepare import * __all__ = ['AutodockWorker', 'AutodockVinaWorker'] class WorkerSignals(QObject): #finished = Signal() #erro...
# Enhanced sampling protocols # This file contains utility functions to generate samples in the gas-phase. import os import jax import multiprocessing import numpy as np from scipy.special import logsumexp from jax.scipy.special import logsumexp as jlogsumexp from fe import topology from fe.utils import get_romol_c...
import random import time import json import enum import os import shutil import sys import colorama import gensim.models.keyedvectors as word2vec import numpy as np from nltk.corpus import wordnet_ic class GameCondition(enum.Enum): """Enumeration that represents the different states of the game""" ...
import microsnp.snptools as snp import microsnp.mpileup as mp import sys import os import re import csv import subprocess import pandas as pd import argparse import textwrap import time from collections import defaultdict def parse_args(): # Top-level parser parser = argparse.ArgumentParser(description='Varia...
#!/usr/bin/env python """ Convert all recipes into feedstocks. This script is to be run in a TravisCI context, with all secret environment variables defined (STAGING_BINSTAR_TOKEN, GH_TOKEN) Such as: export GH_TOKEN=$(cat ~/.conda-smithy/github.token) """ from __future__ import print_function from conda_build....
import argparse import sys import warnings from gettext import gettext from typing import Any from typing import Dict from typing import List from typing import Optional from typing import Tuple import py from _pytest.config.exceptions import UsageError FILE_OR_DIR = "file_or_dir" class Parser: """ Parser for ...
import csv from datetime import datetime, timedelta, date import numpy from django.template.defaulttags import register from django.utils.translation import gettext_lazy as _ from matplotlib import pyplot from pandas import read_csv from pandas.plotting import register_matplotlib_converters from statsmodels.tsa.ar_mode...
from numpy import ( logspace, linspace, geomspace, dtype, array, sctypes, arange, isnan, ndarray, sqrt, nextafter, stack, errstate ) from numpy.testing import ( assert_, assert_equal, assert_raises, assert_array_equal, assert_allclose, ) class PhysicalQuantity(float): def __new__(cls...
# Copyright 2018 D-Wave Systems 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...
import collections import fnmatch import json import os import shutil import subprocess import time import uuid from pprint import pprint from installed_clients.DataFileUtilClient import DataFileUtil from installed_clients.KBaseReportClient import KBaseReport from installed_clients.ReadsUtilsClient import ReadsUtils ...
# Copyright (c) 2010-2012 OpenStack Foundation # # 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 agree...
# Importing stock libraries import numpy as np import pandas as pd from pandas.core.frame import DataFrame import torch from torch import random from torch.nn import parallel import torch.nn.functional as F from torch.serialization import save from torch.utils.data import Dataset, DataLoader, RandomSampler, SequentialS...
# Copyright 2018 The TensorFlow 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 applica...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import copy import os import re import sys import warnings from collections import defaultdict from textwrap import dedent from typing import Any, Dict, List, MutableSequence, Optional from omegaconf import Container, DictConfig, OmegaConf, flag_ov...
import sys, os from lxml import etree from edx_gen import _edx_consts from edx_gen import _process_html from edx_gen import _css_settings from edx_gen import _mob_iframe import __SETTINGS__ #-------------------------------------------------------------------------------------------------- WARNING = " WARNING:"...
import sys sys.path.append('yolov5') from models.common import * from utils.torch_utils import * from utils.datasets import * from yolo import * import tensorrt as trt import pycuda.driver as cuda import pycuda.autoinit import time import copy import numpy as np import os from onnxsim import simplify im...
#coding=utf-8 import os from collections import OrderedDict import Tkinter as tk import ttk import tkFileDialog as tkfd import tkMessageBox as tkmb from .frames import TraceableText, NumericSpinbox from .frames.match import * from .frames.network import * from .frames.team import * from .frames.translations import *...
#!/usr/bin/env python # Copyright 2018 <NAME> # Apache 2.0. from __future__ import print_function from collections import defaultdict import argparse import sys import math def GetArgs(): parser = argparse.ArgumentParser( description = "Use a greedy framework to select pronunciation candidates" ...
import os import numpy as np import pandas as pd """ This function is used to import the data. Put the data in a folder named all_data in the directory of the code """ def import_data(dt_name): """ :param dt_name: Name of the Dataset :return: Three pandas frames which correspond to traini...
from __future__ import print_function from __future__ import absolute_import import base64 from functools import wraps if __name__ == '__main__': import os os.environ['DJANGO_SETTINGS_MODULE'] = 'astrometry.net.settings' import sys fn = os.path.dirname(os.path.dirname(__file__)) sys.path.append(fn...
"""Miscellaneous utility functions. """ from enum import Enum import re import inspect import itertools from scipy import ndimage as ndi from numpydoc.docscrape import FunctionDoc import numpy as np import wrapt def str_to_rgb(arg): """Convert an rgb string 'rgb(x,y,z)' to a list of ints [x,y,z]. """ ret...
""" Displays Agg images in the browser, with interactivity """ # The WebAgg backend is divided into two modules: # # - `backend_webagg_core.py` contains code necessary to embed a WebAgg # plot inside of a web application, and communicate in an abstract # way over a web socket. # # - `backend_webagg.py` contains a c...
# -*- coding: utf-8 -*- """Tests the xonsh lexer.""" from __future__ import unicode_literals, print_function import os import sys from collections.abc import Sequence sys.path.insert(0, os.path.abspath("..")) # FIXME from pprint import pformat import pytest from xonsh.ply.ply.lex import LexToken from xonsh.lexer ...
# -*- coding: utf-8 -*- # # Author: <NAME> <<EMAIL>> # # Tests for seasonal differencing terms from __future__ import absolute_import, division import six from sklearn.linear_model import LinearRegression from sklearn.utils.validation import column_or_1d, check_array from scipy.linalg import svd from statsmodels imp...
from __future__ import print_function, division import pandas as pd import numpy as np import re import fastparquet import logging import dask.dataframe as dd import dask.array as da import dask import time import inspect from .utils import result class Functor(object): """Base class for computations performed o...
import boto3 from botocore import UNSIGNED from botocore.client import Config from botocore.exceptions import ClientError from botocore.handlers import disable_signing import configparser import os import munch import random import string import itertools config = munch.Munch # this will be assigned by setup() prefix...
import ast from html.parser import HTMLParser import re import sys import textwrap from collagraph import Component # Adjust this setting to disable some runtime checks # Defaults to True, except when it is part of an installed application CGX_RUNTIME_WARNINGS = not getattr(sys, "frozen", False) SUFFIX = "cgx" DIRE...
import numpy as np import pytest from pandas import ( DataFrame, NaT, date_range, ) import pandas._testing as tm @pytest.fixture(params=["both", "neither", "left", "right"]) def inclusive_endpoints_fixture(request): return request.param @pytest.fixture def float_frame_with_na(): """ Fixture...
# Copyright 2014 Red Hat, 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 a...
#!/usr/bin/env python3 # # To use this, install with: # # pip install --editable . # # That will create the command "psbt_recover" in your path... or just use "./psbt_recover ..." here # # import click, sys, os, pdb, struct, io, json, re, time from psbt import BasicPSBT, BasicPSBTInput, BasicPSBTOutput from pprint im...
#!/usr/bin/python from __future__ import absolute_import, division, print_function import importlib,os,re,sys from robot.libraries.BuiltIn import BuiltIn,RobotNotRunningError from robot.api import logger from ansible import modules from .picker2 import picker2 from ansible.cli.adhoc import AdHocCLI as mycli from ansibl...
""" This module contains functionality for auto-generating the stub files related to the :rst:dir:`automodapi` and :rst:dir:`automodsumm` directives. """ __all__ = ["AutomodsummEntry", "AutomodsummRenderer", "GenDocsFromAutomodsumm"] import os import re from jinja2 import TemplateNotFound from sphinx.ext.autodoc.mock...
#!/usr/bin/env python import os import sys import random import time import logging import json from collections import defaultdict from itertools import product from multiprocessing import Pool from tempfile import NamedTemporaryFile import pandas as pd import click from tqdm import tqdm as _tqdm tqdm = _tqdm from c...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ################################################## ## N.E.Py.H. - Network Engineer Python Helper ## ################################################## This program uses a Database in YAML format and a Template in Jinja2 format in order to generate configuration. It...
# -*- coding: utf-8; py-indent-offset: 2 -*- """ Deals with examing the atoms around a site and recognizing distinct and useful chemical environments. """ from __future__ import division from mmtbx import ions from iotbx.pdb import common_residue_names_get_class as get_class from cctbx.eltbx import sasaki from scitbx....
# ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # -------------------------------------------------------------------...
import binascii import ipaddress import os from dataclasses import dataclass from enum import IntEnum from typing import List, Optional, Tuple from cryptography.hazmat.primitives.ciphers.aead import AESGCM from ..buffer import Buffer from ..tls import pull_block, push_block from .rangeset import RangeSet PACKET_LONG...
''' This module provides a dummy parser for pythran annotations. * spec_parser reads the specs from a python module and returns them. ''' from pythran.types.conversion import pytype_to_pretty_type from collections import defaultdict from itertools import product import re import sys import os.path import ply.lex ...
# -*- coding: utf-8 -*- """ Created on Fri Mar 26 09:24:51 2021 @author: Monique """ import numpy as np # import math as math import copy import scipy.stats import auxiliary_functions.f_aux as aux from filterpy.kalman import ExtendedKalmanFilter as filterpy_EKF from filterpy.kalman import UnscentedKalmanFilter as f...
# Copyright (C) 2020 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Workflow object and WorkflowState mixins. This contains the basic Workflow object and a mixin for determining the state of the Objects that are mapped to any cycle tasks. """ import calendar import itert...
import random import numpy as np import sys import pickle class _TileManager(object): """docstring for _TileManager""" colors = ['R','B','W','Y','I','T'] def __init__(self): super(_TileManager, self).__init__() self.tiles = [] @property def is_empty(self): if len(...
# Copyright (c) 2017 Intel Corporation. All rights reserved. # Use of this source code is governed by a MIT-style # license that can be found in the LICENSE file. import os import logging import settings import threading from chroma_core.lib.storage_plugin.base_resource import BaseStorageResource from chroma_core.se...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # @miemie2013 import os import sys import random import torch import torch.distributed as dist import torch.nn as nn from mmdet.data import * from mmdet.exp.datasets.coco_base import COCOBaseExp class FCOSEvalCollater(): def __init__(self, context, batch_transforms...
# Copyright 2020 Board of Trustees of the University of Illinois. # # 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 ...
#!/usr/bin/env python """ Data loader for Rigaku table-top X-ray source .ras file format. Provides :func:`load` and :func:`loads` functions to load a Rigaku RAS format file. These functions return a list of file segments containing the following:: sample : sample name comment : file comment x : x data ...
import numpy import unittest import theano from theano import config from theano import tensor as T from theano.scan_module.scan_op import Scan from theano.tests import unittest_tools as utt mode = theano.compile.mode.get_mode(config.mode) class TestGaussNewton(unittest.TestCase): """ Regression test for co...
import networkx as nx import yaml import re import glob import sys import os import argparse import pkg_resources from distutils.dir_util import copy_tree from rich import print from vinca.utils import get_repodata from vinca.utils import literal_unicode as lu from vinca.distro import Distro from vinca.main import ( ...
#!/usr/bin/python3 ######################################################################################## # # ISPWatcher2 # <NAME> # November 1, 2009 # # - Testing - # Tested on MacOS Snow Leopard (10.6) and Ubuntu Linux 9.04 and 9.10 # # - Version History - # 2.0.0 - November 1, 2009 # Converted from .NET to Pyth...
#!/usr/bin/env python from __future__ import print_function, division from numpy import * import skimage.io from skimage import color import os ## For reproducibility random.seed(1) LUMINANCE = 60. CHROMA = 33. VERIFY = True def generate_one_random_lch(): ''' Lch has Luminance in the range [0,100], ch...
import re from melusine.config.config import ConfigJsonReader from melusine.prepare_email.cleaning import remove_accents conf_reader = ConfigJsonReader() config = conf_reader.get_config_file() newline_character = config['regex']['cleaning']['newline_character'] signature_token_threshold = config['regex']['mai...
from django.shortcuts import render, redirect from django.contrib import messages from .forms import * from .truelayer import * from .models import * from django.contrib.auth import authenticate, login, logout from django.http import HttpResponse from django.contrib.auth.decorators import login_required def index(req...
import io import socket import struct import time from typing import Dict, Iterable, List, Tuple, Union from . import types from .util import get_bits, load_domain_name, load_string, pack_domain_name, pack_string __all__ = [ 'REQUEST', 'RESPONSE', 'DNSError', 'Record', 'DNSMessage', 'RData', ...
# Copyright 2020 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# -*- coding: utf-8 -*- """ pygments.lexers.data ~~~~~~~~~~~~~~~~~~~~ Lexers for data file format. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, LexerConte...
# -*- coding: utf-8 -*- #!/usr/bin/env python -W ignore::DeprecationWarning from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseNotFound, HttpResponseForbidden, HttpResponseRedirect, JsonResponse from django.views import View from django.shortcuts import redirect, render, get_object_or_404, get_li...
import tensorflow as tf from tensorflow.contrib import predictor import sonnet as snt import numpy as np import pickle as pickle import os import sys sys.path.append('./') sys.path.append('./') sys.path.append('../') sys.path.append('../code') sys.path.append('../data') sys.path.append('./solvers/cube3/') #from tenso...