text stringlengths 3.07k 22.1k |
|---|
"""
This package provides the database models using PonyORM.
Note that we do not rely on the auto increment feature as the previous
SQLAlchemy implementation did not set AUTO INCREMENT on the ID fields,
as PonyORM would.
"""
from flask import url_for
from flux import app, config, utils
import datetime
import hashlib... |
# -*- coding: utf-8 -*- #
# Copyright 2015 Google LLC. 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 requir... |
import time
import datetime
import random
import socket
import regex
import dateutil.parser
import pytz
import lib.nntplib as nntplib
from pynab import log
from pynab.db import db_session, Blacklist
import pynab.util
import pynab.parts
import pynab.yenc
import config
import contextlib
SEGMENT_REGEX = regex.compile('... |
# -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2017 <NAME> <<EMAIL>>
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 ... |
"""
Standalone routines that relate to single dish-interferometer
combination using CASA's feather.
"""
#region Imports and definitions
import os
import numpy as np
import pyfits # CASA has pyfits, not astropy
import glob
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
# Analysis ... |
import os
import shutil # 但即使copy2也不能保证保留所有metadata
import time
from datetime import datetime
import uuid
import pathlib
from send2trash import send2trash
from bs4 import (BeautifulSoup, Comment)
import lxml # 不一定用,但与bs4解析网页时相关模块有联系,作为模块预装的提示吧
import pandas as pd
def getDir(basedir, newdir):
d = os.path.abspath(os... |
# Copyright 2018 <NAME> (<EMAIL>)
# 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 (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# 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 ssl
from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
import json
import os
import requests
import yaml
from ephem import *
from datetime import datetime, timedelta
import datet... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import *
import misc.utils as utils
from .CaptionModel import CaptionModel
class LSTMCore(nn.Module):
def __init__(se... |
import os
import cv2
import numpy as np
from glob import glob
from collections import defaultdict
from copy import deepcopy
from pyecharts.charts import Pie
from pyecharts import options as opts
rows = [i for i in range(1, 9)]
def draw_defect_heatmap(data, static_path):
root = os.path.join(static_path, 'spindle... |
import abc
import time
from collections import OrderedDict
import gtimer as gt
from rlkit.core import eval_util, logger
from rlkit.data_management.replay_buffer import ReplayBuffer
from rlkit.samplers.data_collector import DataCollector, PathCollector
def _get_epoch_timings():
times_itrs = gt.get_times().stamps... |
#!/usr/bin/env python
__author__ = '<NAME> <<EMAIL>>'
import os.path
import re
import clang.cindex as ci
import app
import violations
RULE_NAMING_CONSTANT = 'naming.constant'
RULE_NAMING_STRUCT = 'naming.struct'
RULE_NAMING_UNION = 'naming.union'
RULE_NAMING_CLASS = 'naming.class'
RULE_NAMING_ENUM = 'naming.enum'
... |
import sys
from itertools import islice
from pathlib import Path
from typing import Tuple, Union, Iterable, Dict, Any, List, Optional
import numpy as np
import pandas as pd
import torch
from numpy import ndarray
from pandas import DataFrame, Series
from pyensembl import EnsemblRelease
from scipy.stats import levene, a... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# 全局数据文件模块
import hashlib
import os
import pickle
def _md5_checksum(obj):
md5_gen = hashlib.md5()
md5_gen.update(pickle.dumps(obj))
return md5_gen.hexdigest()
class DataFileIO(object):
# 数据交互接口
@staticmethod
def set_file(s, w):
# 写文件
with op... |
# 画面上部 (「情報」エリア → ヘッダー) → ヘルプ
import os
import re
import sys
import urllib.request
import zipfile
import subprocess
import datetime
import xml.sax.saxutils
import addon_utils
import bpy
import traceback
from . import common
from . import compat
from .translations.pgettext_functions import *
# メニュー等に項目追加
def menu_func... |
import numpy as np
from scipy.spatial import ConvexHull
import matplotlib.pyplot as plt
from scipy.optimize import fmin
from scipy.interpolate import PchipInterpolator
from .ParticleGroupExtension import core_emit_calc
from .nicer_units import *
from .tools import scale_and_get_units
def emittance_vs_fraction(pg, var,... |
"""
"""
import numpy as np
import pandas as pd
import gsw
#import general_tools as tools
import database as db
#import param as param
from numba import jit
import warnings
warnings.filterwarnings("ignore")
def raw_to_zref(d, zref):
temp = d['TEMP']
psal = d['PSAL']
pres = d['PRES']
temp_qc = d['TEMP_... |
import random
from abc import ABC, abstractmethod
from typing import Dict, List, Optional, TYPE_CHECKING
import torch
from numpy import inf
from torch import Tensor, cat
from torch.nn import Module
from torch.utils.data import random_split, DataLoader
from avalanche.benchmarks.utils import AvalancheConcatDataset, \
... |
import os
import sys
import sound
import asyncio
import logging
import discord
from PyQt5.QtSvg import QSvgWidget
from PyQt5.QtGui import QFontDatabase, QFontMetrics, QIcon
from PyQt5.QtCore import Qt, QCoreApplication, QEventLoop, QDir, pyqtSignal
from PyQt5.QtWidgets import (
QMainWindow,
QPushButton,
QWi... |
import os
import numpy as np
import torch
import torch.nn as nn
from apex import amp
from tensorboardX import SummaryWriter
from torch.utils import data
from transformers import AdamW, get_linear_schedule_with_warmup
from dacon.dataset import DaconDataset
from dacon.model import MultiTaskNet
from snippext.dataset imp... |
# -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2019, Battelle Memorial Institute.
#
# 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... |
"""Module to store resource items in files."""
import logging
import mimetypes
from collections.abc import Iterable
from fondat.codec import Binary, String, get_codec
from fondat.error import InternalServerError, NotFoundError
from fondat.http import AsBody
from fondat.pagination import make_page_dataclass
from fonda... |
import json
import struct
from os.path import isfile
from xml.etree import ElementTree
from collections import namedtuple
import requests
from mitmproxy.http import HTTPResponse
from pefile import PE
from pymem import Pymem
from pymem.exception import ProcessNotFound
from mitm.addons.base import *
from setup.config i... |
# 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.
#
# Copyright (c) Facebook, Inc. and its affiliates.
import logging
import sys
import torch
import torch.nn.functional as F
import uuid
from ... |
import mock
import unittest
import zeit.content.article.testing
import zope.lifecycleevent
class ReferenceTest(unittest.TestCase):
@property
def test_class(self):
from zeit.content.article.edit.reference import Reference
return Reference
def get_ref(self):
import lxml.objectify
... |
import enum
import requests
from datetime import date, timedelta, datetime
from bs4 import BeautifulSoup
import urllib.parse
class Defaults(enum.Enum):
"""
Дефолтные значения для параметров и ссылок
"""
dateFrom = date.today().strftime("%d.%m.%Y")
dateTo = (date.today() + timedelta(days=10)).strft... |
import nn
import utils
import torch
from torch.nn import functional as F
from torch.nn import init
import numpy as np
class SampleRNN(torch.nn.Module):
def __init__(self, frame_sizes, n_rnn, dim, learn_h0, q_levels,
weight_norm):
super().__init__()
print("INIT MODEL")
s... |
from pytorch_transformers.tokenization_openai import OpenAIGPTTokenizer
from pytorch_transformers.modeling_openai import (
OpenAIGPTModel,
OpenAIGPTLMHeadModel,
OpenAIGPTDoubleHeadsModel
)
# Dependecies that are not specified in global hubconf.py
specific_dependencies = ['spacy', 'ftfy']
# A lot of models share th... |
import json
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.contrib.gis.geos import fromstr
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from django.shortcuts import get_object_or... |
import logging
from django.conf import settings
from django.contrib.auth.decorators import login_required, permission_required
from django.core.exceptions import PermissionDenied
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.utils.translation import gettext_lazy as _
... |
# vim:ts=4:sw=4:sts=4:et
# -*- coding: utf-8 -*-
"""Utility functions that cannot be categorised anywhere else.
@undocumented: _is_running_in_ipython
"""
from contextlib import contextmanager
from collections import MutableMapping
from itertools import chain
import os
import tempfile
import collections
__all__ = ["... |
# Copyright 2018 The Oppia 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 ... |
#!/usr/bin/env python
"""
Setup file for installing the MiriTE software
:History:
11 May 2017: Major new setup.py script based on ez_setup.py, using
the mirisim setup.py as a template and copying code
from the package defsetup.py scripts.
12 May 2017: MIRI software divided into 4 parts: Mir... |
#!/usr/bin/python2.7
"""
Copyright (c) 2014, ICFLIX Media FZ LLC All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
Desc: Execute % check_multi;, "encrypt" its STDOUT, HTTP POST it to the server
"""
import argparse
import hashlib
import logging
import... |
try:
import json
import telegram
import logging
import socket
import time
from geopy import distance
from geopy import Point
from datetime import datetime
except Exception as e:
f= open("/home/pi/Crons/guru99.txt","w+")
f.write(str(e))
f.close()
exit()
data = None
bottokenfile = open("/home/pi/Crons/bottok... |
# 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 a... |
# Copyright (c) OpenMMLab. All rights reserved.
import math
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import build_conv_layer, build_norm_layer
from mmcv.runner.base_module import BaseModule
from mmcv.utils import to_2tuple
def nlc_to_nchw(x, hw_shape):
"""Convert [N, L, C] shape tensor... |
# coding:utf-8
# That's an impressive list of imports.
import numpy as np
from numpy import linalg
from numpy.linalg import norm
from scipy.spatial.distance import squareform, pdist
# We import sklearn.
import sklearn
from sklearn.manifold import TSNE
from sklearn.datasets import load_digits
from sklearn.preprocessin... |
import pygame
from math import pi,sqrt,cos,sin,floor
from core import polygons
import copy
import core.gameclass
class RecursiveDrawGroup(pygame.sprite.Group):
""" Standard pygame.sprite.Group classes draw sprites by calling 'blit' on sprite images.
Instead, this class calls 'draw' on each of its s... |
import matplotlib.pyplot as plt
import argparse
import os
import sys
import glob
import numpy as np
def autoscale_y(ax,margin=0.1):
"""This function rescales the y-axis based on the data that is visible given the current xlim of the axis.
ax -- a matplotlib axes object
margin -- the fraction of the total h... |
import json
import re
import sys
from collections import defaultdict, namedtuple
def evaluate(test_annotation_file, user_annotation_file, phase_codename, **kwargs):
"""
DialoGLUE evaluation function for eval.ai
See documentation: https://evalai.readthedocs.io/en/latest/evaluation_scripts.html
See te... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from typi... |
import math
import numpy as np
try:
from tcpb.tcpb import TCProtobufClient
except ImportError:
pass
import os
import errno
#################################################
### electronic structure routines go here #######
#################################################
#each electronic structure method req... |
"""
Main training script for Group Equivariant GANs, ICLR 2021.
Author: <NAME>
"""
import datetime
import os
import random
import numpy as np
import tensorflow as tf
import tensorflow.math as tfm
from time import time
from tensorflow.compat.v1 import set_random_seed
from tensorflow.keras.utils import Progbar
from s... |
# 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... |
#!/usr/bin/env python3
import sys
sys.path.append('/usr/local/lib/python3.5/site-packages')
import logging
import logging.handlers
import os
import time
import random
import threading
import subprocess
from slackclient import SlackClient
__location__ = os.path.realpath(
os.path.join(os.getcwd(), os.path.dirn... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... |
#!/pxrpythonsubst
#
# Copyright 2017 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... |
#!/usr/bin/env python
"""Launch qemu tests."""
import argparse
import errno
import json
import logging
import os
import shutil
import subprocess # nosec
import sys
import tempfile
import traceback
import urllib.parse
import urllib.request
from distutils.util import strtobool
import productmd.compose
import yaml
# h... |
# from sqlalchemy import false
from tensorflow.python.keras.applications import mobilenet_v2
from tensorflow.python.keras.layers import Add, BatchNormalization, Conv2D, Dense, Flatten, Input, LeakyReLU, PReLU, Lambda, SeparableConv2D, Concatenate
from tensorflow.python.keras.layers.core import Dropout
from tensorflow.p... |
'''
Feature scoring functionality
'''
from operator import itemgetter
import math
import numpy as np
import pandas as pd
from sklearn.ensemble import (ExtraTreesClassifier, ExtraTreesRegressor,
RandomForestClassifier, RandomForestRegressor)
from sklearn.feature_selection import (f_regr... |
from __future__ import print_function
import pytest
import lena
import lena.core
from lena.core import LenaTypeError, LenaValueError
import lena.context.functions as lf
from lena.context import (
difference, format_context, get_recursively,
iterate_update, update_recursively, update_nested,
intersection,
... |
# -*- coding: utf-8 -*-
"""
pygments.formatters.terminal256
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for 256-color terminal output with ANSI sequences.
RGB-to-XTERM color conversion routines adapted from xterm256-conv
tool (http://frexx.de/xterm-256-notes/data/xterm256-conv2.tar.bz2)
by <NAME... |
import abc
import enum
import hashlib
import math
from typing import Any, Hashable, Optional, Union
import cachetools
import cachetools.keys
import matplotlib.colors
import mergedeep
import pandas as pd
import pydantic
import structlog
from numpy import dtype
from wraeblast import insights
from wraeblast.filtering im... |
#!/usr/bin/env python3
import json
import os
import requests
import re
import sys
import time
# some constants
NEUTRAL_EXIT_CODE = 78
# tokens
HEROKU_TOKEN = os.environ['HEROKU_API_TOKEN']
GITHUB_TOKEN = os.environ['GITHUB_TOKEN']
# basic headers for communicating with the Heroku API
HEADERS_HEROKU = {
'Accept'... |
from copy import copy
from enum import auto, Enum
from eth_typing import HexStr
from eth_utils import keccak, remove_0x_prefix, to_bytes, to_checksum_address
from mypy_extensions import TypedDict
from typing import (
cast,
Tuple,
Union
)
from zero_ex.order_utils import (
_convert_ec_signature_to_vrs_hex... |
import torch
import numpy as np
from .mesh_util import *
from .sample_util import *
from .geometry import *
import cv2
from PIL import Image
from tqdm import tqdm
def reshape_multiview_tensors(image_tensor, calib_tensor):
# Careful here! Because we put single view and multiview together,
# the returned tensor.... |
# Copyright 2020 The ElasticDL 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 law... |
"""Define parameters that can be sent to the base station."""
import base64
from datetime import datetime, timezone
from enum import Enum
import json
import logging
_LOGGER: logging.Logger = logging.getLogger(__name__)
class DeviceType(Enum):
"""
List retrieved from com.oceanwing.battery.cam.binder.model.Que... |
#!/usr/bin/python3
"""
File: [ functions1.py ]
Author: <NAME>
Date: 9/17/2020
Description: The main bot for this project.
"""
# functions1.py
import os
import csv
import sys
import json
import time
import config
import pprint
import datetime
import pandas as pd
import mysql.connector
from datetime import date
from t... |
import pytest
from pokerl.cards import Card
from pokerl.judger import eval_hand, compare_hands
from pokerl.enums import CardRank, CardSuit, HandRanking
def create_hand(*symbols):
""" """
return [Card(sym) for sym in symbols]
def test_judger_eval_hand():
""" Test hand evaluation """
out = eval_hand(create_hand... |
"""
Module to run tests on core.procimg functions.
"""
import os
from IPython import embed
import numpy as np
from astropy.convolution import convolve
from pypeit.tests.tstutils import dev_suite_required
from pypeit.core import procimg
from pypeit.images.rawimage import RawImage
from pypeit.spectrographs.util impor... |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from functools import partial
from flask import g
from sqlalchemy.event import listen, listens_for
from s... |
import math
from ed2d import window
from ed2d import sysevents
from ed2d.events import Events
from ed2d import context
from ed2d import timing
from ed2d import files
from ed2d import shaders
from ed2d.opengl import gl
from ed2d.opengl import pgl
from gem import vector
from gem import matrix
from ed2d import mesh
from ... |
import logging
import re
import glob
import os
from typing import Dict, Optional, Tuple, List
from pathlib import Path
import numpy as np
from scipy.fftpack import next_fast_len
from draco.util import tools
from draco.core.containers import FrequencyStackByPol, MockFrequencyStackByPol
from . import utils
logger = l... |
# global variables and functions for graphic display management
# to be imported with
#import graphicDisplayGlobalVarAndFunctions as gvf
# useful links
#labels and colors in networkX
# https://networkx.github.io/documentation/latest/examples/drawing/labels_and_colors.html
# look also at
# https://www.wakari.io/shari... |
# coding=utf-8
# Copyright 2018 The TF-Agents 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 applicable law... |
import ctypes
import ctypes.util
import socket
from packing import p16
from packing import p32
__all__ = ['getifaddrs', 'interfaces', 'interfaces4', 'interfaces6', 'sockaddr']
# /usr/src/linux-headers-3.12-1-common/include/uapi/linux/socket.h
sa_family_t = ctypes.c_ushort
# /usr/src/linux-headers-3.12-1-common/incl... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
# Copyright 2011 webapp2 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 applicable law or agreed to in wri... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
This file contains helper functions for updating the cache.
"""
import os
import time
import xml.etree.ElementTree as ET
import json
import boto3
from botocore.exceptions import ClientError
from botocor... |
import logging
import coreapi
from django.core.exceptions import ObjectDoesNotExist
from django.db import transaction
from rest_framework import status, viewsets, mixins
from rest_framework.decorators import action
from rest_framework.generics import GenericAPIView, get_object_or_404
from rest_framework.permissions im... |
#python file
from sklearn.feature_extraction import DictVectorizer
from sklearn.naive_bayes import MultinomialNB
import numpy as np
from nltk.tokenize import word_tokenize,sent_tokenize
import nltk
import re
import os
import glob
def get_traindata(input_files):
if ( len(input_files) == 0):
raise Excepti... |
# Copyright (c) Facebook, Inc. and its affiliates.
import numpy as np
from typing import Dict, List, Optional
import fvcore.nn.weight_init as weight_init
import torch
import torch.nn as nn
from torch.nn import functional as F
from detectron2.layers import Conv2d, ShapeSpec, get_norm
from detectron2.modeling import RO... |
import math
import numpy as np
import logging
import matplotlib.pyplot as plt
import shapely
from shapely.geometry import Polygon
# For Evaluation
def computeIOU(quad1, quad2):
# quadrangle, order: left-top, left-bottom, right-bottom, right-top
# the Polygon will construct the shape
poly1 = Polygon(np.arr... |
#!/usr/bin/env python
from pymodbus.client.sync import ModbusTcpClient as ModbusClient
import paho.mqtt.client as mqtt
from uuid import getnode
import logging, time, configparser, os
# --- Logging configuration ---
FORMAT = ('%(asctime)-15s %(threadName)-15s %(levelname)-8s %(module)-15s:%(lineno)-8s %(message)s')
l... |
"""
MIT License
Copyright (c) 2020 <NAME> - <EMAIL>
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 use, copy, modify, merge, publi... |
#!/usr/bin/env python3
# Script to collect binary dependencies (eg shared libraries required by an executable)
#
# Copyright (c) 2020 <NAME>
#
# This software is provided 'as-is', without any express or implied warranty.
# In no event will the authors be held liable for any damages arising from
# the use of this softw... |
"""
Provides access to read/write/manipulate CATH Release files
"""
# core
import logging
import re
import cathpy.core.error as err
from cathpy.core.models import CathID
LOG = logging.getLogger(__name__)
class HasCathIDMixin(object):
"""
Mixin for classes that contain a :class:`cathpy.core.models.CathID`
... |
import os
from typing import List, Mapping, Optional, Tuple
cur_dir = os.path.dirname(os.path.abspath(__file__))
AMPHIPOD_COSTS = {
"A": 1,
"B": 10,
"C": 100,
"D": 1000,
}
HALLWAY_Y = 1
HOLE_X = [3, 5, 7, 9]
AMPHIPOD_HOLE_X = {
"A": 3,
"B": 5,
"C": 7,
"D": 9,
}
INFINITY = 10000000... |
"""
This is the meta trading class from which other classes
are derived
"""
from fastbt.tradebook import TradeBook
from fastbt.utils import tick
from collections import namedtuple, Counter, defaultdict
from itertools import groupby
from enum import Enum
import inspect
import datetime
import os
import yaml
class Statu... |
# Copyright 2019 The Cirq Developers
#
# 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 ... |
# Standard Library
from copy import deepcopy
# Third Party
import pytest
# GraphQL
import graphene
# Database
from sqlalchemy import Column, types
# Project
from graphene_sqlalchemy_filter import FilterSet, filters
from tests import models
from tests.graphql_objects import USER_FILTER_FIELDS, UserFilter
from tests.... |
"""
## License
GoPiGo for the Raspberry Pi: an open source robotics platform for the Raspberry Pi.
Copyright (C) 2017 <NAME>
This program 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 ... |
"""
Generators for synthetic workflows from the Pegasus workflow gallery
(https://pegasus.isi.edu/workflow_gallery/index.php).
"""
import collections
import random
from .utils import normal, gen_level, join_level
from ..common import TaskGraph
def montage(width=50):
tg = TaskGraph()
gen_width = int(width / ... |
from os import listdir
from os.path import isfile, join
from random import random
import cv2
import numpy as np
from queue import Queue
if __name__ != "__main__":
from . import ObjClass2 as ObjClass
from . import userio
else:
import ObjClass2 as ObjClass
import userio
CACHE_EXT = ".npz"
IMAGE_FOLDER... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
import math
# IBN-a
class IBN(nn.Module):
def __init__(self, planes):
super(IBN, self).__init__()
half1 = int(planes/2)
self.half = half1
half2 = planes - half1
self.IN = nn.Instanc... |
import StringIO
import networkx as nx
# from networkx.readwrite import json_graph
import json
OPTLINE = '#'
CANVAS = '_canvas'
ATTRS = '_attributes'
DB = '_database'
ARCREL = 'relation'
LINECOLOR = 'linecolor'
FILL = 'fill'
BLACK = '0/0/0'
RED = '255/0/0'
GREEN = '0/255/0'
BLUE = '0/0/255'
PINK = '255/0/255'
LIGHTB... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... |
import numpy as np
import h5py
# data file type h5py
import time
import copy
import matplotlib.pyplot as plt
from cfg import loadConfig
def load_mnist(filename):
"""load MNIST data"""
MNIST_data = h5py.File(filename, 'r')
x_train = np.float32(MNIST_data['x_train'][:])
y_train = np.int32(np.array(MNIS... |
import networkx as nx
from typing import Union, List
from time import time
import numpy as np
import logging
import os
import pickle
import sys
import csv
from tqdm import tqdm, trange
from numpy import linalg as la
from joblib import Parallel, delayed
from scipy.sparse import issparse
from scipy import sparse as sps
... |
from __future__ import annotations
__all__ = [
"TimeMatrix",
"MatrixCalculator",
]
class Device:
"""
A class that describes a single device (i.e. a computer, switch, or
server). After initialization is immutable.
Contains the next data:
* name - name of the device. A string that consist... |
import os
from pathlib import Path
from typing import Union
import numpy as np
import tensorflow as tf
from tensorflow.keras.callbacks import Callback
from tensorflow.keras.models import Model
from tensorflow.keras.metrics import categorical_accuracy
from tensorflow.keras.losses import get as get_loss
from .converter... |
import logging
from textwrap import dedent
from typing import List
from airflow.providers.postgres.hooks.postgres import PostgresHook
from common.constants import AUDIO, IMAGE
from common.loader import provider_details as prov
from common.loader.paths import _extract_media_type
from common.storage import columns as co... |
'''
Max-Planck-Gesellschaft zur Foerderung der Wissenschaften e.V. (MPG) is holder of all proprietary rights on this
computer program.
You can only use this computer program if you have closed a license agreement with MPG or you get the right to use
the computer program from someone who is authorized to grant you that... |
import os
import shutil
import time
import urllib.parse
import requests
from studip_sync import parsers
from studip_sync.constants import URL_BASEURL_DEFAULT, AUTHENTICATION_TYPES
from studip_sync.parsers import ParserError
from studip_sync.plugins.plugin_list import PluginList
class SessionError(Exception):
pa... |
# Copyright 2015 Deutsche Telekom AG. All rights reserved.
# Copyright 2015 <NAME>. All rights reserved.
# Copyright 2015 Mirantis, 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
# ... |
import dgl
import numpy as np
import torch as th
import argparse
import time
import new_partitioing_graph
import networkx as nx
import pandas as pd
import json
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
# karate_club_graph = nx.karate_club_graph()
import torch
import pan... |
import warnings
from dataclasses import dataclass
from pathlib import Path
from typing import List, Union, Dict
from unittest import main, TestCase
from openmaptiles.sql import collect_sql, sql_assert_table, sql_assert_func
from openmaptiles.tileset import ParsedData, Tileset
@dataclass
class Case:
id: str
q... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.