text stringlengths 8.04k 46.5k |
|---|
import copy
import datetime
import logging
import os
import time
from functools import partial
from pathlib import Path
from typing import Any, Dict, Optional, Union
import numpy as np
from memory_profiler import memory_usage
from monty.json import MSONable
from monty.serialization import loadfn
from pymatgen.core.str... |
# File: misp_connector.py
#
# Copyright (c) 2017-2022 Splunk 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 app... |
# coding: utf-8
# In[1]:
from numba import jit
import numpy as np
import pandas as pd
from datetime import datetime as dt
import os
import seaborn as sns
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import lightgbm as lgb
import xgboost as xgb
import time
import datetime
from tqdm import tqdm_notebook... |
import numpy as np
import pickle
import os
from PIL import Image
import time
from tqdm import tqdm, trange
import shutil
from random import randint
import argparse
import glob
import pdb
import random
import math
import time
import argparse
import matplotlib.pyplot as plt
from copy import deepcopy
from... |
"""
"""
#| - Import Modules
import os
import sys
# print("import pickle")
import pickle
import copy
# import copy
import numpy as np
import pandas as pd
# import plotly.graph_objects as go
import plotly.graph_objs as go
import plotly.express as px
import scipy.integrate as integrate
from pymatgen_diffusion.aimd.v... |
import unittest
# TODO: Write a test on gradient computation.
class TestGraphDatastructures(unittest.TestCase):
def test_construct_nodes_edges_simple_graph_np(self):
"""
Tests the construction of some basic datastructures useful for GraphNet computation
"""
n1 = Node(np.random.ra... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2008-2010 ReScene.com
# Copyright (c) 2012-2015 pyReScene
#
# 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
# restrictio... |
from tqdm import trange, tqdm
import numpy as np
from polaris2.geomvis import R2toR, R2toC2, R3S2toR, utilsh
import logging
log = logging.getLogger('log')
# Simulates a linear dipole imaged by 4f detection system.
class FourF:
def __init__(self, NA=1.2, M=60, n0=1.3, lamb=0.546, wpx_real=6.5,
npx... |
# GP regression
import numpy as np
from sklearn.metrics import pairwise_distances
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import pickle
import os
def make_K_SE(x, sigma, l):
# using SE kernel def given in Murphy pg. 521
# get pairwise distances
km = pairwise_distances(x.res... |
"""
Copyright (c) 2020 Intel 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 agreed to in writin... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""templates.py -- A set of predefined "base" prospector model specifications
that can be used as a starting point and then combined or altered.
"""
from copy import deepcopy
import numpy as np
from . import priors
from . import transforms
__all__ = ["TemplateLibrary",
... |
#!/usr/bin/env python
#
# Copyright 2007 Google 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 o... |
# Copyright 2021 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
import strax
import straxen
from straxen.get_corrections import get_correction_from_cmt
import numpy as np
import numba
from straxen.numbafied_scipy import numba_gammaln, numba_betainc
from scipy.special import loggamma
import tarfile
import tempfile
export, __all__ = strax.exporter()
@export
@strax.takes_config(
... |
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import struct
import subprocess
import sys
import unittest
import xml.etree.ElementTree
import gdb_rsp
NACL_SIGTRAP = 5
NACL_SIGSEGV = ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 26 18:12:22 2019
@author: weetee
"""
import os
import re
import random
import copy
from collections import Counter, OrderedDict
import unicodedata
import pandas as pd
import json
from unidecode import unidecode
from sklearn.model_selection import tr... |
# Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# Copyright 2019 Atalaya Tech, 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 agreed to in writing,... |
import numpy as np
import Box2D
from Box2D.b2 import (edgeShape, circleShape, fixtureDef, polygonShape, revoluteJointDef, distanceJointDef,
contactListener)
import gym
from gym import spaces
from gym.utils import seeding
"""
The objective of this environment is to land a rocket on a ship.
STATE... |
import pandas as pd
import numpy as np
import math
from scipy.stats import nct
from copy import deepcopy
import matplotlib.pyplot as plt
from ..estimators.stan_estimator import StanEstimatorMAP
from ..exceptions import IllegalArgument, ModelException
from ..utils.kernels import sandwich_kernel
from ..utils.features im... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
"""This module is the top-level module for code that deals with re-binding (i.e., deciding
whether or not an orig space-delimited token needs to be joined to its neighbor). It was
originally developed for automatic processing of the Marcion texts.
There ar... |
#!/usr/bin/env python
"""
Generate a minimal perfect hash function for the keys in a file,
desired hash values may be specified within this file as well.
A given code template is filled with parameters, such that the
output is code which implements the hash function.
Templates can easily be constructed for any programm... |
# Copyright 2014-2016 Insight Software Consortium.
# Copyright 2004-2008 <NAME>.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
"""
defines classes, that describes "callable" declarations
This modules contains definition for next C++ declarations:
- operato... |
import logging
import config
import zipfile
from decorators import login_required
from flask import render_template, request, redirect, session, flash, Blueprint, send_file, after_this_request
import errno
import math
import os
import base64
from requests import get
from cryptography.fernet import Fernet, InvalidToken,... |
"""NOTE - this module is a bit dangerous! It mixes async and dask functionality,
leaving it unclear when global variables are valid.
"""
import faw_analysis_set_parse
import faw_analysis_set_util
import faw_internal_util
import faw_pipelines_util
import asyncio
import collections
import dask.distributed
import enum
i... |
# -*-coding:utf-8-*-
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import QThread,pyqtSignal
from ui import Ui_MainWindow
import sys
import socket
import os
import json
import time
from time import ctime
BASE_DIR = os.path.dirname(os.path.abspath(__file__))# 当前目录
HOST = '127.0.0.1'
PORT = 1... |
# based on https://github.com/stelzner/monet
# License: MIT
# Author: <NAME>
import argparse
import torch
from torch import nn, optim
import torch.distributions as dists
import numpy as np
from PIL import Image
import os
from utils.os_utils import make_dir
this_file_dir = os.path.dirname(os.path.abspath(__file__)) + '... |
#!/usr/bin/env python
from __future__ import print_function
import importlib
import pkg_resources
import os
import random
import subprocess
import sys
import click
from deployfish.config import Config, needs_config
from deployfish.aws.ecs import Service
from deployfish.aws.systems_manager import ParameterStore
from ... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 20 19:06:55 2014
@author: <NAME>
This program controls the mirrors attached to the galvos. The position of one mirror is controlled by a sine wave, the other mirror is controlled by a cosine wave.
When a laser is reflected off both mirrors, it spins in a circle. This... |
import base64
import json
from typing import Dict, Optional
import attr
import pytest
from aiohttp import web
from aiohttp.streams import EmptyStreamReader
from flask import Flask
from hypothesis import Phase
from requests.auth import HTTPDigestAuth
import schemathesis
from schemathesis import loaders
from schemathes... |
# -*- coding: utf8 -*-
import six
from tablestore.error import *
from enum import Enum
import tablestore.protobuf.search_pb2 as search_pb2
class TableMeta(object):
def __init__(self, table_name, schema_of_primary_key, defined_columns=[]):
# schema_of_primary_key: [('PK0', 'STRING'), ('PK1', 'INTEGER'), .... |
import argparse
import os
import sys
import traceback
import json
import random
import subprocess
import statistics
from datetime import datetime
from Bio import SeqIO
from Bio.Seq import Seq
from collections import OrderedDict
class Insertion:
def __init__(self):
self.chromosome = ""
self.family =... |
# Copyright 2016 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 agre... |
# Copyright 2019 DGT NETWORK 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 agreed to in writ... |
import pandas as pd
from pandas.plotting import lag_plot
import numpy as np
import matplotlib as mlp
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import matplotlib.ticker as ticker
import seaborn as sns
from scipy import stats
import statsmodels.api as sm
from statsmodels.formula.api import ols
imp... |
# Copyright [2020] [Two Six Labs, LLC]
# Licensed under the Apache License, Version 2.0
from collections import OrderedDict, defaultdict
from datetime import datetime
from io import StringIO
import sys
from flask import current_app
import pandas as pd
import psycopg2
from sqlalchemy import and_, func, create_engine, M... |
import json
import json
import random
import codecs
import numpy as np
import torch
import torch.utils.data
from torch.utils.data import DataLoader
import layers
from utils import load_wav_to_torch, load_filepaths_and_text
from text import text_to_sequence, poly_yinsu_to_sequence, poly_yinsu_to_mask
from transformers... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# Copyright 2012-2013 Hewlett-Packard Development Company, L.P.
# 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
... |
"""
Supplies MultiDimensionalMapping and NdMapping which are multi-dimensional
map types. The former class only allows indexing whereas the latter
also enables slicing over multiple dimension ranges.
"""
from itertools import cycle
from operator import itemgetter
import numpy as np
import param
from . import util
fr... |
import logging
import click
import click_log
import pandas as pd
from linkml_runtime.linkml_model import (
SlotDefinition,
Example,
EnumDefinition,
PermissibleValue,
Annotation
)
from linkml_runtime.utils.schemaview import SchemaView
from linkml_runtime.dumpers import yaml_dumper
from sheet2datah... |
import numpy as np
from skimage import io
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib.cm as cm
from math import floor
from scipy.signal import convolve2d
from scipy.optimize import linear_sum_assignment
from scipy.stats import linregress
from scipy.spatial import Delaunay
from c... |
"""
DatastoreModel
===========
Superclass for all other datastore-backed models;
contains generic properties and methods
"""
from google.appengine.api import memcache
from google.appengine.ext import ndb
import collections
import datetime
import logging
import os_random
import re
import string
import sys
from .curso... |
#!/usr/bin/env python3
#
# Copyright (C) 2021 Red Hat
#
# 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... |
import os
import fnmatch
import shutil
import csv
import pandas as pd
import numpy as np
import glob
import datetime
print(os.path.realpath(__file__))
def FindResults(TaskList, VisitFolder, PartID):
for j in TaskList:
TempFile = glob.glob(os.path.join(VisitFolder,(PartID+'_'+j+'*.csv')))
# Ideal... |
import html
import json
import logging
from datetime import timedelta
from uuid import uuid4
from colorfield.fields import ColorField
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.gis.db import models
from dja... |
import ast
import json
import logging
import math
import os
import random
import h5py
from dataclasses import dataclass
import braceexpand
import numpy as np
import pandas as pd
import torch
import torchvision.datasets as datasets
import webdataset as wds
from PIL import Image
from torch.utils.data import Dataset, Dat... |
'''
This module implements some basic matrix classes
'''
from math import log, sqrt, cos, sin, atan2, asin, acos, pi
from sys import float_info
class CannotRowReduce(ValueError): pass
class MatrixNotInvertable(ValueError): pass
class QuaternionNotInvertable(ValueError): pass
def are_vectors_equal(vector... |
import torch.nn as nn
from mmcv.cnn import (build_conv_layer, build_norm_layer, constant_init,
kaiming_init)
from mmcv.runner import load_checkpoint
from mmcv.utils.parrots_wrapper import _BatchNorm
from mmseg.models.utils.m2mrf import M2MRF
from mmseg.ops import Upsample, resize
from mmseg.utils... |
# ------------------------------------------------------------------
# Compute residual VLM from alt-tg
# This program has 2 modes:
# First mode:
# Compute alt-tg for provisional region list for during TG QC
# Compute alt-tg for final region list
# ------------------------------------------------------------------
impo... |
"""
Runner for system_simulator.py
Written by <NAME>
Adapted from the India5G repository.
January 2022
"""
import os
import sys
import configparser
import csv
import math
import fiona
from shapely.geometry import shape, Point, LineString, mapping
import numpy as np
from random import choice
from rtree import index... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import utils_m as utils
from torch.nn.utils.rnn import PackedSequence, pack_padded_sequence, pad_packed_sequence
from Capti... |
# Copyright 2015 Intel 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
from __future__ import print_function
import os, os.path
import sys
import shutil
import types
import warnings
from waflib import TaskGen, Task, Options, Build, Utils
from waflib.Errors import WafError
import wutils
try:
set
exce... |
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 20 19:33:39 2021
@author: damv_
Ecuaciones cubicas de estado
"""
from scipy.special import gamma
import numpy as np
"""****************************************************************************************************************************
Indices para ecuaciones cub... |
import math
import torch
import pickle
import numpy as np
from torch import nn
from scipy import signal
import torch.optim as optim
from torch.distributions import Normal
def _uniform_init(tensor, param=3e-3):
return tensor.data.uniform_(-param, param)
def layer_init(layer, weight_init = _uniform_init, bias_ini... |
import re, codecs
import spacy
from stanfordcorenlp import StanfordCoreNLP
from INERC.sfl_based.src.Tools import *
import pandas as pd
import ast
import pickle
tool_set = tools()
nlp_model = spacy.load('en_core_web_sm')
type_abbrev = {"@P":"Person", "@O":"Organization","@D":"Device","@E":"Event","@F":"Film... |
from bs4 import BeautifulSoup
import requests
import re
import os
import bz2
import sys
from tqdm import tqdm
import numpy as np
import pandas as pd
import h5py
import time
import shutil
import zipfile
from .hapi import db_begin, fetch, abundance, moleculeName, isotopologueName
import excalibur.ExoMol as ExoMol
impo... |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2011-2020 <NAME> <<EMAIL>>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
#... |
import math
import operator
from functools import reduce
import bezier
import cv2
import numpy as np
import pyclipper
from pyclipper import PyclipperOffset
from scipy.interpolate import splprep, splev
from shapely.geometry import Polygon
def compute_two_points_angle(_base_point, _another_point):
"""
以基点作x+延长... |
# RLWallet is subclass of Wallet
import asyncio
import json
import time
from dataclasses import dataclass
from secrets import token_bytes
from typing import Any, List, Optional, Tuple
from blspy import AugSchemeMPL, G1Element, PrivateKey
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_fo... |
from __future__ import with_statement
import random
from array import array
import pytest
from whoosh import analysis, fields, formats, query
from whoosh.compat import u, b, text_type
from whoosh.compat import array_tobytes, xrange
from whoosh.codec import default_codec
from whoosh.filedb.filestore import RamStorage
... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six import with_metaclass
from six.moves import range
import os
import numpy as np
import collections
import itertools
import functools
import contextlib
from threading import Lock
from .frame i... |
"""Main module with performance tests interface."""
import json
import time
import datetime
import subprocess
import os.path
import sys
import queue
import threading
import pprint
import csv
from coreapi import *
from jobsapi import *
from gremlin_api import *
import benchmarks
import graph
from s3interface import *
... |
import os
import ast
import pandas as pd
import numpy as np
import networkx as nx
import json
path = os.path.dirname(os.path.abspath(__file__))
def get_presynaptic(X, G, threshold=0.05):
""" Returns a list of predecessors for a group of neurons.
# Arguments
X (list): List of nodes to get the predec... |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
# 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 appl... |
# Copyright 2019, OpenTelemetry 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 or agreed to i... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides a container class to store parameters for the
geometry of an ellipse.
"""
import math
from astropy import log
import numpy as np
__all__ = ['EllipseGeometry']
IN_MASK = [
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
... |
import collections
import datetime
import gc
import math
import threading
import warnings
import joblib
from joblib import delayed
from joblib import Parallel
from optuna._experimental import experimental
try:
import pandas as pd # NOQA
_pandas_available = True
except ImportError as e:
_pandas_import_e... |
# -*- coding: utf-8 -*-
import sys
import os.path
import json
import fnmatch
from collections import Counter, OrderedDict
import boto3
import botocore
import click
from joblib import Parallel, delayed
from clint.textui import colored, puts, indent
from .checks import AclCheck, PolicyCheck, PublicAccessCheck, LoggingCh... |
#! /usr/bin/env python3
# -----------------------------------------------------------------------------
# awesome.py
#
# References:
# - GitHub
# - https://github.com/PyGithub/PyGithub
# - https://pygithub.readthedocs.io/
# - https://pygithub.readthedocs.io/en/latest/github_objects.html
# -----------------------... |
# uncompyle6 version 3.3.5
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
# Embedded file name: c:\Jenkins\live\output\win_64_static\Release\python-bundle\MIDI Remote Scripts\_Framework\Control.py
# Compiled at: 2018-11-30 15:48:11
from __futur... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
"""
Copyright 2021 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... |
#-----------------------------------------------------------------------------
# Copyright (c) 2008 by <NAME>. All rights reserved.
#
# Released under the BSD license. See the LICENSE file for details.
#-----------------------------------------------------------------------------
"""Set based operations for IP addr... |
from typing import List, Union
from pathlib import Path
import warnings
import numpy as np
from probeinterface import Probe, ProbeGroup, write_probeinterface, read_probeinterface
from .base import BaseExtractor, BaseSegment
from .core_tools import write_binary_recording, write_memory_recording
from warnings import ... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from collections import defaultdict, namedtuple
from dateutil.relativedelta import relativedelta
from odoo import SUPERUSER_ID, _, api, fields, models, registry
from odoo.exceptions import UserError
from... |
from typing import Tuple, List, Dict, TextIO
import pickle
import os
import copy
import sqlite3
from multiprocessing import Pool
import numpy as np
from functools import partial
from mrnet.core.mol_entry import MoleculeEntry
from mrnet.utils.visualization import (
visualize_molecule_entry,
visualize_molecule_c... |
#!/usr/bin/python3
"""
# Author: <NAME> <EMAIL>
# Written for Python 3.6 and above
# No warranty is offered, use at your own risk. While these scripts have been
# tested in lab situations, all use cases cannot be accounted for.
# 4 Sept 2019, updated to add gethostbyaddr for lookup and ping
"""
import json
import o... |
import random
import torch
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from torch.utils.data import RandomSampler, BatchSampler
from .utils import calculate_accuracy, Cutout, calculate_accuracy_by_labels, calculate_FP, calculate_FP_Max
from .newtrainer import Trainer... |
import time
import warnings
from collections import deque
from enum import IntEnum
import numpy as np
from numpy import array
from recordtype import recordtype
from flatland.envs.agent_utils import RailAgentStatus
from flatland.utils.graphics_pil import PILGL, PILSVG
from flatland.utils.graphics_pgl import PGLGL
#... |
"""Implements the OpenID Attribute Exchange specification, version 1.0.
@since: 2.1.0
"""
from __future__ import unicode_literals
import six
from openid import extension
from openid.message import OPENID_NS, NamespaceMap
from openid.oidutil import force_text, string_to_text
from openid.server.trustroot import TrustR... |
# 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... |
# stdlib
import sys
from typing import Any
# third party
import pytest
# syft absolute
from syft.lib.python.int import Int
from syft.lib.python.int import IntWrapper
VALID_UNDERSCORE_LITERALS = [
"0_0_0",
"4_2",
"1_0000_0000",
"0b1001_0100",
"0xffff_ffff",
"0o5_7_7",
"1_00_00.5",
"1_0... |
#coding: utf-8
'''
WKWebView - modern webview for Pythonista
'''
__version__ = '1.0'
from objc_util import *
import ui, console, webbrowser
import queue, weakref, ctypes, functools, time, os, json, re
from types import SimpleNamespace
# Helpers for invoking ObjC function blocks with no return value
class _block_d... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import collections
import itertools
import time
import torch
import torch.distributed as dist
import communication
import runtime_utilities
IMAGE_CLASSIFICATION = "image_classification"
TRANSLATION = "translation"
SPEECH_TO_TEXT = "speech_to_te... |
#!/usr/bin/env python3
#
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
#
# Title : superpmi_collect_setup.py
#
# Notes:
#
# Script to setup directory structure required to perform SuperPMI collection in CI.
# It does ... |
#
# 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, software
# distributed under ... |
#!/bin/env python3
import sys
import os
import os.path
import glob
import copy
import traceback
import re
import csv
import tempfile
import urllib.request, urllib.parse, urllib.error
import shutil
import atexit
import subprocess
import time
import math
from collections import defaultdict, Counter
from os.path import jo... |
import sys,types,string,os
import traceback
Errors = 0
Corrects = 0
Wrongs = 0
Warnings = 0
print_debug_messages=0
print_warning_messages= True
MAXWRONGS = 2000
MAXERRORS = 2000000
PYMONLOG = 'pymon.log'
WHERE = ''
Flogs = [False,False,False,False,False,False,False,False,False,False,False,False,Fals... |
# Copyright 2019 The Feast 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# __init__.py
"""A module to simulate optical transfer functions and point spread functions.
If this file is run as a script (python -m pyotf.otf) it will compare
the HanserPSF to the SheppardPSF in a plot.
https://en.wikipedia.org/wiki/Optical_transfer_function
https://e... |
import numpy as np
import xarray as xr
import warnings
# import mpl and change the backend before other mpl imports
try:
import matplotlib as mpl
from matplotlib.transforms import blended_transform_factory
mpl.use("Agg")
import matplotlib.pyplot as plt
mpl = True
except ImportError:
raise Run... |
# coding=utf-8
# Copyright 2020 The Google Research 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 applicab... |
""" test_distance.py
Tests the isi- and spike-distance computation
Copyright 2014, <NAME> <<EMAIL>>
Distributed under the BSD License
"""
from __future__ import print_function
import numpy as np
from copy import copy
from numpy.testing import assert_equal, assert_almost_equal, \
assert_array_almost_equal
impo... |
#!/usr/bin/env python2
from __future__ import print_function
import sys
sys.path.append('../lib')
import os
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.path import Path
from matplotlib.patches import PathPatch
import string
import protocols
import model as... |
import collections
import itertools
import time
import numpy as np
from ..exceptions import ValidationError
from ..models import AlignmentMill
from ..physical_constants import constants
from ..testing import compare_values
from ..util import distance_matrix, linear_sum_assignment, random_rotation_matrix, uno, which_i... |
import sublime
import sublime_plugin
import re
import regex
from pathlib import Path
import os
import fnmatch
import logging
import sys
import traceback
import OrgExtended.asettings as sets
import OrgExtended.orgdb as db
import OrgExtended.orgparse.date as date
log = logging.getLogger(__name__)
RE_TITLE = regex.comp... |
"""CSS Selectors based on XPath.
This module supports selecting XML/HTML tags based on CSS selectors.
See the `CSSSelector` class for details.
"""
import re
from lxml_osx import etree
__all__ = ['SelectorSyntaxError', 'ExpressionError',
'CSSSelector']
try:
_basestring = basestring
except NameError:
... |
"""
Copyright 2021 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import json
import re
import sys
import traceback
import zipfile
from decimal import Decimal
from bs4 import BeautifulSoup as bs
impo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.