text stringlengths 3.07k 22.1k |
|---|
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import numpy as np
import random
from collections import deque
from typing import List
import tensorflow as tf
from agents.base.agent import Agent
REPLAY_MEMORY_SIZE = 50_000 # How many last steps to keep for model training
MIN_REPLAY_MEMORY_SIZE = 1_000 # Minimum number of steps in a memory to
# start training
M... |
# -*- coding: utf-8 -*-
# File: optimizer.py
from contextlib import contextmanager
import tensorflow as tf
from ..tfutils.common import get_tf_version_tuple
from ..compat import tfv1
from ..utils.develop import HIDE_DOC
from .gradproc import FilterNoneGrad, GradientProcessor
__all__ = ['apply_grad_processors', 'Pro... |
# 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... |
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2018, Arm Limited and contributors.
#
# 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
#
# ... |
import hmac
import hashlib
import base64
import time
from Crypto.Cipher import AES
import json
#C:/Users/User/Anaconda3_7/python.exe macaroons_benchmark_37.py
"""This is a library file for creating macaroons. The functions defined are only those
necessary to duplicate the results in Table 2 of Birgisson et al.'s "Maca... |
# %load data_mafe_EI.py
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
import pickle
import glob
from obspy import UTCDateTime, read, Trace, Stream
from scipy import signal
import pandas as pd
from haversine import haversine
sta_data = pd.read_excel("/sdd1/sta_list.xlsx", sheet_name="Data")
s... |
""" test generation and verification of tokens """
# pylint: disable=wrong-import-order
from test.common import payload, pub_keys, priv_keys, algs, generated_keys, \
clock_tick, clock_load
from test import python_jwt as jwt
from datetime import timedelta, datetime
from pyvows import Vows, expect... |
# Copyright © VASP Software GmbH,
# Licensed under the Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import itertools
import numpy as np
import pandas as pd
import py4vasp._util.sanity_check as _check
import py4vasp._util.documentation as _documentation
from IPython.lib.pretty import pretty
from .proj... |
from os import path
# -*- coding: UTF-8 -*-
# for localized messages
from . import _
# GUI (Components)
from skin import parseFont
try:
from skin import parameters
skinparms = True
except:
skinparms = False
from Components.MenuList import MenuList
from enigma import eListboxPythonMultiContent, eListbox, gFont, ... |
from collections import defaultdict, deque
import datetime
import logging
import threading
import weakref
import tornado.locks
from tornado import gen
from .core import CommClosedError
from .utils import sync
from .protocol.serialize import to_serialize
logger = logging.getLogger(__name__)
class PubSubSchedulerExt... |
# -*- coding: utf-8 -*-
"""
Utilities to compare 2 GraphQL schema for incompatibilities.
"""
import itertools
from typing import Dict, Iterator, Optional, Tuple, Type, TypeVar, Union
from .. import (
SPECIFIED_DIRECTIVES,
Directive,
EnumType,
Field,
GraphQLType,
InputObjectType,
InterfaceT... |
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... |
# -*- coding: utf-8 -*-
"""
This module is used to create cli project.
"""
import os
import platform
import shutil
import typer
import flybirds.template as template
import flybirds.utils.flybirds_log as log
from flybirds.utils.file_helper import get_files_from_dir, \
get_paths_from_dir, \
replace_file_content... |
import bisect
from fractions import Fraction
import math
import torch
from torchvision.io import (
_read_video_timestamps_from_file,
_read_video_from_file,
)
from torchvision.io import read_video_timestamps, read_video
from .utils import tqdm
def pts_convert(pts, timebase_from, timebase_to, round_func=math.f... |
'''
whooshalchemy flask extension
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Adds whoosh indexing capabilities to SQLAlchemy models for Flask
applications.
:copyright: (c) 2012 by <NAME>
:license: BSD (see LICENSE.txt)
'''
from __future__ import absolute_import
from __future__ import print_function
from... |
"""
Wishlist Steps
Steps file for Wishlist.feature
For information on Waiting until elements are present in the HTML see:
https://selenium-python.readthedocs.io/waits.html
"""
from os import getenv
import logging
import json
import requests
from behave import *
from compare import expect, ensure
from selenium.web... |
from __future__ import absolute_import
import sys
import os
import distutils.errors
from setuptools.extern import six
from setuptools.extern.six.moves import urllib, http_client
from .textwrap import DALS
import pkg_resources
import setuptools.package_index
from setuptools.tests.server import IndexServer
class Tes... |
import random
import utils.arg_parser
import torch
import torch.nn.functional as F
from models.model_loader import ModelLoader
from train.trainer_loader import TrainerLoader
from utils.data.data_prep import DataPreparation
import utils.arg_parser
from utils.misc import get_split_str
from PIL import Image
import matplot... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
#
# Copyright (c) 2018 <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
# i... |
#!/usr/bin/python3
__version__ = '0.0.8' # Time-stamp: <2021-09-14T10:47:01Z>
## Language: Japanese/UTF-8
"""Simulation Buddhism Prototype No.3 - Death
死亡関連
"""
##
## Author:
##
## JRF ( http://jrf.cocolog-nifty.com/statuses/ (in Japanese))
##
## License:
##
## The author is a Japanese.
##
## ... |
import math
import numpy as np
from utils.env_objects import Cylinder, Cube
import os
class EnvDefs:
epuck = ('EPUCK', os.path.abspath('webots_objects/E-puck.wbo'))
cylinders = [
# node DEF, node file definition, radius
('Cylinder1', os.path.abspath('webots_objects/Cylinder1.wbo'), 0.05),
... |
from django.db import models
# Staff Detail
class StaffDetail(models.Model):
Employee_ID = models.BigIntegerField(primary_key=True)
name = models.CharField(max_length=50)
GENDER_MALE = 'Male'
GENDER_FEMALE = 'Female'
GENDER_CHOICES = [(GENDER_MALE, 'Male'), (GENDER_FEMALE, 'Female')]
gender ... |
"""
CircleCI Web-API Bindings
"""
import abc
import logging
from typing import Any, Mapping, Optional, Tuple, List
import uritemplate
import urllib
import json
import re
import aiohttp
logger = logging.getLogger(__name__) # pylint: disable=invalid-name
class CircleAPI(abc.ABC):
"""CircleCI API
"""
CIR... |
'''
06:57:46.970 DEBUG __main__:HeavyPeeks: run #3089 fset frozenset({3, 4, 30, 23}) inv? True
06:57:54.573 INFO __main__:HeavyPeeks: computed divcore n=32 in 3089 bit-ANF calls, stat 1:32 2:490 3:998 4:33 1:32 2:489 3:990 4:25, size 7152
06:57:54.621 INFO __main__: computed divcore: 7152 elements
real 417m56.201s
... |
"""
Helper routines and class for the `aizynthfinder.analysis` module.
To avoid clutter in that module, larger utility algorithms are placed herein.
"""
import abc
from collections import defaultdict
import networkx as nx
from aizynthfinder.chem import (
Molecule,
UniqueMolecule,
FixedRetroReaction,
h... |
#############################################################################
##
## Copyright (C) 2013 Riverbank Computing Limited.
## Copyright (C) 2016 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the Qt for Python examples of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:BSD$
## ... |
import pytest
from httpx import URL, Origin
from httpx.exceptions import InvalidURL
@pytest.mark.parametrize(
"given,idna,host,scheme,port",
[
(
"http://中国.icom.museum:80/",
"http://xn--fiqs8s.icom.museum:80/",
"xn--fiqs8s.icom.museum",
"http",
... |
from __future__ import division, print_function, absolute_import
import pickle
import shutil
import os.path as osp
import warnings
from functools import partial
from collections import OrderedDict
import torch
import torch.nn as nn
from .tools import mkdir_if_missing
__all__ = [
'save_checkpoint', 'load_checkpoin... |
#!/usr/bin/env python
# Written by <NAME> <dhiru at openwall.com> in July 2012 for JtR project.
# Copyright (c) 2012-2013, <NAME>.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission... |
# Copyright (c) 2020 Sony Corporation. 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... |
# -*- coding: utf-8 -*-
from functools import partial
from collections import OrderedDict
from functools import partial, wraps
import h5py
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from matplotlib.backends.backend_pdf import PdfPages
# The "use" meth... |
import fire
from fastai.text import *
from fastai.lm_rnn import *
def freeze_all_but(learner, n):
c=learner.get_layer_groups()
for l in c: set_trainable(l, False)
set_trainable(c[n], True)
def train_clas(dir_path, cuda_id, lm_id='', clas_id=None, bs=64, cl=1, backwards=False, startat=0, unfreeze=True,
... |
# -*- coding:utf-8 -*-
import copy
import json
import logging
import os
import sys
from io import open
logger = logging.getLogger(__name__)
CONFIG_NAME = "config.json"
class PretrainedConfig(object):
pretrained_config_archive_map = {}
def __init__(self, **kwargs):
pass
def s... |
import torch, os, time, random, generator, discri, classify, utils
import numpy as np
import torch.nn as nn
import torchvision.utils as tvls
import torch.nn.functional as F
from utils import log_sum_exp, save_tensor_images
from torch.autograd import Variable
import torch.optim as optim
import torch.autograd as autograd... |
from math import pi, sin
from geojson import Feature, LineString
RADIUS = 6378137
def geom_reduce(geojson, initial_value_param):
initial_value = initial_value_param
previous_value = initial_value_param
def callback_geom_each(
current_geometry,
feature_index,
feature_properties,
... |
"""
Cloud function to generate transcoded renditions and quality metrics from
video sources.
It is invoked from the bash script "call_cloud_function.sh" that iteratively
triggers an http call for each video entry located in the designated bucket
"""
import sys
import subprocess
import datetime
import os
import time
... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# 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 operator
from functools import reduce
import numpy as np
import torch
from torch import nn
from src.models.change_layer... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, <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 requ... |
import torch.nn as nn
import torch
class Listener(nn.Module):
r"""
Converts low level speech signals into higher level features
Args:
rnn_cell (str, optional): type of RNN cell (default: gru)
hidden_size (int): the number of features in the hidden state `h`
n_layers (int, optional... |
import numpy as np
import pandas as pd
from sklearn.decomposition import TruncatedSVD
import techminer.common as cmn
import techminer.dashboard as dash
import techminer.plots as plt
from techminer.core import exclude_terms
from techminer.dashboard import DASH
from techminer.diagram_plot import diagram_plot
from techmi... |
import pytz
from django.http.response import JsonResponse
from django.contrib.sites.shortcuts import get_current_site
from authtools.forms import UserCreationForm
from django.utils.encoding import force_bytes, force_text
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode
from django.utils import... |
import numpy as np
import tensorflow as tf
from config import cfg
epsilon = 1e-9
class CapsLayer(object):
''' Capsule layer.
Args:
input: A 4-D tensor.
num_outputs: the number of capsule in this layer.
vec_len: integer, the length of the output vector of a capsule.
layer_typ... |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
import pytest
import numpy as np
from numpy.testing import assert_allclose
from sklearn.compose import ColumnTransformer
from sklearn.datasets import load_boston
from sklearn.datasets import load_iris
from sklearn.datasets import make_classification
from sklearn.datasets import make_regression
from sklearn.... |
import json
import multiprocessing
import os
import sys
import os.path as op
import random
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
import pandas as pd
import numpy as np
import pickle
from torch.utils.data import Dataset
from torch.utils.data impo... |
from __future__ import absolute_import
import os
import sys
import errno
import shutil
import json
import os.path as osp
from PIL import Image
import matplotlib.pyplot as plt
# import cv2
import numpy as np
from numpy import array,argmin
import torch
def mkdir_if_missing(directory):
if not osp.exists(directory):
... |
#!/usr/bin/python
# coding: utf-8 -*-
# (c) 2014, Hewlett-Packard Development Company, L.P.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1'... |
"""
This library provides a schema class to make it easier to build schemas.
"""
import inspect
import json
import numbers
import stringcase
from enum import Enum, auto
from typing import Sequence, Optional, Union, Any, Dict
class SchemaType(Enum):
OBJECT = auto()
ARRAY = auto()
STRING = auto()
INTE... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This file is part of daily-wallpaper
#
# Copyright (c) 2017 <NAME> <a.k.a. atareao>
#
# 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 withou... |
# Copyright (C) 2015-2018 Regents of the University of California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 20 11:25:28 2019
@author: arpan
@Description: Generate feature vector labels and save to target folder
"""
import numpy as np
import os
import json
# Local Paths
LABELS = "/home/arpan/VisionWorkspace/Cricket/scripts/supporting_files/sample_set_... |
import os
import datetime
import numpy as np
from numpy.lib.utils import info
import tensorflow as tf
from copy import deepcopy
from grid2op.Agent import BaseAgent
class MyAgent(BaseAgent):
def __init__(self, action_space, env, this_directory_path="./"):
self.name = "PPO"
"""Initialize a new agent... |
# Copyright (c) 2021, DjaoDjin inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... |
import logging
import io
import random
import requests
import execjs
import os
import base64
import json
from io import BytesIO
from PIL import Image
from urllib.parse import quote
# from ..Utils.getproxy import get_proxies
from CrawlerGaoYa.Spiders.Utils.getproxy import get_proxies
from CrawlerGaoYa.Spiders.DB.MongoCl... |
import click
import sys
import traceback
import os
import opencc
from lightnovel import LightNovel
from utils import echo
from provider import lk_new
from provider import wenku8
from provider import lk_mobile
echo.init_subroutine()
@click.group()
def cli():
pass
@cli.command()
# general options
@click.option('-... |
#****************************************************************
#
# Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
import struct
import math
import sys, traceback
from global_defines import *
from flags_global_defines import *
from hash_basic_... |
#!/bin/python3
import colorsys
import sys
# Color scheme formula:
# dictionary of all the keys found in the color.conf file, with as value
# a tuple of hue, saturation, and value adjustments
recipe1 = {
"dmenu color": {
"c_m_normal_bg": (0, -0.5, -0.7),
"c_m_normal_fg": (0, -0.8, 0),
"c_m... |
# -*- coding: utf-8 -*-
# @Date : 2019-07-25
# @Author : <NAME> (<EMAIL>)
# @Link : None
# @Version : 0.0
import argparse
def str2bool(v):
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f', 'n', '0'):
return False
else:
raise ... |
# Copyright (c) <NAME>
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from io import BytesIO
import logging
import os
import re
from concurrent.futures.thread import ThreadPoolExecutor
from subprocess import PIPE, run
from typing import Any... |
# Copyright 2019 <NAME> GmbH
#
# 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, ... |
import asyncio
import concurrent.futures
import functools
import logging
import signal
import threading
import warnings
from typing import (Optional, Collection, Union, Tuple, Set, Text, Any, Coroutine,
cast, TYPE_CHECKING)
from kopf.engines import peering
from kopf.engines import posting
from kopf... |
import os.path
import pytest
from pympler.asizeof import asizeof
import featuretools as ft
from featuretools import config
from featuretools.feature_base import IdentityFeature
from featuretools.primitives import (
Count,
Diff,
Last,
Mode,
Negate,
NMostCommon,
NumUnique,
Sum,
Trans... |
import numpy as np
import matplotlib.pyplot as plt
from numpy.polynomial.legendre import leggauss
from quadr import lglnodes,equispaced
def lagrange_basis(nodes,x,k):
y=np.zeros(x.size)
for ix, xi in enumerate(x):
tmp=[(xi-nodes[j])/(nodes[k]-nodes[j]) for j in range(len(nodes)) if j!=k]
y[ix]=... |
# Copyright (c) 2014, Scality
#
# 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, ... |
""" The base class for PEWPEW processing. See :doc:`usage`.
"""
from multiprocessing import Process, Queue, TimeoutError, Value
from multiprocessing.queues import Empty, Full
from abc import abstractmethod, ABCMeta
import logging
import copy
__default_exit_flag__ = Value('b', True)
__fmt__ = "%(levelname)s: %(asctim... |
# This file is part of CairoSVG
# Copyright © 2010-2018 Kozea
#
# This library is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
#... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import time
import threading
import traceback
import ray
LOG_POINT = 0
LOG_SPAN_START = 1
LOG_SPAN_END = 2
class _NullLogSpan(object):
"""A log span context manager that does nothing"""
... |
# Front matter
##############
import os
from os import fdopen, remove
from tempfile import mkstemp
from shutil import move
import glob
import re
import time
import pandas as pd
import numpy as np
from scipy import constants
from scipy.optimize import curve_fit, fsolve
from scipy.interpolate import interp1d
import matpl... |
# This file is part of the sbk project
# https://github.com/mbarkhau/sbk
#
# Copyright (c) 2019-2021 <NAME> (<EMAIL>) - MIT License
# SPDX-License-Identifier: MIT
"""Polynomial calculation functions.
Mainly lagrange interpolation logic.
Helpful introduction: https://www.youtube.com/watch?v=kkMps3X_tEE
(Simple introd... |
# -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2008 <NAME>
#
# Authors : <NAME> <<EMAIL>>
#
# Contact email: <EMAIL>
# =============================================================================
"""
API for OGC Web Services Common (OWS) c... |
import tensorflow as tf
_R_MEAN = 123.68
_G_MEAN = 116.78
_B_MEAN = 103.94
_RESIZE_SIDE_MIN = 256
_RESIZE_SIDE_MAX = 512
def _crop(image, offset_height, offset_width, crop_height, crop_width):
"""Crops the given image using the provided offsets and sizes.
Note that the method doesn't assume we know the input ima... |
from __future__ import absolute_import
# Copyright (c) 2010-2018 openpyxl
# Python stdlib imports
from datetime import (
time,
datetime,
date,
timedelta,
)
# 3rd party imports
import pytest
# package imports
from openpyxl.comments import Comment
from openpyxl.cell.cell import ERROR_CODES
@pytest.... |
import os
import re
from runpy import run_path
import sys
import warnings
import click
try:
from pygments import highlight
from pygments.lexers import PythonLexer
from pygments.formatters import TerminalFormatter
PYGMENTS = True
except:
PYGMENTS = False
from toolz import valfilter, concatv
from fun... |
"""
Defines the Widget base class which provides bi-directional
communication between the rendered dashboard and the Widget
parameters.
"""
from __future__ import absolute_import, division, unicode_literals
from six import string_types
import param
import numpy as np
from bokeh.models import CustomJS
from bokeh.mode... |
# -*-coding:utf-8-*-
import time
import os
import cv2
from moviepy.editor import VideoFileClip, CompositeVideoClip
# from tqdm import tqdm
from os.path import join, getsize
import argparse
import sys
import logging
parser = argparse.ArgumentParser(description='Classify some images.')
# parser.add_argument('--video', ... |
from typing import NamedTuple, Dict, Callable, Union
import os
import json
import wandb
import torch
import random
import shutil
import tarfile
import tempfile
import numpy as np
from pathlib import Path
from loguru import logger
from copy import deepcopy
from functools import wraps
import torch.distributed as dist
imp... |
#!/usr/bin/env python
import os
import json, codecs
import sys
import copy
import numpy as np
import rospy
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg
from math import pi
from std_msgs.msg import String
from moveit_commander.conversions import pose_to_list
from moveit_msgs.msg import Rob... |
# -*- coding: UTF-8 -*-
#!/usr/bin/python
'''Spinning cube wxPython and PyOpenGL app'''
import wx
from wx.glcanvas import *
#import OpenGL
#from OpenGL import GLUT
#from OpenGL import GLU
#from OpenGL import GL
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
from MenuCAIDViewer import Me... |
# -*- coding: utf-8 -*-
"""
Script for training a CNN segmentation model based on GeoTiff tiles and labels.
Labels may have one class or several, set no_of_classes accordingly.
The main Python libraries are Keras, rasterio and numpy.
Created on Thu Mar 5 13:17:30 2020
@author: ekkylli
Ideas and codesnippets from:
*... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
''' distribute- and pip-enabled setup.py '''
from __future__ import print_function
import sys
import logging
import os
import re
import shutil
# ----- overrides -----
# set these to anything but None to override the automatic defaults
packages = None
package_name = None
... |
import os,sys,re
import numpy as np
import subprocess
from multiprocessing import Process,Pool
import pickle
from Bio.Blast import NCBIXML
from Bio import pairwise2
from Bio.SubsMat import MatrixInfo as matlist
from Bio.SeqIO.FastaIO import SimpleFastaParser
import math
from math import log, exp
from getNatureA import ... |
import argparse
import time
from typing import Optional
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.optim import Optimizer
from torch.utils.data import DataLoader
from architectures import ARCHITECTURES
from datasets import DATASETS
from third_party.smoothadv impor... |
import argparse
import os
import pickle
import GPUtil
import numpy as np
from rte_pac.utils.data_reader import embed_data_set_with_glove_2, load_feature_by_data_set, \
number_feature, generate_concat_indices_for_inter_evidence, generate_concat_indices_for_claim
from rte_pac.utils.estimator_definitions import get_... |
import torch
from torch.utils.data import Dataset
import numpy as np
import dgl
from dgl.data.utils import download, extract_archive, get_download_dir
from .mol_tree_nx import DGLMolTree
from .mol_tree import Vocab
from .mpn import mol2dgl_single as mol2dgl_enc
from .jtmpn import mol2dgl_single as mol2dgl_dec
from .j... |
"""Support for Songpal-enabled (Sony) media devices."""
import asyncio
import logging
from collections import OrderedDict
import voluptuous as vol
from homeassistant.components.media_player import (
MediaPlayerDevice, PLATFORM_SCHEMA)
from homeassistant.components.media_player.const import (
DOMAIN, SUPPORT_S... |
#!/usr/bin/env python3
import sys
import gym
import pybullet_envs
import argparse
import itertools
import collections
import copy
import time
import numpy as np
import torch
import torch.nn as nn
import torch.multiprocessing as mp
from tensorboardX import SummaryWriter
NOISE_STD = 0.005
POPULATION_SIZE = 2000
PAREN... |
import math
import levelData
import colors, entities
import pygame
import enum
import renderer
import mathHelpers
class WallDirection(enum.Enum):
NORTH = 0
SOUTH = 1
EAST = 2
WEST = 3
def generate_distance_table(entity):
# Calculate Walls
entity.rayDistanceTable = {}
entity.entitiesInSig... |
# -*- coding: utf-8 -*-
"""
Copyright 2021 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
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/lice... |
import signal
import time
from typing import Dict, List, Callable, Union
from deepproblog.dataset import DataLoader
from deepproblog.model import Model
from deepproblog.query import Query
from deepproblog.utils import load_list
from deepproblog.utils.logger import Logger
from deepproblog.utils.stop_condition import Ep... |
# ext/declarative/clsregistry.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Routines to handle the string class registry used by declarative.
... |
# -*- coding: utf-8 -*-
"""Interfaces to all of the Movie objects offered by the Trakt.tv API"""
from collections import namedtuple
from trakt.core import Alias, Comment, Genre, get, delete
from trakt.sync import (Scrobbler, comment, rate, add_to_history,
remove_from_history, add_to_watchlist,
... |
#!/usr/bin/python3
"""podfox - podcatcher for the terminal
Usage:
podfox.py import <feed-url> [<shortname>] [-c=<path>]
podfox.py update [<shortname>] [-c=<path>]
podfox.py feeds [-c=<path>]
podfox.py episodes <shortname> [-c=<path>]
podfox.py download [<shortname> --how-many=<n>] [-c=<path>]
... |
from telethon.sync import TelegramClient
from telethon.tl.types import InputPeerChannel
from telethon.errors.rpcerrorlist import PeerFloodError, UserPrivacyRestrictedError, PhoneNumberBannedError, ChatAdminRequiredError
from telethon.errors.rpcerrorlist import ChatWriteForbiddenError, UserBannedInChannelError, Use... |
from typing import Hashable, Iterable, Union
import pandas_flavor as pf
import pandas as pd
from pandas.api.types import is_list_like
import warnings
from janitor.utils import check, check_column, deprecated_alias
from enum import Enum
@pf.register_dataframe_method
@deprecated_alias(columns="column_names")
def encode... |
#!/usr/bin/env python
#
# Copyright 2009-2020 NTESS. Under the terms
# of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
#
# Copyright (c) 2009-2020, NTESS
# All rights reserved.
#
# Portions are copyright of other developers:
# See the file CONTRIBUTORS.TXT in the top ... |
# coding: utf-8
import logging
from django.db.models import Q
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from tastypie.resources import ModelResource
from tastypie import fields
from tastypie.contrib.contenttypes.fields import GenericForei... |
import torch
import math
import torch.distributed as dist
from torch.utils.data.sampler import Sampler
from torch.utils.data.dataset import Dataset
from typing import Optional, Iterator, Callable
from collections import OrderedDict
__all__ = ["LoadBalancingDistributedSampler", "LoadBalancingDistributedBatchSampler"]
... |
# Copyright (C) 2019 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""A mixin for objects that can be cloned"""
import itertools
import datetime
from collections import defaultdict
import sqlalchemy as sa
from werkzeug import exceptions
from ggrc import db
from ggrc.m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.