text stringlengths 3.07k 22.1k |
|---|
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "4"
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow_privacy.privacy.analysis import compute_dp_sgd_privacy
from spektral.data.loaders import SingleLoader
from spektral.datasets.citation import Ci... |
# Copyright 2020 <NAME>
# This file is licensed under the MIT license (see LICENSE.txt).
from typing import List, Optional
import os
import subprocess
from asvtorch.src.misc.fileutils import ensure_exists
from asvtorch.src.settings.settings import Settings
import asvtorch.src.misc.fileutils as fileutils
def prepare... |
#!/usr/bin/env python3
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... |
#!/usr/bin/env python3
# This file is part of dbxfs.
# dbxfs 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.
# dbxfs is distributed ... |
"""
Analytic optical element classes to introduce a specified wavefront
error in an OpticalSystem
* ZernikeWFE
* ParameterizedWFE (for use with hexike or zernike basis functions)
* SineWaveWFE
* TODO: MultiSineWaveWFE ?
* TODO: PowerSpectrumWFE
* TODO: KolmogorovWFE
"""
import collections
from functools import... |
import time
from sys import argv
import random
from cn.xuexi.pdlearn import version
from cn.xuexi.pdlearn import user
from cn.xuexi.pdlearn import dingding
from cn.xuexi.pdlearn import mydriver
from cn.xuexi.pdlearn import score
from cn.xuexi.pdlearn import threads
from cn.xuexi.pdlearn import get_links
# 获取用户标签
def ... |
"""Snap, SubSnap, Sinks classes for snapshot files.
The Snap class contains all information related to a smoothed particle
hydrodynamics simulation snapshot file. The SubSnap class is for
accessing a subset of particles in a Snap.
"""
from __future__ import annotations
from typing import Callable, Dict, List, Option... |
# Copyright 2015 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 a... |
#!/usr/bin/env python
# Filename: remove_falsePositives
"""
introduction:
authors: <NAME>
email:<EMAIL>
add time: 11 October, 2019
"""
import os,sys
from optparse import OptionParser
code_dir = os.path.join(os.path.dirname(sys.argv[0]), '..')
sys.path.insert(0, code_dir)
import parameters
import basic_src.io_func... |
"""WMT20 neural machine translation metrics dataset."""
import os
import csv
import pickle
import datalabs
logger = datalabs.logging.get_logger(__name__)
_DL_URLS = {
"DArr_seglevel": "https://raw.githubusercontent.com/WMT-Metrics-task/wmt20-metrics/main/manual-evaluation/DArr-seglevel.csv",
"txt": "https://d... |
"""A lib for decorator and metaclass"""
import re
import inspect
import types
from typing import Optional, Iterable, Any
from functools import wraps
class DocStringInheritor(type):
"""
A meta class. It make the class:
* Docstring can inherit the parent classes.
* {STRING_DOCS} in docs will be replaced by self.STR... |
# -*- coding: utf-8 -*-
# Copyright 2019 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
'''Generate or check expectations by simulation.'''
# TODO(iannucci): Add a real docstring.
from __future__ import print... |
from dist_zero import errors
from .common import INDENT, escape_c_string
from . import lvalue
from .type import CType
class CExpression(object):
'''A C expression'''
def add_includes(self, program):
raise NotImplementedError()
def to_c_string(self, root=False):
raise NotImplementedError()
def toLV... |
import math
import os
import pathlib
import re
import shutil
import subprocess
import sys
from typing import Dict, List, Optional
from . import aws
from . import log
from . import utility
DOCKER_URI_HUB = 'docker.io/scwatts/woof-nf:0.2.5'
PROCESS_LINE_RE = re.compile(r'^\[[ -/0-9a-z]+\] process > (\S+).+?$')
STAGI... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import sys
from random import shuffle
import time
import numpy as np
import tensorflow as tf
tf.enable_eager_execution()
tfe = tf.contrib.eager
class LogReg(tf.keras.layers.Layer):
... |
# -*- coding: utf-8 -*-
"""Tests for forms and WTForms extensions."""
# noqa: D103
import itertools
from unittest.mock import MagicMock
import pytest
from wtforms import Form, StringField
from orcid_hub.forms import validate_orcid_id_field # noqa: E128
from orcid_hub.forms import BitmapMultipleValueField, CountrySe... |
from __future__ import division
import numpy as np
import math
import os
import tensorflow as tf
from tensorflow.contrib.tensorboard.plugins import projector
from App import App
class Embedding:
def __init__(self, name, input, ouput, dropout, projector, nb_embeddings, checkpoint_dir):
self.input = input
... |
# -*- coding: utf-8 -*-
"""Test losses"""
import datetime
import numpy as np
import pandas as pd
from pandas.util.testing import assert_series_equal
from pvlib.soiling import hsu, kimber
from pvlib.iotools import read_tmy3
from conftest import (
requires_scipy, needs_pandas_0_22, DATA_DIR)
import pytest
@pytest.... |
# coding=utf-8
"""
drf_client SDK: Resource
The abstract class for Resources in the drf_client System.
All Resources (e.g., projects, assets, users) subclass from this.
"""
import importlib
import pprint
from collections import OrderedDict
from datetime import datetime, timedelta
from weakref import WeakKeyDictionar... |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
import ast
from numba import templating
from numba import error, pipeline, nodes, ufunc_builder
from numba.minivect import specializers, miniast, miniutils
from numba import utils, functions
from numba import typesystem
from numba... |
"""
Defines the SaytexSyntax class, containing methods for converting between SayTeX and LaTeX.
"""
from . import syntax_dictionary
from . import config
class SaytexSyntaxError(Exception):
"""
Raised in to_latex, if error.
"""
pass
class MultipleSaytexInterpretations(Exception):
"""
Raised i... |
#!/usr/bin/env python
import os
import sys
import numpy as np
import pickle
import datetime as dt
from SEIRcity.scenario import BaseScenario as Scenario
from SEIRcity.get_scenarios import get_scenarios
from .simulate_one import simulate_one
from SEIRcity import param_parser
from SEIRcity import param as param_module
f... |
# import argparse
# import os, time
# import numpy as np
# from tqdm import tqdm
# from mypath import Path
# from dataloaders import make_data_loader
# from dataloaders import make_test_data_loader
# from modeling.sync_batchnorm.replicate import patch_replication_callback
# from modeling.deeplab import *
# from utils.... |
import json
import logging
import os
import tempfile
from difflib import SequenceMatcher
import mock
import pytest
import responses
from click.testing import CliRunner
from dagster.cli.pipeline import pipeline_execute_command
from dagster.cli.workspace.context import WorkspaceProcessContext
from dagster.cli.workspace.... |
# Copyright (c) 2020 <NAME>
# This code is licensed under MIT license
# (https://github.com/kwotsin/mimicry/blob/master/LICENSE)
# ------------------------------------------------------------------------------
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2020 Megv... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
"""分割检的封装
"""
from functools import wraps
import numpy as np
def nms_test(bounding_boxes, confidence_score, threshold):
picked_boxes = []
picked_score = []
picked_index = []
if len(bounding_boxes) == 0:
return picked_boxes, picked_score, picked_... |
''' Base Extractor class and associated functionality. '''
from abc import ABCMeta, abstractmethod
import json
import pandas as pd
import numpy as np
from pandas.api.types import is_numeric_dtype
from pliers.transformers import Transformer
from pliers.utils import isgenerator, flatten
class Extractor(Transformer, ... |
import os, cv2, glob
import numpy as np
from PIL import Image
import torch
import torch.utils.data as data
from torchvision import datasets, models, transforms
from settings import *
from utils import get_train_split, ImgAug, from_pil, to_pil, read_masks, get_test_meta, get_nfold_split
import augmentation as aug
impo... |
# Copyright 2018 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 a... |
import h5py
import importlib
import os
import pickle
import numpy as np
from openravepy import Environment
from core.internal_repr.action import Action
from core.internal_repr.parameter import Object, Symbol
from core.internal_repr.plan import Plan
from core.util_classes.robots import Baxter, PR2, Washer
class PlanSe... |
import numpy as np
import pandas as pd
from pprint import pprint
import subprocess
import matplotlib.pyplot as plt
import inspect
import os
import json
import dill
import clify
from dps.utils import Config, process_path, confidence_interval, standard_error
from dps.parallel.command_line import SubCommand, parallel_cl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
(c) 2014 <NAME> || http://faircloth-lab.org/
All rights reserved.
This code is distributed under a 3-clause BSD license. Please see
LICENSE.txt for more information.
Created on 31 January 2014 12:36 PST (-0800)
"""
import os
import glob
import hashlib
# import pdb... |
"""Convert pure-Python wheels to conda packages"""
import argparse
import base64
import configparser
import csv
from enum import Enum
import hashlib
from io import BytesIO, StringIO
import json
import os
from pathlib import Path
import posixpath
import tarfile
import win_cli_launchers
from .requirements import requi... |
try:
from imp import reload
except ImportError:
from importlib import reload
import random
import string
import sys
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.urls import clear_url_caches
from django.test import ove... |
#!/usr/bin/env python
#
# Common corpus functions
import logging
import struct
log = logging.getLogger(__name__)
class BaseType(object):
TYPE_URL = 1
TYPE_RSP0 = 2
TYPE_USERNAME = 3
TYPE_PASSWORD = 4
TYPE_POSTFIELDS = 5
TYPE_HEADER = 6
TYPE_COOKIE = 7
TYPE_UPLOAD1 = 8
TYPE_RANGE = ... |
import os
import csv
import pandas as pd
import re
import ccxt
import time
from core import N_RETRY, DDOS_COOLDOWN
from enum import Enum
# from decimal import *
# getcontext().prec = 8
from ccxt.base.errors import ExchangeNotAvailable, ExchangeError, RequestTimeout, DDoSProtection
class TickerFields(Enum):
Hig... |
import logging
from django.contrib.auth.models import AbstractUser, Group
from django.db import models
from django.db.models import CharField
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django_countries.fields import CountryField
from localflavor.us.models import USStat... |
from __future__ import print_function
from __future__ import absolute_import
from . import _, config
# GUI (Screens)
from Screens.MessageBox import MessageBox
#from Tools.Notifications import AddPopup
# Plugin
from Components.PluginComponent import plugins
from Plugins.Plugin import PluginDescriptor
from boxbranding ... |
# coding = utf-8
# -!- coding: utf-8 -!-
#! python = 3.6
import bs4,re,requests
import urllib,time
from my_thread import MyThread
import traceback
question = "牛奶保质期多久"
# 根据用户问句从百度知道页面爬取相关问题搜索结果(question_list_html)返回 句子-链接 字典的列表
def get_sim_questions(html_text):
similar_questions = []
soup = bs4.BeautifulSoup(html... |
"""
This module contains the interface for graphlab server, and the
implementation of a local graphlab server.
"""
'''
Copyright (C) 2015 Dato, 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 ..cython.cy_ipc import... |
# -*- coding: utf8 -*-
import datetime
import json
import re
from dataclasses import dataclass
MAKSIMALEN_ROK = 10 * 365
MAKSIMALNA_MASA = 9999
def preveri_cas_uporabe(cas_uporabe):
if(isinstance(cas_uporabe, int)):
if(cas_uporabe > 0 and cas_uporabe <= MAKSIMALEN_ROK):
return True
el... |
import inspect
import warnings
from functools import partial
from typing import Callable, Union
import logging
from logging import handlers as logging_handlers
from .color_provider import ColorFormatter
from .utils import ensure_dir, get_logger_config, get_color_config
from .exceptions import InvalidOption, Duplicat... |
# -*- coding: utf-8 -*-
"""
Módulo: Juego
Diseño: Eliana
Código: M.Alejandra y Eliana
---
Este módulo contiene la importacion del framework, la libreria de colores y el módulo random de python.
La clase Barra_tiempo nos permite tener el actor Temporizador con todos sus atributos modificados, si ... |
#!/usr/bin/python
from __future__ import division
import copy
import random
# Used in modified BokehJS
ID_MAP = {
'title': 'the_title',
'x_axis': 'the_xaxis',
'y_axis': 'the_yaxis',
'x_gridlines': 'the_x_gridlines',
'y_gridlines': 'the_y_gridlines',
'legend': 'the_legend',
'figure_info': ... |
from __future__ import print_function
from epinet_fun.corner_func_generate_traindata import generate_traindata_for_train
from epinet_fun.corner_func_generate_traindata import data_augmentation_for_train
from epinet_fun.corner_func_generate_traindata import generate_traindata512
from epinet_fun.func_cepinetmodel imp... |
"""
This is code for doing cast extractions.
Test on mac in ipython:
run extract_casts.py -gtx cas6_v3_lo8b -ro 2 -test True
run extract_casts.py -gtx cas6_v3_lo8b -ro 2 -test True -cruises newport_line
Run for real on perigee (after transferring the required sta_df.p)
python extract_casts.py -gtx cas6_v3_lo8b -ro 2 ... |
import os
import cv2 as cv
from libtiff import TIFF
from optparse import OptionParser
def createApo(wholebraintxt,saveapo,multiple):
path = wholebraintxt
file = open(path)
lines = file.readlines();
for i in range(len(lines)):
lines[i] = lines[i].strip('\n');
lines[i] = lines[i].split(',... |
# coding=utf-8
"""Given a start frame, visualize the pixel trajectory and world."""
import argparse
import os
import cv2
import math
import numpy as np
from combine_traj import get_world_coordinates
parser = argparse.ArgumentParser()
parser.add_argument("video_frame_path")
parser.add_argument("start_frame_idx", type... |
""" support code for talking to the oldschool bil2 /
getting lanes into gbrowse"""
import pickle
from pathlib import Path
import pypipegraph as ppg
import os
def activate(groups_allowed_to_access, modules):
if isinstance(groups_allowed_to_access, str):
groups_allowed_to_access = [groups_allowed_to_access... |
from typing import List, Dict, Iterable, Tuple
import sqlite3
from collections import defaultdict, OrderedDict, Counter
from functional import seq
from qanta import logging
from qanta.datasets.abstract import AbstractDataset, TrainingData, QuestionText, Answer
from qanta.util.environment import QB_QUESTION_DB
from qa... |
from mongoengine import *
from datetime import datetime, timedelta
from collections import defaultdict
import random
import bson
import uuid
'''
WGs are top level elements, they contain a set of ExpensesLists,
each ExpensesList contains a list of expensePosts.
'''
#connect(host='mongodb://mongo:27017/depts3')
d... |
import tempfile
import json
import pvl
import pyproj
import csmapi
from knoten import csm
from numbers import Number
import numpy as np
import pandas as pd
from pysis import isis
from pysis.exceptions import ProcessError
import holoviews as hv
from holoviews import opts, dim
from bokeh.models import HoverTool
d... |
import numpy as np
import matplotlib.pyplot as plt
from svmutil import *
from argparse import ArgumentParser
from sklearn.metrics import confusion_matrix
TRAIN_PERCENTAGE = 0.7
def plot_confusion_matrix(y_true, y_pred, classes, title,
cmap=plt.cm.Blues):
cm = confusion_matrix(y_true, y... |
"""
Constants used by hahomematic.
"""
from __future__ import annotations
from datetime import datetime
from enum import Enum
DEFAULT_ENCODING = "UTF-8"
HA_DOMAIN = "hahm"
MANUFACTURER = "eQ-3"
INIT_DATETIME = datetime.strptime("01.01.1970 00:00:00", "%d.%m.%Y %H:%M:%S")
LOCALHOST = "localhost"
IP_LOCALHOST_V4 = "127... |
"""Base class for selection pipelines."""
from copy import copy, deepcopy
from typing import Optional, List, Sequence, Any, Tuple, Union
from pandas import Series
from lightautoml.validation.base import TrainValidIterator
from ..features.base import FeaturesPipeline
from ..utils import map_pipeline_names
from ...dat... |
"""Support for Z-Wave fans."""
from __future__ import annotations
import math
from typing import Any, cast
from zwave_js_server.client import Client as ZwaveClient
from zwave_js_server.const import TARGET_VALUE_PROPERTY, CommandClass
from zwave_js_server.const.command_class.thermostat import (
THERMOSTAT_FAN_OFF_... |
import asyncio
import datetime
import logging
import time
import dataset
import discord
from discord.embeds import Embed
from discord.ext import commands
from discord.ext.commands import Cog, Bot
from discord_slash import cog_ext, SlashContext
from discord_slash.model import SlashCommandPermissionType
from discord_sla... |
from pypy.interpreter import gateway
from pypy.objspace.std.stdtypedef import *
from pypy.objspace.std.register_all import register_all
from pypy.objspace.std.basestringtype import basestring_typedef
from pypy.interpreter.error import OperationError
from sys import maxint
def wrapunicode(space, uni):
from pypy.ob... |
__version_info__ = (1,1,1)
__version__ = '1.1.1'
import requests
import json
import urllib
import httplib
from collections import defaultdict
api_uri = 'http://api.discogs.com'
user_agent = None
class DiscogsAPIError(Exception):
"""Root Exception class for Discogs API errors."""
pass
class UserAgentError(D... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
from numpy.fft import ifft
"""
Example of a closure-function. See also partial from ...
def force(A, f, ndof, fdof):
# Closure function. See also functools.partial
# fext = self.force(dt, tf=T)
def wrapped_func(dt, t0=0, tf=1):
ns =... |
import json
import ijson
from requests.structures import CaseInsensitiveDict
from entityservice.database import *
from entityservice.encoding_storage import stream_json_clksnblocks, convert_encodings_from_base64_to_binary, \
store_encodings_in_db, upload_clk_data_binary, include_encoding_id_in_binary_stream, \
... |
"""
The :mod:`hotspots.utilities` module contains classes to for
general functionality.
The main classes of the :mod:`hotspots.extraction` module are:
- :class:`hotspots.hs_utilities.Helper`
- :class:`hotspots.hs_utilities.Figures`
"""
from __future__ import division
import collections
import mat... |
# -*- coding: utf-8 -*-
# @Time : 2020/3/23 下午3:24
# @Author : RegiusQuant <<EMAIL>>
# @Project : nlp-practice
# @File : models.py
# @Desc : 情感分析模型
from core import *
from data import SSTCorpus
class SimpleSelfAttentionModel(nn.Module):
def __init__(self, n_words, n_embed, p_drop, pad_idx, res_conn=Fa... |
"""
Copyright 2017-2018 Fizyr (https://fizyr.com)
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 w... |
import torch
from torch import nn
import torch.nn.functional as F
import math
def conv_block(inp,out, ks=3, stride=1, padding=0, activation='relu', bias=True):
""" ConvNet building block with different activations and normalizations support."""
assert activation=='relu' or activation==None
return nn.Sequ... |
from argparse import ArgumentParser
from typing import List, Any
import json
import os
from os.path import join as pjoin
import cv2
import nibabel as nib
import numpy as np
from pytorch_lightning.core.lightning import LightningModule
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning import... |
import logging
import peewee
from typing import List, Tuple, Iterable, Union
from playhouse.postgres_ext import ArrayField, SQL
from slim.support.peewee.data_record import PeeweeDataRecord
from slim.utils import sentinel
from ...base.sqlquery import SQL_OP, SQLQueryOrder, SQLQueryInfo, DataRecord, SQLValuesToWrite
fr... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
import tensorflow.contrib.slim as slim
import tensorflow_probability as tfp
from tensorflow.python.training import session_run_hook
tfd = tfp.distributions
__all__ = [... |
import hmac
import hashlib
import json
import base64
import time
import sys
HEADER_MODEL = {
'alg': 'HMAC-SHA256',
'typ': 'JWT'
}
PAYLOAD_MODEL = {
'sub': 'User_XXX',
'exp': '1234567890'
}
# from smalltrain.utils.gg_setting import GGSetting
from smalltrain.utils.gg_setting import GGSetting
def get_... |
from gitfiti import find_max_daily_commits, parse_contributions_calendar
# Test
CONTRIBUTIONS_CALENDAR_SVG = '''\
<svg width="721" height="110" class="js-calendar-graph-svg">
<g transform="translate(20, 20)">
<g transform="translate(624, 0)">
<rect class="day" width="11" height="11" y="0" fill="#eeee... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
from __future__ import print_function
import tensorflow as tf
import matplotlib
matplotlib.use('Agg')
import tempfile
import argparse
import gzip
import json
import os
import pickle
import matplotlib.pyplot as plt
import numpy as np
SAVE_PATH = 'C:/Users/Srdjan/Desktop/Laboratory AIS/!dl-lab-2018-master/exercise2'
... |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import multiprocessing as mp
import sys
from argparse import Namespace
from typing import Any, List
from extra_scripts.create_l... |
# coding=utf-8
# Copyright 2018 The Google AI Language 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 ... |
"""Async EMQx LwM2M Backend"""
# Built-in
import asyncio
import collections
import json
import logging
import re
import weakref
# PyPI
from asyncio_mqtt import Client
from subpub import AsyncSubPub
from . import emqx
# Package
from emqxlwm2m import lwm2m
class EMQxQueue(asyncio.Queue):
async def get(self, time... |
import csv
import sys
import os.path
import http.client
from PyQt5 import uic, QtWidgets
from PyQt5.QtCore import QTimer
from PyQt5.QtGui import QPixmap
import requests
from controller import PS4Controller
running_screen = "running_screen.ui"
Ui_Running_screen, QtBaseClass = uic.loadUiType(running_screen)
HOST = '1... |
import pandas as pd
import numpy as np
import plotly.graph_objects as go
import datetime
from dateutil.relativedelta import *
import copy
import streamlit as st
st.markdown("""
# Betting against beta
**AIM:** To make case for a defensive (also called betting-against-beta at times) stock strategy.
**INSTRUCTION:**
... |
import numpy as np
from scipy.integrate import solve_ivp
import sys
# Later on, create ABCs to wrap AFM model and force models.
class ForcedHarmonicOscillator():
"""
A class to model the AFM QTF/cantilever - sample system as a forced harmonic oscillator subject to a sinusodial driving force and a given tip-sa... |
"""Blender operators and menus for use with Avalon."""
import os
import sys
import platform
import time
import traceback
import collections
from pathlib import Path
from types import ModuleType
from typing import Dict, List, Optional, Union
from Qt import QtWidgets, QtCore
import bpy
import bpy.utils.previews
impor... |
import random
import keyword
import decimal
import string
import time
rc = random.choice
rd = random.randint
class Games:
"""
This class holds all the games you can play.
"""
def __init__(self):
self.games = [getattr(self, function)
for function in filter(lambda x: not (x... |
import os, sys
import unittest
import vtk, qt, ctk, slicer
import numpy as np, math, time
import json
import imp
import shutil
import textwrap
import importlib.util
import inspect
from pathlib import Path
from distutils.util import strtobool
from inspect import signature
import traceback
import logging
... |
#!/usr/bin/env python
import argparse
import json
import os
import sys
import time
from typing import List
from PIL import Image
from loguru import logger
from mmdet.apis import inference_detector, init_detector
from pdf2image import convert_from_path
from database.db import Connection
from docrecjson.commontypes imp... |
#Adera is a question-answer drug repurposing software. Its main workflow includes
#taking the two search inputs. The first is the pathways or diseases needed to repurpose from.
#the other one is the pathway or disease that needed to be repurposed to.
#The software then downloads the PUBMED ID INDEX for the first quer... |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 <NAME> <<EMAIL>>
# Copyright 2007 <NAME> <<EMAIL>>
#
# This file is part of duplicity.
#
# Duplicity 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 Softw... |
# coding=utf-8
from __future__ import unicode_literals
from datetime import date
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.db.models import Sum, Q
from django.contrib.auth.models import User
from django.conf import settings
from core.models import Subscription, C... |
import pytest
import os
from core import Synapse
import synapseclient
def dispose_syn_project_from_body(body, syn_test_helper):
if body is None:
return
project_id = body.get('data', {}).get('createSynProject', {}).get('synProject', {}).get('id', None)
if project_id:
syn_project = Synapse.... |
import datetime
from django.shortcuts import render, redirect, get_object_or_404
from django.conf import settings
from django.views import View
from django.urls import reverse_lazy
from django.http import JsonResponse, QueryDict
from django.contrib import messages
from django.views.generic import DeleteView
from djang... |
import pytest
import warnings
import numpy as np
from copy import deepcopy
from sequentia.classifiers import HMM, HMMClassifier
from ....support import assert_equal, assert_not_equal
# Set seed for reproducible randomness
seed = 0
np.random.seed(seed)
rng = np.random.RandomState(seed)
# Set of possible labels
labels ... |
'''
This module exports one function, makenetlist, which returns a netlist
representation, when given a list of partial nets from the graphic submodule.
Internally, the NetInfo class is used to group all the functions of generating
the netlist together. It uses makenetgroups.makegroups to do the initial
grouping of ... |
import sys
import random
from os.path import expanduser, basename
import argparse
from configparser import ConfigParser
from ldap3.core.exceptions import LDAPInsufficientAccessRightsResult
from .utils import (n2sn_list_group_users_as_table,
n2sn_list_user_search_as_table)
from .ldap import ADObject... |
# Copyright (C) 2015 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2015 Stratosphere 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/L... |
#!/usr/bin/env python3
"""
Stanley Control
Author: SheffieldWang
"""
#import basic
import math
import numpy as np
import scipy.linalg as la
import bisect
#import ROS
import rospy
from nav_msgs.msg import Path
from geometry_msgs.msg import PoseStamped
from control.msg import Command
import sys
k = 0.5# control gai... |
import base64
from datetime import datetime
import io
import dash
from dash.dependencies import Input, Output, State
import dash_bootstrap_components as dbc
from dash import dcc
from dash import html
import pandas as pd
import pathlib
from main import app
import random
#import joblib
#import torch
#import config
#impor... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
from __future__ import division, print_function, unicode_literals
import argparse
import sys
import re
from collections import defaultdict
import logging
SENT_BOUNDARY = "-X-" # sentence boundary
def to_conll_format(y_tr... |
import asyncio
import sys
import warnings
from argparse import ArgumentParser
from importlib import import_module
from . import hdrs, web_exceptions, web_reqrep, web_urldispatcher, web_ws
from .abc import AbstractMatchInfo, AbstractRouter
from .log import web_logger
from .protocol import HttpVersion # noqa
from .serv... |
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Converts repo dependencies in DEPS into Git submodules.
This module was cloned from the similarly named "resource" of the
sync_submodules recipe module, ... |
# Copyright (c) 2018 <NAME>
# Universidad Carlos III de Madrid and University of Sheffield
import random
import numpy as np
import climin
from functools import partial
########################################################################################################################
"""
Util methods for HetMOGP... |
import calendar
import datetime
import json
import os
import urllib.request
from PIL import Image, ImageDraw, ImageFont
from lib.waveshare_epd import epd7in5b_V2 as epd_m
# configs
calendar_start = calendar.SUNDAY
tmp_dir = './tmp'
assets_dir = './assets'
## Fonts, texts
normal_font = '{}/TenorSans-Regular.ttf'.for... |
#!/usr/bin/env python3
# device.py
# Copyright 2019, Shield Diagnostics and the Oatmeal Protocol contributors
# License: Apache 2.0
from typing import Union, Tuple, Dict, List, Type, TypeVar, Optional
import serial.tools.list_ports
from serial import SerialException
import logging
import time
import functools
import ... |
import abc
import math
import os
import random
from PIL import Image, ImageDraw, ImageFilter, ImageFont
from pyavagen.fields import AvatarField
from pyavagen.utils import get_random_hex_color
from pyavagen.validators import (
ColorValidator,
MinValueValidator,
TypeValidator
)
COLOR_LIST_FLAT = [
'#1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.