text stringlengths 3.07k 22.1k |
|---|
import datetime
import os
import json
import time
from threading import Thread
from flask import Flask, request, jsonify, Response, send_from_directory
from flask_cors import CORS
from flask_restx import Api, Resource
from werkzeug.middleware.proxy_fix import ProxyFix
from src import *
from src.connectors import antr... |
#!/usr/bin/env python
#
#
# Generate a "tuning" datset, where each datapoint in the set consists of the information from two bouncing ball
# simulators. Used to train TuneNet.
import os
import os.path as osp
import matplotlib.pyplot as plt
import numpy as np
import torch
import torchvision.transforms as transforms
f... |
"""Copyright 2011 The University of Michigan
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... |
# Copyright 2016 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.
"""LCM display module controller.
The NT7534 (128x64 digital LCM) on SocKit is controlled by HPS SPI interface
from SPIM1.
Before using, please make sure... |
#! /usr/bin/env python3
import sys
import argparse
import raptr
def main():
""" Handles arguments and invoke driver function.
"""
head_description = "Add a bam pair with qualifier 'xenocp' for a sample."
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,
... |
#!/usr/bin/env python
# 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 ... |
"""
Minion data cache plugin for Etcd key/value data store.
.. versionadded:: 2018.3.0
.. versionchanged:: 3005
It is up to the system administrator to set up and configure the Etcd
infrastructure. All is needed for this plugin is a working Etcd agent
with a read-write access to the key-value store.
The related docu... |
# -*- coding: utf-8 -*-
# @Time : 2018/05/18
# @Author : <NAME>
import datetime
import json
import cv2
import numpy as np
import time
import core
import os
from PIL import Image, ImageDraw
def transformation_points(src_img, src_points, dst_img, dst_points):
src_points = src_points.astype(np.float64)
dst_p... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
import re
from netaddr import IPNetwork
from terraform_compliance.steps import resource_name
from terraform_compliance.common.exceptions import Failure
from collections.abc import Iterable
import json
class EmptyStash(object):
pass
class Null(object):
pass
def flatten_list(input):
return list(flatten(... |
# 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 ... |
import os
import logging
import options
_Error = logging.Error
_Options = options.Options
_StrOption = options.StrOption
_IntOption = options.IntOption
_PathOption = options.PathOption
_EnumOption = options.EnumOption
_LinkedOption = options.LinkedOption
_VersionOption = options.VersionOption
_BoolOption = options.B... |
# Copyright (c) Microsoft Corporation
# All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation
# the rights to ... |
# Copyright The PyTorch Lightning team.
#
# 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 i... |
import os
import time
import copy
import threading
from queue import Queue
from core.orm import *
import cv2
import pyautogui
import pyperclip
import pyscreeze
import subprocess
import platform
pyautogui.FAILSAFE = False
IMG_PATH = '../img/'
run_flag = Queue(1)
run_work = {}
stop_signal = Queue(1)
class WorkThread... |
from dataclasses import dataclass, fields
from typing import List, ClassVar, Any, Tuple
import re
from json_debug import to_json, StrJsonMixin, snake2camel, snake2pascal
__all__ = [
'Term', 'Var', 'Atom', 'Struct', 'Functor', 'Clause',
'Addr', 'Register', 'StackAddr', 'AtomAddr',
'Instruction', 'Builtin',
... |
import time
from .downloads import download_pretrained_model
from .evals import get_metrics
from .helpers import *
from .models import BertSCLSTM
def load_model(vocab, verbose=False):
model = BertSCLSTM(3 * len(vocab["chartoken2idx"]),
vocab["token2idx"][vocab["pad_token"]],
... |
from __future__ import print_function
from boto3.session import Session
import json
import urllib
import boto3
import zipfile
import tempfile
import botocore
import traceback
import re
import zipfile
import time
print('Loading function')
cf = boto3.client('cloudformation')
code_pipeline = boto3.client('codepipeline'... |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import re
impor... |
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
from torch.distributions import Normal
from torch import distributions
from torch.nn.parameter import Parameter
import ipdb
from sklearn import cluster, datasets, mixture
from sklearn.preprocessing import StandardScaler
from flows.flo... |
import torch
from torch.autograd import Variable
def lap(fields, device='cuda'):
def dx(f):
p = Variable(torch.zeros((f.size(0),1,f.size(1),2), device=device))
return torch.cat((p, f[:,1:-1,:,:] - f[:,:-2,:,:], p), 1)
def dy(f):
p = Variable(torch.zeros((f.size(0),f.size(1),1,2), devic... |
import sys
import wx
import flavours
from flavours.gui import fonts, shell, appframe, scripts
from io import StringIO
if flavours.MAC:
from AppKit import (
NSApp,
NSView,
NSPoint,
NSMakeRect,
NSToolbar,
# NSProcessInfo,
# NSString,
NSLeftMouseDraggedM... |
"""API for console manipulation using ANSI Escape sequences in Python.
"""
import logging
from itertools import chain
from pyansiescapes.enums import ANSICommands, TextAttributes, ColorDrawingLevel, Colors
from pyansiescapes import utils
import pyansiescapes._types as t
import emojis
_logger = logging.getLogger(__file... |
from binascii import hexlify
from dataclasses import dataclass, field
from typing import Set, Mapping, Union, Optional, Dict
from warnings import warn
from .binio import to_dword, from_dword
from .disasm import disasm
from .machine_code_assembler import asm
from .machine_code_utils import mach_memcpy
from .metadata_ob... |
# 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 u... |
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.append(os.path.abspath("."))
import config
from src.data import data_reader
from src.utli import utli
def userDataFactroy():
df_profile = data_reader.userProfile()
df_final_rating = data_reader.rating()
df_... |
from flask import render_template, request, redirect, url_for, session
from flask.ext.login import login_required, login_user, logout_user, current_user, current_app, abort
import dateutil.parser
from registry import app, auth, oauth, login_manager, registers, forms, locator
from registry.auth import AuthClient, AuthTo... |
def choices_to_dict(choices_str: str) -> dict:
# REDcap choices are expressed as pipe-delimited sets of comma-delim values
#
# Used to populate dropdown, checkbox, or slider types
#
# Example: 1, Yes | 0, No
# Example: 0, 0 | .25, 0.25 | .5, 0.5 | 1, 1 | 2, 2 | 4, 4 | 8, 8
# Example: 1, Unab... |
# <NAME>, Imaging Biomarkers and Computer-Aided Diagnosis Laboratory,
# National Institutes of Health Clinical Center, July 2019
"""Load and pre-process CT images in DeepLesion"""
import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
from scipy.ndimage.morphology import binary_fill_holes, binary_openi... |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2013 <EMAIL>.
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2013-11-01
#
"""workflow-build [options] <workflow-dir>
Build Alfred Workflows.
Compile contents of <workflow-dir> to a ZIP file (with extension
`.alfredworkflow`).
The name... |
from __future__ import absolute_import
from __future__ import print_function
import sys
import types
try:
from cStringIO import StringIO
except ImportError:
from six import BytesIO as StringIO
import marshal
import types
import six.moves.cPickle
import itertools
if six.PY2:
from pickle import Pickler
else:... |
# Copyright 2016 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 agree... |
"""Helper file for computing various statistics over our data such as mention
frequency, mention text frequency in the data (even if not labeled as an
anchor), ...
etc.
"""
import argparse
import logging
import multiprocessing
import os
import time
from collections import Counter
import marisa_trie
import nltk
impor... |
# Copyright 2018 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... |
###########################################
# Model for generating samples from model
#
###########################################
import torch
import torch.nn as nn
from torchtext.data import Iterator as BatchIter
import argparse
import numpy as np
import math
import time
from torch.autograd import Variable
import t... |
import argparse
import json
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from datasets.shapenetV2 import build_shapenetV2
from models.nerf import build_nerf, set_grad
from models.weight_generator import WeightGenerator, add_weight_res
from utils.shape_video import create_360_vide... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Catalog utility functions / classes."""
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from astropy.coordinates import Angle, SkyCoord
__all__ = [
'coordinate_iau_format',
'ra_iau_format',
... |
import matplotlib.pyplot as plt
from numpy import corrcoef, mean, zeros
from copy import deepcopy
from scipy import spatial
import Krippendorff
########################################################################################
class Rater:
def __init__(self, ID):
self.ID = ID
self.matrix = self.ReadF... |
import md5
import os
import random
import string
import tempfile
from cStringIO import StringIO
import pytest
from django.conf import settings
from django.core.files.storage import default_storage
from django.core.management import call_command
from django.test import TestCase
from django.test.utils import override_se... |
#! /usr/bin/env python3
import argparse
import csv
import importlib
import itertools
import math
import re
import sys
import unicodedata
from types import CodeType, ModuleType
from typing import (
Any,
Dict,
Iterable,
Iterator,
Match,
Optional,
Sequence,
TextIO,
Tuple,
)
INCLUDE_GL... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2020, Myriota Pty Ltd, All Rights Reserved
# SPDX-License-Identifier: BSD-3-Clause-Attribution
#
# This file is licensed under the BSD with attribution (the "License"); you
# may not use these files except in compliance with the License.
#
# You may ob... |
# Malaya Natural Language Toolkit
#
# Copyright (C) 2019 Malaya Project
# Licensed under the MIT License
# Author: huseinzol05 <<EMAIL>>
# URL: <https://malaya.readthedocs.io/>
# For license information, see https://github.com/huseinzol05/Malaya/blob/master/LICENSE
import tensorflow.compat.v1 as tf
from malaya.functio... |
# Copyright 2019 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... |
from enum import Enum
from functools import lru_cache
import json
import os
import regex as re
import warnings
from .constants import GPT2_TOKENIZER_LEN
from .paths import OFFICIAL_GPT2_ENCODER_DIR, OFFICIAL_RUGPT3_ENCODER_DIR
from .official_gpt2_encoder.encoder import Encoder as OfficialEncoder
class Tokenizer(Enum)... |
"""
main_summary to Vertica Search Rollups
This job is added by Bug 1364530 and was originally located at
[1]. Search rollups are computed and then ingested by Vertica.
[1] https://gist.github.com/SamPenrose/856aa21191ef9f0de18c94220cd311a8
"""
import logging
import arrow
import click
from pyspark.sql import SparkS... |
# coding=utf-8
# Copyright 2019 The TensorFlow Datasets 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 appl... |
#!/usr/bin/env python3
# Import OE-Classic recipe data into the layer index database
#
# Copyright (C) 2013 Intel Corporation
# Author: <NAME> <<EMAIL>>
#
# Licensed under the MIT license, see COPYING.MIT for details
import sys
import os.path
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__... |
#!/usr/bin/python
"""
Helper script to split monthly input geojson files with all detections for example from E13d into separate entries per grouped by AOI and timestamp
Also creates a csv for additional indicator with `suffix` to allow grouped view of these data
Usage:
# update `list_of_dates_to_process` with dates i... |
from datetime import datetime
import tempfile
import os
import json
import shutil
import numpy as np
import ray
from typing import Type
from ray.tune.logger import UnifiedLogger
from config.custom_config import Config
from ray.rllib.agents.trainer import Trainer
def select_policy(agent_id):
if agent_id == "pla... |
'''
Basic structures
'''
from struct import Struct
from .helpers import num, hexbyte
from .enums import GradientType
_MAGIC = b'4-tP'
_LENGTH = Struct('<i')
def _bare(fmt: str, mul=None) -> tuple:
fmt = Struct(fmt)
def packer(*data) -> bytes:
if mul is not None:
data = [x / mul for x i... |
# -*- coding: utf-8 -*-
"""
Parallel Strategies
===================
Register objectives for incomplete trials.
Parallel strategy objects can be created using `strategy_factory.create('strategy_name')`.
"""
import copy
import logging
from orion.core.utils import GenericFactory
from orion.core.worker.trial import Tri... |
'''
https://github.com/christiancosgrove/pytorch-spectral-normalization-gan
chainer: https://github.com/pfnet-research/sngan_projection
'''
# ResNet generator and discriminator
import torch
from torch import nn
import torch.nn.functional as F
# from spectral_normalization import SpectralNorm
import numpy as np
from ... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 8 20:03:11 2020
@author: charl
"""
import pandas as pd
import names
import numpy as np
# Reformat dataframe output from pd.read_csv() on an Metrica open tracking data CSV file
# into a more user/database friendly format
def Reformat(data): # Input - a dataframe, Outp... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 2 08:30:48 2019
@author: <NAME>
"""
# =============================================================================
# 1. SET PARAMETERS
# =============================================================================
p_s = 600
###MODEL PATCH SIZE
m... |
# 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... |
"""
Misc functions.
"""
import ipaddress
import datetime
import hashlib
import json
import netaddr
import netifaces
import os
import re
import requests
import scapy.all as sc
import subprocess
import sys
import threading
import time
import traceback
import uuid
import server_config
IPv4_REGEX = re.compile(r'[0-9]{... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
import socket
import ssl
import threading
import select
import re
import os
import subprocess
import time
from binascii import hexlify, unhexlify
from base64 import b64encode
from seth.args import args
from seth.parsing import *
import seth.consts as consts
class RDPProxy(threading.Thread):
"""Represents the RDP... |
import os
import tensorflow as tf
from PIL import Image
import numpy as np
# 验证码存放路径
IMAGE_PATH = "./pictest/"
# 验证码图片宽度
IMAGE_WIDTH = 60
# 验证码图片高度
IMAGE_HEIGHT = 24
# 验证集,用于模型验证的验证码图片的文件名
VALIDATION_IMAGE_NAME = []
# 存放训练好的模型的路径
MODEL_SAVE_PATH = './models/'
CHAR_SET_LEN = 10
CAPTCHA_LEN = 4
def get_image_file_na... |
from pprint import pprint
from copy import deepcopy
import torch
import json
from tqdm import tqdm
# from nltk.tokenize import sent_tokenize
from collections import Counter, defaultdict
from .data import SlotFeatures
def sent_tokenize(text, start_pos):
"""TODO"""
import spacy
nlp = spacy.load("en_cor... |
"""
Validate the content of files included in a PR
Rules for fields:
- name
- required
- type: str
- max length: 100
- author
- required
- type: str
- max length: 100
- author_github
- type: str
- must be valid URL, non 4xx and 5xx HTTP response
- must contain substring 'github.com'
- blu... |
# -*- coding: utf-8 -*-
import re, os
import util
getShipName = util.getShipName
getNameCode = util.getNameCode
parseNameCode = util.parseNameCode
ColorDict = {
'#a9f548': '#4eb24e', #绿色
'#ffff4d': '#ffd000', #黄色
'#ff5c5c': '#ec5d53', #红色
'#ffa500': '#ff9900' #橙色
}
def getMemoryGroup():
return uti... |
"""
Program's entry-point
:authors: [<NAME>, <NAME>, <NAME>]
:url: https://github.com/pBouillon/TELECOM_TAN
:license: [MIT](https://github.com/pBouillon/TELECOM_TAN/blob/master/LICENSE)
"""
import matplotlib.pyplot as plt
import pyaudio
import numpy as np
from utils.constants import *
from utils.data... |
# -*- coding: utf-8 -*-
"""Generic requests handlers."""
import datetime
from operator import itemgetter
from google.appengine.ext import ndb
from jinja2 import FileSystemLoader
from webapp2 import cached_property
from webapp2 import RequestHandler
from webapp2 import uri_for
from webapp2_extras import auth
from webap... |
import argparse
import numpy as np
import gym
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from utils import logz
from utils.tools import get_output_folder, OUNoise, hard_update, soft_update
from utils.buffer import ReplayBuffer
FloatTensor = torch.FloatTensor
"""
... |
import asyncio
import datetime
from collections import deque
import cv2
import numpy as np
from .app import MeasurementStep
_message_action = {
MeasurementStep.NOT_READY: "",
MeasurementStep.READY: "Press 's' to start",
MeasurementStep.USER_STARTED: "",
MeasurementStep.MEASURING: "Press Esc to cance... |
"""Utilities for mypy.stubgen, mypy.stubgenc, and mypy.stubdoc modules."""
import sys
import os.path
import json
import subprocess
import re
from contextlib import contextmanager
from typing import Optional, Tuple, List, Iterator, Union
from typing_extensions import overload
from mypy.moduleinspect import ModuleInsp... |
import os
import time
import hashlib
from datetime import datetime
from collections import defaultdict
from rich.console import Console
from ripper import common
from ripper.common import is_ipv4, strip_lines
from ripper.constants import DEFAULT_CURRENT_IP_VALUE, MIN_SCREEN_WIDTH
from ripper.proxy_manager import Prox... |
#! /usr/bin/env python3
# Copyright (c) 2021, <EMAIL>u<EMAIL>
# All rights reserved
# This file is under BSD 2-Clause License, see LICENSE file
import os,sys, random, io
import argparse
from pyzbar import pyzbar
from PIL import Image, ImageDraw
from datetime import datetime
from urllib import request
import qrcode
... |
from __future__ import annotations
from collections import defaultdict
from tndm.utils.args_parser import ArgsParser
import tensorflow as tf
from typing import Dict, Any
from enum import Enum
from copy import deepcopy
from tndm.utils import AdaptiveWeights
from tndm.data import DataManager
class ModelType(Enum):
... |
import inspect
from pathlib import Path
from unittest.mock import Mock
import parso
from test_pkg import functions
import pytest
from ploomber.util import dotted_path
from ploomber.exceptions import SpecValidationError
from ploomber.sources.inspect import getfile
@pytest.mark.parametrize('spec', [
'test_pkg.fun... |
# 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 2019 The Google NoisyStudent Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
#!/usr/bin/env python
# Copyright 2020 <NAME>
# License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
Adopt from my another project: https://github.com/funcwj/setk
See https://github.com/funcwj/setk/tree/master/doc/data_simu for command line usage
"""
import argparse
import numpy as np
from aps.loader.... |
# Copyright 2015 Planet Labs, 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 writ... |
from django.db import connection, transaction
def get_cursor():
return connection.cursor()
def fetch_rows_as_dict(cursor=None, table_name=None):
cursor = cursor or get_cursor()
"Return all rows from a cursor as a dict"
if table_name:
cursor.execute("SELECT * FROM %s" % table_name)
columns... |
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed
# under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... |
# vim: set fileencoding=utf-8 :
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, t... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Tigera, 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 re... |
import ast
import json
import os.path
import tkinter as tk
from datetime import datetime
from tkinter import ttk
from thonny import codeview, get_workbench, ui_utils, THONNY_USER_DIR
from thonny.base_file_browser import BaseLocalFileBrowser
from thonny.plugins.coloring import SyntaxColorer
from thonny.ui_utils import ... |
from random import choice
from string import ascii_uppercase, digits
try:
from django.utils.encoding import force_unicode as force_text
except (NameError, ImportError):
from django.utils.encoding import force_str as force_text
from django.db import transaction
from django.contrib.gis.db.models import PointFie... |
#!/usr/bin/python
''' this is igroup module
(c) 2018-2019, NetApp, Inc
# 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',
'sta... |
"""
Functions for serialize Pandas DataFrame.
Much of the code here is inspired by that in the aioinflux packet found here: https://github.com/gusutabopb/aioinflux
"""
import re
import math
from influxdb_client.client.write.point import _ESCAPE_KEY, _ESCAPE_STRING, _ESCAPE_MEASUREMENT
def _itertuples(data_frame):
... |
#!/usr/bin/env python
"""
Convert a mesh file from one SfePy-supported format to another.
Examples::
$ ./script/convert_mesh.py meshes/3d/cylinder.mesh new.vtk
$ ./script/convert_mesh.py meshes/3d/cylinder.mesh new.vtk -s2.5
$ ./script/convert_mesh.py meshes/3d/cylinder.mesh new.vtk -s0.5,2,1
$ ./script/conve... |
#!/usr/bin/env python3
"""
File name: viewnet.py
Author: <NAME>
email: <EMAIL>
Date created: 02/09/2017 (DD/MM/YYYY)
Python Version: 3.5
Description:
Module used for visualization of the network systems generated using
netsim.py
"""
import argparse, os, time,traceback,sys
import numpy as... |
import streamlit as st
import numpy as np
from streamlit_folium import folium_static
from folium.plugins import MarkerCluster
import folium
import pandas as pd
import geopandas
import plotly.express as px
from datetime import datetime
pd.set_option('display.float_format', lambda x: '%.3f' % x)
st.set_page_config(layo... |
from azure.iot.device.aio import IoTHubDeviceClient, ProvisioningDeviceClient
from azure.iot.device import MethodResponse, Message
import smbus2, bme280, os, asyncio, json, time
from grove.grove_moisture_sensor import GroveMoistureSensor
from dotenv import load_dotenv
from grove.grove_light_sensor_v1_2 import GroveLigh... |
import time
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
from nets.deepdsod_model import DSOD
from loss import MultiBoxLoss
from datasets.dsod_dataset import mydateset
from os.path import exists
from utils import *
# {'car': 1, 'person': 2, 'truck': 3, 'bus': 4, 'rider': 5, 'rear': 6,... |
import asyncio
import itertools
from collections import defaultdict
from collections.abc import Iterable
from dataclasses import dataclass
from datetime import datetime, timedelta
from pathlib import Path
from typing import List, Union, Dict, Any, Sequence
import os
import logging
from aiomultiprocess import Pool
from... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, print_function
import sys
import time
import datetime
from django.test import TestCase
from django.core.cache import cache, get_cache
import redis_cache.cache
if sys.version_info[0] < 3:
text_type = unicode
bytes_type = str
el... |
#!/usr/bin/env python
#
# 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
# "L... |
"""
"""
import json
import os
import pickle
import random
from collections import Counter
from copy import deepcopy
import numpy as np
from tatk.util.multiwoz.dbquery import query
days = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday']
domain_keywords = {
'restaurant': 'place to di... |
from __future__ import with_statement
import errno
from pypy.interpreter.baseobjspace import W_Root
from pypy.interpreter.gateway import interp2app, unwrap_spec
from pypy.interpreter.error import OperationError, oefmt
from pypy.interpreter.error import exception_from_saved_errno
from pypy.interpreter.typedef import T... |
#! python
from collections import defaultdict
from .aln.utils import get_query_start_end_in_forward_read
"""
Find and tag inversion alignments and flanking alignments before
and after inversions.
iv:A:B --> flank alignments before an inversion
iv:A:I --> inversion alignment
iv:A:A --> flank alignments aft... |
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
class TimeSeries():
"""A class that holds time series data
Attributes:
- series (pd.Series) - a pandas Series with a Datetime index.
The index must be in time order.
"""
def __... |
# 可以自己import我们平台支持的第三方python模块,比如pandas、numpy等。
from rqalpha.api import *
import pandas as pd
import numpy as np
from datetime import timedelta
from pybrain.datasets import SequentialDataSet
from pybrain.tools.shortcuts import buildNetwork
from pybrain.structure.networks import Network
from pybrain.structure.modules im... |
from __future__ import absolute_import, division, print_function
import os
import re
import pickle
import warnings
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from rlssm import plotting
from .utils import list_individual_variables
from .stan_utility import check_all_diag... |
import torch
import random
import torchvision.transforms as transforms
import numpy as np
import cv2
from poissonblending import blend
from multiprocessing import Process, Queue, Pool
import time
import sys
def gen_input_mask(shape, position, w_h):
"""
* inputs:
- shape (sequence, required):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
import six
import six.moves.cPickle as pickle
from six.moves.queue import Queue
import sys
from threading import Thread
from mathics import settings
from... |
import math
import torch
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
# from model.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d
from ..utils import build_norm_layer
'''
class IBN(nn.Module):
def __init__(self, planes):
super(IBN, self).__init__()
half1 = int(planes/2)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.