text stringlengths 8.04k 46.5k |
|---|
# -*- coding: utf-8 -*-
# This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2014 and later, <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:
#
# 1.... |
# coding=utf-8
# Copyright 2022 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... |
#!/usr/bin/python
# For a complete discussion, see http://forum.kodi.tv/showthread.php?tid=254502
import datetime
import random
import string
import time
import os
import re
import codecs
import logging
import music
from flask import Flask, json, render_template
from functools import wraps
from flask_ask import Ask, ... |
#!/usr/bin/python3
# Copyright (c) 2018-2022 The MobileCoin Foundation
# TODO
# - Better errors on missing env vars
# - SGX HW/SW
# - Default MC_LOG
import argparse
import json
import os
import shutil
import socketserver
import subprocess
import sys
import threading
import time
from pprint import pformat
BASE_CLIENT... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from collections import defaultdict
import autonetkit.log as log
import netaddr
from autonetkit.ank import sn_preflen_to_network
from autonetkit.compiler import sort_sessions
from autonetkit.compilers.device.router_base import RouterCompiler
from autonetkit.nidb import config_... |
from datetime import timedelta
from intervalpy import Interval
import os
import pytest
import sys
from pyduration import Duration, util
module_dir = os.path.dirname(__file__)
sys.path.append(os.path.join(module_dir, '..', 'pyduration'))
t_ = util.timestamp
def span(t1, t2, start_open=False):
return Interval(t_(... |
# Copyright (c) 2009-2012 <NAME>. See LICENSE for details.
from __future__ import absolute_import
import sys
from greenlet import greenlet
from gevent._compat import PY3
from gevent._compat import PYPY
from gevent._compat import reraise
from gevent._util import Lazy
from gevent._tblib import dump_traceback
from gevent.... |
import numpy as np
from PIL import Image, ImageTk
import matplotlib.pyplot as plt
import cv2
from scipy.integrate import simps
import os
import tkinter
from scipy.signal import find_peaks
import math
import re
from matplotlib.ticker import (AutoMinorLocator)
from tkinter import Text, Radiobutton, Frame, Button, filedia... |
from mpi4py import MPI
import urllib.request
from bs4 import BeautifulSoup
import pandas as pd
from time import sleep
from datetime import datetime
import random
import re
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
import timeit
import configs # use MAIN_URL_TO_PROCESS, BR... |
from typing import Dict, Optional, Tuple, Union
import torch
from torch.distributions import Uniform
from kornia.augmentation.random_generator.base import RandomGeneratorBase
from kornia.augmentation.utils import _adapted_rsampling, _adapted_uniform, _common_param_check, _joint_range_check
from kornia.geometry.bbox i... |
#!/usr/bin/env python
"""This is the manager for the various queues."""
import collections
import os
import random
import socket
import time
import logging
from grr import config
from grr.lib import data_store
from grr.lib import rdfvalue
from grr.lib import registry
from grr.lib import stats
from grr.lib import uti... |
# Copyright (c) 2021 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, ... |
#!/usr/bin/env python3
#==============================================================================
# This script takes an xml file which describes hardware options and produces
# header files in the directory hardware which are used by the embedded
# software.
# Currently there is an option to produce the xml file ... |
# -*- encoding: utf-8 -*-
"""The main function."""
import argparse
import codecs
import locale
import os
import shutil
import sys
import time
from operator import attrgetter
from unicodedata import normalize
import numpy as np
from astropy.time import Time as astrotime
from six import string_types
from mosfit import... |
# This file is part of Androguard.
#
# Copyright (C) 2012/2013, <NAME> <desnos at t0t0.fr>
# 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.or... |
# Copyright 2018 PerfKitBenchmarker 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... |
import inspect
import re
import sys
from collections import defaultdict
from enum import Enum
from inspect import Signature, _empty, isabstract, isclass, iscoroutinefunction
from typing import (
Any,
Callable,
Dict,
Mapping,
Optional,
Type,
TypeVar,
Union,
cast,
g... |
# 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... |
import warnings
from datetime import datetime
from functools import partial
import numpy as np
import pandas as pd
import pandas.api.types as pdtypes
from featuretools import variable_types
from featuretools.entityset.relationship import RelationshipPath
from featuretools.exceptions import UnknownFeature
from feature... |
from __future__ import annotations
import dataclasses
import io
import pprint
from enum import Enum
from typing import Any, BinaryIO, Callable, Dict, Iterator, List, Optional, Tuple, Type, TypeVar, Union, get_type_hints
from blspy import G1Element, G2Element, PrivateKey
from typing_extensions import Literal, get_args... |
"""
Toolkit model which works with operator type specifications and metadata.
This should only be used within development tools.
"""
from dataclasses import dataclass, field
import dataclasses
import json
from pathlib import Path
import re
from typing import Dict, Iterable, List, Optional, Union
import yaml
from ray... |
import logging
from urllib.parse import urlparse
from jwkest import b64e
from oic import CC_METHOD
from oic import OIDCONF_PATTERN
from oic import unreserved
from oic.oauth2.base import PBase
from oic.oauth2.exception import GrantError
from oic.oauth2.exception import HttpError
from oic.oauth2.exception import Missin... |
# Copyright 2016 Open Source Robotics Foundation, 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... |
# Copyright 2020 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 wri... |
import alphashape
import h5py
import importlib
import matplotlib.pyplot as plt
import numpy as np
import os
import scipy.ndimage
from shapely.geometry import Point
import shutil
from skimage.transform import warp
from skimage.registration import optical_flow_tvl1
import torch
import NNtools
def load_data(datadir, mo... |
'''
harmalysis - a language for harmonic analysis and roman numerals
Copyright (C) 2020 <NAME>
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... |
#!/usr/bin/python3
import os
# Importing h5py on windows will mess with your environment. When we pass the messed up environment to gadgetron
# child processes, they won't load properly. We're saving our environment here to spare our children from the
# crimes of h5py.
environment = dict(os.environ)
import sys
impor... |
#!/usr/bin/python2.7
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
"""Force constants calculation."""
# Copyright (C) 2011 <NAME>
# All rights reserved.
#
# This file is part of phonopy.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain ... |
# -*- coding: utf-8 -*-
# $Id: build.py $
"""
Test Manager - Builds.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute it and/or modify it under ... |
import torch
from torch import nn
from torch.autograd import Variable
import torch.nn.functional as F
from models.captioning_model import CaptioningModelDecoder, print_current_beam
from utils import TOKEN_START, TOKEN_END
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class ContrastiveLoss(nn... |
# This program is published under a GPLv2 license
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) <NAME> <<EMAIL>> 2011-2012
# Copyright (C) <NAME> <<EMAIL>>: 2012-03-10 Added frames
# Copyright (C) <NAME> <<EMAIL>>: 2018
# Copyright (C) 2020 <NAME> <<EMAIL>>... |
'''
Author: <NAME>
Date: May 1, 2019
Course: ISTA355
Final Project
This file contains all the functions used for my ISTA355 Final Project.
The purpose of the file is to accomplish the task of incorporating question
answering features to a classifier in order to replicate a open ended question
answer model or search e... |
#!/usr/bin/env python
# Make sample fastqs 2-level
# Andrew's barcode parser/fastq combiner modified for 2-level
import barcodeutils as bu
import argparse
import os
import json
from collections import OrderedDict
import re
import sys
import glob
import xml.etree.ElementTree as ET
import ast
import run_info
SCRIPT_DIR... |
import tensorflow as tf
import numpy as np
from special_ops.operators import clip_dangerous_gradients
from utils.einsum import einsum
from core.config import cfg
from .se3 import *
from .intrinsics import *
from . import projective_ops as pops
from . import cholesky
cholesky_solve = cholesky.solve
MIN_DEPTH = 0.1
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
r"""table utils"""
from __future__ import print_function, unicode_literals, division, absolute_import
from future import standard_library
standard_library.install_aliases() # noqa
from builtins import * # noqa
from past.builtins import basestring
from future.utils import... |
#!/usr/bin/env python3
import sys
import cv_bridge
import cv2
import math
import yaml
import numpy as np
import numpy.lib
import scipy.signal
import image_geometry
from sensor_msgs.msg import CameraInfo
bridge = cv_bridge.CvBridge()
def patch_normalise(image, patch_size):
patch_half_size = [(p-1)/2 for p in patch_s... |
"""
<NAME>
<EMAIL>
The Tree of learning bears the noblest fruit,
but noble fruit tastes bad.
Proceed Formally.
"""
# Omitted the correlative uncertainty in the calibration constant
# since the TE value and Area values both are dependent on T and B
"""
TODO: Ship the toolsuite with a .ini so columnames can be gene... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# mockturtle
Simple python interpreter for a subset of the turtle graphics
language.
## Table of Contents
- [Command-line usage and help]
- [Platform]
- [Modes of running]
- [Forms of input]
- [Examples]
- [Program structure]
- [Main classes and functions]
... |
#!/usr/bin/env python3
# coding: utf-8
# Copyright 2019 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 ... |
# -*- coding: utf-8 -*-
"""
:copyright: Copyright 2017-2018 by the contributors (see AUTHORS file).
:license: BSD-2-Clause, see LICENSE for details.
See also:
Confluence Cloud REST API Reference
https://docs.atlassian.com/confluence/REST/latest/
Confluence XML-RPC and SOAP APIs
https:/... |
#!/usr/bin/env python3
import fnmatch
import json
import os
import re
import sys
import matplotlib.path
import requests
import yaml
data = yaml.safe_load(open('otaniemi.yml'))
use_cache = True # run "make refresh" to force new data
re_nametoid = re.compile('[^a-zA-Z0-9_]+')
# Getting ways by ID:
# wget -o /dev/nu... |
import brl
import tabularRL as tq
import numpy as np
#import matplotlib
# Force matplotlib to not use any Xwindows backend.
#matplotlib.use('Agg')
import time
import brl_util as util
import pdb
import seeding
import pickle
import argparse
import os
from tabulate import tabulate
from collections import OrderedDict
impo... |
import enum
import logging
import math
from math import floor
from typing import Dict, List, Optional, Tuple
from s2clientprotocol.debug_pb2 import Color
from sharpy.constants import Constants
from sharpy import sc2math
from sharpy.sc2math import spiral
from sharpy.general.zone import Zone
from sc2 import... |
# Turnwheel & Event Log
import os, math
from . import GlobalConstants as GC
from . import InputManager, StateMachine, BaseMenuSurf, BattleAnimation
from . import Background, Action, Engine, Image_Modification, Weather, Dialogue
import logging
logger = logging.getLogger(__name__)
class ActionLog(object):
... |
""" Eases production of colors in the terminal,
and only doing so when it is capable of showing it.
(whether we are in a tty, and whether the TERM suggests we are color-capable.
You can override that in manual checks with the arguments on guess_color_support(),
You can override that in the automatic che... |
##########################################################################
#
# Copyright 2008-2010 VMware, Inc.
# All Rights Reserved.
#
# 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 withou... |
from typing import TYPE_CHECKING, Optional
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.core.exceptions import ValidationError
from django.forms import modelformset_factory
from django.http import Htt... |
#----------------------------------------------------------------------
# Copyright (c) 2012, <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 of source code must r... |
# -*- coding:utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright (c) 2012 Samsung SDS, Co., LTD
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.... |
import datetime
import sys
import time
import trio
import trio_mysql
import pytest
import socket
from tests import base
class TempUser:
def __init__(self, c, user, db, auth=None, authdata=None, password=None):
self._c = c
self._user = user
self._password = password
self._auth = aut... |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
"""
Lambda function designed to be called on a recurring schedule ("rate(5 minutes)")
that will methodically work through the steps of creating Personalize campaigns
for product and search personalization by completi... |
# Copyright 2022 The Pigweed 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 ... |
from __future__ import print_function, division, absolute_import
import importlib
import itertools
import json
import logging
import math
import numbers
import os
import time
from pymel.core import addAttr, annotate, Attribute, attributeQuery, circle, cmds, createNode, delete, \
disconnectAttr, duplicate, hasAttr... |
from airsim_client import *
from rl_model import RlModel
import time
import numpy as np
import threading
import json
import os
import uuid
import glob
import datetime
import h5py
import sys
import requests
import PIL
import copy
import datetime
# A class that represents the agent that will drive the vehicle, train the... |
#!/usr/bin/python3.5
import os
import sys
import re
import xml.sax
import tkinter as tk
from tkinter import filedialog
from tkinter import ttk
from tkinter import *
import tkinter.filedialog
import tkinter.messagebox
from tkinter.ttk import *
from . import dialog
from .dialog import Dialog
from tkinter.filedialog impor... |
"""SVD elements from XSD schema file v1.3.3
"""
import re
import pysvd
# /device
# http://www.keil.com/pack/doc/cmsis/svd/html/elem_device.html
class Device(pysvd.classes.Base):
"""The element <device> provides the outermost frame of the description.
* Only one <device> section is allowed per file. All other... |
"""
wire has the basic extended types useful for creating logic.
Types defined in this file include:
* `WireVector` -- the base class for ordered collections of wires
* `Input` -- a wire vector that receives an input for a block
* `Output` -- a wire vector that defines an output for a block
* `Const` -- a wire vector... |
#Checks if country exists within a certain decade and returns list of all countries
countriesArr = [{"year" : 1900, "countries" : ["Argentina", "Austria", "Belgium", "Bhutan", "Bolivia", "Brazil", "Bulgaria", "Canada",
"Chile", "Colombia", "Costa Rica", "Cuba", "Denmark", "Dominican Republic",... |
from __future__ import absolute_import, division, print_function
from collections import OrderedDict
import math
from pymel.core import curve, cluster, delete, dt, duplicate, expression, group, hide, ikHandle, insertKnotCurve, joint, move, orientConstraint, parent, parentConstraint, pointConstraint, xform
import pdi... |
"""
visualization of netCDF data
"""
from tempfile import mkstemp
# from matplotlib import use
# use('Agg') # use this if no xserver is available
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import colors
from matplotlib.patches import Polygon
import matplotlib.patches as mpatches
import ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 20 21:08:47 2018
@author: aarontallman
"""
import os
import random
import time
import string
import numpy as np
import requests
from lxml import html
LOCAL = os.path.dirname(os.path.dirname(__file__))
CDNM = LOCAL + '/data/wordslist.txt'
THES = LOCA... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe.model.naming import set_name_by_naming_series
from frappe import _, msgprint
import frappe.defaults
from frappe.ut... |
import inspect
import math
import typing as tp
from collections import OrderedDict
from abc import abstractmethod, ABCMeta
from beatsearch.rhythm import MonophonicRhythm, PolyphonicRhythm, Unit, UnitType, parse_unit_argument
from beatsearch.feature_extraction import BinaryOnsetVector, IOIVector, \
IOIDifferenceVect... |
import os
import json
import math
import torch
import pprint
import logging
import numpy as np
import torch.nn as nn
from abc import abstractmethod
from abc import ABC
from abc import ABCMeta
from typing import Any
from typing import Set
from typing import Dict
from typing import List
from typing import Type
from typ... |
# -*- coding: utf-8 -*-
import codecs
import random
import numpy as np
import multiprocessing
from collections import Counter
import os
import pickle
#import gensim
#from gensim.models import KeyedVectors
import h5py
import time
import json
import jieba
import tensorflow as tf
from model.config import Config
PAD_ID =... |
# Copyright 2013 Mirantis, 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 agr... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'cpef: tools to help scrap AMAC information 基金业协会私募基金数据库'
__author__ = '<NAME>'
import numpy as np
import pandas as pd
from bs4 import BeautifulSoup
from fake_useragent import UserAgent
import requests, time, re, math, openpyxl, datetime, os, shutil, psutil, platform, p... |
# python3
r"""Learners of generalized method of moments with deep networks.
References:
- DeepGMMLearner:
<NAME>, <NAME>, and <NAME>. Deep generalized method of
moments forinstrumental variable analysis. InAdvances in Neural Information
Processing Systems, pages3559–3569, 2019.
- AdversarialSEMLearner
<NAME... |
#########################################################################
#
# graphics.py - This file is part of the Spectral Python (SPy) package.
#
# Copyright (C) 2001-2010 <NAME>
#
# Spectral Python is free software; you can redistribute it and/
# or modify it under the terms of the GNU General Public Lice... |
import os, sys
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
import traceback
from yue.core.song import Song, SongSearchGrammar
from yue.core.search import naive_search, ParseError, SearchGrammar, \
AndSearchRule, ExactSearchRule
from yue.core.sqlstore import SQLStore
from ... |
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin
# Create your models here.
from django.conf import settings
from django.db.models.signals import post_save
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from d... |
#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Distribution Provider API
:author: <NAME>
:copyright: Copyright 2020, <NAME>
:license: Apache License 2.0
:version: 1.0.1
..
Copyright 2020 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in co... |
import random
from pokemon_type import Type
class MoveBase():
STATUS = 0
PHYSICAL = 1
SPECIAL = 2
class Move():
def __init__(self, name, hex, type, base, power, accuracy, effects):
self.name = name
self.hex = hex
self.type = type
self.base = base
self.power =... |
#!/usr/bin/python
import olypy.details as details
from collections import defaultdict
from olypy.oid import to_oid
from olymap.detail import long_subkind_to_display_subkind
from olymap.detail import long_kind_to_display_kind
from olymap.detail import rank_num_string
from olymap.detail import castle_ind
from olymap.det... |
# 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.
"""Task queue endpoints for creating and updating issues on issue tracker."""
import datetime
import json
import logging
import urllib2
import webapp2
from... |
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
import argparse
import json
import hashlib
import logging
import pathlib
import sys
import urllib.parse
f... |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
# Released under t... |
# RT - Server Tool
from typing import Union
from discord.ext import commands
import discord
from rtlib.ext import Embeds
from datetime import datetime, timedelta
from asyncio import TimeoutError, sleep
from random import sample
PERMISSION_TEXTS = {
"administrator": "管理者",
"view_audit_log":... |
# 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 applic... |
# ------------------------------------------------------------------------------
# CodeHawk C Analyzer
# Author: <NAME>
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2017-2020 Kestrel Technology LLC
#
# Permission is hereby granted, free of ch... |
#!/env/bin/python
import init
import findspark
findspark.init()
import os
import pandas as pd
import numpy as np
from pyspark.sql import *
from pyspark import *
import pyspark.sql.functions as f
from timeit import default_timer as timer
import logging
from RecsysSchema import RecsysSchema
from pyrecdp.data_processor... |
# Copyright (c) 2016 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
#!/usr/bin/env python
"""
Interface to Point Grey's Spinnaker C library. This uses a
helper C library (spinshim.dll) that provides a callback
for the Spinnaker ImageEvent. This is done in order to try
capture every frame from the camera, which spinCameraGetNextImage()
does not seem to gaurantee.
You will need the fold... |
"""Take the buildings footprints from OSM and add attributes to them
Write a final buildings footprints into a geopackage
"""
import sys
import os
import geopandas as gpd
import pandas as pd
import numpy as np
from collections import OrderedDict
from preprocess_utils import *
from tqdm import tqdm
tqdm.pandas()
d... |
"""Bridge where the final showdown with the AI occurs."""
import random
from pygame.rect import Rect
from pyntnclick.i18n import _
from pyntnclick.utils import (render_text, lookup_debug_color,
make_reversible_list)
from pyntnclick.cursor import CursorSprite
from pyntnclick.state import... |
#
# Copyright 2016 Red Hat | Ansible
#
# This file is part of Ansible
#
# Ansible 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.
#
# ... |
import re, sys, os, operator, argparse, pickle, io, time, gc
from scipy.sparse import csr_matrix
import pandas as pd
from collections import Counter
from glob import glob
from sklearn.linear_model import LogisticRegressionCV
from datetime import timedelta
script_dir = os.path.dirname(os.path.realpath(__file__))
lib = o... |
# ---------------------------------------------------------------------
# ObjectModel model
# ---------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Python module... |
from commands import *
with open("data/krone.json", "r") as f:
krone = json.load(f)
def show_title(title):
return title and ", " + title
def display_char(character):
return character["name"] + show_title(character.get("title", ""))
def rpgcommand(func):
async def _inner(command, message):
if not await h... |
# Package imports
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
import plotly.express as px
import geopandas as gpd
# Have to do this first one as it's an experimental feature as of sklearn v0.21.2
from sklearn.experimental import enable_iterative_imputer
from sklearn.im... |
# Implementation of the differential fault attack for the M0 fault model
#
# For a description of this attack see:
# <NAME>, <NAME> and <NAME>
# A Diagonal Fault Attack on the Advanced Encryption Standard.
# IACR Cryptology ePrint Archive, 581, 2009.
#
# input: faulty cipher texts and correct cipher text after the 10th... |
# Copyright (c) 2013 Potential Ventures Ltd
# Copyright (c) 2013 SolarFlare Communications Inc
# 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 of source code must retain th... |
#TODO:
#sampling N(1,1)
#last feature probability change to combined feature probability
import tensorflow as tf
import sys
import math
import six
import numpy as np
def dropout(input_tensor, dropout_prob):
"""Perform dropout.
Args:
input_tensor: float Tensor.
dropout_prob: Python float. The probabili... |
# -*- coding: utf-8 -*-
"""Runner for making a sparse model by weight pruning.
- Author: <NAME>
- Email: <EMAIL>
"""
import abc
import copy
import itertools
import os
import time
from typing import Any, Callable, Dict, List, Set, Tuple, cast
import torch
import torch.nn as nn
import torch.nn.utils.prune as prune
fr... |
"""Loads, standardizes and validates input data for the simulation.
Abstract the extract and transform pieces of the artifact ETL.
The intent here is to provide a uniform interface around this portion
of artifact creation. The value of this interface shows up when more
complicated data needs are part of the project. S... |
from __future__ import generators
import types
from sequtil import *
NOT_ON_SAME_PATH = -2
class ReadOnlyAttribute(object):
def __init__(self, attr):
self.attr = attr
def __get__(self, obj, klass):
return getattr(obj, self.attr)
##########################################################... |
from pytest import raises
from core.test_utils import assert_exception_correct
from SampleService.core.validator import builtin
def test_noop():
# not much to test here.
n = builtin.noop({})
assert n('key', {}) is None
def test_noop_fail_bad_input():
_noop_fail_build(None, ValueError('d must be a ... |
import dask
import datetime
import logging
import os
import time
import dask.array as da
import numpy as np
import pandas as pd
from ase.data import atomic_numbers
from collections import OrderedDict
from ml4chem.atomistic.features.cutoff import Cosine
from ml4chem.atomistic.features.base import AtomisticFeatures
from ... |
from functools import partial
from typing import List
import tensorflow as tf
from keras.initializers import RandomNormal
from keras.layers import (
Activation,
Add,
BatchNormalization,
Concatenate,
Conv2D,
Conv2DTranspose,
Input,
InputSpec,
Layer,
LeakyReLU,
SeparableConv2D... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.