text stringlengths 3.07k 22.1k |
|---|
from Config._functions import strip_alpha, find_all, is_whole, strip_front
from Config._bppnew_parsing import *
from Config._db import Database
import discord, os, re, time
from datetime import datetime as dt
def HELP(PREFIX):
return {
"COOLDOWN": 3,
"MAIN": "Allows you to write short tags and/or programs",
... |
import discord
from discord.ext import commands
import random
from src.discord.giphy import Gif
import json
import sys
import os
import tensorflow as tf
import boto3
import json
import asyncio
import random
import src.models.aesop_gpt2 as gpt2
from transformers import GPT2Model, GPT2Config, GPT2Tokenizer
import pickle
... |
"""Multi field polygon raster analysis for Rob."""
import logging
import os
import multiprocessing
import sys
import time
from osgeo import gdal
from osgeo import ogr
from osgeo import osr
import pygeoprocessing
import numpy
import shapely
import shapely.geometry
import shapely.wkb
import taskgraph
gdal.SetCacheMax(2... |
import numpy as np
import math
import itertools as itool
import matplotlib.pyplot as plot
epsilon = 1#0**-21
sigma = 1#0**-8
class particle:
def __init__(self, dim, i):
self.name = i
self.position = np.zeros(dim, dtype='longdouble')
self.velocity = np.zeros(dim, dtype='longdouble')
... |
#! /usr/bin/env python
# -*- coding: UTF-8 -*-
import sys
import socket
import os
import gzip
'''
====================================================
CLASS FOR WEB SERVER
====================================================
'''
class Server:
def __init__(self, host, port, staticfiles, cgibin, exec_path):
... |
#!/usr/bin/env python
import gzip
import json
import optparse
import os
import re
import subprocess
import sys
def stop_err(msg):
sys.stderr.write(msg)
sys.exit(1)
def fetch_databases(jar_path, genome_list=None):
snpDBs = dict()
(snpEff_dir, snpEff_jar) = os.path.split(jar_path)
databases_path =... |
import json
import os
import argparse
import datetime
import requests
# default settings
V1_TOKEN = os.environ.get('TMV1_TOKEN', '')
V1_URL = os.environ.get('TMV1_URL', 'https://api.xdr.trendmicro.com')
def check_datetime_aware(d):
return (d.tzinfo is not None) and (d.tzinfo.utcoffset(d) is not None)
class Tm... |
import numpy as np
from time import time
from caffe2.proto import caffe2_pb2
from caffe2.python.modeling.initializers import Initializer, pFP16Initializer
from caffe2.python import core, model_helper, workspace, brew
from caffe2.python.models.resnet import ResNetBuilder
#core.GlobalInit(['caffe2', '--caffe2_log_level=... |
"""Generator energy forecasting"""
import os
import numpy as np
import pandas as pd
import statsmodels.api as sm
from scipy.stats import norm
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
from data import ModelData
from analysis import AnalyseResults
np.random.seed(10)
class ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 6 12:03:13 2018
@author: bahadir
"""
import numpy as np
from matplotlib import pyplot as plt
import cv2
import random
def homography(crr):
max_in = []
H = None
for i in range(1000):
crr1 = crr[random.randrange(0, len(crr))]
... |
# -*- coding: utf-8 -*-
__author__ = 'ooo'
__date__ = '2019/1/9 12:17'
import torch
import torch.nn as nn
from torch.nn import init
from xmodules.res_utils import DownsampleA
from xmodules.classifier import AdaAvgPool, ViewLayer, ReturnX
from xmodules.preprocess import PreProc
import torch.nn.functional as F
import ma... |
import torch
from sortedcontainers import SortedDict
import neuro_shooting.activation_functions_and_derivatives as ad
import torch.nn as nn
def compute_parameters(states):
parameters = dict()
# now compute the parameters
q1 = states['q1']
p1 = states['p1']
q2 = states['q2'].transpose(1,2)
p2 =... |
"""
Some utils for UserWorkspace calls
"""
from django.conf import settings
from django.db.models import Q
from tworaven_apps.utils.basic_response import (ok_resp,
err_resp)
from tworaven_apps.utils.view_helper import \
(get_request_body, get_request_body_as_json,
... |
import logging
import asyncio
from pathlib import Path
from typing import Dict, Optional, Tuple, List, Callable
import time
import concurrent
from blspy import PrependSignature, PrivateKey, PublicKey, Util
from chiapos import DiskProver
from src.protocols import harvester_protocol
from src.server.connection import Pe... |
# Copyright (c) <NAME> <_<EMAIL>>
# See COPYING for details.
from __future__ import print_function
from passacre import _argparse as argparse
def escape(x):
"""
Shell escape the given string
Implementation borrowed from now-deprecated commands.mkarg() in the stdlib
"""
if '\'' not in x:
... |
'''
This module defines the main API to interact with Capsul processes.
In order to execute a process, it is mandatory to have an instance of
:py:class:`CapsulEngine`. Such an instance can be created with factory
:py:func:`capsul_engine`
Classes
=======
:class:`CapsulEngine`
---------------------
Functions
=========
... |
import tensorflow as tf
from tensorflow.keras.layers import *
from tensorflow.keras.models import Model
print(tf.__version__)
def grad_loss(v_gt, v):
# Gradient loss
loss = tf.reduce_mean(tf.abs(v - v_gt), axis=[1,2,3])
jy = v[:,:,1:,:,:] - v[:,:,:-1,:,:]
jx = v[:,:,:,1:,:] - v[:,:,:,:-1,:]
jy_ =... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 18 11:16:38 2018
@author: <NAME>
Transform textfile containing a trajectory using a constant transformation
T_new = T_left * T_old * dT
For example, T_eye = T_WB * T_hand * T_hand_eye.
"""
import argparse
import math
import os
import numpy as ... |
# !/usr/bin/env python
# -*- coding:utf-8 -*-
# author : zerodel
# Readme:
#
GENE_BIOTYPE = "gene_biotype"
__doc__ = '''this module fits the GFF2 format , not GFF3
'''
__author__ = 'zerodel'
class GTFErr(Exception):
pass
class GTFItemErr(GTFErr):
"""base class of exception of seq-file item utility
"""
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#--------------------------------------------------
#RCJ 2016 ROS node of state machine for GPSR
#
#author: <NAME>
#date: 16/03/21
#--------------------------------------------------
import sys
import roslib
sys.path.append(roslib.packages.get_pkg_dir('roch_gpsr') + '/s... |
# Copyright 2021 The Kubric 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time : 2019/8/27
@Author : AnNing
"""
import os
import h5py
import numpy as np
from scipy.interpolate import griddata
from lib.lib_read_ssi import FY4ASSI
from lib.lib_database import add_result_data, exist_result_data
from lib.lib_constant import FULL_VALUE
def ... |
# displays main game board
import pygame
import time
from Control import config
from View.Buttons.blackjack_next_hand_button import BlackjackNextHandButton
from View.Buttons.blackjack_leave_table_button import BlackjackPostHandLeaveTableButton
from View.Buttons.blackjack_quit_game_button import BlackjackPostHandQuitBut... |
"""Apply K-means scenario reduction algorithm to identify representative set of operating conditions"""
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
def get_all_samples(df):
"""Construct samples to be used in K-mean algorithm"""... |
from . import db, ma
from datetime import datetime
import enum
from marshmallow import fields as MarshmallowFields
class MediaList(enum.Enum):
'''
Model choices for the media types
'''
photo = "photo"
video = "video"
audio = "audio"
class CategoryList(enum.Enum):
'''
Model Choices for ... |
"""
sulfaroa
9/6/18
Module 3 Problem Set
"""
import sys
import requests
from csv import *
class Module3:
"""Module 3 Questions"""
'''
22. Define a function which extracts the geographic location and ZIP code out of an HTML file.
The file name will be passed in as the parameter value, the fun... |
import sys, os, lucene, threading, time
import math
from multiprocessing import Pool
import shutil
from datetime import datetime
from org.apache.lucene import analysis, document, index, queryparser, search, store, util
from java.nio.file import Paths
from org.apache.lucene.analysis.miscellaneous import LimitTokenCoun... |
import pickle
import MySQLdb
from interpro7dw import pfam
from interpro7dw.utils import logger
from interpro7dw.utils.mysql import uri2dict
from interpro7dw.interpro.oracle.entries import Entry
from interpro7dw.utils.store import BasicStore
from .utils import create_index, jsonify
def populate_annotations(uri: str,... |
"""
model.py contains code for building models from torchvision models, and defines
a class that acts as a container.
"""
from collections import OrderedDict
import pickle
from PIL import Image
import torch
from torch import nn
from torch import optim
from torchvision import models, transforms
import util
# Resourc... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import torch.nn as nn
import torch as T
from torch.autograd import Variable as var
import numpy as np
from torch.nn.utils.rnn import pad_packed_sequence as pad
from torch.nn.utils.rnn import pack_padded_sequence as pack
from torch.nn.utils.rnn import PackedSequence
from... |
import collections
import numpy as np
import numpy.ma as ma
import pandas as pd
import random
import torch
from torch.utils.data import DataLoader, TensorDataset
from sklearn.model_selection import train_test_split
def check_has_missing(X):
return (X == -1000).any()
def replace_with_1000(X):
X[np.isnan(X)] ... |
import numpy as np
import os
import json
try:
import ruamel_yaml as yaml
except ModuleNotFoundError:
import ruamel.yaml as yaml
LINEMOD_names = np.asarray(['ape', 'benchvise', 'cam', 'can', 'cat',
'driller', 'duck', 'eggbox', 'glue', 'holepuncher',
'iron... |
"""Prototypical dataset classes"""
#pylint: disable=W0223
import csv
from enum import Enum
import json
import logging
import os.path
import random
import tensorflow as tf
import wandb
from ..artifact import Artifact
from ..globals import ML2_BUCKET, WANDB_ENTITY
logging.basicConfig(level=logging.INFO)
logger = loggi... |
from __future__ import division
import glob
import json
import math
import os
import random
import sys
from datetime import timedelta
from time import localtime, strftime, time
import keras.backend as K
import numpy as np
import scipy.io as sio
from keras import applications, optimizers
from keras.callbacks import Le... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import itertools
from pathlib import Path
import cv2
import numpy as np
import PIL.Image
import torch.nn as nn... |
from typing import Any, Callable, Dict, List, Optional, Union, cast
from ..language import print_ast, StringValueNode
from ..language.block_string import print_block_string
from ..pyutils import inspect
from ..type import (
DEFAULT_DEPRECATION_REASON,
GraphQLArgument,
GraphQLDirective,
GraphQLEnumType,... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
import logging
import traceback
import os
import sys
from typing import Dict, List, Union
from zthreading.events import EventHandler, Event
from airflow.utils.helpers import parse_template_string
from airflow.models import TaskInstance
from sqlalchemy import asc, desc
import traceback
from airflow_db_logger.exceptions... |
from struct import Struct, calcsize, pack, pack_into, unpack_from
from collections import OrderedDict
from ixypy.virtio.types import VRING_AVAIL_F_NO_INTERRUPT, VIRTIO_NET_CTRL_RX, VIRTIO_NET_CTRL_RX_PROMISC
from ixypy.virtio.exception import VirtioException, BufferSizeException
from ixypy.ixy import IxyStruct, IxyQue... |
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Auto-anchor utils
"""
import random
import numpy as np
import torch
import yaml
from tqdm import tqdm
from utils.general import LOGGER, colorstr, emojis
PREFIX = colorstr("AutoAnchor: ")
def check_anchor_order(m):
# Check anchor order against stride order for YO... |
from __future__ import annotations
import collections
import os
import re
import shutil
import sys
import sysconfig
from contextlib import contextmanager
from pathlib import Path
from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional, Tuple
from distlib.scripts import ScriptMaker
from pip._internal.req... |
# Copyright 2015 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... |
#!/usr/bin/env python
"""
Based on <NAME> es2graphite
https://github.com/mattweber/es2graphite
"""
import re
import sys
import json
import time
import pickle
import struct
import socket
import thread
import urllib2
import argparse
from pprint import pprint
from datetime import datetime
NODES = {}
CLUSTER_NAME = ''
S... |
import onmt
import onmt.Markdown
import argparse
import torch
def loadImageLibs():
"Conditional import of torch image libs."
global Image, transforms
from PIL import Image
from torchvision import transforms
parser = argparse.ArgumentParser(description='preprocess.py')
onmt.Markdown.add_md_help_argum... |
"""
Copyright 2018 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, software
di... |
from django.http.response import JsonResponse
from django.views.decorators.http import require_http_methods
import sys, MySQLdb
sys.path.insert(0, '..')
from mysite import db_config
def db_query(std_name, std_type):
conn = db_config.mysql_connect()
curs = conn.cursor()
if std_type == 'detail':
'... |
import sys
import imp
import itertools
import collections.abc
import pathlib
import concurrent.futures
from collections import namedtuple, deque
import requests
import yaml
if sys.version_info >= (3, 5):
from http import HTTPStatus
elif sys.version_info >= (3, 4):
from rekt.httputils import HTTPStatus
else:
... |
from sys import platform
import datetime
# Library written for Python 3!
left_channel = 0x60
right_channel = 0x62
# function for returning a SMBus object
# checks the Rpi version before it selects the bus
def getNewSMBus():
bus = None
if platform == 'uwp':
import winrt_smbus as smbus
bus = s... |
from otp.otpbase.PythonUtil import randFloat, normalDistrib, Enum
from otp.otpbase.PythonUtil import clampScalar
from toontown.toonbase import TTLocalizer, ToontownGlobals
import random, copy
TraitDivisor = 10000
def getTraitNames():
if not hasattr(PetTraits, 'TraitNames'):
traitNames = []
for desc... |
# Copyright 2016 <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
__all__ = ['Channelizer']
import os
import platform
from copy impor... |
import os.path
import json
import logging
from itertools import chain
from django.conf import settings
from django.utils.module_loading import import_string
from django.db.models import Q
from django.contrib.staticfiles.storage import staticfiles_storage
from wazimap.models import Geography
log = logging.getLogger(_... |
#!/usr/bin/env python3
#
# Copyright 2021 Graviti. Licensed under MIT License.
#
# pylint: disable=invalid-name
"""Dataloaders of VGGFace2 dataset."""
import csv
import os
from collections import defaultdict
from itertools import islice
from typing import DefaultDict, Dict, Tuple
from tensorbay.dataset import Data, ... |
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load("@bazel_tools//tools/cpp:lib_cc_configure.bzl", "get_cpu_value")
load("@rules_sh//sh:posix.bzl", "posix")
def _create_build_content(rule_name, is_windows, tools, required_tools,... |
import copy
import numpy as np
import pytest
import rasterio
from datetime import timedelta
from fastapi.testclient import TestClient
from httpx import AsyncClient
from ...exceptions import SelectedAreaPolygonIsTooLarge, TimeseriesTimeoutError
from ...main import app
from ...routers import datasets as ds
from ...rout... |
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software... |
"""
Check if 2 Words are Anagrams.
@Author: <NAME>
@Date: 1/18/2021
@Updated: N/A
------------------
Note:
Resources:
* Check if two unordered lists are equal:
https://stackoverflow.com/questions/9623114/check-if-two-unordered-lists-are-equal
* How to efficient... |
from flask import jsonify, request, session
import io, sys, boto3
from uuid import uuid4
from PIL import Image
from . import api, ErrorData, Collage, CollageDepartment, User, db, cache
s3 = boto3.client('s3')
@api.route('/profile', methods=["GET"])
def get_profile():
# 查看是否登入
if "user" in session:
user... |
# -*- coding: utf-8 -*-
import base64
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.addons.base.models.res_bank import sanitize_account_number
import logging
_logger = logging.getLogger(__name__)
class AccountBankStatementLine(models.Model):
_inherit = "account.bank.st... |
import numpy as np
import pandas as pd
from statsmodels.tools.grouputils import Grouping
from statsmodels.tools.tools import categorical
from statsmodels.datasets import grunfeld, anes96
from pandas.util import testing as ptesting
class CheckGrouping(object):
def test_reindex(self):
# smoke test
... |
import unittest
import numpy as np
import itertools
import paddle.v2.framework.core as core
from paddle.v2.framework.op import Operator
def grad_var_name(var_name):
return var_name + "@GRAD"
def create_op(scope, op_type, inputs, outputs, attrs):
kwargs = dict()
for in_name, in_dup in Operator.get_op_in... |
from datetime import datetime
import pytest
from apscheduler.jobstores.memory import MemoryJobStore
from apscheduler.jobstores.base import JobLookupError, ConflictingIdError
def dummy_job():
pass
def dummy_job2():
pass
def dummy_job3():
pass
@pytest.yield_fixture
def memjobstore():
yield Memor... |
from Tkinter import * #case sensitive
import pdb, traceback, sys
import operator
import numpy
from simrank_fns import *
import os
import pickle
import search_by_ht_fns as hasht
from new_graph import *
#takes ~8 sec to start up, dep on initial graph size
def main():
#load G, scores and id labels
root =... |
# ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
from __future__ import absolute_import, unicode_literals
import logging
import sys
import traceback
from django import template
from django.conf import ... |
import os
import argparse
import logging
import ujson as json
import pickle as pkl
import tensorflow as tf
from preprocess.tf_preprocess import run_prepare
from models.SelfAttentiveSentenceEmbedding import SelfAttentive
from utils.tf_util import get_record_parser, evaluate_batch, get_batch_dataset, get_dataset, print_m... |
import yaml
import subprocess
import binascii
import os
from ckan_cloud_operator import kubectl
from ckan_cloud_operator import logs
from ckan_cloud_operator.labels import manager as labels_manager
from .constants import OPERATOR_NAMESPACE, OPERATOR_CONFIGMAP
def get_operator_version(verify=False):
installed_im... |
# pylint: disable=line-too-long
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import importlib
import json
import sys
import traceback
import markdown
import six
from deepdiff import DeepDiff
from django.conf import settings
from django.db import models
from django.urls import reve... |
"""distutils.dir_util
Utility functions for manipulating directories and directory trees."""
import os
import errno
from distutils.errors import DistutilsFileError, DistutilsInternalError
from distutils import log
# cache for by mkpath() -- in addition to cheapening redundant calls,
# eliminates redundant "creating ... |
from __future__ import print_function # (at top of module)
from .vsatype import *
from .bsc import *
from .tern import *
from .ternzero import *
from .hrr import *
import math
from scipy import special as scm
def get_hd_threshold(num_vecs):
"""
:param num_vecs: This is the number of vectors to be added via ... |
from __future__ import division
import copy
import json
import logging
import math
import os
import uuid
from builtins import next
from builtins import str
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.exceptions import ValidationError
from django.core.files.s... |
import os
import pytest
from funcy import first, get_in
from dvc import api
from dvc.exceptions import FileMissingError, OutputNotFoundError
from dvc.testing.test_api import TestAPI as _TestAPI
from dvc.utils.fs import remove
from tests.unit.fs.test_repo import make_subrepo
clouds = [
"s3",
"gs",
"azure"... |
from numpy.testing import (assert_, assert_allclose,
assert_raises, assert_equal)
import numpy as np
from scipy.optimize._lsq.common import (
step_size_to_bound, find_active_constraints, make_strictly_feasible,
CL_scaling_vector, intersect_trust_region, build_quadratic_1d,
minimi... |
# from __future__ import absolute_import
# from __future__ import division
# from __future__ import print_function
import time
import logging
import os.path
from os.path import join as pjoin
import numpy as np
from keras import regularizers
from keras.models import Model
from keras.layers import Dropout, Embedding
fr... |
def frombin(x):
vv = 0
for b in x:
vv = vv * 2 + int(b)
return vv
def lmk_output(v):
vv = frombin(v)
# print "# %8.8x"%vv
print("0 101")
print(("0 %3.3x" % (vv >> 24)))
print(("0 %3.3x" % ((vv >> 16) & 0xff)))
print(("0 %3.3x" % ((vv >> 8) & 0xff)))
print(("0 %3.3x" % (... |
import numpy as np
import tensorflow as tf # pylint: ignore-module
import copy
import os
import functools
import collections
import multiprocessing
def switch(condition, then_expression, else_expression):
"""Switches between two operations depending on a scalar value (int or bool).
Note that both `then_expres... |
from collections import OrderedDict
import cv2
import logging
import numpy as np
import gym
from typing import Any, List
from ray.rllib.utils.annotations import override, PublicAPI
from ray.rllib.utils.spaces.repeated import Repeated
from ray.rllib.utils.typing import TensorType
ATARI_OBS_SHAPE = (210, 160, 3)
ATARI_... |
# Copyright 2020 The TensorFlow Quantum 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... |
# 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 (t... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import tensorflow as tf
# from tensorflow.contrib import slim
import tf_slim as slim
from nets import vgg
from utils.rpn_msr.anchor_target_layer import anchor_target_layer as anchor_target_layer_py
def mean_image_subtraction(images, means=[123.68, 116.78, 103.94]):
num_channels = images.get_shape().as_list()[-1]... |
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# tcpaccept Trace TCP accept()s.
# For Linux, uses BCC, eBPF. Embedded C.
#
# USAGE: tcpaccept [-h] [-T] [-t] [-p PID] [-P PORTS]
#
# This uses dynamic tracing of the kernel inet_csk_accept() socket function
# (from tcp_prot.accept), and will ne... |
# Module for handling git repositories. The functions in this modules are meant to be copied over in order to extend
# support to other version control programs, e.g., svn
import html
import os
import subprocess
import time
import abc
from datetime import datetime
from urllib.parse import urlparse
import dateutil.pars... |
import argparse
import json
import logging
import os
import time
from typing import Dict, List, Tuple, Union
import grpc
import mlflow
import numpy as np
from PIL import Image
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.metrics import accuracy_score
from src.proto import onnx_ml_pb2, predict_... |
# Copyright (c) 2018 PaddlePaddle 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 app... |
# Copyright (c) 2020, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... |
from upydev.wsio import wstool, WebSocketFileIO
from upydev.serialio import serialtool, SerialFileIO
from upydev.bleio import bletool, BleFileIO
from upydev.rsyncio import synctool
from upydev.dsyncio import d_sync_recursive, check_wdlog, dev2host_sync_recursive
from upydev.helpinfo import see_help
from upydevice impo... |
from __future__ import absolute_import, division, print_function
from PySide2.QtCore import Qt, QAbstractItemModel, QModelIndex
import libtbx.phil
# =============================================================================
def check_phil(phil, scope=True, definition=True, raise_error=True):
"""
Convenience f... |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import os, sys
import pprint
from shutil import copy2
import xml.etree.ElementTree as ET
TAG_PREFIX='{http://www.cern.ch/cms/DDL}'
CMSSW_NOT_SET=1
TRACKER_MATERIAL_FILE_MISSING=2
HEADER = """
#ifndef SIMTRACKER_TRACKERMATERIALANALYSIS_LISTGR... |
# @Author : FederalLab
# @Date : 2021-09-26 00:33:24
# @Last Modified by : <NAME>
# @Last Modified time: 2021-09-26 00:33:24
# Copyright (c) FederalLab. All rights reserved.
"""Preprocesses the Shakespeare dataset for federated training.
Copyright 2017 Google Inc.
Licensed under the Apache Lic... |
import numpy as np
from sklearn.preprocessing import StandardScaler
# from matplotlib import pyplot as plt
from .trend_filters import HPTrendFilter_trend
from .wavelet_fun import robust_MODWT_var
from .periodogram_acf_fun import general_periodogram, acf_med_from_periodogram
from .fisher_siegel_test import fisher_test
f... |
#!/usr/bin/env python
from sys import exit
import argparse
import time
try:
import paho.mqtt.client as mqtt
except ImportError:
raise ImportError("This example requires the paho-mqtt module\nInstall with: sudo pip install paho-mqtt")
import blinkt
MQTT_SERVER = "localhost"
MQTT_PORT = 1883
MQTT_TOPIC = "pi... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import unittest
"""
# _-----=> irqs-off
# / _----=> need-resched
# | / _---... |
# Tweepy
# Copyright 2009-2010 <NAME>
# See LICENSE for details.
from __future__ import print_function
import time
import datetime
import hashlib
import threading
import os
import logging
try:
import cPickle as pickle
except ImportError:
import pickle
try:
import fcntl
except ImportError:
# Probably... |
import json
import logging
import os
from collections import Counter
from typing import Any, Dict, List, Tuple
import posthoganalytics
from django.db import connection
from psycopg2 import sql
from posthog.models import Event, Organization, Person, Team, User
from posthog.models.dashboard import Dashboard
from postho... |
# -*- coding: utf-8 -*-
'''
Manages configuration files via augeas
This module requires the ``augeas`` Python module.
.. _Augeas: http://augeas.net/
.. warning::
Minimal installations of Debian and Ubuntu have been seen to have packaging
bugs with python-augeas, causing the augeas module to fail to import. ... |
'''
Copyright 2013 <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 or agreed to in writing, software
distribu... |
# <NAME> (Tunstill) Copyright (c) 2020
# Email: <EMAIL>
# Provides type coercion and BSON/JSON/Python dict sanitation methods for any class in a nested dict structure.
from __future__ import absolute_import, division, print_function
import bson
import genpy
import rospy
import roslib.message
try:
from collect... |
import json
from filecmp import cmp
from pathlib import Path
import pytest
from bookmarks_converter import BookmarksConverter
from bookmarks_converter.core import JSONMixin
from bookmarks_converter.models import Folder, JSONBookmark
from pytest_mock import class_mocker as mocker
class Test_DBMixin:
def test_pars... |
from django.test import TestCase
# Create your tests here.
from .models import Game, Move
from .serializers import GameSerializer, MoveSerializer, IntegrityError
from .game_logic.game_state import initial_state
from .game_logic import config
from .game_logic.location_state import player
from django.db.models import Mo... |
"""Implementation of the 'follow_joint_trajectory' ROS action."""
import actionlib
import actionlib_msgs
import copy
import math
import rospy
from control_msgs.msg import FollowJointTrajectoryAction
from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint
def trajectory_is_finite(trajectory):
"""Ch... |
import numpy as np
from sklearn import manifold
import torch
# import visual.visdom
import visual.plt
import utils
####--------------------------------------------------------------------------------------------------------------####
####-----------------------------####
####----CLASSIFIER EVALUATION----####
####---... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.