text stringlengths 6.04k 39.5k |
|---|
#
# Copyright 2017 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 required by applicable law or... |
# coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
"""
"""
from __future__ import unicode_literals, absolute_import
import os
import re
import tempfile
import string
import sys
from logging import DEBUG, INFO
import numpy as np
import pandas as pd
import jpype
import warnings
__all__ = ['NetLogoLink',
'NetLogoException']
PYNETLOGO_HOME = os.path.dir... |
#! /usr/bin/env python
##############################################################################
## DendroPy Phylogenetic Computing Library.
##
## Copyright 2010-2015 <NAME> and <NAME>.
## All rights reserved.
##
## See "LICENSE.rst" for terms and conditions of usage.
##
## If you use this work or any portio... |
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import rv_discrete
import scipy
import datetime
import dataset
# import pickle
plt.rcdefaults()
# Debug mode
debug = True
def printdebug(debugmode, string=None, vartuple=None):
"""
prints string, varname and var for debug purposes
:par... |
import asyncio
import struct
import time
import socket
import logging
from io import BytesIO
from abc import ABC, abstractmethod
from typing import Optional, List, Tuple, Dict, NamedTuple, Callable
from typing import cast, TYPE_CHECKING
from asyncio import Transport, Protocol, Event, BaseTransport, TimerHandle
from as... |
from fastapi import APIRouter
from config import APISettings
from fastapi import Depends, UploadFile, File, Form, Header, BackgroundTasks, Response
from starlette.responses import StreamingResponse
from typing import Optional
from pydantic import BaseModel
from modules.JWT import get_jwt_identity
from mongoengine.err... |
#!python3
import sys
import shutil
import re
from state import State
import time
import math
import logging, logging.handlers
import argparse
import json
import irsdk
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import (QApplication, QMainWindow)
from controls import ControlsWindow
import ctypes
imp... |
"""Examine callable regions following genome mapping of short reads.
Identifies callable analysis regions surrounded by larger regions lacking
aligned bases. This allows parallelization of smaller chromosome chunks
through post-processing and variant calling, with each sub-section
mapping handled separately.
Regions ... |
"""
sphinx.ext.graphviz
~~~~~~~~~~~~~~~~~~~
Allow graphviz-formatted graphs to be included in Sphinx-generated
documents inline.
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import posixpath
import re
import subprocess
from hashl... |
'''
Functions about transforming mesh(changing the position: modify vertices).
1. forward: transform(transform, camera, project).
2. backward: estimate transform matrix from correspondences.
Preparation knowledge:
transform&camera model:
https://cs184.eecs.berkeley.edu/lecture/transforms-2
Part I: camera geometry and ... |
from gamma.core import *
from gamma.nodes import *
################
### Node types
################
prep = node('Prep', ['out_channels'])
classifier = node('Classifier', ['in_channels', 'out_channels'])
residual_block = node('ResidualBlock', ['in_channels', 'out_channels', 'stride',
'h_channels', 'groups', 'act'... |
import logging
import os
import pathlib
import sys
import time
from queue import Empty, Queue
from threading import Event
from typing import Optional, Sequence
import numpy as np
import torch
from google.cloud import container_v1 as container
from rich.progress import (
BarColumn,
Progress,
ProgressColumn,... |
from __future__ import print_function, division, absolute_import
import numpy as np
from scipy.misc import imsave, imread, imresize
from sklearn.feature_extraction.image import reconstruct_from_patches_2d, extract_patches_2d
from scipy.ndimage.filters import gaussian_filter
from keras import backend as K
import os
i... |
#!/usr/bin/python
# Copyright: Ansible Project
# 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterf... |
import base64
import json
import warnings
from collections import defaultdict, namedtuple
from enum import Enum, EnumMeta
from types import FunctionType
from typing import Any, Generator, NamedTuple, Tuple, Union
import lpipe.exceptions
import lpipe.logging
from lpipe import normalize, signature, utils
from lpipe.acti... |
"""This module handles experiments related to matrix connections."""
import os
import gc
import numpy as np
from collections import OrderedDict
from pprint import pprint
import pickle
from scipy import sparse
from mpmath import mpf
import pandas as pd
from .connectivity_patterns import MatrixConnectivity
from .simpl... |
"""
train an distributed estimator with a fixed controller
"""
import sys, os
import torch
import torch.nn as nn
import argparse
torch.manual_seed(0)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
ROBOTICS_CODESIGN_DIR = os.environ['ROBOTICS_CODESIGN_DIR']
sys.path.append(ROBOTICS_CODESIG... |
import cv2
import numpy as np
# ==================== Constants ====================
# IMAGE_DIR = "./q3_images/"
IMAGE_DIR = "./q3_sample_images/"
IMAGE_1_NAME = "img_1.jpg"
IMAGE_2_NAME = "img_2.jpg"
IMAGE_3_NAME = "img_3.jpg"
OUT_DIR = "./out/q3/"
# ==================== Images ====================
img_1 = cv2.imrea... |
import random
import datetime
import json
import os
from collections import OrderedDict
from collections import Counter
# 分成小函数的确优美 但是太慢太慢
class LogAnalysis:
def __init__(self, directory):
if not directory:
directory = 'E:/logs/'+ str(datetime.date.today())
self.directory = directory
... |
# This Python module is part of the PyRate software package.
#
# Copyright 2017 Geoscience Australia
#
# 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/... |
# Copyright 2014-2015 <NAME>.
# This file is part of SGGL. SGGL is licensed under the terms of the
# 2-clause BSD license. For more information, see LICENSE.txt.
import os
import xml.etree.ElementTree as etree
import collections
import io
import re
API_LIST = 'gl:core', 'gl:compatibility', 'gles1', 'gles2'
NOTICE =... |
# -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
#
# Author: <NAME> <<EMAIL>>
#
# 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/l... |
"""
Copyright 2019 by <NAME> (alohawild)
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 ... |
'''
<NAME>
Map Simulated World
---
Use Webots .wbt file to create a map of the world and obstacles. Used to navigate
the robot through the world and locate items.
NOTE:
The robot used in this project is a GCtronic e-puck. Everything is configured
around this specific robot.
NOTE:
It is important for the world to be ... |
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import warnings
import gc
import os
warnings.filterwarnings('ignore')
from datetime import datetime
from sklearn.feature_selection import VarianceThreshold
from sklearn.model_selection import StratifiedKFold, RandomizedSearchCV... |
# Copyright 2018 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.
import base64
import datetime
import re
import traceback
from google.protobuf import json_format as jsonpb
from recipe_engine import recipe_api
from PB.rec... |
import torch
from torch.fx import GraphModule, Node
from torch import fx, nn
from torch.nn import Module
USE_LINK = False
USE_DDP = False
__all__ = ['ptq_reconstruction']
try:
import spring.linklink as link
if not link.is_initialized():
link.initialize()
USE_LINK = True
except (ModuleNotFoundErro... |
# Copyright 2019 Atalaya Tech, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, ... |
import numpy as np
import networkx as nx
import spira.all as spira
from copy import deepcopy
from spira.core.parameters.variables import GraphParameter, StringParameter
from spira.core.parameters.descriptor import Parameter
from spira.yevon.geometry.coord import Coord
from spira.yevon.vmodel.geometry import GeometryPa... |
"""
Initial working model taken from : https://github.com/eliben/code-for-blog/blob/master/2008/wx_mpl_dynamic_graph.py
Author: <NAME>
"""
"""
This demo demonstrates how to draw a dynamic mpl (matplotlib)
plot in a wxPython application.
It allows "live" plotting as well as manual zooming to specific
regions.
Both X... |
#!/usr/bin/env python3
import netCDF4 as nc
import sys
import numpy as np
import matplotlib.pyplot as plt
import argparse
import scipy.ndimage as sn # contains the filters
from plotTools import addImagePlot
from netcdfTools import read3dDataFromNetCDF
from utilities import selectFromList
#============================... |
from sieve_common.common import *
import json
from sieve_oracle.checker_common import *
from sieve_common.k8s_event import get_mask_by_resource_key, parse_key
from deepdiff import DeepDiff
from pathlib import PurePath
def get_resource_helper(func, namespace):
k8s_namespace = namespace
response = func(k8s_name... |
# Copyright 2019 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 torch
import torch.nn as nn
import torch.nn.functional as F
from onmt.models.transformer_layers import PositionalEncoding, PrePostProcessing
from onmt.models.transformer_layers import EncoderLayer, DecoderLayer
from onmt.models.transformers import TransformerEncoder, TransformerDecoder, Transformer, Transformer... |
import click
from phonopy import Phonopy
from phonopy.interface.vasp import read_vasp_from_strings
from aiida.manage.configuration import load_profile
from aiida.orm import QueryBuilder, Int, Float, Bool, Str, load_node
from aiida.plugins import DataFactory, WorkflowFactory
from aiida.engine import run, submit
from aii... |
import mmd_scripting.core.nuthouse01_core as core
import mmd_scripting.core.nuthouse01_pmx_parser as pmxlib
import mmd_scripting.core.nuthouse01_pmx_struct as pmxstruct
_SCRIPT_VERSION = "Script version: Nuthouse01 - v0.6.01 - 7/12/2021"
# This code is free to use and re-distribute, but I cannot be held responsible f... |
import logging
import numpy as np
import pandas as pd
import statsmodels.api as sm
from statsmodels.stats.multitest import multipletests
#from scipy import stats --- conflicts with input param names
#from joblib import Parallel, delayed, cpu_count
import matplotlib # color maps and changing Agg backend after cpv alters... |
#!/usr/bin/env python
#
from __future__ import print_function
import os, sys, re, json, time, astropy
import numpy as np
from astropy.table import Table, Column, hstack
from numpy import log10, power as pow
#from astropy.cosmology import FlatLambdaCDM
##cosmo = FlatLambdaCDM(H0=73, Om0=0.27, Tcmb0=2.725) # replaced... |
import os
import sys
import json
import collections
import tempfile
import datetime
import ftrack_api
from openpype.api import get_project_settings
from openpype.lib import (
get_workfile_template_key,
get_workdir_data,
Anatomy,
StringTemplate,
)
from openpype.pipeline import AvalonMongoDB
from openpy... |
from __future__ import absolute_import, division, print_function
from ..components import Actor
import inspect
import itertools
import six
import collections
from ..logger import logger
__all__ = ['FuncActor', 'Switch', 'ShellRunner', 'Sink',
'DictionaryMerge', 'DictionaryExtract', 'LoopWhile',
... |
""" PyTorch implementation of DualPathNetworks
Based on original MXNet implementation https://github.com/cypw/DPNs with
many ideas from another PyTorch implementation https://github.com/oyam/pytorch-DPNs.
This implementation is compatible with the pretrained weights from cypw's MXNet implementation.
Hacked together b... |
# -*- coding: utf-8 -*-
"""Processing a list of power plants in Germany.
SPDX-FileCopyrightText: 2016-2021 <NAME> <<EMAIL>>
SPDX-License-Identifier: MIT
"""
__copyright__ = "<NAME> <<EMAIL>>"
__license__ = "MIT"
# Python libraries
import os
import logging
# External libraries
import pandas as pd
import numpy as n... |
"""
Classes for querying the information in a test coverage report.
"""
from __future__ import unicode_literals
import re
from collections import defaultdict
import os
import itertools
import posixpath
from diff_cover.command_runner import run_command_for_code
from diff_cover.git_path import GitPathTool
from diff_cov... |
"""Kamereon models."""
import json
from dataclasses import dataclass
from typing import Any
from typing import cast
from typing import Dict
from typing import List
from typing import Optional
from marshmallow.schema import Schema
from . import enums
from . import exceptions
from . import helpers
from renault_api.mode... |
import os
import random
import numpy as np
from time import gmtime, strftime, localtime
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from rdkit import Chem, DataStructs
from rdkit.Chem import AllChem
from tqdm import tqdm... |
import re
import sqlite3
import subprocess
from time import time_ns
from PySide2.QtCore import Qt, QBasicTimer, QSize, QRect
from PySide2.QtGui import QPainter, QPen, QColor, QFont, QPixmap, QIcon
from PySide2.QtWidgets import QMainWindow, QFormLayout, QActionGroup, QPushButton, QDialog, QWidget, QInputDialog, \
Q... |
# -*-coding: utf-8 -*-
"""
@Project: IntelligentManufacture
@File : image_processing.py
@Author : panjq
@E-mail : <EMAIL>
@Date : 2019-02-14 15:34:50
"""
import os
import glob
import cv2
import numpy as np
import matplotlib.pyplot as plt
import copy
def show_batch_image(title, batch_imgs, ind... |
#!/usr/bin/env python3
import sqlite3
import os
import logging
import datetime
import json
from dateutil.relativedelta import *
# Constants
DATABASE_NAME = "pronote2mqtt.db"
DATABASE_TIMEOUT = 10
DATABASE_DATE_FORMAT = "%Y-%m-%d"
DATABASE_DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S"
# Config constants
P2M_KEY = "p2m"
DB_KEY... |
#!/usr/bin/env python
# Copyright 2020 The Tekton 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... |
# vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Copyright (c) 2013-2017 <NAME> <<EMAIL>>
# Copyright (c) 2013 Mime Consulting Ltd. <<EMAIL>>
# 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... |
import logging
import string
import datetime
import json
import uuid
import urllib.request, urllib.parse, urllib.error
import base64
import requests
import os.path
import sys
import random
import re
from pyramid.config import Configurator
from pyramid.renderers import JSONP, render
from pyramid.response import Response... |
import random
import cv2
import os
import torch
import torch.nn.functional as F
import numpy as np
from glob import glob
import data_util
import util
from collections import defaultdict
import concurrent.futures
import functools
import pathlib
import geometry
rng = np.random.default_rng(seed=13)
string2class_dict =... |
#!/usr/bin/python
# app.py
from flask import Flask
from flask import request, render_template
import re
import sys
import pymongo
from pymongo import MongoClient
import urlparse
import requests
import logging
import os
from flask import json
from bson.objectid import ObjectId
import ast # to convert unicode to dict
#i... |
################################################
# Call every 10 minutes, checks schedule and sets Relay accordingly
# Pump is executed on hour check in case script misses iteration on full hour
# but this will execute the pump is updated right after execution with same time, e.g. change the amount
# maybe set DaysCn... |
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or th... |
#!/usr/bin/env python
# Copyright (c) Facebook, Inc. and 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... |
from random import randrange
from typing import List, Tuple
# A handy list of small primes
SMALL_PRIMES = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59,\
61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139,\
149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 22... |
# import linkml
import logging
import random
import re
# urllib? urllib3? pure requests?
import urllib
import click
import click_log
import linkml.utils.rawloader as rl
import linkml_runtime
import pandas as pd
import requests
import yaml
from linkml_runtime.dumpers import yaml_dumper
# cosine? SIFT4?
from strsimpy.co... |
import os
import subprocess
import stat
from typing import List, Dict, Optional, Set, Iterable
from .exception import DarwinException
# In a MachO file, need to deal specially with links that use @executable_path,
# @loader_path, @rpath
#
# @executable_path - where ultimate calling executable is
# @loader_path - dir... |
import colorsys
import pickle
from collections import OrderedDict
import boost_histogram as bh
import matplotlib
import matplotlib.pyplot as plt
import mplhep as hep
import numpy as np
import scipy.optimize
import uproot
from coffea.util import load
from hist import Stack
plt.style.use([hep.style.ROOT, hep.style.fira... |
# Replication Script
import subprocess
from subprocess import PIPE
import datetime
import hashlib
import platform
import sys
import random
import time
dlrm_exe = ["python3", "-u", "dlrm_s_pytorch.py"]
rpmb_exe = ["python3", "rpmb.py"]
dlrm_support_dir = "/dlrm/support"
dlrm_output_dir = "/dlrm/results"
rp_mat_dir =... |
from havsim.simulation.road_networks import Lane, downstream_wrapper, get_inflow_wrapper, increment_inflow_wrapper
def compute_route(start_road, start_pos, exit):
"""
start_road: object for the start road
start_pos: position on the start road
exit: name for the exit road (string)
"""
# The exit... |
# coding: utf-8
# Welcome to the fourth Lab session of the "Advanced algorithmics and graph theory with Python" MOOC. In this exercise you will learn how to find solutions to the Traveling Salesman Problem.
#
# The main objective of this exercise is to:
# * Describe the classic traveling salesman problem and use it a... |
import logging
import operator
import pickle
import re
import warnings
import zipfile
from functools import lru_cache
from pathlib import Path
from typing import (Any, Callable, Dict, Iterator, List, NamedTuple, Optional,
Tuple, Union)
from xml.etree import ElementTree
from shapely.geometry import ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import cPickle
from ConfigParser import ConfigParser
import numpy as np
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg
from pylab import Figure
from CoolProp.HumidAirProp import HAProps, HAProps_Aux
from PyQt4.QtGui import (QDialog, QGridLayout,... |
import json
import urllib.parse
import urllib.request
from functools import singledispatch
from collections import namedtuple
import concurrent.futures as cc
class typer(object):
'''
This decorator is designed to handle input of a
variable type for the "getX" methods of objects.
'''
def __init__(... |
import copy
import csv
import glob
import json
import os
from collections import OrderedDict, defaultdict
from datetime import datetime, timedelta
from itertools import chain
from typing import Any, DefaultDict, Dict, List
import jsons
import pytz
import yaml
from miniconf.site_data import (
CommitteeMember,
... |
# Copyright (c) MONAI Consortium
# 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, so... |
"""PUMA Noise simulator
Follows https://arxiv.org/abs/1810.09572.
Includes a general RadioTelescope class that defines a telescope in terms
of various dish, packing, and instrumental noise properties, as well as
instances of this class for the full and petite configurations of PUMA
(see https://arxiv.org/abs/1907.125... |
import pickle
import time
import unittest
import numpy as np
from overcooked_ai_py.agents.agent import AgentPair, FixedPlanAgent, CoupledPlanningAgent, GreedyHumanModel, CoupledPlanningPair, EmbeddedPlanningAgent, RandomAgent
from overcooked_ai_py.mdp.actions import Direction, Action
from overcooked_ai_py.mdp.overcook... |
from aergo.herapy.utils.encoding import (
decode_private_key, encode_b64, encode_address, encode_b58
)
from aergo.herapy.utils.converter import (
convert_public_key_to_bytes, bytes_to_int_str
)
from aergo.herapy.account import Account
from aergo.herapy.obj.private_key import PrivateKey
from aergo.herapy.obj.add... |
import fcntl
import inspect
import json
import os
import platform
import re
import shutil
import signal
import stat
import subprocess
import sys
import tempfile
import time
from multiprocessing import Process
import pytest
from unit.check.chroot import check_chroot
from unit.check.go import check_go
from unit.check.is... |
from typing import Dict, List, Optional, Tuple, Collection, Callable
import networkx as nx
import numpy as np
def bucket_molecules(molecules: List[Dict], keys: List[Callable]) -> Dict:
"""
Organize molecules into nested dictionaries according to molecule properties
specified by the "keys".
The neste... |
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
'''By: <NAME>'''
'''Contact: <EMAIL>'''
import numpy as np
'''Boundary Conditions'''
builtInSupport = (0, 0, 0);
simpleSupport = (0, 0, 1);
rollerSupportX = (1, 0, 1);
rollerSupportY = (0, 1, 1);
freeEnd = (1, 1, 1);
# Assumptions:
# Constant Cross Sectional Area
# 2-D Truss NOT 3D Beam
name = input("Problem Na... |
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import os
import sys
import cv2
import random
import webbrowser
import numpy as np
import tkinter as tk
import tkinter.messagebox as tkMessageBox
from tkinter import *
from tkinter import ttk
from threading import Timer
from PIL import Image, ImageTk
from datetime import datetime
class Gif(Label):
def __init__(... |
# This script converts files from the HaloFinder
# into hdf5 readable files.
#It also computes the Sersic index of all structures
# Not all quantities are dumped, should be modified depending on what is needed
# and the version of the HaloFinder
import numpy as np
import pandas as pd
import yt.utilities.fortran_util... |
import re
import urllib
import time
from django.shortcuts import render, redirect, get_object_or_404
from django import http
from django.db.utils import DatabaseError
from django.db import transaction
from django.db.models import Count
from django.conf import settings
from django.core.urlresolvers import reverse
from ... |
import json
from enum import Enum
import requests
from requests import Response
import os
from crawler.crawler_bis.fdutils import string_or_path, web_downloader
try:
from urllib import quote # Python 2.X
except ImportError:
from urllib.parse import quote # Python 3+
class FlickrPrivacyFilter(Enum):
def... |
import collections
import re
from colorsys import hls_to_rgb
from .parser import parse_one_component_value
class RGBA(collections.namedtuple('RGBA', ['red', 'green', 'blue', 'alpha'])):
"""An RGBA color.
A tuple of four floats in the 0..1 range: ``(red, green, blue, alpha)``.
.. attribute:: red
... |
from __future__ import print_function
import argparse
import os
import shutil
import random
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('--dir', help="data directory", default="data-orchard")
parser.add_argument('--max_args', help="max number of integers per value node", type=int, default... |
import copy
import datetime
import logging
from django.template.defaultfilters import date
from django.urls import reverse
from django.utils import timezone
from django.utils import translation
from django.utils.translation import gettext as _
from linebot import models
from conf import tasks
from golf import models ... |
import io
import json
import os
import librosa
import numpy as np
import re
import tempfile
from collections import defaultdict
from pathlib import Path
from urllib.parse import urljoin
from scipy.signal import find_peaks
from surfboard.sound import Waveform
from pykalman import UnscentedKalmanFilter as KalmanFilter
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=class-missing-docstring
"""The unit test suite for the libcros_config_host.py library"""
... |
'''
Copyright 2021 Flexera Software LLC
See LICENSE.TXT for full license text
SPDX-License-Identifier: MIT
Author : sgeary
Created On : Wed Dec 08 2021
File : report_artifacts_html.py
'''
import logging
import os
import base64
import _version
logger = logging.getLogger(__name__)
#---------------------------------... |
import copy
import signal
from lxml import builder
import time
from threading import Thread, Condition
import traceback
from xmpp import xml
from xmpp.features import NoRoute
from pympler import muppy, summary
import os
import modes
import roster
import UserManager
import Msg
import Config
import Utmp
from Log impor... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
import numpy as np
import tensorflow as tf
import multiprocessing as mp
from multiprocessing import Process, Manager
#import ray
import time
#import rfpimp as rfp
from tqdm import tqdm
from scipy.linalg import solve_triangular, sqrtm
from .models import BnnBase, BnnBinaryClassifier
from .projections import Covariance... |
import sys
import die
import sortdict
import re
LevelChars = "rkdpcofgsq"
FakeNameCounter = 0
def GetParentLevelChar(LevelChar):
if LevelChar == LevelChars[0]:
return "-"
n = LevelChars.find(LevelChar)
assert n >= 0
return LevelChars[n-1]
def SplitLevelIsTrue(SplitLevelChar, TestLevelChar):
if len(SplitLevelC... |
import random
from django.apps import apps
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models import Q, UniqueConstraint
from .exceptions import OutOfQuestionsException
from .utils import te... |
from __future__ import absolute_import, division, print_function
from simdna import util
from collections import OrderedDict
import numpy as np
import re
import itertools
class DefaultNameMixin(object):
"""Basic functionality for classes that have a self.name attribute.
The self.name attribute is typical... |
# -*- coding: utf-8 -*-
from guillotina.contrib.image.scale import scaleImage
from guillotina.contrib.image.scale import scalePILImage
from guillotina.tests.image import TEST_DATA_LOCATION
from io import BytesIO
from unittest import TestCase
import os.path
import PIL.Image
import PIL.ImageDraw
import warnings
with o... |
import os
import csv
import numpy as np
import pandas as pd
from lightfm import LightFM
from lightfm.evaluation import precision_at_k
from lightfm.evaluation import auc_score
import scipy.sparse
import warnings
from scipy.sparse import SparseEfficiencyWarning
from sklearn.metrics import label_ranking_average_precision_... |
import numpy as np
from database.imports import *
from database.models.base import Base
from database.models.mixins import HasNotes, HasMetaData, HasReagents, HasHardware, HasReagentTypes, HasDataFileSources, HasMetaDataSources, HasMdsHwRecords, HasDfsHwRecords
###-------------------
### Experiment tables
###--------... |
import re
from flask import Blueprint, request, jsonify
from .models import User, Note, Video
from . import db
from firebase import Firebase
from flask_cors import cross_origin
from werkzeug.utils import secure_filename
from pytube import YouTube
import os
import shutil
import math
import datetime
import ssl
from googl... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Bioindustrial-Park: BioSTEAM's Premier Biorefinery Models and Results
# Copyright (C) 2020-, <NAME> <<EMAIL>>
#
# This module is under the UIUC open-source license. See
# github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt
# for license details.
'''
Ref... |
# File: heat_pump_adoption_modelling/pipeline/preprocessing/feature_engineering.py
"""
Adding new features to EPC dataset.
"""
# ----------------------------------------------------------------------------------
# Import
import pandas as pd
import numpy as np
import re
from hashlib import md5
from heat_pump_adoption... |
from collections import namedtuple
import unittest
import os
import warnings
import shutil
import torch
import torch.utils.cpp_extension
import torch.testing._internal.common_nn as common_nn
from torch.testing._internal.common_cuda import TEST_CUDA
# Note that this namedtuple is for C++ parity test mechanism's intern... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.