text stringlengths 3.07k 22.1k |
|---|
##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
#!/usr/bin/env python3
# coding=utf-8
"""
Air conditionner classes
"""
import logging
import sys
import bitstring
from eakon import HVAC
from eakon.enums import daikin_enum
class Daikin(HVAC):
"""
Daikin ARC478A5
"""
__MARK = 433
__ONE_SPACE = 1288
__ZERO_SPACE = 440
__temp_max = 30
... |
# Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
"""
@name: Modules/Computer/Nodes/_test/test_node_local.py
@author: <NAME>
@contact: <EMAIL>
@copyright: (c) 2014-2020 by <NAME>
@license: MIT License
@note: Created on Apr 29, 2014
@summary: This module is for testing local node data.
Passed all 19 tests - DBK - 2019-01-19
"""
__updated__ = '2020... |
# -*- coding: utf-8 -*-
import torch
import torchvision
import numpy as np
import torch.optim as optim
import os
import time
import argparse
import json
from vgg import *
from torchvision import transforms
from torchvision import models
def data_transform(name, train=True):
means = [0.485, 0.456, 0.406]
std... |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# 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 Apach... |
import configparser
import gc
import os.path
import random
import sys
from copy import deepcopy
from datetime import datetime
import numpy as np
import tools
class SettingConfig:
"""
Class that encapsulates all the parameters and variables required for a counterfitting run
"""
def __init__(self, co... |
import csv
import logging
from furl import furl
from django.apps import apps
from django.contrib.auth import get_user_model
from django.core.exceptions import PermissionDenied
from django.urls import reverse
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
from act... |
#! /usr/bin/python
from monai.utils import first, set_determinism
from monai.transforms import (
AsDiscrete,
AddChanneld,
Compose,
CropForegroundd,
LoadImaged,
Orientationd,
RandCropByPosNegLabeld,
RandAffined,
ScaleIntensityRanged,
ScaleIntensityRangePercentilesd,
Spacingd,... |
import sys
import re
from .optconst import *
from .lgmisc import LGParseError
"""
Utilities for parsing postscript notated tokens and links, returned by Link Grammar API method Linkage.postscript()
"""
__all__ = ['strip_token', 'parse_tokens', 'parse_links', 'parse_postscript', 'skip_lines', 'trim_garbage'... |
#
# Very basic demangling script
#
from __future__ import print_function
# Exception thrown when a `$` is seen in the input
class Truncated(Exception):
pass
# Peekable stream
class Peekable(object):
def __init__(self, inner):
self.inner = inner
self.cache = None
def next(self):
if s... |
from ai4water.backend import torch
class HSGLayer(torch.nn.Module):
def __init__(self, n_units, init_gates_closed):
super(HSGLayer, self).__init__()
self.W_R = torch.nn.Linear(n_units, n_units, bias=False)
self.W_F = torch.nn.Linear(n_units, n_units)
if init_gates_closed:
... |
# Copyright 2021, ETH Zurich, Media Technology Center
#
# 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 b... |
import cv2
import os
from contextlib import contextmanager
from .geometry import Box, Point
import numpy as np
class Style:
def __init__(self, lineColor=0, fillColor=None):
self.lineColor = lineColor
self.fillColor = fillColor
pass
def copy(self):
s = Style()
s.lineColor... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import tf_slim as slim
from tensorflow.keras import backend as Kb
# from tensorflow.contrib.keras.api.keras import backend as Kb
from models.specs import TFNetwork
from lib.nn.losses i... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import math
import cv2
from torch.autograd import Variable
from PIL import Image
def init_weights(net, init_type='normal', gain=0.02):
from torch.nn import init
def init_func(m):
classname = m.__class__.__name__
... |
#
# Copyright (c) 2014-2020 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
"""
Utilities
"""
import glob
import os
import shutil
import subprocess
import time
import yaml
import re
import six
import netaddr
from tsconfig import tsconfig
from controllerconfig.common import constants
from control... |
from django.db import models, transaction
from django.db.models import Prefetch, functions
from django.utils import timezone
class SmartMeterManager(models.Manager):
"""
Manager for the SmartMeter model
"""
use_for_related_fields = True
def user_meters(self, user_id):
return self.filter(u... |
#!/usr/bin/env python
'''Base layout types and interfaces.
Section numbers refer to the CSS 2.1 specification at
http://www.w3.org/TR/CSS21/
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
#-----------------------------------------------------------------------------
# Basic types. These are used bot... |
import math
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeatures
from mlfx import Project
p = Project()
R = 10
p.add_global('real', 'R', R)
Omega = 0.05
p.add_global('real', 'Omega', Omega)
p.add_global('real', 'delta', Omega / 10)
L = 2 * math.pi ... |
import os
from pymongo import MongoClient
from ase.io import Trajectory
from ase.optimize.bfgs import BFGS
from ase.optimize.sciopt import SciPyFminCG
from ase.calculators.vasp import Vasp
from ase.calculators.emt import EMT
from vasp_interactive import VaspInteractive
from ase.db import connect
from finetuna.atomist... |
# 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
# distributed under t... |
import os
from os import listdir
from json import load
from subprocess import call
from pandas import DataFrame
"""
This if the technical function, which using to run external softs and getting metha information about
anlizyng substance.
"""
#Getting smiles formula and names of substances
def parse_smi_file(smiles, na... |
import requests
import time
ERROR_STRING = '"ERROR, event logged"'
OSCAR_API_BASE_URL = 'http://burdellanswers.com:3000/api/oscar/'
DEPARTMENTS = { 'ACCT' : 'Accounting',
'AE' : 'Aerospace Engineering',
'AS' : 'Air Force Aerospace Studies',
'APPH' : 'Applied Physiolo... |
# Copyright (C) 2012-2013 <NAME>
#
# This work is licensed under the Creative Commons
# Attribution-NonCommercial-ShareAlike 3.0 Unported License.
# To view a copy of this license, visit:
# http://creativecommons.org/licenses/by-nc-sa/3.0/
#
# This file was created using the streaming example from Tweepy
# as a general... |
import torch
import PIL
import os
from torchvision import datasets,transforms
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sn
import os
import sys
import warnings
from collections import namedtuple
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from t... |
from __future__ import absolute_import
from datetime import timedelta, date
from decimal import Decimal
from itertools import chain
from django.conf import settings
from django.db.models import CharField, Func, F, Avg, DecimalField, ExpressionWrapper
from django.test import TestCase
from django.utils.encoding import ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
lightroom_sync.py
Lightroom sync is a script to synchronize your lightroom catalogs across multiple devices.
"""
import click
import os
import sqlite3
import re
import logging
import shutil
import time
from logging.config import dictConfig
from pathlib import Path
def... |
import numpy as np
import pybie2d
from qfs._two_d_qfs import QFS_Pressure, QFS_B2C
from qfs._two_d_qfs import QFS_LU_Inverter, QFS_Circulant_Inverter
from qfs._two_d_qfs import QFS_Square_QR_Inverter, QFS_Rectangular_QR_Inverter
from qfs._two_d_qfs import QFS_Square_SVD_Inverter, QFS_Rectangular_SVD_Inverter
from qfs.... |
import numpy as np
from scipy.spatial import distance
from bisect import bisect
from bisect import insort_left
def compute_states_importance(states_q_values_df, compare_to='worst'):
if compare_to == 'worst':
states_q_values_df['importance'] = states_q_values_df['q_values'].apply(
lambda x: np.... |
import os
from .db_core import VfsDatabase, VfsNode, GtocArchiveEntry
from .db_cross_game import DbCrossGame
from .ff_adf import AdfDatabase
from .ff_types import *
from .db_types import *
from .ff_determine import determine_file_type_and_size
from .file import ArchiveFile
def determine_file_type_by_name(vfs: VfsData... |
from numba import jit
def physical_c():
# nue = 1.0e-4 # [m^2/s] : water
# density = 1000.0 # [kg/m^3] : water
nue = 1.0e-3 # [m^2/s] : glycerin
density = 1261.0 # [kg/m^3] : glycerin
length = 0.1 # [m]
height = 0.1 # [m]
time = 100.0 # [s]
inlet_velocity = 0.05 # [m/s]
ou... |
"""Help command."""
import itertools
import logging
from typing import Dict
import discord
from discord.ext.commands import Command
from discord.ext.commands import HelpCommand
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
from .i18n import Translator
_ = Translator("Help", __file__)
log = logging.getL... |
#
# Copyright (c) 2020 BlackBerry Limited. 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 requ... |
# -*- coding: utf-8 -*-
import pytest
import time
from memsql.common import query_builder, database
import uuid
import datetime
import copy
def test_connection_open(test_db_conn):
assert test_db_conn.connected()
def test_connection_close(test_db_conn):
assert test_db_conn.connected()
test_db_conn.close()... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File : functional.py
# Author : <NAME>, <NAME>
# Email : <EMAIL>, <EMAIL>
# Date : 23.07.2019
# Last Modified Date: 23.10.2019
# Last Modified By : Chi Han, Jiayuan Mao
#
# This file is part of the VCML codebase
# Distrib... |
import logging
from datetime import datetime
from django.core.mail import mail_admins
from django.core.exceptions import PermissionDenied
from django.views.decorators.csrf import csrf_protect
from django.db import IntegrityError, DatabaseError
from django.db.models import Count
from django.http import Http404, HttpRe... |
import cv2
import pyautogui
from PIL import ImageGrab, Image
import numpy as np
import platform
import os
import psutil
import time
import win32api
PLATFORM = platform.system()
if PLATFORM:
import win32gui
from winguiauto import findTopWindow
def windowEnumerationHandler(hwnd, top_windows):
top_... |
from __future__ import print_function
import numpy as np
import pytest
import nengo
from nengo.builder import Model
from nengo.builder.ensemble import BuiltEnsemble
from nengo.builder.operator import DotInc, PreserveValue
from nengo.builder.signal import Signal, SignalDict
from nengo.utils.compat import itervalues
... |
# Copyright 2018-2020 The UBC EOAS MOAD Group
# and The University of British Columbia
#
# 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
#
# U... |
# Author: <NAME> <<EMAIL>>
from time import time
import pandas as pd
import numpy as np
import re
"""
The :mod:'data_preprocessing' module contains the process_files() function and CleanData class.
The process_files() function can combine raw CSV file output from the ovid database and process them into
files usable... |
import heapq
from datetime import datetime
from threading import RLock
from typing import Any, Dict, Iterable, List, Optional, Set
from triad.utils.convert import to_datetime
from tune._utils import to_base64
from tune.concepts.flow.trial import Trial
from tune.concepts.space.parameters import TuningParametersTemplate... |
from flask import Flask, jsonify, request
import sqlfile as SqlFile
app = Flask(__name__)
@app.route('/', methods=['GET'])
def test():
return jsonify({'message' : 'It works'})
@app.route('/getUser', methods=['POST'])
def login():
data_tuple = (request.json['user_email'], request.json['user_password'])
res... |
#!/usr/bin/env python
import numpy as np
from LLC_Membranes.llclib import file_rw, transform, topology
def z_correlation(z, L, v=0.1):
""" Calculate where to place monomers on the z-axis so that a given correlation length is obtained
:param z: mean z-positions where monomers will be placed with gaussian pro... |
from __future__ import division
import torch
from torch_cluster import neighbor_sampler
from torch_geometric.utils import degree
from torch_geometric.utils.repeat import repeat
from .data import size_repr
class Block(object):
def __init__(self, n_id, e_id, edge_index, size):
self.n_id = n_id
sel... |
# coding: utf8
# This file is part of Scapy
# Scapy 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 2 of the License, or
# any later version.
#
# Scapy is distributed in the hope that it will b... |
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect
from django.views import View
from app.logic.calendar import create_calendar
from .forms import *
from .decorators import house_required
def index(request):
return render(request, 'app/index.html')
@login_requi... |
# -*- coding: utf-8 -*-
import os
import logging
import glob
import json
import argparse
import math
import codecs
from tqdm import tqdm, trange
import numpy as np
import torch
import random
import pickle
import sys
sys.path.append('/data/private/chenyutong/VLP/')
from torch.utils.data import DataLoader, RandomSampler,... |
import numpy as np
from src.io.psee_loader import PSEELoader
from src.io import npy_events_tools
import os
import cv2
import argparse
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import torch
sns.set_style("darkgrid")
def generate_event_volume(events,shape,ori_shape,C):
x, y, c, p, fe... |
from tkinter import *
from tkinter import font as tkfont
import math
# program variable
operator_number = {}
number_list = []
# initiating instance
root = Tk()
# title
root.title("Calculator")
# define font
button_font = tkfont.Font(family="Times", size="24", weight="bold", slant="italic")
equal_button_font = tkfon... |
"""Create a dataset of two spheres coupled by an invisible spring, floating
without gravity. Outputs a tfrecord in data/coupled_spheres. (Should be run from
$ARTIFICE)
# TODO: add realistic physics simulation as in
https://gist.github.com/Zulko/f828b38421dfbee59daf, using package 'ode'.
"""
import vapory
import nump... |
#!/usr/bin/env python
# coding=utf-8
"""Examples of using the cmd2 table creation API"""
import functools
import sys
from typing import (
Any,
List,
)
from cmd2 import (
EightBitBg,
EightBitFg,
Fg,
ansi,
)
from cmd2.table_creator import (
AlternatingTable,
BorderedTable,
Column,
... |
# Copyright (c) 2019 <NAME> - Quantum Group
"""
Assist constructing a WRspice script
"""
import numpy as np
import networkx as nx
import pandas as pd
import logging, os
# Get the style from NODE_STYLE.csv spreadsheet
dir_path = os.path.dirname(os.path.realpath(__file__))
NODE_STYLE = pd.read_csv(os.path.join(dir... |
# Version: 2020.02.21
#
# MIT License
#
# Copyright (c) 2018 <NAME> and <NAME>
#
# 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 ri... |
import numpy as np
import pandas as pd
from scipy.stats import pearsonr,spearmanr
from scipy.stats import entropy as kl
from sklearn.metrics import roc_auc_score, f1_score, mean_squared_error
from math import sqrt
import os
import multiprocessing as mp
def get_annotator_ensemble_baseline(annotations, k, agg_function... |
# Copyright 2021 The Kubeflow 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 applicabl... |
#!/usr/bin/env python
"""
This file is part of Python TripleSec - a Python implementation of TripleSec
Released under The BSD 3-Clause License
Copyright (c) 2013 Keybase
"""
from __future__ import absolute_import
import binascii
import getpass
import struct
import six
import sys
from Crypto import Random
rndfile =... |
import os
import sys
import random
import math
import re
import time
import numpy as np
import cv2
import matplotlib
import matplotlib.pyplot as plt
import io
import lmdb
import sqlite3
import pandas as pd
import json
import argparse
from PIL import Image
from IPython.display import display
from pycoc... |
# Project Quex (http://quex.sourceforge.net); License: MIT;
# (C) 2005-2020 <NAME>;
#_______________________________________________________________________________
"""PURPOSE: Edit Distance Functions
NOTE: Those functions are supposed to operate on non-cyclic DFAs.
This module implements functions to transform a gi... |
#!/usr/bin/python3
import math
import mmap
import os
def _chunks(seq, n):
return (seq[i:i+n] for i in range(0, len(seq), n))
def calculate_shannon_entropy(data):
data = bytearray(data)
length = len(data)
occurrences = [0] * 256
for byte in data:
occurrences[byte] +... |
"""
An attempt at getting a recursive attribute tree
"""
##### Utils #####################################################################################
## To be able to do partial with positionals too
# Explicit version of partial_positionals(isinstance, {1: types})
from py2json.util import mk_isinstance_cond, mk_... |
#!/usr/bin/python3
import tkinter as tk
import tkinter.ttk as ttk
import serial.tools.list_ports
import mss
import cv2
import time
import numpy as np
from datetime import datetime
lbl_det_rate_resetval = '-'
lbl_det_max_resetval = '-'
btn_det_startstop_start = 'Start'
btn_det_startstop_stop = 'Stop'
display_prefix = ... |
from Agents.BaseAgent import BaseAgent
import matplotlib
import matplotlib.pyplot as plt
import argparse
import numpy as np
import os
import sys
import pickle
import utils.tiles3 as tc
import math
# Not using wrap around tilings for angle and angular velocity
# as they are restricted by the environment to some thresho... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# @Author: <NAME>
# @Date: 2018-07-12 08:57:12
# @Last Modified by: <NAME>
# @Last Modified time: 2018-07-20 09:28:27
# @E-mail: <EMAIL>
# @Description: 抓取高德POI,高德POI每次请求最多返回30条数据,page_num从1开始,需要设置城市代码和城市边界
import time
import json
import random
import logging
import loggin... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 11 20:26:07 2017
@author: immersinn
"""
import os
from collections import defaultdict
import pandas
from . import utils
from . import bill_proc_utils as bpu
import bill_sponsor_analysis_pipeline
from . import plotly_utils
def get_repr_bi(bill_... |
from copy import copy
from lib.methods import deduce_new_block_origins, deduce_new_block_endings,\
push_block_origins, push_block_endings, fill_row
class OverwriteException(Exception):
"""
Exception raised, when program tries to overwrite filled/empty cell.
If not raised while assumption making it mea... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""Contains different selector objects.
Selector objects can be used as stand alone objects
or add extra functionality to the translators.
Selectors:
ProxySelector, UserAgentSelector
Attributes:
_IPV4_REGEXP (regexp): Regular expression to much IPv4 addresses.
... |
#
# 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 us... |
""" Basic named axis implementation.
Requires python 3
Author: <NAME>,
Philipps University of Marburg
<EMAIL>
"""
import textwrap
from collections import namedtuple
import numpy as np
class Map(object):
pass
class NegOp(Map):
@staticmethod
def __call__(x):
... |
"""
RPE Protocol objects
"""
# ***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights
... |
"""
Computing in the thymic Q framework.
"""
import os
import tempfile
import click
import delegator
import numpy as np
import pandas as pd
# These are our "lvj" columns, which are the most common indices for
# probabilities and sequences in what follows.
lvj = ['length', 'v_gene', 'j_gene']
def bound(x, m):
"... |
import hashlib
import json
import os
import re
import subprocess
got_win32api = True
try:
import win32api
except ModuleNotFoundError:
got_win32api = False
#-------------------------------------------------------------------------------
#
#-----------------------------------------------------------------------... |
'''
<NAME>
structs.py
This file defines all the data containers for the simulator. It also contains
a handful of functions at the bottom to help with initialization of these
containers. I use pythons dataclass decorator which lets me write less
source code when defining a data class. These data class have no methods.... |
## importance resampling
import gym
import numpy as np
from gym import spaces
class FourRoom(gym.Env):
def __init__(self, seed=None, goal_type='fix_goal'):
self.n = 11
self.map = np.array([
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, ... |
from collections import defaultdict
from itertools import groupby, product, chain
from typing import Union, Iterator
from .utils import *
class GameEntity:
__slots__ = ['guid', 'timestampMs']
def __init__(self,
guid: str,
timestampMs: int,
):
self.g... |
# %% [markdown]
# ##
import os
import matplotlib as mpl
# mpl.use("Agg")
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.stats import gaussian_kde
import pymaid
from src.data import load_metagraph
from src.graph import preprocess... |
# Copyright (C) 2015-2019 <NAME>
# SPDX-License-Identifier: Apache-2.0
from __future__ import division, print_function
import time, subprocess, os
from math import log
import numpy
from matplotlib import pyplot
import dolfin
from ocellaris import Simulation, setup_simulation, run_simulation
def run_and_calculate_err... |
"""
Created on Tue Jan 26 08:27:50 2021
@author: utric
"""
import numpy as np
from numpy import pi as π
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy.constants import mu_0 as μ0
import pycoilib as pycoil
from pycoilib._set_axes_equal import _set_axes_equal
from pycoilib.shape imp... |
"""
Join two KGTK edge files or two KGTK node files.
TODO: Need KgtkWriterOptions
"""
from argparse import Namespace, SUPPRESS
import typing
from kgtk.cli_argparse import KGTKArgumentParser, KGTKFiles
def parser():
return {
'help': 'Join two KGTK files',
'description': """Join two KGTK edge file... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
http://ross.net/crc/download/crc_v3.txt
@author: <NAME>
@mail: <EMAIL>
"""
from bitstring import BitStream
def crcNmea(data):
crc = BitStream("0x00")
length = int(data.length / 8)
for _ in range(length):
crc = crc ^ data.read("bytes:1")
ret... |
import os
import pytest
from energuide import element
from energuide import snippets
from energuide import validator
@pytest.fixture
def doc() -> element.Element:
sample_filename = os.path.join(os.path.dirname(__file__), 'sample.h2k')
with open(sample_filename, 'r') as h2k:
doc = element.Element.parse... |
# Copyright 2019 The PlaNet 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... |
from scipy import sparse
#import matplotlib.pyplot as plt
import os
#import tensorflow as tf
import numpy as np
import scipy
from mpl_toolkits.mplot3d import Axes3D
from plyfile import PlyData, PlyElement
# from IPython.display import clear_output
import os
from shapely.geometry import Point
from shapely.geometry.p... |
from __future__ import division, print_function
from collections import namedtuple
import numpy as np
from .. import util
from .. import core
RankNormedScoreResults =\
namedtuple("RankNormedScoreResults",
["pattern_idx", "percnormed_score",
"score", "offset", "revcomp"])
#this has... |
# -*- python -*-
# Based on commit <PASSWORD> of
# https://github.com/RobotLocomotion/drake/blob/master/tools/workspace/lcm/lcm.bzl
load("@rules_python//python:defs.bzl", "py_library")
load("//tools:pathutils.bzl", "basename", "dirname", "join_paths")
def _lcm_outs(lcm_srcs, lcm_package, lcm_structs, extension):
... |
#!/usr/bin/python
# -*- coding:utf8 -*-
import urllib2
import re
import os
import argparse
import signal
import sys
import time
search_api = r"http://pandavip.www.net.cn/check/check_ac1.cgi?domain=%s"
available_mark = u"domain name is available"
too_fast_mark = u"query frequency is too high, please try again later"
e... |
#!/Library/Frameworks/Python.framework/Versions/3.1/bin/python3
# -*- coding: utf-8 -*-
import os, sys
import xml.etree.ElementTree as ET
sys.path.append(os.getcwd().split('projects')[0]+'projects/slps/shared/python')
import BGF3, slpsns
from functools import reduce
import xml.etree.ElementTree as ET
debug = False
#de... |
"""
Copyright 2020 https://github.com/WiardYu
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 ... |
#! /bin/env python
"""
>>> get_connectivity((6, ))
array([0, 1, 1, 2, 2, 3, 3, 4, 4, 5])
>>> get_connectivity((6, ), ordering='ccw')
array([1, 0, 2, 1, 3, 2, 4, 3, 5, 4])
>>> get_connectivity((3, 4))
array([ 0, 1, 5, 4, 1, 2, 6, 5, 2, 3, 7, 6, 4, 5, 9, 8, 5,
6, 10, 9, 6, 7, 11, 10])
>>> g... |
import tensorflow as tf
import common_utils
import optimization
from models.tf_metrics import precision, recall, f1
# from albert import modeling,modeling_google
from bert import modeling
# from bert import modeling_theseus
from models.utils import focal_loss
from tensorflow.python.ops import metrics as metrics_lib
lo... |
"""
Copyright 2019 <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
distrib... |
"""
Copyright 2012-2019 <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
di... |
"""AESDD dataset."""
import collections
import os
import re
import numpy as np
import tensorflow as tf
import tensorflow_datasets.public_api as tfds
# Markdown description that will appear on the catalog page.
_DESCRIPTION = """
The Acted Emotional Speech Dynamic Database (AESDD) is a publically available speech ... |
import sys
from keyword import iskeyword
from dataclasses import dataclass
from arpeggio import ParsingExpression, EOF, RegExMatch as _ , StrMatch
from arpeggio import ParseTreeNode, Terminal
#------------------------------------------------------------------------------
ALL = ( # single character constants and ru... |
import tkinter as tk
class RoundedToolTip:
"""Custom rounded tooltips, easy to use, specify widget and text as positional arguments
Keyword Arguments:
triggerkey -- Which key/event(default is <Enter>) triggers the tooltip to show
releasekey -- Which key/event hides(default is <Leav... |
import math
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.autograd as autograd
import torch.optim as optim
import numpy as np
from torch.autograd import Variable
from FLICKR.sup_flickr8k_dataset import *
from FLICKR.model_flickr import RNN_VAE
import argparse
import matplo... |
import json
import os
from datetime import datetime
from pathlib import Path
from shutil import move
from uuid import uuid4
from uav_analysis.mass_properties import quad_copter_batt_prop, quad_copter_fixed_bemp2
from uav_analysis.testbench_data import TestbenchData
from symbench_athens_client.exceptions import Propel... |
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import gevent
import socket
import fixtures
import subprocess
from util import retry
from mockredis import mockredis
from mockzoo import mockzoo
from mockifmap import mockifmap
import redis
import time
import urllib2
import copy
import os
import json... |
import scipy.io as sio
import os
import cv2
import time
import random
import pickle
import numpy as np
from PIL import Image
import yaml
import sys
import torch
from torch.utils import data
import torch.nn.functional as F
import torchvision.transforms as tf
from utils.utils import Set_Config, Set_Logger, Set_Ckpt_Cod... |
TICKS_PER_UPDATE = 8
TICKS_PER_FRAME = 3
MAX_HEALTH = 100
MAX_HUNGER = 100
MAX_SLEEPINESS = 20
MAX_DIGESTION = 100
MAX_HAPPINESS = 100
GRUMPY_THRESHOLD = 20
# The ANIMATIONS value contains all the entries from lines 6 to 16.
# The left side of the equals is the name of the animation. When you call
# animate_sprite, y... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.