text stringlengths 6.04k 39.5k |
|---|
# coding:utf-8
from datetime import datetime, timedelta
# from urllib import Request, urlopen
from urllib import request
import demjson
import pandas as pd
import tushare as ts
from pandas.io import sql
from org.tradesafe.bt.log import logging as log
from org.tradesafe.conf import config
from org.tradesafe.data.inde... |
from openleadr import utils, objects
from dataclasses import dataclass, asdict
import pytest
from datetime import datetime, timezone, timedelta
from collections import deque
@dataclass
class dc:
a: int = 2
def test_hasmember():
obj = {'a': 1}
assert utils.hasmember(obj, 'a') == True
assert utils.hasme... |
import datetime
from collections import namedtuple
import numpy as np
import pandas as pd
import torch
# from ctgan.data_transformer import DataTransformer
from ctgan.synthesizers.base import BaseSynthesizer
from rdt.transformers import OneHotEncodingTransformer
from sklearn.mixture import BayesianGaussianMixture
fro... |
#Yale GrabLab 2019
#<NAME>
#This document serves to provide addresses for both, the RX/MX set and X* Dynamixel Series (Protocol1 and Protocol 2)
#These addresses will be used in the lib_robotis_mod file in order to read and write values to the dynamixel device.
RXMX_Series = {
"ADDR_MODEL_NUMBER_L" : 0, # 1... |
import ctypes
import math
import time
import keyboard
class TimingPoint:
def __init__(self, offset, slider_velocity, beat_duration):
self.offset = offset
self.slider_velocity = slider_velocity
self.beat_duration = beat_duration
class HitObjects:
def __init__(self, x, y, off... |
#//
#// -------------------------------------------------------------
#// Copyright 2011 Synopsys, Inc.
#// Copyright 2019-2020 <NAME> (tpoikela)
#// All Rights Reserved Worldwide
#//
#// Licensed under the Apache License, Version 2.0 (the
#// "License"); you may not use this file except in
#// compli... |
#####################################################
# Better incremental search #
#####################################################
import re
from copy import copy
import sublime, sublime_plugin
from .misc import *
# Region names we use for i-search. Using our own names means that ther... |
# <NAME>, Stevens Institute of Technology, 2019
# Find all triangles with surface normal perpendicular to gravity, within some degree of tolerance.
# Vertical groups are grown from these triangles across adjacent and likewise aligned triangles
# to form vertical groups.
# We write these vertical groups to new OBJ... |
import numpy as np
import matplotlib.pyplot as plt
import time
import skcuda.linalg as linalg
import aspire.em_classavg.data_utils as data_utils
from aspire.em_classavg.image_denoising.image_denoising.ConverterModel.Converter import Converter
class EM:
def __init__(self, images, trunc_param=10, beta=0.5, ang_jum... |
import numpy as np
import random,sys
import scipy
from scipy.spatial.distance import pdist,squareform,cdist
#from scipy.spatial import distance_matrix
import matplotlib.pyplot as plt
import scipy
### "for loop" version
### faster than "matrix version"
### because only need to consider points within h_k
### for loop... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 15 10:17:32 2020
@author: briere
"""
import argparse
import logging
from GraphMetrics import *
from neo4j import GraphDatabase
descr = '''This script computes the optimal number of supports to cluster the IntegrationGraph.
Once filtered, the graph... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from flask import Flask, render_template, request, redirect, send_from_directory
from flask_cors import CORS
import codecs
import os
import re
import operator
impor... |
import sys, sublime, sublime_plugin, os, json
from operator import itemgetter
PYTHON_VERSION = sys.version_info
if PYTHON_VERSION[0] == 2:
import imp
shared_enums_module = os.path.join(os.getcwd(), "SharedEnums.py")
imp.load_source("SharedEnums", shared_enums_module)
del shared_enums_module
shared_functions_modul... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Module for xml parsing"""
# Libraries
from lxml import etree
# Modules
import datamodel
from jarvis.shared_orchestrator import (function_inheritance, fun_elem_inheritance,
fun_inter_inheritance, phy_elem_inheritance,
... |
import os, sys, random
import numpy as np
import cv2
from scipy import ndimage
from matplotlib import pyplot as plt
from keras.initializers import RandomNormal
from keras.layers import Input, Dense, Activation, Dropout, Flatten, Reshape, LeakyReLU
from keras.layers.convolutional import Conv2D, Conv2DTranspose
from ker... |
"""
Module of functions that apply to/get choice data for a trials dataframe (monkeys).
"""
from macaque.f_toolbox import *
from collections import Counter
import pandas as pd
import numpy as np
tqdm = ipynb_tqdm()
from macaque.f_trials import add_chosenEV
#%%
#from numba import jit
#from numpy import arange
#import... |
"""
$Rev: 4142 $: Revision of last commit
$Author: dkaplan $: Author of last commit
$Date: 2011-10-31 11:30:40 -0500 (Mon, 31 Oct 2011) $: Date of last commit
"""
import logging
import math
import numpy
import astropy
from astropy.time import Time
from astropy.coordinates import SkyCoord
from . import beam... |
#!/usr/bin/env python
# coding: utf-8
# %%
#Copyright: <NAME>
#Date: 07/01/2021
import os
import sys
import time
import py4DSTEM
import numpy as np
from tqdm import tqdm
from itertools import product
from functools import reduce
from operator import mul
from numpy import integer
from collections.abc import Iterator
... |
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 4 23:37:47 2020
@author: acros
"""
import numpy as np
import scipy.linalg as linalg
def mult_by_inverse(A, b):
""" Numerically stable way of getting A*B^{-1}"""
v = np.linalg.solve(b.T, A.T)
solution = v.T
return(solution)
import matplotl... |
#
# Copyright (c) 2016, 2020, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
... |
from itertools import cycle
import random
import sys
import pygame
from pygame.locals import *
FPS = 30
SCREENWIDTH = 288
SCREENHEIGHT = 512
PIPEGAPSIZE = 100 # gap between upper and lower part of pipe
BASEY = SCREENHEIGHT * 0.79
# image, sound and hitmask dicts
assets, SOUNDS, HITMASKS = {}, {}, {}
# list ... |
'''
basic_generation.py
This file has a simple experiment for generation of graphs. The aim of this script is to
get structred graph knwoledge from any given input text. For now the input texts are
sample texts from Wikipedia.
07.10.2019 - @yashbonde
'''
# import dep
import os
import numpy as np
from collections im... |
# -*- coding: utf-8 -*-
"""plot_functions various functions to create graphs of temperature data
This python module contains a multiple Python functions to create different
visualizations of the average global temperature data from the various grab
functions in this project. The are designed to have a consistent input... |
import numpy as np
import tensorflow as tf
import config_res as config
import argparse
import os
import cv2
from utils import *
from loss_fun import *
import data_load as dl
# import model_utils
import global_agg_net
import transform_function
import all_transformer as at
def arg_parser():
parser = argparse.Argume... |
#!/usr/bin/env python
# coding=utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import tensorflow as tf
from tensorflow.contrib.rnn import RNNCell
from network import net, build_network
from sacred import Ingredient
nem = Ingredient('nem', ingredients=[net])... |
# -*- coding: utf-8 -*-
r"""
Hyperbolic Points
This module implements points in hyperbolic space of arbitrary dimension.
It also contains the implementations for specific models of
hyperbolic geometry.
This module also implements ideal points in hyperbolic space of arbitrary
dimension. It also contains the implementa... |
#!/usr/bin/python
# Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
#
from __future__ import absolute_import
import gevent
import gevent.monkey
gevent.monkey.patch_all(thread=False)
import sys
import os
import logging
from flexmock import flexmock
import json
from cfgm_common.exceptions import (
Refs... |
# Copyright 2017-2022 TensorHub, 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... |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
import logging
from math import acos, sqrt, tan
import numpy as np
from . import IRCdata
from . import optparams as op
from .displace import displace_molsys
from .exceptions import AlgError
from .history import oHistory
from .linearAlgebra import symm_mat_eig, symm_mat_inv, symm_mat_root
from .printTools import print... |
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
from copy import deepcopy
import numpy as np
from scipy import linalg
from ..io.constants import FIFF
from ..io.pick import pick_channels
from ..utils import logger, verbose
from ..forward import convert_forward_solution
from ..evoke... |
"""
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
import logging
from typing ... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ///////////////////////////////////////////////////////////////////////////
#
# Read a GPX file, and build a road. Return the data in the normalized
# OpenGL vertexData structure
#
# ///////////////////////////////////////////////////////////////////////////
import sys
... |
from zeit.cms.content.property import ObjectPathAttributeProperty
from zeit.cms.i18n import MessageFactory as _
from zeit.content.cp.interfaces import IAutomaticTeaserBlock, ITeaserBlock
import json
import gocept.lxml.interfaces
import grokcore.component as grok
import lxml.etree
import lxml.objectify
import zeit.cms.c... |
import sqlite3
from tqdm import tqdm
from pathlib import Path
import pandas as pd
from imagehash import hex_to_hash
import warnings
from operator import and_ as bitwise_and
from functools import reduce
from sys import stderr
from enum import Enum
result_db = "matches.db"
osx_db = Path("osx/catalina/osx_emoji_hashes.db... |
# 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... |
import pytest
import os
from pathlib import Path
import shutil
import pandas as pd
from wrftamer.main import project, list_projects, list_unassociated_exp, reassociate
# -----------------------------------------------------------------------
# Trivial tests for nonexistent project
# ----------------------------------... |
# created: 2019-01-03
# Copyright (c) 2019-2020 <NAME>
# License: MIT License
from typing import TYPE_CHECKING, Iterable, Dict
from ezdxf.math import Vec2, Shape2d, NULLVEC
from .forms import open_arrow, arrow2
if TYPE_CHECKING:
from ezdxf.eztypes import Vertex, GenericLayoutType, DXFGraphic, Drawing
DEFAULT_ARRO... |
#!/usr/bin/env python3
'''
Usage: seq2ffv1.py source_parent_directory output_directory
The script will fnd a single reel, multi-reel (with or without sidecar WAV)
image sequence beneath the source_parent_directory.
The script will then:
* Create a folder structure for each image sequence in
your designated output_dire... |
from PyQt5.QtWidgets import *
from PyQt5.QtCore import Qt,QThread
from PyQt5 import QtCore,QtGui,QtWidgets,uic
import cv2
import os
import sys
import json
import datetime
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import skimage
import threading
import time
import queue
from mrcnn import visua... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 IBM Corporation
# Copyright 2015-2019 Lenovo
#
# 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/licens... |
# coding:utf-8
import os
import time
import pwd
import grp
import subprocess
import unittest
import uuid
import resource
import logging
import random
import threading
from six.moves import queue
from captain_comeback.index import CgroupIndex
from captain_comeback.cgroup import Cgroup
from captain_comeback.restart.mess... |
"""Contains the TextUI class."""
from collections import defaultdict
from datetime import datetime
from psutil import cpu_percent, virtual_memory, Process
import mpf._version
from mpf.core.delays import DelayManager
from mpf.core.mpf_controller import MpfController
try:
from asciimatics.scene import Scene
fr... |
#!/usr/bin/env python
#
# Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/
# Written by <NAME> <<EMAIL>>
#
"""Download the Swedish Traffic Signs dataset and create the Speed Limit Signs
dataset from and train with attention sampling.
NOTE: Swedish Traffic Signs dataset is provided from
https://... |
# Problem Set 3: Simulating the Spread of Disease and Virus Population Dynamics
import random
random.seed(0)
import pylab
from ps3b_precompiled_37 import *
'''
Begin helper code
'''
class NoChildException(Exception):
"""
NoChildException is raised by the reproduce() method in the SimpleVirus
and Resis... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
import csv
import json
import re
import shutil
import time
from subprocess import Popen, PIPE
import click
import click_config_file
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import requests
import tempfile
import os
from urllib.parse import urlparse
default_ab_params = {'url': "https://to... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2018, <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and/or distribute this software 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 P... |
import os
import urllib.request
import xml.etree.ElementTree as ET
from lxml.builder import ElementMaker
from pywps import NAMESPACES as ns
import base.cron
from base.models import WPSProvider, WPS, Process, InputOutput, DATATYPE, ROLE
from workflowPSE.settings import BASE_DIR, wps_log
E = ElementMaker()
wps_em = El... |
# Copyright 2021 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, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013, 2014 Kitware 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... |
# 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 pickle
import sys
import os
import time
import lasagne
import theano
import numpy as np
import theano.tensor as T
from lasagne import layers
from lasagne.updates import nesterov_momentum
from theano.sandbox.neighbours import neibs2images
from lasagne.nonlinearities import sigmoid, rectify, leaky_rectify, identi... |
# Copyright 2015, 2018 IBM Corp.
#
# 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... |
""" Cisco_IOS_XR_ip_domain_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR ip\-domain package operational data.
This module contains definitions
for the following management objects\:
ip\-domain\: Domain server and host data
Copyright (c) 2013\-2018 by Cisco Systems, Inc.
All rights r... |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# 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... |
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 4 15:00:17 2020
@author: kahg8
"""
import os
# Helper libraries
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from tensorflow.keras.models import load_model
from preprocessing import get_test_data
PATH_LIST = 'C:/Users/kahg8/Documents/GitHub/... |
# Copyright 2018 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 csv
import json
import os
from sys import stdout
import nni
from time import sleep
import sys
from datetime import datetime
f = open("curr_pwd", "wt")
cwd = os.getcwd()
f.write(cwd)
f.close()
sys.path.insert(1, os.path.join(cwd, ".."))
sys.path.insert(1, os.path.join(cwd, "..", "..", "graph-measures"))
sys.pat... |
#!/usr/bin/env python3
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Toolbox to manage all the json files in this directory.
It can reformat them in their canonical format or ensures they are well
fo... |
#!/usr/bin/env python3
"""
Create GCP project + stack file for Pulumi
requirements:
- click pyyaml sample-metadata google-cloud-billing-budgets
- kubectl needs to be installed in the environment
(due to subprocess call)
Example usage:
cd stack
DATASET="my-dataset"
python new_stack.py \
... |
# -*- coding: utf-8 -*-
# ======================================================================================================================
# Copyright (©) 2015-2021 LCS - Laboratoire Catalyse et Spectrochimie, Caen, France.
# =
# CeCILL-B FREE SOFTWARE LICENSE AGREEMENT - See full LICENSE agreement in the roo... |
import pickle
from networkx.algorithms.operators.unary import reverse
import numpy as np
import os
import random
import argparse
from copy import deepcopy
from scipy.spatial.transform import Rotation as R
from torch.utils.data import Dataset, DataLoader
from ossid.utils import meta2K, quatAngularDiffBatch, heatmapGau... |
import copy
import math
from functools import partial
from typing import Any, Callable, List, Optional, Sequence
import torch
from torch import nn, Tensor
from torchvision.ops import StochasticDepth
from .._internally_replaced_utils import load_state_dict_from_url
from ..ops.misc import ConvNormActivation, SqueezeExc... |
""" Module for requesting data from bitcointalk.org and parsing it. """
import codecs
from datetime import date
from datetime import datetime
from datetime import time as tm
import HTMLParser
import json
import logging
import lxml.html
import requests
import os
from random import random
import re
import sys
import time... |
# Copyright (c) 2013 OpenStack Foundation.
# 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... |
from aws_requests_auth.aws_auth import AWSRequestsAuth
from elasticsearch import Elasticsearch, RequestsHttpConnection
from elasticsearch.exceptions import AuthenticationException, \
AuthorizationException, NotFoundError
from elasticsearch_dsl import Q, Search, connections
from elasticsearch_dsl.response import Res... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
import os
import sqlite3
import time
# Rutas
#sys.path.append(".")
from sqlite3 import Error
#from PyQt5 import QtCore, QtGui, QtWidgets
from PySide2 import QtCore, QtGui, QtWidgets
#from PyQt5.Qt import QApplication, QClipboard
from PySide2.QtGui import QClip... |
import json
import time
from functools import wraps
from itertools import repeat
from typing import Any, Callable, Container, Dict, Iterable, List, Optional
from urllib.parse import quote
import gevent
import structlog
from cachetools.func import ttl_cache
from gevent.lock import Semaphore
from matrix_client.api impor... |
from flask_restplus import Namespace, fields
import socket
import time
from datetime import datetime, date, time, timedelta
from flask import jsonify, request
import pymongo
from database import DB
from bson import json_util, ObjectId
from apis.utils.common import *
from apis.libraries.send_mail import Send_mail
import... |
from __future__ import print_function
import itertools
import os
import numpy as np
import sys
from datetime import date, datetime, timedelta
from fnmatch import fnmatch
from time import time
from .jpllib import SpiceKernel
from .sgp4lib import EarthSatellite
from .timelib import Timescale, julian_date
today = date.t... |
# Copyright 2015 Linaro Limited
#
# 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 wri... |
#!/usr/bin/env python
# Basic support for extracting data from .obo ontology files.
# Adapted from readobo.py in sols.
# TODO: replace with a proper lib.
import re
import sys
options = None
def case_normalize_initial(s):
# to avoid lowercasing first letter of e.g. abbrevs, require two
# lowercase letters... |
from __future__ import print_function
import os
import time
import numpy as np
import theano
import theano.tensor as T
import lasagne
import matplotlib.pyplot as plt
from tqdm import tqdm
from mpl_toolkits.axes_grid1 import make_axes_locatable
from lasagne.layers import InputLayer, Conv1DLayer, Pool1DLayer
from lasag... |
import time
import json
import tqdm
from ltron.ldraw.documents import LDrawMPDMainFile
from ltron.bricks.brick_scene import BrickScene
from pathlib import Path
# from ltron.gym.components.scene import SceneComponent
from ltron.gym.components.episode import MaxEpisodeLengthComponent
from ltron.gym.components.render impo... |
import argparse
import logging
import os
import string
from datetime import datetime
from time import time
import torch
import torchaudio
from torch.optim import SGD, Adadelta, Adam, AdamW
from torch.optim.lr_scheduler import ExponentialLR, ReduceLROnPlateau
from torch.utils.data import DataLoader
from torchaudio.data... |
# Copyright (c) <NAME>.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory.
""" Numpy based implementation of multi objective
Differential Evolution using either DE/rand/1 or DE/best/1 strategy ('best' refers to the current pareto front').
Ca... |
# Armory Mesh Exporter
# http://armory3d.org/
#
# Based on Open Game Engine Exchange
# http://opengex.org/
# Export plugin for Blender by <NAME>
# Copyright 2015, Terathon Software LLC
#
# This software is licensed under the Creative Commons
# Attribution-ShareAlike 3.0 Unported License:
# http://creativecommo... |
# -*- coding: utf-8 -*-
"""
pyvisa.resources.messagebased
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
High level wrapper for MessageBased Instruments.
This file is part of PyVISA.
:copyright: 2014 by PyVISA Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
from __futu... |
import opentracing
from opentracing import (
child_of,
Format,
InvalidCarrierException,
UnsupportedFormatException,
SpanContextCorruptedException,
)
import ddtrace
from ddtrace.ext.priority import AUTO_KEEP
from ddtrace.opentracer import Tracer, set_global_tracer
from ddtrace.opentracer.span_contex... |
"""
Contains all functions used for searching Stack Overflow and Google
"""
import os
import random
import re
import sys
import copy
from bs4 import BeautifulSoup
import requests
import urwid
import socli.printer
import socli.tui
uas = [] # User agent list
header = {} # Request header
google_search = True
so_url ... |
import distutils
import glob
import os
import shutil
import subprocess
import sys
import types
from distutils.core import Extension
from distutils.dist import Distribution
from distutils.sysconfig import customize_compiler
from os.path import abspath, dirname, exists, join, getmtime
from random import choice
from shuti... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... |
# Copyright (c) 2011 Tencent Inc.
# All rights reserved.
#
# Author: Michaelpeng <<EMAIL>>
# Date: October 20, 2011
"""
This is the target module which is the super class of all of the targets.
"""
from __future__ import absolute_import
import os
import re
from blade import config
from blade import console
from... |
import difflib
import io
import os
import sys
import pytest
from fontTools.pens.boundsPen import BoundsPen
from ufo2ft import (
compileInterpolatableTTFs,
compileOTF,
compileTTF,
compileVariableCFF2,
compileVariableCFF2s,
compileVariableTTF,
compileVariableTTFs,
)
from ufo2ft.constants imp... |
import os, os.path
import shutil
import numpy as np
import chroma.event as event
from chroma.tools import count_nonzero
from chroma.rootimport import ROOT
import array
# Check if we have already imported the ROOT class due to a user's
# rootlogon.C script
if not hasattr(ROOT, 'Vertex') or not hasattr(ROOT, 'Channel'):... |
from brightics.common.repr import BrtcReprBuilder
from brightics.common.repr import strip_margin
from brightics.common.repr import dict2MD
from brightics.common.repr import pandasDF2MD
from brightics.common.utils import check_required_parameters
from brightics.common.groupby import _function_by_group
import numpy as np... |
#kivy modules
from kivy.uix.label import Label
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.textinput import TextInput
from kivy.uix.button import Button
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.popup import Popup
from kivy.uix.image import Image as I... |
#!/usr/bin/env python
import rospy
from nav_msgs.msg import Odometry
from sensor_msgs.msg import Range
from geometry_msgs.msg import Pose
from rfid_node.msg import TagData
import math
import tf
import numpy as np
import sklearn
from sklearn import linear_model
from threading import Lock
from distutils.version import... |
import torch
from torchvision import transforms
from torch.autograd import Variable
import torch.nn.functional as F
import torch.utils.data as Data
from torch.utils.tensorboard import SummaryWriter
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
... |
import numpy as np
import math
import random
class Point():
def __init__(self,pt):
self.x = float(pt[0])
self.y = float(pt[1])
def __add__(self,point):
return Point((self.x+point.x,self.y+point.y))
def __sub__(self,point):
return Point((self.x-point.x,self.y-point.y))
... |
import tensorflow as tf
import tensorflow_probability as tfp
import batch_norm
import util
import pdb
from tensorflow.contrib.rnn import RNNCell
from tensorflow.python.ops import array_ops
from tensorflow.contrib.rnn import LSTMCell, LSTMStateTuple
from tensorflow.contrib.rnn import MultiRNNCell
from tensorflow.python... |
import os
import os.path as op
from os.path import join as pjoin
import sys
import warnings
import pytest
from mayavi import mlab
import nibabel as nib
import numpy as np
from numpy.testing import assert_array_equal, assert_array_less
from unittest import SkipTest
from surfer import Brain, io, utils
from surfer.util... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
"""Transformer model."""
import numpy as np
import tensorflow as tf
# pylint:disable=arguments-differ
def get_angles(pos, i, d_model):
"""Copied from https://www.tensorflow.org/tutorials/text/transformer ."""
angle_rates = 1 / np.power(10000, (2 * (i // 2)) / np.float32(d_model))
return pos * angle_rates... |
# Lint as: python2, python3
# 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
#
... |
import mxnet as mx
import symbol_utils
# Coded by <NAME> on Sep-25, 2018
# Referred to the pytorch code https://github.com/Youngkl0726/Convolutional-Block-Attention-Module/blob/master/CBAMNet.py,
# More detailed information can be found in the following paper:
# <NAME>, <NAME>, <NAME> and <NAME>, "CBAM: Convoluti... |
# Copyright 2021, 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from . import http
import time
from . import util
from . import exceptions
from . import compat
from . import verlib
import re
import json
from xml.etree import ElementTree
from . import signalsmixin
from . import plexobjects
from . import plexresource
fro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.