text stringlengths 6.04k 39.5k |
|---|
# Copyright (c) 2021, salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root
# or https://opensource.org/licenses/BSD-3-Clause
"""
The Trainer, PerfStats and Metrics classes
"""
import os
import random
import time
import nump... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
from astropy.coordinates import SkyCoord, get_moon, get_sun, get_body
from astropy.coordinates.name_resolve import NameResolveError
import astropy.table
from collections import OrderedDict
import ephem
import pyorbit... |
import argparse
import time
import math
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
import data
import model
from utils import batchify, get_batch, repackage_hidden
from adv_drop_algorithms import adversarial_dropout
parser = argparse.ArgumentParser(descrip... |
"""End-To-End Memory Networks.
The implementation is based on http://arxiv.org/abs/1503.08895 [1]
"""
from __future__ import absolute_import
from __future__ import division
import tensorflow as tf
import numpy as np
from six.moves import range
import logging
from utils import position_encoding
logging.getLogger("te... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tianyancha: A scraper of Tianyancha, the best Chinese Business Database."""
__author__ = '<NAME>'
import json
import codecs
import time
import re
import pandas as pd
from bs4 import BeautifulSoup
from selenium import webdriver
from collections import OrderedDict
cl... |
import random
import numpy as np
from netCDF4 import Dataset
import pyximport
pyximport.install(setup_args={'include_dirs':[np.get_include()]})
from scipy.interpolate import CubicSpline
from supra.Utils.AngleConv import roundToNearest
from supra.Utils.Classes import Constants
from supra.Supracenter.cyzInteg import z... |
import sys
import unittest
from test.support import run_unittest, have_unicode, is_jython
import math
L = [
('0', 0),
('1', 1),
('9', 9),
('10', 10),
('99', 99),
('100', 100),
('314', 314),
(' 314', 314),
('314 ', 314),
(' \t\t 314 \t\... |
from instanceHandling import (Instance, calcFailedSaves, applyImmunity, addSaveEffects, calculateDamage)
from dataParsing import (getUnitStats, getUnitSpec, getWeapon)
import pytest
# Test Data Structure
testInstance = Instance()
# Tests on the instance data structure
testInstance.addOrder("achilles1", 1, getUnitStat... |
# -*- coding: utf-8 -*-
# Copyright 2010-2011 OpenStack Foundation
# Copyright (c) 2015 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/lice... |
# -*- coding: utf-8 -*-
# coding=utf-8
# Copyright 2019 The SGNMT 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 requir... |
# coding=utf-8
# Copyright 2022 The Fiddle-Config 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... |
#!/usr/bin/env python3
"""ConsIter produces an updated reference genome that more
closely matches the sequenced viral population by iteratively
mapping reads to the reference and generating a new consensus sequence.
"""
import argparse
import subprocess
import shutil
import re
import os
import sys
# set base command... |
import numpy as np
import math
import healpy as hp
import ispice
import pandas
from astropy.table import Table
from astropy.io import fits
import os
import os.path
import sys
from joblib import Parallel, delayed
from sphericosmo.clcontainer import *
from sphericosmo.mapcontainer import *
from sphericosmo.redshiftcount... |
import numpy as np
from vispy import scene, app
from vispy.util import keys
from .MyWaveVisual import MyWaveVisual
from .color_scheme import palette
from ..view import Picker
from ..utils import EventEmitter
class Axis(scene.AxisWidget):
"""from scene.AxisWidget"""
def set_x_transform(self, x_trans... |
from nlplingo.oregon.event_models.uoregon.tools.utils import *
random.seed(1996)
def get_saying_verbs_ar(saying_verbs_en):
with open(os.path.join(WORKING_DIR, 'datasets/ACE2005/bidict_ar-en.txt')) as f:
biwords = {line.strip().split('\t')[0]: line.strip().split('\t')[1] for line in f.readlines() if
... |
'''
collection of commonly used Ops and layers
'''
from math import sqrt
import itertools
import numpy as np
import tensorflow as tf
import app.hparams as hparams
def lyr_linear(
name, s_x, odim,
axis=-1, bias=True, w_init=None, b_init=None):
'''
Like tf.xw_plus_b, but works on arbitrary sha... |
"""
Provide function for 2D placefield detection.
"""
import numpy as np
from scipy import ndimage
from skimage import measure, morphology
import opexebo
import opexebo.defaults as default
import opexebo.errors as err
def place_field(firing_map, **kwargs):
'''
Locate place fields on a firing map.
Ident... |
# Problem Set 2, hangman.py
# Name: <NAME>
# Collaborators:
# Time spent: 16 days
# Hangman Game
# -----------------------------------
import random
import string
WORDLIST_FILENAME = "words.txt"
#########################################################################################################################... |
import os
import time
import json
import base64
from tqdm import tqdm
import numpy as np
import shutil
from PIL import Image
from copy import deepcopy
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from tencentcloud.common imp... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import numpy as np
from numpy.testing import assert_allclose, assert_array_less
from abel.rbasex import rbasex_transform, cache_cleanup
from abel.rbasex import get_bs_cached, cache_cleanup
from... |
from typing import Any
import numpy as np
import pandas as pd
import pyarrow as pa
import six
import fletcher as fr
def generate_test_array(n):
return [
six.text_type(x) + six.text_type(x) + six.text_type(x) if x % 7 == 0 else None
for x in range(n)
]
class TimeSuitePatterns:
"""
S... |
#!/usr/bin/python
__author__ = 'ahmed'
import csv
import sys
from logging import exception
from xml.etree import ElementTree
from xml.etree.ElementTree import Element
from xml.etree.ElementTree import SubElement
import datetime
import logging
from xml.dom import minidom
import argparse
# dictionary to hold IANA S... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 8 14:34:24 2019
@author: github.com/sahandv
"""
import numpy as np
class MeanEmbeddingVectorizer(object):
def __init__(self, word2vec):
self.word2vec = word2vec
if len(word2vec)>0:
self.dim=len(word2vec[next(iter(gl... |
import matplotlib
matplotlib.use('Agg')
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.gridspec as gridspec
from datetime import timedelta
import json, os,csv
from sys import argv
plt.style.use("seaborn-poster")
def plot_results(df, int_vars:list, ax_arg=... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains functions and classes related with Maya API curve nodes
"""
from __future__ import print_function, division, absolute_import
from copy import copy
from collections import OrderedDict
import maya.cmds
import maya.api.OpenMaya
from tpDcc.libs.py... |
import os
import warnings
import matplotlib.pyplot as plt
import pandas as pd
import conf
from . import geo
from ..output import OUTPUT_DATA_SPEC
# map mun code -> name
mun_codes = pd.read_csv('input/names_and_codes_municipalities.csv', sep=';')
mun_codes = dict(zip(mun_codes['cod_mun'], mun_codes['cod_name']))
war... |
#!/usr/bin/env python3
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in th... |
# Copyright (C) 2017-2019 <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 3 of the License, or
# (at your option) any later version.
#
# This program is distribut... |
# Copyright 2022 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import urllib
import math
import numpy as np
from scipy.optimize import minimize
from scipy.optimize import nnls
from scipy.spatial.distance import cosine
# from scipy.optimize import basinhopping # , differential_evolution
# from scipy.optimize import fmin_cobyla
from scipy.stats import entropy
from mutagene.signa... |
"""
Dataset Definition of GEF_14 power dataset.
Format: Column 0 Column 1 Column 2 Column 3-27
Load Zone Date (MM-DD-YYYY HH:MM) Load 25 Weather Station Readings
"""
from __future__ import print_function, division
import os
from os import listdir... |
from math import comb
from typing import Dict, List, Optional, Tuple, Union
import numpy as np
import torch
from core.fastmurty.mhtdaClink import (
allocateWorkvarsforDA,
deallocateWorkvarsforDA,
mhtda,
sparse,
)
from core.fastmurty.mhtdaClink import sparsifyByRow as sparsify
from scipy.optimize import... |
import os
import sys
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
import MultiExporter.constants as const
import MultiExporter.presetUtils as presetUtils
from maxsdk import layer, qtUtils, sceneUtils, userprop, utility
from pymxs import runtime as rt
class ... |
# Copyright 2019 <NAME>. 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 agree... |
import logging
import os
from pathlib import Path
from datetime import datetime
from urllib.error import HTTPError
from urllib.request import urlopen
import pandas
from enstools.misc import download, bytes2human
from enstools.core import get_cache_dir
class DWDRadar:
# create a new temporal directory to store con... |
__author__ = 'rcj1492'
__created__ = '2017.05'
__license__ = 'MIT'
def retrieve_template(file_path):
'''
a method to retrieve text of a template file
:param file_path: string with relative path of file
:return: string with text of file
'''
from os import path
from pocketlab ... |
"""
compute_ss_model
- Chapter 5 assignment for Beard & McLain, PUP, 2012
- Update history:
2/4/2019 - RWB
"""
import sys
sys.path.append('..')
import numpy as np
from scipy.optimize import minimize
from tools.tools import Euler2Quaternion, Quaternion2Euler
# from tools.transfer_function import transf... |
# Copyright (c) 2016, <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, s... |
import json
import os,struct
from queue import Queue
from threading import Thread
from random import shuffle, sample
from tensorflow.core.example import example_pb2
import numpy as np
def sample_generator(bin_fname, single_pass=False):
"""
Generator that reads binary file and yield text sample for training or... |
from __future__ import division
from percept.tasks.base import Task
from percept.tasks.train import Train
from percept.fields.base import Complex, List, Dict, Float
from inputs.inputs import SimpsonsFormats
from percept.utils.models import RegistryCategories, get_namespace
import logging
from percept.tests.framework im... |
import numba
from numba import cuda
from tinytorch.tensor.data import (
MAX_DIMS,
TensorData,
broadcast_index,
index_to_position,
shape_broadcast,
to_index,
)
# This code will CUDA compile fast versions your tensor_data functions.
# If you get an error, read the docs for NUMBA as to what is al... |
#!/usr/bin/python3
# Copyright 2017-2020 <NAME>
#
# The MIT License (MIT)
#
# Use of this source code is governed by MIT license that can be
# found in the LICENSE.txt file.
import sys
import os.path
import re
import subprocess
import argparse
import string
import configparser
me = os.path.basename(__file__)
root = ... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 15 10:31:23 2017
@author: robertmarsland
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import subprocess
import os
import pickle
import datetime
from sklearn.decomposition import PCA
StateData = ['ACI', 'ACII', 'CIATP'... |
import networkx as nx
import random
import numpy as np
import itertools
import matplotlib.pyplot as plt
import scipy as sp
import scipy.sparse # call as sp.sparse
import scipy.sparse.linalg # call as sp.sparse.linalg
"""
DRAWING FUNCTIONS
"""
'''def _dense_spectral(G:nx.Graph, weight:str):
A = nx.to_scipy_spa... |
import numpy as np
import quaternion
from tbase.shader import Shader
from tbase import utils
from tbase.utils import Quaternion
try:
from pyglet.gl import *
except:
print("WARNING: pyglet cannot be imported but might be required for visualization.")
VERTEX_SHADER = ['''
varying vec3 normal, lightDir0, lightDi... |
from pytelegrafhttp.endpoint import Endpoint
from pytelegrafhttp.util import check_online
from pytelegrafhttp.clock import now
from pytelegrafhttp import scrape
from unittest import TestCase
import re
from datetime import timedelta
class EndpointTest(TestCase):
def setUp(self):
self.endpoint = Endpoint('/myuri/en... |
# Import the libraries
import pandas as pd
import matplotlib.pyplot as plt
import re
import numpy as np
# Load the dataframe
print("Loading the dataset")
df = pd.read_csv('train.csv')
df.head()
# Shape of the original data
print("Shape of original dataset",df.shape)
# ### Features use
#
#
# * Mail add... |
# -*- coding: utf-8 -*-
import sys
import codecs
import json
import math
import numpy as np
from scipy.misc import logsumexp
from scipy.stats import norm, laplace # gamma
from scipy.special import gammaln, multigammaln
import random # for debug
from argparse import ArgumentParser
from json_utils import load_json_file... |
import pickle
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib.colors import Colormap
import argparse
import pandas as pd
import os
from collections import Counter
from scipy import stats
from clustering_genomic_signatures.dbtools.get_signature_metadata import (
get_metadata... |
#
# raichu.py : Play the game of Raichu
#
# Written by saimorap, hatha, aagond
#
# Based on skeleton code by <NAME>, Oct 2021
#
#I have used the numpy library extensively in the code
# and reffered its whenever needed from https://numpy.org/doc/stable/reference/index.html
import sys
import time
from typin... |
"""
translate.py
Partition reads into coding, noncoding, and low-complexity bins
"""
import itertools
import sys
import warnings
import functools
import click
import numpy as np
import screed
from sourmash.minhash import hash_murmur
from orpheum.log_utils import get_logger
from orpheum.sequence_encodings import encod... |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import pickl... |
import requests
from requests.auth import HTTPBasicAuth
import json
import logging
logging.basicConfig(level=logging.DEBUG)
class ScrumwiseObject(object):
_object_type = None
def __init__(self, scrumwise_session, data=None):
self.scrumwise_session = scrumwise_session
self.obj_id = None
... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""=================================================================
@Project : Algorithm_YuweiYin/LeetCode-All-Solution/Python3
@File : LC-1994-The-Number-of-Good-Subsets.py
@Author : [YuweiYin](https://github.com/YuweiYin)
@Date : 2022-02-22
========================... |
import numpy as np
import numpy.ma as ma
import os
import time
import pickle
import warnings
import argparse
import pdb
import matplotlib.pyplot as plt
from glob import glob
from random import sample, shuffle, choice
from scipy.ndimage.morphology import distance_transform_edt
from rasterio import open as rasopen, band... |
'''
This module contains function for operations on reinforced concrete sections.
'''
# Standard library imports
# Third party imports
import numpy as np
from shapely.geometry import Point
from shapely.geometry import Polygon
from shapely.ops import split
import shapely
# Project specific imports
import conctools._... |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2007 <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions ... |
# -*- coding: utf-8 -*-
import logging
import json
import re
import gzip
from io import BytesIO
import time
import warnings
from functools import wraps
from .compat import (
compat_pickle, compat_cookiejar, compat_urllib_request,
compat_urllib_parse, compat_urllib_parse_urlparse, compat_urllib_error
)
from .c... |
import numpy as np
import glob
import datetime
import math
import random
import os
import shutil
import matplotlib.pyplot as plt
import pretty_midi
from pypianoroll import Multitrack, Track
import librosa.display
from utils import *
ROOT_PATH = '/Users/sumuzhao/Downloads/'
test_ratio = 0.1
LAST_BAR_MODE = 'remove'
d... |
'''
Created on 2017.9.18
@author:
'''
# -*- coding: utf-8 -*-
import os
from Constants import *
import types
import sys
import FileUtil
e_type_map = {'CHEMICAL':'chemical', 'GENE-N':'gene', 'GENE-Y':'gene'}
def analyse_two_offsets(offset1, offset2):
if offset1[1] < offset2[0]:
return 'normal'
else:
... |
# -*- coding: utf-8 -*-
# Copyright 2019 The Aerospace 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 a... |
import time
from typing import List, Optional, Union
from packaging import version
import pandas as pd
from tqdm.auto import tqdm
from mstrio import config
from mstrio.api import datasets
from mstrio.object_management.search_operations import full_search, SearchPattern
from mstrio.connection import Connection
from ms... |
if __name__ == "__main__":
import matplotlib
matplotlib.use('TkAgg')
from dicom.sequence import Sequence
import skimage
from image_transform import fast_warp
from util_scripts.test_slice_locationing import slice_location_finder
import matplotlib.pyplot as plt
import numpy as np
import pickle as pic... |
# coding: utf-8
# Original work Copyright <NAME> (EPL 1.0)
# See ThirdPartyNotices.txt in the project root for license information.
# All modifications Copyright (c) Robocorp Technologies Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in... |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A UNIX SSH server.
"""
import fcntl
import grp
import os
import pty
import pwd
import socket
import struct
import time
import tty
from zope.interface import implementer
from twisted.conch import ttymodes
from twisted.conch.avatar import Con... |
#!/usr/bin/env python
"""
@package mi.dataset.parser.test
@stream_handle marine-integrations/mi/dataset/parser/test/test_adcps_jln.py
@author <NAME>
@brief Test code for a adcps_jln data parser
Parts of this test code were taken from test_adcpa.py
Due to the nature of the records in PD0 files, (large binary re... |
#!/usr/bin/env python3
# -*-python-*-
#
# Copyright (C) 1999-2021 The ViewCVS Group. All Rights Reserved.
# Copyright (C) 2000 <NAME> <<EMAIL>>
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http:/... |
import os
import sys
import warnings
from collections import namedtuple
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from torchvision import datasets, transforms
from torch.utils.model_zoo import load_url as load_state_dict_from_url
from torchsummary import summary
import time
... |
import requests
import subprocess
import shlex
import os
from enum import Enum
from typing import List, Optional, Tuple, Dict, Any
from urllib.parse import quote_plus, urlparse
from gtmcore.logging import LMLogger
from gtmcore.configuration import Configuration
logger = LMLogger.get_logger()
REQUEST_TIMEOUT = 30
de... |
"""
Renders mesh using OpenDr for visualization.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import cv2
from opendr.camera import ProjectPoints
from opendr.renderer import ColoredRenderer
from opendr.lighting import LambertianPoi... |
import torch
import torch.cuda
import torch.nn.functional as F
from typing import Optional, Union, List
from dataclasses import dataclass
import numpy as np
import cv2
from scipy.spatial.transform import Rotation
from scipy.interpolate import CubicSpline
from matplotlib import pyplot as plt
from warnings import warn
... |
import sys
import os
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import (QApplication,
QMainWindow,
QTabWidget,
QVBoxLayout,
QHBoxLayout,
... |
#!/usr/bin/env python # pylint: disable=too-many-lines
''' Ansible module '''
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ _... |
import os
import yaml
import math
import glob
from typing import *
import torch
import torchvision.transforms as T
import torchvision.transforms.functional as TF
import torch.nn.functional as F
from PIL import Image
import numpy as np
import clip
from omegaconf import OmegaConf
# from cmodels.taming.vqgan import VQMo... |
import copy
import logging
import math
from typing import (
IO,
Any,
Callable,
Dict,
List,
MutableMapping,
MutableSequence,
Optional,
Set,
Tuple,
Union,
cast,
)
from rdflib import Graph, URIRef
from rdflib.namespace import OWL, RDFS
from ruamel.yaml.comments import Comme... |
import os
from collections import namedtuple
from xml.sax.saxutils import escape
from eulxml.xmlmap.core import load_xmlobject_from_string
from lxml import etree
from memoized import memoized
from corehq import toggles
from corehq.apps.app_manager import id_strings
from corehq.apps.app_manager.const import RETURN_TO
... |
# Copyright (c) 2020, <NAME>
# License: MIT License
from typing import List, TYPE_CHECKING, Iterable, Tuple, Dict, Union, cast, Sequence
from abc import abstractmethod
from collections import namedtuple
import math
from ezdxf.math import Vec2, BSpline, linspace, ConstructionRay, ParallelRaysError, bulge_to_arc, Constru... |
# <NAME>
# <EMAIL>
# April 2, 2018
import sys
import os
import inspect
model_path = os.path.dirname(
os.path.abspath(inspect.getfile(inspect.currentframe()))) + "/../models"
print("train: Add {} to path".format(model_path))
sys.path.append(model_path)
from models import PCA
from gpflow.kernels import RBF, Expone... |
"""
========================================================================================
Wrap landlab component with the Basic Modeling Interface (:mod:`landlab.bmi.bmi_bridge`)
========================================================================================
.. sectionauthor:: <NAME>
Function reference
--... |
from purchaseRequests import email_config
from team_manager import settings
from django.core.mail import send_mail
from django.shortcuts import get_object_or_404, render, redirect
from django.http import HttpResponseRedirect, HttpResponse
from django.urls import reverse
from django.utils import timezone
from django.con... |
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
from __future__ import annotations
from typing import Tuple, Union, Dict
import typing
from pycde.support import _obj... |
# -*- coding: utf-8 -*-
"""
codegen
~~~~~~~
Extension to ast that allow ast -> python code generation.
:copyright: Copyright 2008 by <NAME>.
:license: BSD.
"""
from ast import *
BOOLOP_SYMBOLS = {
And: 'and',
Or: 'or'
}
BINOP_SYMBOLS = {
Add: '+',
Sub: ... |
import json
import requests
import base64
import zlib
from simplejson.errors import JSONDecodeError
aliasAddress = './aliases.json'
lbAddress = './leaderboard.json'
remainingAddress = './remaining_combos.json'
submittedAddress = './submitted_combos.json'
towerAliasAddress = './tower_aliases.json'
hastebinUrl = 'https... |
# -*- coding: utf-8 -*-
'''
This module defines multiple utility functions for filtering, creation, slicing,
etc. of neo.core objects.
'''
import neo
import copy
import warnings
import inspect
import numpy as np
import quantities as pq
def get_events(container, **properties):
"""
This function returns a list... |
"""Guess the MIME type of a file.
This module defines two useful functions:
guess_type(url, strict=True) -- guess the MIME type and encoding of a URL.
guess_extension(type, strict=True) -- guess the extension for a given MIME type.
It also contains the following, for tuning the behavior:
Data:
knownfiles -- list ... |
"""Serialize graphs to/from files on disk."""
import ast
import os
from xml.etree import ElementTree as etree
import networkx as nx
import numpy as np
import pandas as pd
from shapely import wkt
from . import settings
from . import utils
from . import utils_graph
def save_graph_geopackage(G, filepath=None, encodin... |
# -*- coding: utf-8 -*-
#
# This file is part of PyGaze - the open-source toolbox for eye tracking
#
# PyGazeAnalyser is a Python module for easily analysing eye-tracking data
# Copyright (C) 2014 <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pu... |
# coding=utf-8
"""Define basic fixtures."""
import os
# First patch httplib
tracer = None
try:
from ddtrace import config, patch, tracer
if os.getenv("RECORD", "false") != "none":
from ddtrace.internal.writer import AgentWriter
class Writer(AgentWriter):
def is_alive(self):
... |
import os
import random
import time
import cv2
import numpy as np
import logging
import argparse
import shutil
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torchvision
import torchvision.transforms as transforms
impor... |
#!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... |
# 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 appli... |
"""Plugin common functions."""
import logging
import re
import shutil
import sys
import tempfile
import warnings
import OpenSSL
import pkg_resources
import zope.interface
from josepy import util as jose_util
from acme.magic_typing import List # pylint: disable=unused-import, no-name-in-module
from certbot import a... |
# Copyright 2011-2016 <NAME>, <NAME>, and <NAME> and
# Copyright 2017 <NAME>.
#
# This file is part of mumpy. It is subject to the license terms in the file
# LICENSE found in the top-level directory of this distribution. A list of
# mumpy authors can be found in the file AUTHORS.md at the top-level
# directory of this... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems
This module is developed by:
<NAME> <<EMAIL>>
<NAME> <<EMAIL>>
This module is under the University of Illinois/NCSA Open Source License.
Please refer to https://github.com/Q... |
import base64
import copy
import hashlib
import logging
import os
from datetime import datetime
from typing import Dict, Optional, Union
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from lxml import etree
from oscrypto.asymmetric import Certificate, load_certificate
from .exc... |
#!/usr/bin/env python
from myhdl import *
class C_OPcode:
"""
Tipos de operaciones
"""
R_type = 0b0110011
I_type = 0b0010011
I_type_JALR = 0b1100111 # se usa para la funcion JALR junto funct3 = 0, es decir funct3 = 000 o ADDI
I_type_LOAD = 0b0000011 # usadas para instrucciones de carga
... |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
"""
Drawers for various edge styles in graph plots.
"""
__all__ = ["AbstractEdgeDrawer", "AlphaVaryingEdgeDrawer",
"ArrowEdgeDrawer", "DarkToLightEdgeDrawer",
"LightToDarkEdgeDrawer", "TaperedEdgeDrawer"]
__license__ = "GPL"
from igraph.drawing.colors import clamp
from igraph.drawing.metamagic ... |
import models
import player
import config
import playerstat
import wrap
import ratingjob
import serverinfo
import playerdetail
import json
# import logging
import time
import traceback
import StringIO
from google.appengine.ext import db
"""
AddGameStat json:
{
"server_id": <integer>,
"server_start": <unsigned... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Intensity-based image registration
"""
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import scipy.ndimage as nd
from ...core.image.image_spaces import... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.