text stringlengths 3.07k 22.1k |
|---|
"""
Calculus functionality (differentiation and integration) for polynomials (objects implementing the
:class:`~polynomials_on_simplices.polynomial.polynomials_base.PolynomialBase` interface).
"""
import copy
import numpy as np
import polynomials_on_simplices.algebra.multiindex as multiindex
from polynomials_on_simp... |
import numpy as np
from numba import jit
# Euler angles in matrix representation
@jit(nopython=True)
def euler2rotmat(ang):
g = np.zeros((3, 3))
sa = np.sin(ang[0])
ca = np.cos(ang[0])
sb = np.sin(ang[1])
cb = np.cos(ang[1])
sc = np.sin(ang[2])
cc = np.cos(ang[2])
g[0, 0] = ca*cc... |
# Copyright 2015-2017 F-Secure
# 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, ... |
"""
Tastypie resource definitions. This exposes the timemap stories, branches,
and map data through a REST interface
"""
from tastypie.authentication import Authentication
from tastypie.authorization import DjangoAuthorization
from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS
from tastypie import fi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2013 ton1517 <<EMAIL>>
#
# 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, includin... |
'''Transfer CIFAR-10 model'''
from __future__ import print_function
import logging
import os
import pdb
import numpy as np
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.optim as optim
from lib.cifar_resnet import *
from lib.dataset_utils import *
from lib.nin import *
os.envir... |
from . import NamedEntity
import logging
import wikiutils
import json
from catalogauto import *
from jsonschema.jsonschema import validate, ValidationError, SchemaError
import sanitychecks
class SpecificEnabler(NamedEntity):
def __init__(self, identifier, metapage, originator):
NamedEntity.__init__(self, 'SE at ... |
# -*- encoding: utf-8 -*-
################################################################################
## TexPack Sprite and Sheet classes
################################################################################
__all__ = ['Rect', 'Sprite', 'Sheet']
import logging
log = logging.getLogger(__name__)
######... |
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from .modules import encoder, bts
from ..utils import load_weights
from utils import log_info
class Model(nn.Module):
def __init__(self, dataset, max_depth, model_weights_file, seed=None):
super(Model, self).__init__()
i... |
'''
@Author: <NAME>
@Date: 2021-01-07 15:04:21
@Description: 这个是训练 mixed model 的时候使用的
@LastEditTime: 2021-02-06 22:40:20
'''
import os
import numpy as np
import time
import torch
from torch import nn, optim
from TrafficFlowClassification.TrafficLog.setLog import logger
from TrafficFlowClassification.utils.setConfig im... |
# -*- coding: utf-8 -*-
"""
chemdataextractor.scrape.acs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tools for scraping documents from The American Chemical Society.
:copyright: Copyright 2017 by <NAME>.
:license: MIT, see LICENSE file for more details.
"""
from __future__ import absolute_import
from __future__ import division
fro... |
# %% [markdown]
'''
# PyMAPDL Example
In this 'VS Code 'Python Code file' a built-in example is selected, its model description is printed and results are selected and plotted.
Selection is done by assigning variables
'''
# %%
from turtle import window_height
import numpy as np
import pandas as pd
import plotly.grap... |
import os
from tqdm import tqdm
import sys
import subprocess
import pandas as pd
import numpy as np
from amrtime import parsers
import math
import itertools
import re
from sklearn.preprocessing import normalize
class Homology():
"""
Generate a read encoding
"""
def __init__(self, simulated_reads, data... |
import socket
import struct
import numpy as np
import serial
from psychopy import visual, core, sound
from serial.tools.list_ports import comports
from Online.AmpInterface import TriggerUnit
from thirdparty.collections import AttrDict
class TriggerNeuracle(TriggerUnit):
triggerbox = None
dotSize = 50
d... |
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import numpy as np
import matplotlib.pyplot as plt
import os
from pickle import Pickler, Unpickler
print(tf.__version__)
EPOCHS = 200
NUM_CHANNELS=128
KERNEL_SIZE=(4,4)
DROPOUT_RATE=0
BATCHNORM=True
BATCH_SIZE=128
SPLIT=0.2
CACH... |
#!/usr/bin/env python3
from flask import Flask
from flask import render_template, url_for, redirect
from flask_uuid import FlaskUUID
from functools import partial
import json
import urllib
import sys
import os
# Youtube API
from apiclient.discovery import build
from apiclient.errors import HttpError
from oauth2clie... |
import os
import re
import sys
import pwd
import time
import socket
import platform
import struct
import fcntl
try:
import urllib2
except ImportError:
import urllib.request as urllib2
import subprocess
try:
import lsb_release
except ImportError:
lsb_release = None
from datetime import datetime
from coll... |
"""
image_date_organizer.organize
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2019 <NAME>
:license: BSD-3-clause
"""
from datetime import datetime
from pathlib import Path
import shutil
import logging
import re
from typing import cast, Optional, Dict
import magic
import pendulum
from PIL import Image
from PIL.ExifT... |
from .cbl_type import CBLType, CBLTypeInstance, CBLTypeMeta
from .containers import Temporary
from .function_type import InstanceFunctionType
import cmd_ir.instructions as i
class StructTypeInstance(CBLTypeInstance):
def __init__(self, compiler, this, var_members, func_members, func_properties):
super().... |
"""This module provides the basic functions about deep learning"""
# -*- coding: utf-8 -*-
# date: 2021
# author: AllChooseC
import numpy as np
import torch
from torch.utils.data.dataloader import DataLoader
from torch.utils.data.sampler import SubsetRandomSampler
from tqdm import tqdm
class_distribution = [59.68, 8... |
from math import log10, exp
import numpy
def get_index_given_truth_values(variables, truth_values, cardinalities):
"""
The function converts truth table tuples to array indices
:param variables: The variable in factor
:param truth_values: The values of given variables in the truth table (same ... |
### Imports ###
from flask import Flask, render_template, g
from flask import request as req
import sched, time, json, pytest, logging
from covid_data_handler import parse_csv_data, process_covid_csv_data, covid_API_request, schedule_covid_updates
from covid_news_handling import news_API_request, update_news,today... |
# Copyright (c) 2021 <NAME>
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import os
from shutil import rmtree
import click
import epic
from epic.detection.detectors_factory import DetectorsFactory
from epic.preprocessing.preprocess import preprocess
from epic.utils.file_pr... |
import os
import shutil
import sys
import pathlib
import tarfile
import magic
from bot import DOWNLOAD_DIR, LOGGER, aria2
import subprocess
import time
from PIL import Image
from hachoir.parser import createParser
from hachoir.metadata import extractMetadata
#from fsplit.filesplit import Filesplit
from bot import ari... |
import torch
from transformers import BertModel
from transformers.models.bert.modeling_bert import BertEmbeddings, BertEncoder, BertPooler
from transformers.modeling_outputs import BaseModelOutputWithPoolingAndCrossAttentions
class FullwordBertEmbeddings(BertEmbeddings):
def forward(
self,
input... |
"""
The main sampling script.
Takes pixel positions (x, y) and the number of components (npeaks)
from the command line (via sys.argv[]), sets the priors, the likelihood
function, preforms some sanity checks, and fires up MultiNest through
pymultinest.
"""
import os
import sys
import warnings
import mpi4py
import nump... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
"""
"MooseGesture 0.1" a mouse gestures recognition library.
<NAME> <EMAIL>
http://coffeeghost.net/2011/05/09/moosegesture-python-mouse-gestures-module
Usage:
import moosegesture
gesture = moosegesture.getGesture(points)
Where "points" is a list of x, y coordinate tuples, e.g. [(100, 200), (1234, 567... |
# Palje - Document MSSQL databases to Confluence wiki
#
# Copyright 2021 ALM Partners Oy
# SPDX-License-Identifier: Apache-2.0
import sys
from argparse import ArgumentParser
from . import storage_format
from .confluence_rest import ConfluenceREST
from .mssql_database import MSSQLDatabase, DATABASE_OBJECT_TYPES
def ... |
#!/usr/bin/env python
"""
Twitter Acrobot: Play the 'acro' game on Twitter
This bot generates a random acronym and a random hashtag for tracking
individual rounds of play. During the first phase of the round, users may
submit their definitions for the random acronym. Once the second phase begins,
submissions are close... |
from flask import Flask, abort, request
from flask_cors import CORS
import redis as red
import serial, serial.tools.list_ports
import json, struct, sys, time
import threading
####* DEFAULT ARGUMENTS *####
try:
sys.argv[1]
except IndexError:
baudrate = 115200
else:
baudrate = sys.argv[1]
try:
sys.argv[... |
# Copyright 2018/2019 The RLgraph 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... |
#!/usr/bin/env python2.7
# Copyright 2014 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.
"""Parses BuildBot `actions.log' and extracts events.
These events can be uploaded as JSON to monitoring endpoints.
"""
import ar... |
import logging
import sys
from . import install
from . import plugins
from .Journal import open_journal
from .color import ERROR_COLOR
from .color import RESET_COLOR
from .config import get_journal_name
from .config import scope_config
from .editor import get_text_from_editor
from .editor import get_text_from_stdin
fr... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import ray
from collections import namedtuple
import numpy as np
import random
from ray.rllib.agents.trainer import Trainer
from ray.rllib.models.catalog import ModelCatalog
from ray.rllib.policy.policy impor... |
import datetime
import io
import requests
from rest_framework.exceptions import ValidationError
from dateutil import relativedelta
from uuid import uuid4
from PIL import Image
from bleach.sanitizer import Cleaner
from PyPDF2 import PdfFileWriter, PdfFileReader
from reportlab.pdfgen import canvas
from reportlab.lib.page... |
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
"""Adaptive Phase threshold dynamics."""
import os
import torch
from torch.utils.cpp_extension import load
from ...utils.int_utils import right_shift_to_zero
from ...utils.utils import staticproperty
from ... import jitconfig
class Acc... |
import sys
import os
import docker
import json
import random
class DockerSwarm:
'''
Class: DockerSwarm
Member Variables:
config_file:
Configuration containing the manager IP
address (required) and information about
remote nodes to be managed
manager_ip:
IP address of the manager node
... |
import unittest
from validateJSON import *
class TestTrashEscapedCharacters(unittest.TestCase):
def testAll(self):
self.assertEqual(
# in file, "hello \" \n \\""
# we see hello \\" \\n \\\\"
trashEscapedCharacters(r'"hello \" \n \\"'),
'"hello ~~ ~n ~~"'
... |
# Copyright (c) 2020 Leedehai. All rights reserved.
# Use of this source code is governed under the MIT LICENSE.txt file.
import os
import sys
from pathlib import Path
from typing import Dict, List, Optional, Tuple
from pylibs import rotating_logger
from pylibs import score_utils
from pylibs.rotating_logger import (
... |
import sublime
import sublime_plugin
import re
import datetime
from time import time
from urllib import parse
from collections import namedtuple
from ..deps.jsonschema import validate, ValidationError
from ..core import RequestCommandMixin
from ..core.parsers import parse_tests
from ..core.responses import prepare_r... |
#!/usr/bin/python
# Copyright: (c) 2020, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
DOCUMENTATION = r'''
---
module: firewall_alias
short_description:... |
# -*- coding: utf-8 -*-
"""Model unit tests."""
import pytest
from annotator.annotations.models import Annotation, AspInd, BooleanUnsure, Clause, SynArg
from annotator.annotations.rest import AnnoSchema
class Bunch(object):
"""Empty object that can hold arbitrary other objects."""
pass
@pytest.fixture()
... |
__author__ = "OguzBey"
__version__ = "1.5.0"
__email__ = "<EMAIL>"
from modules import spider
from modules import crawler
from modules import sqli
import sys
import os
import logging
B_RED = spider.B_RED
B_WHITE = spider.B_WHITE
B_BLUE = spider.B_BLUE
RESET = spider.RESET
YELLOW = spider.YELLOW
GREEN = spider.GREEN
... |
import gym_mupen64plus
# %%
import gym, torch, cv2, time
import numpy as np
import torch.nn as nn
from torch.distributions import Categorical
import torch.nn.functional as F
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from collections import deque
import pickle
from os import path
import ... |
# -*- coding: utf-8 -*-
"""
Qt Widgets to integrate OpenFrames
"""
from PyQt5.QtWidgets import QWidget, QGridLayout, QSizePolicy
from PyQt5.QtGui import QWindow, QOpenGLContext
from PyQt5.QtCore import Qt, QSize, QCoreApplication, QEventLoop
from . import PyOF
DEFAULT_WIDTH = 320
DEFAULT_HEIGHT = 240
class OFWindow... |
"""Query module
"""
from common import *
from enum import Enum # pip install enum34
from storage import ShelveStorage
import clang.cindex
import logging
import os
import parser
import pygraphviz
import sys
def make_locus(line, column):
return '{}:{}'.format(line, column)
class Query(Enum):
Definit... |
from datetime import datetime
import hashlib
import timeit
from urllib.parse import urlparse, urljoin
from urllib.request import urlopen # python 3 syntax
import requests
import time
import pygal
from pygal.style import Style
import json
import sys
import traceback
import cairosvg
import copy
from flask import Flask... |
#!/usr/bin/env python3
from web.settings import Settings as settings
import logging
import datetime
import random
import threading
import re
import time
import os
import sys
import web.modeltr as data
import vcenter.vcenter as vcenter
import signal
from web.modeltr.enums import MachineState, RequestState, RequestTy... |
from __future__ import absolute_import
from __future__ import unicode_literals
from contextlib import contextmanager
import json
from collections import defaultdict, namedtuple, OrderedDict
from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from couchdbkit import... |
#!/usr/bin/env python
import os
import sys
import pwd
import signal
import subprocess
from getpass import getuser
from optparse import OptionParser
# parsing the command line
parser = OptionParser()
parser.set_description("""'superclean' is a script used to clean the current \
working directory of files, hidden dire... |
import binascii
from libexploit.io.stdout import init_logger
#---------------------------------------#
# Class to encode bytes #
#---------------------------------------#
silent = False
def hex2bin(pattern):
"""
Converts a hex string (\\x??\\x??\\x??\\x??) to real hex bytes
Arguments:
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020. Distributed under the terms of the MIT License.
from pathlib import Path
import numpy as np
import pytest
from pymatgen.electronic_structure.core import Spin
from vise.analyzer.band_edge_properties import (
BandEdge, BandEdgeProperties, is_band_gap)
from vise.defaul... |
# -------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# ----------------------------------------------------------------------... |
import datetime
import json
import logging
from collections import Counter
from typing import List
from django.utils import timezone
from orders.exceptions import OrderException
from orders.models import Order, Product, Shift
from users.models import User
def execute_data_minimisation(dry_run=False):
"""
Re... |
# Copyright (c) 2019-present, <NAME>
from collections import OrderedDict
import torch
from torchvision.ops import MultiScaleRoIAlign
from torchvision.models.detection.rpn import (
AnchorGenerator,
RPNHead,
)
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor, TwoMLPHead
from torchvision.... |
import random
import sys
from MMU import MMU
from BlocoMemoria import BlocoMemoria
from Endereco import Endereco
from Instrucao import Instrucao
from Conjunto import Conjunto
from output import Output
class TP2:
tamanhoRAM: int = 1000 #quantidade de blocos da ram
tamanhoCache1: int = 32 #quantidade de blocos ... |
import dataclasses
from typing import Any, Callable, List, Mapping, MutableMapping, Optional
import wcwidth
from pad_data import common
from pad_data.skill import Skill
@dataclasses.dataclass
class EnemySkillRef:
enemy_skill_id: int
enemy_ai: int
enemy_rnd: int
def _unflatten(raw: List[Any], idx: int, wi... |
import datetime
import functools
import sqlite3
from flask import (
Blueprint, flash, g, redirect, render_template, request, session, url_for
)
from dbfunc import connect_db,match_user_pwd,disconnect_db,get_domain,insert_user_pwd
from dbfunc import databasePATH,check_repeat,log_write
from sliderbaritem import patie... |
#!/usr/bin/env python3
from __future__ import print_function
import math
import sys
import numpy as np
"""
This is a version of BFGS specialized for the case where the function
is constrained to a particular convex region via a barrier function,
and where we can efficiently evaluate (via calling f_finite(x), which
r... |
# ProDy: A Python Package for Protein Dynamics Analysis
#
# Copyright (C) 2010-2012 <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
# (at your opti... |
# coding=utf-8
# Copyright 2018 The DisentanglementLib Authors. All rights reserved.
# Copyright 2021 <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
#
# ht... |
import torch
import torch.utils.data as data
import random
import math
import os
import logging
from utils import config
import pickle
from tqdm import tqdm
import pprint
import pdb
pp = pprint.PrettyPrinter(indent=1)
import re
import ast
#from utils.nlp import normalize
import time
from collections import defaultdict... |
import topics_frequent.array as topics
import pytest
# @pytest.fixture
# def array_with_dup():
# return [0,0,1,1,1,2,2,3,3,4]
def test_11():
height = [4,3,2,1,4]
print("Test question 11")
assert topics.container_with_most_water_11().maxArea(height) == 16
def test_26():
nums = [0,0,1,1,1,2,2,3,3,4... |
# -*- coding: utf-8 -*-
import json
from random import shuffle
DIRECTIONS = {
"rg": {"dr": +1, "dg": -1, "db": 0},
"rb": {"dr": +1, "dg": 0, "db": -1},
"gb": {"dr": 0, "dg": +1, "db": -1},
"gr": {"dr": -1, "dg": +1, "db": 0},
"br": {"dr": -1, "dg": 0, "db": +1},
"bg": {"dr": 0, "dg": -1, "db":... |
bl_info = {
"name": "Simple panels",
"blender": (2, 80, 0),
"category": "Object",
}
if "bpy" in locals():
import importlib
if "edge_walker" in locals():
importlib.reload(edge_walker)
import bpy
from . import (
edge_walker
)
import bmesh
import random
import time
from functools import ... |
##Main program
## Before running this program, you need to have functional aws cli and boto3 installed.
##^^^^^^
##Author: AI_Papa (<EMAIL>)
##Import AWS client modules
import boto3
from botocore.exceptions import ClientError
##Import modules for multi-thread and general OS utilities
import logging,time, io, os, s... |
"""
Test for SQS to DC tool
"""
import json
from pathlib import Path
from unittest.mock import MagicMock
import distributed
import pystac
import pystac.collection
import pystac.item
import pytest
from datacube.utils import documents
from odc.stac import stac2ds
TEST_DATA_FOLDER: Path = Path(__file__).parent.joinpath... |
# 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/env python3
import sys
import pickle
import os
import gc
import json
from logging import getLogger
import numpy as np
import pandas as pd
import cv2
#import tensorflow as tf
from tqdm import tqdm
try:
APP_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../')
sys.path.append(APP_RO... |
import os
import re
import magic
import fnmatch
import ctypes
import ctypes.util
import binwalk.smartstrings
from binwalk.compat import *
from binwalk.common import strings
from binwalk.prettyprint import PrettyPrint
class HashResult(object):
'''
Class for storing libfuzzy hash results.
For internal use only.
'''
... |
from flask import request
from .. import db
from ..models import User
from datetime import datetime
import pytz
from sqlalchemy import CheckConstraint
from flask.ext.login import current_user
from collections import defaultdict, OrderedDict
from ..email import send_email
class CartItem(db.Model):
"""Functions as ... |
import click
import json
import logging
import os
import operator
import traceback
from functools import reduce
from typing import Any, Dict, List, Union
from kubails.external_services import gcloud, git
logger = logging.getLogger(__name__)
CONFIG_FILE_NAME = "kubails.json"
SERVICES_FOLDER = "services"
# See the d... |
# Copyright (c) 2013, <NAME>
# All rights reserved. BSD License
#
# 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 the above copyright
# notice, this list of conditions ... |
import json
import urllib
from django.contrib.auth.models import User
from django.core.mail import send_mail
from django.core.management import call_command
from django.http import HttpResponse, HttpResponseRedirect, HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404, render, redirect
from dj... |
"""
Udacity dataset general functions.
These are adopted in training, testing the models and also driving the
Udacity simulator autonomous car.
"""
import os
import random
import numpy as np
import pandas as pd
import csv
import cv2
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
i... |
# -*- 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... |
import logging
import webapp2
import json
import logic
from models import Rating, PFuser, ClusterRating
from google.appengine.api import memcache
import cloudstorage as gcs
from mapreduce import base_handler
from mapreduce import mapreduce_pipeline
my_default_retry_params = gcs.RetryParams(initial_delay=0.1,
... |
""" pixtosky - A module to perform coordinate transformation from pixel coordinates
in one image to pixel coordinates in another frame
:Authors: <NAME>
:License: :doc:`LICENSE`
PARAMETERS
----------
inimage : str
full filename with path of input image, an extension name ['... |
# VMware ThinApp Factory
# Copyright (c) 2009-2013 VMware, 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
#
# Unl... |
# -*- coding: UTF-8 -*-
#/**
# * Software name: CC2531
# * Version: 0.1.0
# * Library to drive TI CC2531 802.15.4 dongle to monitor channels
# * Copyright (C) 2013 <NAME>, ANSSI.
# *
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the CeCILL-B license as published here... |
"""
MIT License
Copyright (c) 2021-present noaione
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, publis... |
from sqlalchemy import create_engine
from pandas import read_sql as psql
from time import sleep
def _getConnection(dbname='tm351',
host='localhost', port=5432,
user='tm351admin', password='<PASSWORD>'):
engine = create_engine("postgresql://{user}:{password}@{host}:{port}/{... |
import numpy as np
import matplotlib.pyplot as plt
import astropy.units as au
import astropy.constants as ac
import os
import xarray as xr
from scipy.interpolate import interp1d
from scipy.stats import poisson
from .models import TigressWindModel
__all__ = [ "TigressSimContainer", "TigressSimLoader" ]
class Tigress... |
from datasets import TFrecords2Dataset
import tensorflow as tf
import numpy as np
import cv2
import os
import time
from nets import txtbox_384
from processing import ssd_vgg_preprocessing
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
slim = tf.contrib.slim
tf.logging.set_verbosity(tf.logging.INFO)
show_pic... |
from rubbletumbler.net import download_files, download_file, url_parts, root_content_dl_addr, get_csv_file_contents, get_csv_file_data, get_matching_files
import argparse
import re
import os
import sys
import datetime
fname = 'MOD03.A2019176.2225.061.NRT.hdf'
def browse_action(args):
if args.list:
ctr = ... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
import six
import collections
import copy
from torch.utils.data import Dataset
from collections import defaultdict
import h5py
from scipy.stats import norm
import os
SKIP_TYPES = six.string_types
class SimpleDataset(Dataset):
'''
... |
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Validates all aggregate functions across all datatypes
#
import logging
import pytest
from tests.common.test_vector import *
from tests.common.impala_test_suite import ImpalaTestSuite
from tests.common.test_dimensions import create_exec_option_dimension
from te... |
import re
import urllib.parse
from itertools import cycle
import requests
from bs4 import BeautifulSoup
# for reading email from pdf
import io
from PyPDF2 import PdfFileReader
from urllib.request import urlopen
from crossref.restful import Journals
from django.utils.dateparse import parse_date
from lxml.html import ... |
import torch.nn as nn
import torch
import numpy as np
class GLU(nn.Module):
def __init__(self):
super(GLU, self).__init__()
# Custom Implementation because the Voice Conversion Cycle GAN
# paper assumes GLU won't reduce the dimension of tensor by 2.
def forward(self, input):
r... |
import numpy as np
import cv2
from .math_functions import euclidean_dist_2_pts
def extract_img_markers(img, workspace_ratio=1.0):
"""
Extract working area from an image thanks to 4 Niryo's markers
:param img: OpenCV image which contain 4 Niryo's markers
:param workspace_ratio: Ratio between the width ... |
#!/usr/bin/env python
from __future__ import division
"""MODULE_DESCRIPTION"""
__author__ = "<NAME>"
__copyright__ = "Copyright 2015, Cohrint"
__credits__ = ["<NAME>", "<NAME>"]
__license__ = "GPL"
__version__ = "1.0.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"
import logging
import n... |
import re
import sys
from heapq import heappop, heappush
from math import ceil, sqrt, floor
from PIL import Image, ImageDraw
# To do : pixelchange speed should be relative to the pixel
def readimage(imageName):
with Image.open(imageName) as im:
colorpixel = list()
for y in range(im.he... |
# -*- coding: utf-8 -*-
__all__ = [
"set_config_provider",
"DataDriver",
"ConnectionPool",
"QueriesSet",
"BaseQuery",
"ReaderMixin",
"WriterMixin",
"FixtureQuery",
"UriConnMixin",
"FileConnMixin",
"UriParts"
]
"""High-level entities
"""
import inspect
import functools... |
import torch
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
import time
import random
import socket
import copy
import multiprocessing as mp
import queue as Queue
import numpy as np
import argparse
import torchvision.models as backbones
import sys
from modules.mod... |
"""
Tests for fm/negfc*.py (3D ADI cube)
"""
import copy
from .helpers import aarc, np, parametrize, fixture
from vip_hci.fm import (confidence, firstguess, mcmc_negfc_sampling,
nested_negfc_sampling, nested_sampling_results,
speckle_noise_uncertainty, cube_planet_free,... |
import ConfigParser
import logging
import functools
import json
import abc
import os
log = logging.getLogger(__name__)
EXE = "pbsmrtpipe"
__all__ = ['ButlerTask',
'ButlerWorkflow',
'config_parser_to_butler']
__author__ = "<NAME>"
class TestkitCfgParserError(ValueError):
pass
class Cons... |
import asyncio
from asyncio.tasks import ALL_COMPLETED
from concurrent.futures import ThreadPoolExecutor
from functools import partial
from logging import getLogger
from pathlib import Path
from typing import Optional, Sequence, Union
from aiohttp import ClientSession
from gmusicapi.clients import Mobileclient
from a... |
import os
import subprocess
import sys
import urllib.request
import hashlib
import socket
import shutil
import errno
import statistics
from datetime import date
INVALID_SYMBOLS = [";","&","(",")","|","*","?","[","]","~","{","}","<","!","^",'"',"'","\\","$","/","+","-","#"," "]
class insertSizeError(Exception):
d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.