text stringlengths 6.04k 39.5k |
|---|
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
#!/usr/bin/env python
# Copyright 2019 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.
"""Utilities for optimistically parsing dex files.
This file is not meant to provide a generic tool for analyzing dex files.
A DexFile... |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
from util import *
def update_graphics(block, next_block, playing_field, player):
#black background and text
DISPLAY_SCREEN.blit(background_img, (0, 0))
pygame.draw.rect(DISPLAY_SCREEN , black, (off_set_x, off_set_y, playing_field_width, playing_field_height) )
font = pygame.font.SysFont("comicsansm... |
"""
It's used very easily. First, you write a module that is like
tests/commands.py. Each function name BLAH_command implements a sub-command.
Then you use modargs.args.parse_and_run_command to parse the command line and
run the function that matches.
Note that the _command suffix is optional and configurable, but i... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Simple web app engine, developed by <NAME> (<EMAIL>).
1, Provide basic request dispatching.
2, Provide basic http context access (e.g.: request/response/cookie).
3, Provide basic http tools (e.g.: static file sender).
"""
import os
import re
import sys... |
import logging
from enum import Enum
from .config_parser import get_config
from .custom_config import (
EMPTY_CONFIG,
ConfigType,
check_config_group,
get_config_types,
)
from .network.message_router import MultiSeatMessageRouter
from .network.socket_handler import SocketHandler
SURRORTG_VERSION = "0.2... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 10 13:20:12 2021
@author: jackreid
"""
import ee
import folium
from datetime import datetime as dt
from datetime import timedelta
import pandas as pd
import numpy as np
from dateutil.parser import parse
import os
from osgeo import gdal
import subpr... |
import kube_vars as globalvars
import os
import kube_factory as factory
import kube_logs as logs
from kubernetes import client
from kubernetes.client.rest import ApiException
#Current file path
CURDIR = os.path.abspath(os.path.dirname(__file__)) + "/"
def CreateConfigMap(parser_args):
_CoreV1Api = globalvars.ge... |
#!/usr/bin/env python3.6
import signal
import sys
import argparse
import datetime
from dateutil import parser
from astral.geocoder import lookup, database
from astral.sun import sun
import csv
import pytz
import os
import os.path
import requests
import json
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyp... |
# Copyright 2014 The Bazel 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 applicable la... |
import bpy
from bpy import context
from mathutils import Vector, Quaternion
from math import radians, degrees
import numpy as np
import time
import bmesh
from mathutils.bvhtree import BVHTree
import colorsys
import os
import sys
import math
from .. import error_distribution
from .. import material_helper
from ..export... |
#!/usr/bin/env python3
# sc25519.py
# access library for smartcards that support ed25519/x25519 operations
# according to the OpenPGP 3.4.1 spec, e.g. the Yubikey 5 series,
# and demo code
# Nov 2020 (c) <<EMAIL>>
# MIT license
import nacl.bindings
from smartcard.Exceptions import NoCardException
from smartcard... |
r"""
Groups of isometries.
Let `M = \ZZ^n` or `\QQ^n`, `b: M \times M \rightarrow \QQ$ a bilinear form and
$f: M \rightarrow M$ a linear map. We say that $f$ is an isometry if for all
elements $x,y$ of $M$ we have that $b(x,y)=b(f(x),f(y))$.
A group of isometries is a subgroup of $GL(M)$ consisting of isometries.
EXA... |
# -*- coding: utf-8 -*-
# imageio is distributed under the terms of the (new) BSD License.
""" Plugin that wraps the freeimage lib. The wrapper for Freeimage is
part of the core of imageio, but it's functionality is exposed via
the plugin system (therefore this plugin is very thin).
"""
import numpy as np
from .. im... |
import sys
sys.path.append('..')
sys.path.append('../plugins')
import model
import modeltemplates
import datetime
import pytz
import json
import templates
import time
from bs4 import BeautifulSoup
import re
import requests
import threading
import sse
"""
this file contains test functions and helpers to test the mode... |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2017-2018 CNRS
# 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
#
# # Machine Translation Project
# This is a project from the natural language processing nanodegree from udacity
#
# (https://br.udacity.com/course/natural-language-processing-nanodegree--nd892)
#
# ## Introduction
# In this notebook, we will build a deep neural network that functions as part of ... |
"""
A quick prototype to demonstrate the translation of data into the spec being
devised for the ARDC-GMRT project.
"""
from datetime import datetime, timezone
from pathlib import Path
import zipfile
import tempfile
from typing import Any, Dict, Tuple, Union, List
import json
import uuid
import click
import numpy
imp... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# 适用于 tensorflow >= 2.0, keras 被直接集成到 tensorflow 的内部
# ref: https://keras.io/about/
from tensorflow.keras.layers import Input, LSTM, TimeDistributed, Bidirectional, Dense, Lambda, Embedding, Dropout, \
Concatenate, RepeatVector
from tensorflow.keras.optimizers import Ad... |
from typing import List, NamedTuple, Optional
from ..error import GraphQLSyntaxError
from .ast import Token
from .block_string import dedent_block_string_lines
from .character_classes import is_digit, is_name_start, is_name_continue
from .source import Source
from .token_kind import TokenKind
__all__ = ["Lexer", "is_... |
"""
schema.py defines the schema of the tables describing Grist's own data structures. While users can
create tables, add and remove columns, etc, Grist stores various document metadata (about the
users' tables, views, etc.) also in tables.
Before changing this file, please review:
https://phab.getgrist.com/w/migrat... |
#!/usr/bin/env python3
import argparse
import h5py
import json
import logging
from pathlib import Path
from pybind_nisar.products.readers.Raw import Raw
from pybind_nisar.products.writers import SLC
from pybind_nisar.workflows import defaults
from pybind_nisar.types import to_complex32
import numpy as np
import pybind_... |
#!/usr/bin/env python
# Program: photon_toa.py
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# Description:
# Reads a FITS file of photon event times (from NICER or another X-ray mission)
# and generates TOAs from the unbined times using a pulsar timing model
# and an analytic temp... |
# coding=utf-8
from subzero.constants import PREFIX, TITLE, ART
from support.config import config
from support.helpers import pad_title, timestamp, df, display_language
from support.scheduler import scheduler
from support.ignore import ignore_list
from support.items import get_item_thumb, get_on_deck_items, get_all_it... |
import xml.etree.ElementTree as ET
import inspect
import huawei_lte.utils as utils
from huawei_lte.errors import RouterError
class XmlObject(object):
'''A simple object to handle XML object serialisation'''
def __init__(self, settings=None):
self._SKIP_BLANK = self._get_param(settings, 'ski... |
import sys,typing
# the top level class is the module singleton
scopes = []
flow = []
log = []
class empty:pass
instance = empty()
def standard_c_header(**kw):
yield ( """/*
%(namespace)s.c AUTO-GENERATED by %(name)s
*/
// ======= STATIC HEADER ========
#include <string.h>
#include <stdio.h>
#include <st... |
# coding: utf-8
# # In this notebook, I use the update rules according to the last notebook (based on the Newton-Raphson method) on the MNIST dataset.
#
# -------------------------------------------------------------------------------------------------------------------
#
# # This notebook also generates the comparis... |
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
# Copyright 2019 TerraPower, 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 writi... |
# baselineTeam.py
# ---------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkeley... |
r"""
Platonic Solids
EXAMPLES: The five platonic solids in a row;
::
sage: G = tetrahedron((0,-3.5,0), color='blue') + cube((0,-2,0),color=(.25,0,.5)) +\
octahedron(color='red') + dodecahedron((0,2,0), color='orange') +\
icosahedron(center=(0,4,0), color='yellow')
sage: G.show(aspect_rati... |
"""
Copyright (c) 2018 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import print_function, absolute_import, unicode_literals
import logging
import re
import random
import json
from osbs.build.... |
"""Training:tutorial functions."""
import os
import shutil
from planemo.engine import (
engine_context,
is_galaxy_engine,
)
from planemo.training import (
Training
)
from planemo.training.topic import Topic
from planemo.training.tutorial import (
get_galaxy_datatype,
get_hands_on_boxes_from_local_g... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import csv
import datetime
import hashlib
import io
import os
import random
import uuid
from django.test import TransactionTestCase
from le_utils.constants import content_kinds
from kolibri.core.analy... |
# Copyright (C) 2019-2021 Parrot Drones SAS
#
# 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 and the followin... |
# Copyright 2017-2022 RStudio, PBC
#
# 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 os
import string
import random
from itertools import chain
from collections import namedtuple
from mock import patch, call
import pytest
from baseline.utils import str2bool
from mead.utils import (
KEYS,
convert_path,
get_output_paths,
get_export_params,
find_model_version,
get_dataset_fr... |
"""
Helper functions for FFN with ESP
=================================================================
Author: <NAME> <<EMAIL>> (2018)
Tensorflow implementation of a Feed Forward Deep network with ESP
activation, as defined in
"Expectation propagation: a probabilistic view of Deep Feed Forward Networks"
# Licensed ... |
"""
BitBake 'Command' module
Provide an interface to interact with the bitbake server through 'commands'
"""
# Copyright (C) 2006-2007 <NAME>
#
# SPDX-License-Identifier: GPL-2.0-only
#
"""
The bitbake server takes 'commands' from its UI/commandline.
Commands are either synchronous or asynchronous.
Async commands r... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Test the glm utilities.
"""
from __future__ import absolute_import
import numpy as np
from nibabel import load, Nifti1Image, save
from ..glm import GeneralLinearModel, data_scaling, FMRILinearModel
f... |
# Copyright 2016 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... |
# Copyright (c) 2018 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from ctypes import *
from binascii import hexlify, unhexlify
from enum import IntEnum, IntFlag
import pdb
import hashlib
import d... |
import discord
import os
#import pynacl
#import dnspython
import server
from discord.ext import commands
from discord.utils import get
from utils.config import EMBEDS
from utils.utils import is_mod_or_admin
dow = 1
import datetime
import time
import requests
import json
from itertools import islice
client = commands.... |
import numpy as np
import math
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from scipy.integrate import odeint
from scipy.integrate import ode
import random, pickle
import pandas as pd
from scipy.optimize import fsolve, least_squares
from scipy.optimize import curve_fit
# Evaluating stea... |
# %%
import os
import sys
import time
import math
import glob
import ast
import random
from albumentations.augmentations.transforms import Resize
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.functional as F
import pytorch_lightning as pl
fr... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.keras._impl.keras import backend as K
from tensorflow.python.keras._impl.keras.engine import Layer
from tensorflow.python.keras._impl.keras.layers.recurrent impor... |
import ast,_ast
from pythonql.algebra.operators import *
from collections import namedtuple
# List of classes for our internal AST
boolOp_e = namedtuple('boolOp_e',['op','args'])
binaryOp_e = namedtuple('binaryOp_e',['op','args'])
unaryOp_e = namedtuple('unaryOp_e',['op','arg'])
lambda_e = namedtuple('lambda_e',['arg... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
# Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
"""Plotting functions."""
import sys
from itertools import count
from functools import partial
# For plot tests, matplotlib must be set to headless mode early
if 'pytest' in sys.modules:
import matplotlib
matplotlib.use('Agg')
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.pyplot import cm... |
"""
Class to read Sensitivity file
"""
from collections import OrderedDict
from itertools import product
from numpy import transpose, hstack
from matplotlib.pyplot import gca
from serpentTools.utils.plot import magicPlotDocDecorator, formatPlot
from serpentTools.engines import KeywordParser
from serpentTools.messages... |
# -*- coding: utf-8 -*-
# coding=utf-8
# Copyright 2019 The SGNMT Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
import torch
from typing import List, Dict, Optional, Any
import copy
import logging
from functools import reduce
from bagua.torch_api.utils import check_contiguous, get_flattened_tensor
import gorilla
__all__ = ["fuse_optimizer", "fuse_step", "is_fused_optimizer"]
def flatten_params_and_states(optimizer: torch.opt... |
"""
factor.py
"""
from operator import attrgetter
from numbers import Number
from numpy import float64, inf
from toolz import curry
from zipline.errors import (
UnknownRankMethod,
UnsupportedDataType,
)
from zipline.lib.rank import masked_rankdata_2d
from zipline.pipeline.mixins import (
CustomTermMixin,
... |
#!/usr/bin/python3
import sys
if sys.path[0].endswith("worker"):
sys.path[0] = sys.path[0][:-6]
from utils import env, tools
config = env.getenv("CONFIG")
#config = "/opt/docklet/local/docklet-running.conf"
tools.loadenv(config)
from utils.log import initlogging
initlogging("docklet-taskworker")
from utils.log impo... |
#!/usr/bin/python
# -- Content-Encoding: utf-8 --
"""
Tests for javaobj
See:
http://download.oracle.com/javase/6/docs/platform/serialization/spec/protocol.html
:authors: <NAME>, <NAME>
:license: Apache License 2.0
:version: 0.4.0
:status: Alpha
..
Copyright 2019 <NAME>
Licensed under the Apache License, Ve... |
__author__='thiagocastroferreira'
"""
Author: Organizers of the 2nd WebNLG Challenge
Date: 23/04/2020
Description:
This script aims to evaluate the output of data-to-text NLG models by
computing popular automatic metrics such as BLEU (two implementations),
METEOR, chrF++, TER and BERT-Score.
ARG... |
import argparse
import os
import json
import lasagne
import numpy as np
import sklearn.metrics
import theano.tensor as T
from hyperopt import STATUS_OK, STATUS_FAIL, fmin, Trials
from sklearn.model_selection import train_test_split, GroupShuffleSplit
import misc_tools
import settings
import graph_tools
from nn_models... |
import numpy.testing as npt
import numpy as np
from fury import window, molecular as mol
def test_periodic_table():
# Testing class PeriodicTable()
table = mol.PTable()
npt.assert_equal(table.atomic_number('C'), 6)
npt.assert_equal(table.element_name(7), 'Nitrogen')
npt.assert_equal(table.atomic_s... |
from tea.global_vals import *
from tea.helpers.constants.test_names import *
from enum import Enum
from .value import Value
from tea.ast import DataType, LessThan, GreaterThan, Literal, Relationship
# Other
import attr
# Need to be reset for each test
group1 = None
group2 = None
outcome = None
__test_to_statistic_o... |
import os
import cv2
import numpy as np
from sympy import N
import tensorflow.compat.v1 as tf
from config import config
from models import Inception
from utils import change_channel, gray_normalizer
import time
from pythonosc import udp_client
from scipy import ndimage
import pyttsx3
engine = pyttsx3.init()
tf... |
# Copyright (c) 2015 OpenStack Foundation.
#
# 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
#
# Unle... |
#!/usr/bin/python
# Copyright (c) 2017 Alibaba Group Holding Limited. <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by <NAME>
email : <EMAIL>
*************... |
# encoding: utf-8
# BaseCoverageRecord, Timestamp, CoverageRecord, WorkCoverageRecord
from sqlalchemy import (
Column,
DateTime,
Enum,
ForeignKey,
Index,
Integer,
String,
Unicode,
UniqueConstraint,
)
from sqlalchemy.orm.session import Session
from sqlalchemy.sql.expression import and... |
"""
The `star' class is the core of PBjam and refers to a single target that is to
be peakbagged. Each `star' instance is assigned an ID and physical input
parameters, as well as a time series or power spectrum.
The different steps in the peakbagging process are then passed the `star'
instance, updating it with t... |
# -*- coding: utf-8 -*-
"""Common utility classes and functions."""
import numpy as np
from numba import njit
from scipy.linalg import null_space
RAD = np.pi / 180 # degree to radian
DEG = 180 / np.pi # radian to degree
def pdf(a, bins):
"""Compute the probability density from a data set a and the given bins."... |
import os
from warnings import warn
from itertools import combinations
from sqlalchemy.orm import joinedload
from sqlalchemy.sql.expression import and_
from credoscript import config
from credoscript.models import *
from credoscript.adaptors import *
from credoscript.support.pymolviewer import PyMOLViewer
PDB_DIR = ... |
# !/usr/bin/python
# -*- coding: latin-1 -*-
"""
A module for creating and managing grids of model spectra
"""
from functools import partial
from glob import glob
import multiprocessing
import os
import pickle
from pkg_resources import resource_filename
import time
import warnings
from astropy.io import fits
from astr... |
# Copyright 2015 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import os
import shutil
import logging
from pathlib import Path
TAG ... |
import base64
import datetime
import logging
import math
import multiprocessing
import os
import signal
import time
import psycopg2
from psycopg2 import errorcodes as postgres_errors
from ctf_gameserver.lib.args import get_arg_parser_with_db, parse_host_port
from ctf_gameserver.lib import daemon
from ctf_gameserver.l... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2020 Citrix Systems, Inc.
#
# 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
# ... |
"""PyTorch module conversion related functions.
"""
import copy
from typing import List, Callable, Dict
from collections import OrderedDict
import torch
from torch import Tensor, nn
from torch.fx.experimental.normalize import NormalizeOperators
from torchdistx import deferred_init as torchdistx_deferred_init
from torc... |
import numpy as np
from numpy import ma
import pandas as pd
import xarray as xr
import cv2 as cv
from scipy import ndimage as ndi
class Flow:
"""
Class to perform semi-lagrangian operations using optical flow
"""
def __init__(self, dataset, smoothing_passes=1, flow_kwargs={}):
self.get_flow(dat... |
# ------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: Steve
#
# Created: 27/04/2013
# Copyright: (c) Steve 2013
# Licence: <your licence>
# ------------------------------------------------------------------------------
import sys
i... |
# 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... |
"""Provide infrastructure to allow exploration of variations within populations.
Uses the gemini framework (https://github.com/arq5x/gemini) to build SQLite
database of variations for query and evaluation.
"""
import collections
import csv
import os
import toolz as tz
from bcbio import install, utils
from bcbio.dist... |
"""Unit test for treadmill.api input validation.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
# Disable R0915: Too many statements
# pylint: disable=R0915
import copy
import unittest
import jsonschema
import ... |
"""Parsing functions for Binvox files.
https://www.patrickmin.com/binvox/binvox.html
Exporting meshes as binvox files requires binvox CL tool to be on your path.
"""
import os
import subprocess
import numpy as np
import collections
from distutils.spawn import find_executable
from .. import util
from ..base import T... |
#!/usr/bin/env python
# coding=utf-8
## @package biopredyn
## Copyright: [2012-2019] Cosmo Tech, All Rights Reserved
## License: BSD 3-Clause
import libsedml
import model, simulation, result, change, ranges
## Abstract representation of an atomic task in a SED-ML work flow.
class AbstractTask:
## @var id
# A uni... |
import wx
import wx.lib.intctrl
import wx.lib.rcsizer as rcs
import socket
import sys
import re
import six
import datetime
import Model
import Utils
import JChip
import ChipReader
from JChip import EVT_CHIP_READER
import RaceResult
import Ultra
import HelpSearch
from ReadSignOnSheet import GetTagNums
HOST, PORT = JCh... |
import bpy
import math
import mathutils
from os import listdir
from os.path import isfile, join
from . raytracer import sensor_position_for_distance
from . import calc
from . import create
from . import data
# ------------------------------------------------------------------------
# Helper functions
# ---------... |
from __future__ import division, print_function, absolute_import
import logging
import numpy as np
import os.path
from ast import literal_eval
import nibabel as nib
from dipy.core.gradients import gradient_table
from dipy.data import get_sphere
from dipy.io.gradients import read_bvals_bvecs
from dipy.io.peaks import... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from __future__ import division
from __future__ import print_function
import numpy as np
import pandas as pd
from typing import Text, Union
import copy
from ...utils import get_or_create_path
from ...log import get_module_logger
import torch
i... |
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from sklearn.decomposition import NMF
from sklearn.preprocessing import MinMaxScaler
def add_team_postfix(input_df):
output_df = input_df.copy()
top = output_df['inning'].str.contains('表')
output_df.loc[top, 'batter'] = ... |
import os
import glob
import random
import cv2
import numpy as np
import torch
import torch.utils.data as data
from .info_list import SCENE
from .info_list import CARTOONS
class YoukuDataset(data.Dataset):
def __init__(self, data_dir, upscale_factor, nFrames, augmentation, patch_size, padding, v_freq=10, cut=Fals... |
# REFERENCES
# https://pymotw.com/3/threading/
# https://realpython.com/intro-to-python-threading/
# https://docs.python.org/3/library/concurrent.futures.html
# https://stackoverflow.com/questions/6893968/how-to-get-the-return-value-from-a-thread-in-python
# https://stackoverflow.com/questions/3221655/python-threading-... |
""" mplsoccer pitch dimensions.
Note that for tracab, uefa, metricasports, custom, and skillcorner the dimensions are in meters
(or centimeters for tracab). Real-life pictures are in actually measured in yards and
the meter conversions for distances (e.g. penalty_area_length) are slightly different,
but for the purpos... |
# -*- coding: utf-8 -*-
# Copyright StateOfTheArt.quant.
#
# * Commercial Usage: please contact <EMAIL>
# * Non-Commercial Usage:
# 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
#
... |
import os
import urllib.request
import urllib.error
import json
import discord
import pandas as pd
pd.options.display.float_format = '{:,.2f}'.format
db_loc = os.path.join(os.getcwd(), 'db_files')
FANTASY = 'fantasy'
POINTS = 'points'
PTs = 'pts'
fantasy_trigger = '!f'
stats_trigger = '!p'
pt_trigger = '!tpe'
user_a... |
#!/usr/bin/env python3
# vim: ts=3:sw=3:et
import os
import sys
import traceback
import re
import csv
import time
import logging
import logging.config
import argparse
import datetime
import configparser
import threading
import smtplib
from saq.constants import *
from saq.client import Alert
import csv
from splunklib ... |
from warnings import warn
from libpysal import cg
from libpysal.common import requires
from rtree import Rtree
import numpy
try:
import geopandas
from shapely.geometry import Point, LineString
except ImportError:
msg = "geopandas/shapely not available. Some functionality will be disabled."
warn(msg)
... |
import os
import re
import json
import pickle
import requests
import stringdist
import zipfile
import urllib.request
import numpy as np
from django.http import HttpResponse
from django.shortcuts import render
from simstring.database.dict import DictDatabase
from simstring.measure.cosine import CosineMeasure
from simst... |
# -*- coding: utf-8 -*-
"""
================================================
:mod:`onebot.plugins.urlinfo` Urlinfo plugin
================================================
This plugin shows information about urls posted.
"""
from contextlib import closing
import re
import pickle
import ipaddress
import socket
import... |
# @license
# Copyright 2017 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... |
# pylint: disable=invalid-name
"""PySide custom widgets.
:created: 12/12/2018
:author: <NAME> <<EMAIL>>
"""
from __future__ import absolute_import
from collections import OrderedDict
from functools import partial
import logging
import os
from PySide2 import QtCore, QtGui, QtWidgets
LOG = logging.getLogger(__name__... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Show simple data of the simulation
"""
import colorsys
import os
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from numba import jit
from skdylib.spherical_coordinates import xyz2sph
SIMULATIONS_DIRECTORY = "./simulation... |
"""Objects module -- classes for data received from the Github API"""
from abc import ABC, abstractmethod
from functools import cached_property
import re
from more_itertools import first, last
from .app import App
from .states import BuildStatus, Ok, Progress, Status
from .types import Date, Missing, Sha
__all__ =... |
print(f'Loading {__file__}...')
from matplotlib.colors import LogNorm
import numpy as np
def quick_view(hdr):#don't use this anymore, sw_viewer is better, more general
waxs = next(hdr.data('Small and Wide Angle Synced CCD Detectors_waxs_image'))
saxs = next(hdr.data('Small and Wide Angle Synced CCD Detectors_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.