text stringlengths 8.04k 46.5k |
|---|
# -*- coding:utf-8 -*-
"""
Author:
<NAME>,<EMAIL>
"""
from __future__ import print_function
import time
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as Data
from sklearn.metrics import *
from torch.utils.data import DataLoader
from tqdm import tqd... |
#
# The MIT License
#
# Copyright 2016 Vector Software, East Greenwich, Rhode Island USA
#
# 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 limita... |
# -*- coding: utf-8 -*-
"""
femagtools.femag
~~~~~~~~~~~~~~~~
Running FEMAG
"""
import subprocess
import os
import glob
import logging
try:
import zmq
except ImportError:
pass
import sys
import json
import io
import femagtools.mcv
import femagtools.airgap as ag
import femagtools.fsl
import femagt... |
import logging
import pandas as pd
import pyprind
import six
import dask
from dask import delayed
from dask.diagnostics import ProgressBar
import py_entitymatching.catalog.catalog_manager as cm
from py_entitymatching.blocker.blocker import Blocker
from py_entitymatching.utils.catalog_helper import log_info, get_name... |
"""
Author: Benny
Date: Nov 2019
"""
from data_utils.ModelNetDataLoader import ModelNetDataLoader
import argparse
import numpy as np
import os
import torch
import logging
from tqdm import tqdm
import sys
import importlib
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = BASE_DIR
sys.path.append(os.path.... |
import matplotlib
import os
import math
import numpy as np
import datetime
matplotlib.use('Agg')
matplotlib.rcParams.update({
"text.usetex": True,
"font.family": "sans-serif",
"font.sans-serif": ["Helvetica"]})
import matplotlib.pyplot as plt
from common import invoke_main, render_exception, wri... |
# -*- coding: utf-8 -*-
"""
Seat Connect integration
Read more at https://github.com/farfar/homeassistant-seatconnect/
"""
import re
import asyncio
import logging
from datetime import datetime, timedelta
from typing import Union
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry, SOURCE_REA... |
# -*- coding: utf-8 -*-
'''
File server pluggable modules and generic backend functions
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import collections
import errno
import fnmatch
import logging
import os
import re
import time
# Import salt libs
import salt.loader
... |
# standard library
from typing import Union, Optional, List
# third party imports
from tabulate import tabulate
from loguru import logger
import numpy as np
# local imports
from probeye.subroutines import titled_table
from probeye.subroutines import simplified_list_string
from probeye.subroutines import len_or_one
fr... |
#MenuTitle: Straight Stem Cruncher
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
__doc__="""
Measures in centers of straight segments, and reports deviations in stem thicknesses.
"""
import vanilla
from Foundation import NSPoint
def pointDistance(p1, p2):
stemThickness = (... |
#!/usr/bin/env python
#
# python script to process makedoc instructions in a source file and produce
# DocBook XML output
#
#
# This performs 3 stages of processing on it's input, in a similar fashion
# to makedoc:
#
# 1. Discard everything outside of /* */ comments
# 2. Identify lines which contains commands (a sing... |
#!/usr/bin/python
# Copyright 2015 <NAME> and <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
"""
Tests for Tax-Calculator Parameters class and JSON parameter files.
"""
# CODING-STYLE CHECKS:
# pycodestyle test_parameters.py
# pylint --disable=locally-disabled test_parameters.py
import copy
import os
import json
import math
import tempfile
import numpy as np
import paramtools
import pytest
# pylint: disable=i... |
import numpy as np
from scipy.sparse import diags
from scipy.interpolate import RectBivariateSpline, interp1d
from astropy.io import fits
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm # for better display
###############################################
# Hack to get the path of module. To be c... |
"""
Code to manage IAM roles, groups, and policies.
"""
from __future__ import print_function
import json
import os
import os.path
import urllib
import urllib2
from collections import defaultdict
import logging
from datetime import datetime
import boto
import boto.iam
import boto3
import botocore
from . import read_co... |
# (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
import copy
import logging
import math
import torch
import torch.nn as nn
from vissl.models.model_helpers import DropPath as PathDropout, to_2tuple, trunc_normal_
from vissl.models.trunks import register_model_trunk
from vissl.utils.hydra_config i... |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
#!/usr/bin/env python
from __future__ import division, print_function
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from pxl.styleplot import set_sns
import os
import argparse
from itertools import islice
R = 0.5375
D = R*2
nu = 1e-6
c = (0.04 + 0.06667)/2
H = 0.807
def clean_column_names(d... |
#!/usr/bin/python3
# -*- encoding="UTF-8" -*-
#Import Package
import re
import numpy as np
import matplotlib.pyplot as plt
from tkinter.messagebox import *
import parameters
from Functions.string2num import string2num
def getTitleAC():
if len(parameters.listACParam) == 1:
WriteString = 'Fre' + '\t'
... |
"""
Connect to a MySensors gateway via pymysensors API.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/mysensors/
"""
import asyncio
from collections import defaultdict
import logging
import os
import socket
import sys
from timeit import default_timer a... |
### Import useful libraries
import pandas as pd
import numpy as np
import torch,time,datetime,random,statistics,argparse
from torch import cuda,nn
from seqeval.metrics import classification_report
from torch.utils.data import Dataset, DataLoader
from transformers import AutoTokenizer,AutoModel,AutoModelForMaskedLM,Auto... |
# Copyright (C) 2021 Google 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, ... |
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for details.
from __fu... |
import torch
from plnn.proxlp_solver import utils
import math
import copy
from plnn.explp_solver import anderson_optimization
class CutDualVars(anderson_optimization.DualVars):
"""
Class representing the dual variables alpha, beta_0, and beta_1, and their functions f and g.
They are stored as lists of ten... |
import re, json, os
from datetime import date
import cloudscraper, jsonpickle, random
with open(os.path.join(os.path.dirname(__file__), 'scrapers.json')) as f:
scrapers = json.load(f)['scrapers']
#cars of nitrotype
cars = {
1 : '<NAME> SS',
2 : '<NAME>',
3 : '<NAME>',
4 : 'Portch Picante',
5 : '... |
"""
Class definition for SqliteRecorder, which provides dictionary backed by SQLite.
"""
from copy import deepcopy
from io import BytesIO
from collections import OrderedDict
import os
import gc
import sqlite3
from itertools import chain
import json
import numpy as np
import pickle
import zlib
from openmdao import ... |
# coding: utf-8
# # TV Script Generation
# In this project, you'll generate your own [Simpsons](https://en.wikipedia.org/wiki/The_Simpsons) TV scripts using RNNs. You'll be using part of the [Simpsons dataset](https://www.kaggle.com/wcukierski/the-simpsons-by-the-data) of scripts from 27 seasons. The Neural Network... |
"""Here is defined the AttributeSet class."""
import re
import sys
import warnings
import pickle
import numpy as np
from . import hdf5extension
from .utils import SizeType
from .registry import class_name_dict
from .exceptions import ClosedNodeError, PerformanceWarning
from .path import check_attribute_name
from .und... |
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2010 <NAME>, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your op... |
import logging
import struct
import numpy as np
import warnings
from typing import List, Dict, Optional
import qcodes as qc
from qcodes import VisaInstrument, DataSet
from qcodes.instrument.channel import InstrumentChannel
from qcodes.instrument.base import Instrument, Parameter
from qcodes.instrument.parameter import... |
import os
import numpy as np
import audioread
import librosa
from mido import MidiFile
from piano_vad import (note_detection_with_onset_offset_regress,
pedal_detection_with_onset_offset_regress)
import config
def create_folder(fd):
if not os.path.exists(fd):
os.makedirs(fd)
... |
# 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Description
The widely used IR evaluation metrics, such as AP (average precision), nDCG and ERR
Note: commonly the metric-computation is not conducted on gpu
"""
import torch
import numpy as np
from ptranking.data.data_utils import LABEL_TYPE
ADHOC_METRIC = ['P', 'AP... |
"""
writemdict.py - a library for creating dictionary files in the MDict file format.
Optional dependencies:
python-lzo: Required to write dictionaries using LZO compression. (Other compression schemes are available.)
Simple usage example:
from __future__ import unicode_literals
from writemdict import MDi... |
import numpy as np
import scipy.signal
import matplotlib.pyplot as plt
import matplotlib
plt.switch_backend('agg')
import sys
import pandas as pd
import os
import pickle
from multiprocessing import Pool
from itertools import repeat
import utils.EventDetection_utils as EventDetection_utils
import utils.general_util... |
#!/usr/bin/env python
#############################################################################
##
# This file is part of Taurus
##
# http://taurus-scada.org
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Taurus is free software: you can redistribute it and/or modify
# it under the terms of t... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\filters\sim_template.py
# Compiled at: 2020-08-27 05:53:33
# Size of source mod 2**32: 43653 bytes
i... |
############################################################
### Forked from https://github.com/YihanWang617/On-ell_p-Robustness-of-Ensemble-Stumps-and-Trees
############################################################
import pprint
from gurobipy import *
from sklearn.datasets import load_svmlight_file
from scipy impo... |
import numpy as np
from google.protobuf import text_format
from . import caffe_pb2 as caffe
from .caffe_utils import *
from .extra_layers import *
from ..layers import *
from ..models import Model
def caffe_to_keras(prototext, caffemodel, phase='train', debug=False):
"""Converts a Caffe Graph into a Keras Graph
... |
# i code this with a friend in the first semester of college.
# you can access the repository where we worked here: https://github.com/luisgustavocarmelo/trabalho-ap1s1
Opcoes_do_Menu_Principal = ['Alunos', 'Cursos', 'Matrículas', 'Relatórios', 'SAIR']
Opcoes_do_Submenu = ['Listar todos', 'Listar um', 'Incluir... |
import logging
import sys
import time
import json
from datetime import datetime
from datetime import timedelta
from django.utils import timezone
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import F
fr... |
import io
import os
import pprint
import sys
import time
import yaml
from argparse import ArgumentParser
import warnings
warnings.filterwarnings('ignore',category=FutureWarning)
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.ERROR)
import dataloader
from models import MODEL
from models import cifar_vae a... |
"""
fileiobase provides general purpose NMR file IO functions and classes
used by multiple nmrglue.fileio modules.
Originally part of NMR glue -- an open source module for working with NMR data
in Python https://github.com/jjhelmus/nmrglue/
If you find nmrglue useful in your research please cite the package as:
<NAM... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: <NAME>
# Description: Plots Detector Signal and Demodulation of DM-DR
##
## Modules
##
import sys
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
from scipy import special
##
## Settings
##
kwargs_figur... |
#!/usr/bin/python
# AUTHOR
# <NAME> <<EMAIL>>
# COPYRIGHT
# Copyright (c) 2015 <NAME> <<EMAIL>>
# LICENSE
# MIT License (http://opensource.org/licenses/MIT)
"""
Various patterns to scan pixels on a grid. Rectangular patterns are scanned
first along the x-coordinate then the y-coordinate. Radial patterns are
sca... |
""" Welcome to the Tadman ncurses interface. It's original goal was
to have all the functionality of the GTK+ version, but use fewer
dependencies and be accessible from a terminal interface.
Now, this interface is the main interface of the project. The GTK+
variant will be updated later on if anyone shows interest in ... |
# -*- coding: utf-8 -*-
# MIT license
#
# Copyright (C) 2018-2021 by <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
# ... |
from __future__ import print_function
from sklearn import svm
from sklearn.cross_validation import train_test_split
import argparse
import classifier
import common
import numpy
import os
from classifier import BagOfWords, svm_uni_fitter, svm_bi_fitter, svm_uni_pos_fitter, svm_bi_pos_fitter
from datas... |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Yahoo! 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... |
from angr import SimEngineError, SimProcedure, SimState
from angr.knowledge_plugins import Function
from angr.sim_type import *
import angr # type annotations; pylint: disable=unused-import
import claripy
from claripy.ast.bv import BV
from angr.calling_conventions import SimCC, SimFunctionArgument
from typing import ... |
"""Airflow Pipeline DAGs that create derived tables to simplify reporting on data workspace"""
from datetime import datetime
import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import UUID
from airflow.operators.python_operator import PythonOperator
from dataflow.dags.base import _PipelineDAG
from dataflow.da... |
import socketserver
import binascii
import ssl
import threading
import math
import time
import dns
import dns.message
from syhelpers.dataqueue import DataQueue
from syhelpers.encoding import dnshostdecode, dnstxtencode, lenofb64decoded, dnsip4encode, dnshostencode, dnsip6encode
from syhelpers.files import sanatizefile... |
import copy
import os
from abc import abstractmethod
from argparse import Namespace
from contextlib import ExitStack
from typing import Dict, List, Optional, Set, Union
from jina import __default_executor__, __default_host__, __docker_host__, helper
from jina.enums import DeploymentRoleType, PodRoleType, PollingType
f... |
# This should not be run, it just contains the main codebase
import re
from calculator import *
from decimal import Decimal
from colorama import Fore, Style
import PySimpleGUI as Sg
FG = Fore.GREEN
FA = Fore.RED
SR = Style.RESET_ALL
def help_print():
print(
f"{FA}Invalid Options...{SR}",
f"{FG}Us... |
# -------- Library importings -------- #
# Importing system libraries
import glob
import os
# and math, signal and plot libraries for creating user-defined functions
import numpy as np
from scipy.interpolate import interp2d
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
from mpl_toolkits import mplot... |
#!/usr/bin/env python
# cardinal_pythonlib/psychiatry/treatment_resistant_depression.py
"""
===============================================================================
Original code copyright (C) 2009-2020 <NAME> (<EMAIL>).
This file is part of cardinal_pythonlib.
Licensed under the Apache License, ... |
# 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, os, json
from frappe import _
from frappe.utils import get_timestamp
from frappe.utils import cint, today, formatdate
import frappe.defa... |
import os
import matplotlib as mpl
if os.environ.get('DISPLAY','') == '':
mpl.use('Agg')
import matplotlib.pyplot as plt
from textwrap import wrap
import collections
import timeit
from datetime import datetime
import sklearn.metrics as sm
import pandas as pd
import numpy as np
import jax.numpy as jnp
from jax impor... |
#!/usr/bin/env python
# Generic
import os
from collections import Counter
# Libs
import itertools
# Custom
from rest_rpc import app
##################
# Configurations #
##################
SOURCE_FILE = os.path.abspath(__file__)
logging = app.config['NODE_LOGGER'].synlog
logging.debug(
"tr... |
from __future__ import unicode_literals
import json
import re
import six
from collections import deque, OrderedDict
from marshmallow.fields import Nested
from marshmallow.validate import Length
from six import iteritems, iterkeys, itervalues
from slybot import __version__ as SLYBOT_VERSION
from slybot.fieldtypes imp... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from datetime import datetime
import re
import string
import os
import json
import wget
import csv
import pandas as pd
import numpy as np
import xgboost as xgb
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.integrate import quad
from matpl... |
import numpy as np
from bresenham import bresenham
import cv2
# from multiprocessing import Process, Queue
# from sklearn.cluster import KMeans
from scipy.spatial import distance_matrix
# import matplotlib.pyplot as plt
from collections import Counter
from pprint import pprint
from PIL import Image
from time import tim... |
import os
import argparse
import random
import numpy as np
import torch
from torch.utils.data import DataLoader, Dataset
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, AutoConfig
from transformers.optimization import get_linear_schedule_with_warmup, Adafactor
import nlp
from rouge_score import rouge_sc... |
"""
********************************************************************************
* Name: docker_commands.py
* Author: <NAME>
* Created On: July 2014
* Copyright: (c) Brigham Young University 2014
* License: BSD 2-Clause
********************************************************************************
"""
try:
im... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def mgc_scatter(x, y, colors=None, includ_colorbar=False, title=None, figsize=(10, 10)):
"""
plot scatter based on matplotlib
@x <1d np.array>: data x
@y <1d np.array>: data y
@title <None or dict>: {'label': None, 'fontsize':... |
import discord
from discord.ext import commands
import json
import os
import logging
import subprocess
import asyncio
import threading
import socket
import time
import cv2
from PIL import Image, ImageFilter
import urllib.request
import urllib.parse
import json
import random
import tkinter as tk
import wave
import audio... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Background models.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from astropy.coordinates import Angle, SkyCoord
from astropy.io import fits
from astropy.modeling.models import Gaussian1D
from ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import dash
import pandas
from app import app
import cfg
import time
import pickle
import dash_html_components as html
from plotly import tools
import plotly.graph_objs as go
from iclip_tab import createGeneModelPlot
import plotly.utils as pu
@app.callback(
dash.dep... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.core.validators
from aldryn_apphooks_config.fields import AppHookConfigField
from aldryn_categories.fields import CategoryManyToManyField
from aldryn_categories.models import Category
from aldryn_newsblog.utils.utilities import get_valid_la... |
import numpy as np
import cv2
import matplotlib.pyplot as plt
##############################################################################
############################### CLASSES ##################################
##############################################################################
# Define a class to... |
# Copyright The HuggingFace Team and The HuggingFace Inc. team. 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... |
#!/usr/bin/env python3 -O
import argparse
import math
import os
import re
import sys
import collections
import importlib.machinery
import importlib.util
import typing
from string import ascii_lowercase, digits
import itertools
from functools import partial
from typing import List, Tuple, Callable, Sequence, Optional, I... |
import logging
import random
import re
import sys
from collections import defaultdict
from enum import Enum
from operator import itemgetter
from typing import Any, Dict, List, Optional, Union
from textworld import EnvInfos
from room import Room
from room_search import opposite_dir, RoomSearch
_directions = ["north",... |
import hmac
import base64
import warnings
import mimetypes
from hashlib import sha256
from urllib.parse import quote, quote_plus
from datetime import datetime
from twisted.web.http import datetimeToString
from txaws import _auth_v4
from txaws.client.base import BaseClient, BaseQuery
from txaws.service import AWSServi... |
import sqlite3
import csv
import pandas as pd
import os
import time
import logging
import traceback
import configparser
# Gets or creates a logger
logger = logging.getLogger(__name__)
# # set log level
logger.setLevel(logging.INFO)
#config object to pull the password from conf file
config = configparser.ConfigPars... |
#######
'''
SGD is not bad
Sparsity?
Eta row-wise is not bad
[DOING] Need to measure everything
Continuous stream with mixture?
[DONE] Show loss decreases within episode? meta-learning
[DONE] WRITE a PlasticBlock
Linear + tanh
Changing mixture
[Done] Only first 10 labels
'''
import argparse
import torch
im... |
#!/usr/bin/env python3
import argparse
import os
import os.path
import json
import pickle
import time
import sys
import flatbuffers
from tqdm import tqdm
sys.path.insert(0, '/usr/share/_ggnn')
sys.path.insert(0, '/usr/share/_ggnn/_Graph')
sys.path.insert(0, '/usr/local/share/_ggnn')
sys.path.insert(0, '/usr/local/share... |
import datetime
import decimal
import itertools
import re
import socket
import time
import uuid
from operator import itemgetter
from bson import Binary, ObjectId, SON
import pymongo
import six
from six import iteritems
try:
import dateutil
except ImportError:
dateutil = None
else:
import dateutil.parser
... |
# -*- coding: utf-8 -*-
import json
import logging
import os
import random
import sys
import pygame
import pygbutton
from src import Screens, Tiles, Structures
from src import config as cfg
from src.Utilities import ColorRGB
__author__ = "<NAME>"
__version__ = "0.1"
parent_dir = os.path.dirname(os.getcwd())
logger... |
import logging
from collections import defaultdict
from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional, Set, Tuple
from eth_utils.address import to_checksum_address
from rotkehlchen.accounting.structures import Balance
from rotkehlchen.assets.asset import Asset, EthereumToken
from rotkehlchen.chai... |
"""Fire modes and group class definitions."""
import enum
from typing import Dict, Final, Optional
from ..base import Cached
from ..census import Query
from ..models import FireGroupData, FireModeData
from .._proxy import InstanceProxy, SequenceProxy
from .._rest import extract_payload
from ..types import LocaleData
... |
#!/usr/bin/env python
# coding: latin-1
# A bunch of naive python functions to decode somes ais_data/AIVDM messages:
# try with !AIVDO,1,1,,,B00000000868rA6<H7KNswPUoP06,0*6A
# doc : http://catb.org/gpsd/AIVDM.html
#################################################################################
# HOW TO USE IT :
# msg... |
# Lint as: python3
# Copyright 2021 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 ... |
# Copyright 2018, Erlang Solutions Ltd, and S2HC Sweden AB
#
# 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... |
"""
WARNING: This file is incredibly gross. I am so sorry.
Hyperparater search functions wrapped around training. It should be noted that there is
a ton of repeated code between random_search(), grid_search(), and IC_grid_search(). If
code changes in any of these functions, similar changes should be made in the other ... |
# -*- coding: utf-8 -*-
# Copyright 2014 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.
"""Module that helps to triage Commit Queue failures."""
from __future__ import print_function
import glob
import os
import ppri... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, <NAME>
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
import unittest
import aniso8601
from aniso8601.exceptions import ISOFormatError
from aniso8601.resolution import Time... |
import itertools
import numpy as np
from . import _automethods, backend, binary, ffi, lib, monoid, semiring, utils
from ._ss.vector import ss
from .base import BaseExpression, BaseType, call
from .dtypes import _INDEX, lookup_dtype, unify
from .exceptions import NoValue, check_status
from .expr import AmbiguousAssign... |
import os
import numpy as np
from math import inf
import cv2
import tifffile as tiff
import h5py
from scipy.spatial import distance
from PIL import Image
from skimage.filters import apply_hysteresis_threshold
from scipy.ndimage.morphology import binary_fill_holes
from scipy.ndimage import convolve
import tensorflow as... |
import os, subprocess, sys, shutil, stat, logging, shlex, getpass
# see no evil
from .workflowdata import workflowdata, workflowtests
pjoin = os.path.join
# Global configuration constants
docker = "docker" # the docker executable
srcdir = "/src" # mount location in container of source directory
blddir = "/bld" # mount... |
import asyncio
import json
import time
import logging as log
import multiprocessing
import subprocess
import sys
import webbrowser
from yaml import scanner
from urllib.parse import unquote
from typing import Any, List, AsyncGenerator, Optional
from galaxy.api.consts import Platform
from galaxy.api.jsonrpc import Appli... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Dell EMC OpenManage Ansible Modules
# Version 3.0.0
# Copyright (C) 2020-2021 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
from __future__ import (absolute_import, divi... |
#!/usr/bin/python
import code
import os
import random
import select
import socket
import struct
import subprocess
import sys
import threading
import time
import traceback
try:
import ctypes
except ImportError:
has_windll = False
else:
has_windll = hasattr(ctypes, 'windll')
if sys.version_info[0] < 3:
is_bytes = l... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
import gin.tf
slim = tf.contrib.slim
gin.constant('networks.STACK_SIZE_1', 1)
gin.constant('networks.STACK_SIZE_4', 4)
gin.constant('networks.OBSERVATION_DTYPE_FLOA... |
#1 引入需要的模块
import pygame
import random
import os
#1 配置图片地址
IMAGE_PATH = 'imgs/'
#1 设置页面宽高
scrrr_width=800
scrrr_height =560
#1 创建控制游戏结束的状态
GAMEOVER = False
#4 图片加载报错处理
LOG = '文件:{}中的方法:{}出错'.format(__file__,__name__)
#3 创建地图类
class Map():
#3 存储两张不同颜色的图片名称
map_names_list = [IMAGE_PATH + 'map1.png', IMAGE_PATH + ... |
#!/usr/bin/env python
#
# Read doxygen xml files into an object tree that can be
# written to either Sphinx ReStructuredText format or SWIG doctrings
#
# Written by <NAME>, 2017
#
from __future__ import print_function
import sys, os
try:
import lxml.etree as ET
except ImportError:
import xml.etree.ElementTree... |
import pygame, math
import numpy as np
"""
LIBRERIA DE OBJETOS 3D BÁSICOS
==========================================
Esta librería proviene de un tutorial para renderizar formas simples usando matemática y pygame.
Este archivo esta designado para dibujar en pantalla la forma especificada.
"""
# Radian rotated by ... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from .compat import implements_to_string
from .html import slugify
from .tools import remove_padding
from .filter import MoyaFilterParams
from . import namespaces
from collections import namedtuple
fr... |
# -*- coding: utf-8 -*-
# import matplotlib.pyplot as plt
import numpy as np
# from numpy import ma
import pygimli as pg
from pygimli.physics import ert
from pygimli.viewer.mpl.colorbar import createColorBarOnly
def createData(elecs, schemeName='none', **kwargs):
""" Utility one-liner to create a BERT datafile
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.