text stringlengths 3.07k 12.6k |
|---|
"""Models for [Gharbi2016] Deep Joint demosaicking and denoising."""
import os
from collections import OrderedDict
from numpy.core.fromnumeric import shape
from pkg_resources import resource_filename
import numpy as np
import torch as th
import torch.nn as nn
__all__ = ["BayerDemosaick", "XTransDemosaick"]
_BAYER_... |
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import pytest
from llnl.util.filesystem import working_dir, mkdirp, touchp
from llnl.util.link_tree import Link... |
# Copyright (c) 2013, SELCO and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe import msgprint
import datetime
from datetime import timedelta
from frappe.utils import cint, flt, nowdate,getdate
def execute(filters=No... |
# Lint as: python3
# Copyright 2019, The TensorFlow Federated 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 ... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2022 CERN.
#
# Invenio-Vocabularies is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""Test the funder vocabulary resource."""
import json
from copy import de... |
import sys
import numpy as np
from collections import deque
import heapq
import copy
class Puzzle:
def __init__(self, n:int , grid ):
self.grid = grid
self.n = n
self.blank = 0
self.goal_state_tup = tuple(range(1 , self.n**2 - 1)) + (0,0)
def h(self , grid=None):
if gri... |
""" Lexical analysis is the breaking of a string into tokens. """
import re
import linecache
from builtins import SyntaxError as BaseSyntaxError
class SyntaxError(BaseSyntaxError):
pass
class UnexpectedEndError(SyntaxError):
pass
class LexicalGrammar:
"""Quick and dirty lexer implementation.
In ... |
# coding: utf-8
""" ...explain... """
from __future__ import division, print_function
__author__ = "adrn <<EMAIL>>"
# Standard library
import os
import sys
# Third-party
from astropy import log as logger
import astropy.units as u
import matplotlib.pyplot as pl
import numpy as np
import superfreq
def dat_iterator(... |
"""Graphical procedures for GPR data."""
import numpy as np
import math
import matplotlib.pyplot as plt
from matplotlib import cm
from ...gis.raster import RectifyTif
class PLT:
def show(self):
"""Display the current plot."""
plt.show()
def save(self, outpath):
"""Sa... |
from typing import Dict, List, Tuple, Union
import spacy
from spacy.matcher import DependencyMatcher
from spacy.tokens import Token
from spacy.tokens.doc import Doc
from spacy.tokens.span import Span
from ..get_api._model import (
API,
Action,
APIDependencies,
Condition,
Dependency,
Parameter,... |
# Copyright 2020, Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2017 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
from pymor.core.interfaces import ImmutableInterface
from pymor.discretizations.basic import Discr... |
"""Configure select in a device through MQTT topic."""
from __future__ import annotations
import functools
import logging
import voluptuous as vol
from homeassistant.components import select
from homeassistant.components.select import SelectEntity
from homeassistant.config_entries import ConfigEntry
from homeassista... |
# This is taken from:
# https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5
# i.e.
# Detectron2 Tutorial.ipynb
from detectron2.utils.visualizer import ColorMode
from detectron2.utils.visualizer import Visualizer
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
... |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Setup for instrumentation host-driven tests."""
import logging
import os
import sys
import types
from pylib.host_driven import test_case
from pylib.host... |
import numpy as np
import dace as dace
from dace.transformation.auto_optimize import auto_optimize
from dace.transformation.subgraph import ReduceExpansion
from dace.transformation.dataflow import MapCollapse, MapExpansion
from dace.transformation.interstate import LoopToMap
N, H, W, C_before_fc1, S0, S1, S2, S3, S4,... |
from __future__ import print_function
import subprocess
import json
import netrc
import sqlite3
import os
import sys
import shutil
import logging
from datetime import datetime
errorInImportFileFolder = 'import_errors'
dateformatForFolder = "%Y-%m-%d-%H-%M-%S"
dateformatForLabel = "%Y-%m-%d %H:%M:%S"
auth_path_key = '... |
from __future__ import unicode_literals
import base64
import io
import json
import frappe
import cv2
import numpy as np
from PIL import Image
import os.path as osp
import glob
import cv2
import numpy as np
import torch
import emotif.ESRGAN.RRDBNet_arch as arch
@frappe.whitelist(allow_guest=True)
def add_feedback(nam... |
# -*- coding:utf-8 -*-
import xml.etree.cElementTree as et
import os
import re
import sys
import string
import xml.dom.minidom as minidom
#脚本说明:
#
#该脚本会遍历所在目录及其子目录下所有的xml文件
# 并将其生成.cs和.xml
#
#运行环境:python 3.x (python 2.x可以使用 GenTemplate_py2x.py)
#
#Author:王飞飞
#Time:2018-11
#
OutFilePath_cs = r"E:\Unity2017Work\Lemon\... |
import re
import textwrap
import unicodedata
import Default.comment
import sublime
import sublime_plugin
def previous_line(view, sr):
"""sr should be a Region covering the entire hard line"""
if sr.begin() == 0:
return None
else:
return view.full_line(sr.begin() - 1)
def next_line(view,... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Utilities to parse Apache access log.
To get known about access log, see Apache HTTP server official document.
[`en <http://httpd.apache.org/docs/2.4/en/logs.html>`_]
[`ja <http://httpd.apache.org/docs/2.4/ja/logs.html>`_]
This module is also executable to parse acce... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... |
from view.python_core.utils.pil_helpers import add_string
from PIL.ImageDraw import Draw
from view.python_core.utils.colors import mpl_color_to_PIL
from view.python_core.utils.fonts import get_maximum_font_size_by_width
class NoStimulus(object):
def __init__(self, pulsed_stimuli_handler):
super().__init... |
import pickle
import os
import numpy as np
from experiments.distributed_experiments import run_experiment, tracking_exp, planner_agent_exp, learning_curve_exp, noise_test_exp
def cross(logfile, cross_exp, exp_name='cr'):
# load data, choose correct task, method, num_episodes, noise_cond, seq_len
with open(logf... |
# <---- import session ---->
# import flask
from flask import Flask, jsonify
from flask_cors import CORS
import requests
# for youtube player
import os
import time
import random
# import youtube downloader
import youtube_dl
# import mongodb
import vlc
from vlc_player import Player
# <---- initail flask session ---... |
# -*- coding: utf-8 -*-
# Copyright 2018-2022 the orix developers
#
# This file is part of orix.
#
# orix is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) ... |
import pandas as pd
from src.utility.file_utility import get_directory_files, create_directory, copy_file
from src.utility.system_utility import progress_bar
from src.utility.image_utility import load_image, crop_roi, save_image
from sklearn.model_selection import train_test_split
def get_labels(n_labels, as_string=T... |
import csv
import logging
import socket
import json
from io import TextIOWrapper
import tld
import urllib
from django.utils import timezone
from rest_framework import pagination, parsers, request, response, viewsets
from rest_framework.authentication import BasicAuthentication, SessionAuthentication
from rest_framewor... |
import yaml
import peewee
from datetime import datetime
import logging
import shlex
import subprocess
import sys
from pathlib import Path
from typing import Callable, Optional, List, Iterable, Tuple
from straight.plugin import load
__version__ = "dev~"
HOME = Path.home()
CONFIG_FILE_NAME = ".magpie.yml"
DEFAULT_CONFI... |
import sys
import warnings
from django.core.exceptions import FieldDoesNotExist
from django.utils.text import capfirst
from django.utils.encoding import smart_str
from django.db.models.options import Options
try:
from django.db.models.options import get_verbose_name as camel_case_to_spaces
except ImportError:
... |
import argparse
import errno
import json
import logging
import os
from collections import defaultdict
from copy import deepcopy
from find_apps import find_apps
from find_build_apps import BUILD_SYSTEM_CMAKE, BUILD_SYSTEMS
from idf_py_actions.constants import PREVIEW_TARGETS, SUPPORTED_TARGETS
from ttfw_idf.IDFAssignTe... |
import string
import requests
import urllib.request
import database
import scriptwrapper
from TikTokApi import TikTokApi
import shutil
import traceback, sys
import subprocess
import settings
from time import sleep
from pymediainfo import MediaInfo
forceStop = False
#GreyFieldMedia
def getAllCl... |
# Copyright 2020 NVIDIA Corporation
#
# 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 wr... |
# Copyright (c) 2017 Intel Corporation
#
# 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 i... |
import logging
from . import messages
logger = logging.getLogger(__name__)
def make(data, client):
"""
Instantiates an instance of Event or a subclass, for the given
event data and (optional) client.
"""
type_id = data['event_type']
cls = types.get(type_id, Event)
return cls(data, clien... |
# -*- coding: utf-8 -*-
"""
override class with command handlers for CspMaster.
"""
# Standard python imports
import pkg_resources
import enum
import logging
# Tango import
from tango import DevState, Except, ErrSeverity, Database, DeviceProxy
# SKA imports
from ska_ser_logging import configure_logging
from ska.base.... |
from imp_lexer import *
from combinators import *
from imp_ast import *
from functools import *
import sys
# Basic parsers
def keyword(kw):
return Reserved(kw, RESERVED)
num = Tag(INT) ^ (lambda i: int(i, 16))
id = Tag(ID)
# Top level parser
def imp_parse(tokens):
ast = parser()(tokens, 0)
return ast
d... |
# -*- coding: utf-8 -*-
"""
boxel.service
~~~~~~~~~~~~~
This module provides functions for various media services that can be
boxelized.
"""
from .config import Dimensions
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from urlparse import... |
# Copyright 2019-2021 Huawei Technologies Co., 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 agre... |
###
# Copyright 2019 <NAME>, 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... |
import unittest
from mock import Mock
import numpy as np
from GPyOpt.acquisitions import AcquisitionEI
from GPyOpt.core.task.space import Design_space
class TestEIAcquisition(unittest.TestCase):
def setUp(self):
self.mock_model = Mock()
self.mock_optimizer = Mock()
domain = [{'name': 'var... |
from imports import *
FONTSIZEOPTIONS = (5, 8, 10, 11, 12, 16, 20, 24, 32)
IMAGETRESHHOLD = 5 * 1024 * 1024 # 10MB
# TAG2CONFIG = {
# 'fontsize': r'fontsize-(?P<value>\d)',
# }
# TAG2CONFIG: Dict[str, re.Pattern] = {key: re.compile(value) for key, value in TAG2CONFIG.items()}
DEFAULT_TAGS = {
'bold': {
... |
import sys, os
import json, CoolProp, sys
CP = CoolProp.CoolProp
def inject_hsanchor(fluid, i, json_data):
Tanchor = 1.1*CoolProp.CoolProp.PropsSI('Tcrit',fluid)
rhoanchor = 0.9*CoolProp.CoolProp.PropsSI('rhomolar_critical',fluid)
hanchor_molar = CP.PropsSI('Hmolar','T',Tanchor,'Dmolar',rhoanchor,fluid)... |
#!/usr/bin/env python3
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import copy
import math
import os
import sys
import time
import pickle as pkl
import utils
import hydra
from logger import Logger
from replay_buffer import ReplayBuffer
class Workspace(object):
def __init_... |
#!/usr/bin/env python3
"""A utility for dealing with provisioning profiles"""
from enum import Enum
import copy
import datetime
import os
import plistlib
import shutil
import subprocess
import sys
import tempfile
from typing import Any, cast, Dict, Iterable, List, Optional
import OpenSSL
class ProvisioningType(Enu... |
# This file is part of beets.
# Copyright 2016, <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 rights to use, copy, modify, ... |
# Copyright 2020 The TensorFlow Probability 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 o... |
# Visualizing data
from __future__ import division
from collections import Counter
from collections import defaultdict
from matplotlib import pyplot as plt
# Chapter data
years = [1950, 1960, 1970, 1980, 1990, 2000, 2010]
gdp = [300.2, 543.3, 1075.9, 2862.5, 5979.6, 10289.7, 14958.3]
movies = ["<NAME>", "Ben-Hur", "Ca... |
from __future__ import absolute_import, division, print_function, unicode_literals
import torch.nn as nn
from torch.nn import CrossEntropyLoss, MSELoss
from transformers.configuration_roberta import RobertaConfig
from transformers.file_utils import add_start_docstrings, add_start_docstrings_to_callable
from transform... |
import os
import glob
import json
import sys
import random
from operator import itemgetter
from utils import *
from generate_graphs import *
# Rank counties for a given state
def rank_zips(all_zips):
groups = {'good': [], 'bad': [], 'ugly': [], 'low_cases': [], 'no_data':[]}
for zip_file in all_zi... |
import random
from collections import namedtuple, deque
class ReplayBuffer:
"""Fixed-size buffer to store experience tuples."""
def __init__(self, buffer_size, batch_size):
"""Initialize a ReplayBuffer object.
Params
======
buffer_size: maximum size of buffer
ba... |
#!/usr/bin/env python
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under th... |
from django.conf import settings
from django.db import models
from django.utils.text import slugify
from django.dispatch import receiver
from django.contrib.auth.models import User
from django.utils import timezone
from django.db.models.signals import pre_save, post_save
from django.core.mail import send_mail
from io i... |
import logging
import pickle
import sympy
import numpy as np
import xarray as xr
from collections import OrderedDict
from espei.utils import database_symbols_to_fit
from itertools import chain
from pycalphad import equilibrium, variables as v
from pycalphad.codegen.callables import build_callables
from pycalphad.core.u... |
# --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>, <NAME>, based on code from <NAME>
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import ... |
import random
import re
import typing as t
from collections import defaultdict
from os import path
from discord import Color, Embed, Guild, Member, Message, TextChannel
from discord.ext.commands import Cog, Context, command
from bot import config
from bot.core.bot import Bot
DIR_PATH = path.dirname(__file__)
# TODO:... |
import logging
from django.conf import settings
from django.core.urlresolvers import reverse
import httplib
import urllib
from eulfedora import models, server
from eulxml.xmlmap.dc import DublinCore
from pidservices.clients import parse_ark
from pidservices.djangowrapper.shortcuts import DjangoPidmanRestClient
from r... |
#######################################################################
# Copyright (C) 2017 <NAME>(<EMAIL>) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
##############################################################... |
#
# Copyright (c) 2020, Neptune Labs Sp. z o.o.
#
# 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 agr... |
from ReadWriteMemory import ReadWriteMemory
from ReadWriteMemory import ReadWriteMemoryError
import pymem
from gooey import Gooey, GooeyParser
import time
from colored import stylize, attr, fg
import logging
import requests
from enum import Enum
class VoteState(Enum):
GAME = 0
DISCUSSION = 1
VOTED = 2
... |
import enum
from typing import List, Dict, Optional, Any, TypeVar, Union, Set # noqa
from typing import cast
from attr import attrs, attrib, Factory
class Placeholder(enum.Enum):
BUILD_STAGE = 'build_stage'
class Instruction(object):
pass
class RoleTraits(enum.Enum):
VPC_NEEDED = 'vpc_needed'
Type ... |
# -*- coding: utf-8 -*-
"""
Produces fake instrument data for testing.
"""
from __future__ import print_function
from __future__ import absolute_import
import functools
import numpy as np
import xarray as xr
import pysat
from pysat.instruments.methods import testing as mm_test
platform = 'pysat'
name = 'testing2D_xa... |
###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... |
import simplejson as json
from flask import Flask, request, Response, redirect, url_for
from flask import render_template
from flaskext.mysql import MySQL
from pymysql.cursors import DictCursor
from forms import SignupForm
app = Flask(__name__,
template_folder="templates",
static_folder="static... |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for
# full license information.
#Parts of this code originates from the Microsoft Azure IoT SDK
#Have:
#Change Device Method and recive confirmation
#List devices and preoperties
#Read current twin... |
from django.contrib.auth.decorators import login_required
from django.db.models.functions import Lower
from django.shortcuts import render
from django.contrib import messages
import random
import re
from .models import Hunt, Team
from .forms import PersonForm, ShibUserForm
import logging
logger = logging.getLogger(__... |
"""Register Adobe Analytics Data Feed files in Athena"""
import os
import time
from io import BytesIO
from gzip import GzipFile
from urllib.parse import urlparse
import boto3
def get_s3_file(s3_uri):
"""Retrieve an S3 file"""
s3_client = boto3.client('s3')
url_object = urlparse(s3_uri)
bucket = url_o... |
import os
import sys
from typing import List
import arrow
import click
from r2k.cli import cli_utils, logger
from r2k.config import config
from r2k.constants import ARTICLE_EBOOK_LIMIT, Parser
from r2k.dates import get_pretty_date_str, now
from r2k.ebook.epub_builder import create_epub
from r2k.ebook.single_article i... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import json
import os
import numpy as np
from datasets.squad_tfrecords import input_fn_builder
from models.xlnet import build_xlnet_for_keras_estimator
from utils import get_run_confi... |
#!/usr/bin/env python
import numpy;
import cmath;
import math;
def prod(arg):
""" returns the product of elements in arg.
arg can be list, tuple, set, and array with numerical values. """
ret = 1;
for i in range(0,len(arg)):
ret = ret * arg[i];
return ret;
def allIndices(dim):
""" Fr... |
# Copyright (c) 2020 Civic Knowledge. This file is licensed under the terms of the
# Revised BSD License, included in this distribution as LICENSE
"""
Task definitions for managing packages, used with invoke
"""
from pathlib import Path
from invoke import Collection, task
from metapack import open_package
from meta... |
# -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2008 <NAME> and the gPodder Team
#
# gPodder 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... |
import traceback
import sys
import depgraph
from common import utils
from common.constants import UNKNOWN_LABEL, VOID, ENUM_ABBREV_CODE
from common.constants import X64_FUN_ARG_REGS, ARM_FUN_ARG_REGS, INT, TTYPES
from common.constants import FUN_ARG, LOC_VAR, ENUM_DW_FORM_exprloc
from elements.ttype import Ttype
from e... |
import numpy as np
import cartopy.crs as ccrs
import cartopy.geodesic as cgeo
def _axes_to_lonlat(ax, coords):
"""(lon, lat) from axes coordinates."""
display = ax.transAxes.transform(coords)
data = ax.transData.inverted().transform(display)
lonlat = ccrs.PlateCarree().transform_point(*data, ax.proj... |
"""Period stats"""
from collections import OrderedDict
import datetime
import numpy as np
import pandas as pd
from pandas.io.sql import read_sql
from pyiem.network import Table as NetworkTable
from pyiem.plot.use_agg import plt
from pyiem.util import get_autoplot_context, get_dbconn
PDICT = OrderedDict([
('av... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from __future__ import absolute_import, division, print_function
import gc # noqa: F401
import os
import timeit
import torch
import numpy as np
from lib.ops import PRIMITIVES
from lib.utils import count_flops, model_init
LUT_FILE = "lut.npy"... |
from typing import List, NamedTuple, Optional, Union
from dagster import check
from dagster.core.definitions import (
AssetMaterialization,
Materialization,
MetadataEntry,
NodeHandle,
)
from dagster.core.definitions.events import AssetKey
from dagster.serdes import whitelist_for_serdes
from .handle im... |
import asyncio
import json
import queue
import traceback
from datetime import date, datetime, timedelta
from multiprocessing import Queue
from typing import Awaitable, Dict, List
import pandas as pd
import pytz
from alpaca_trade_api.rest import REST, URL, TimeFrame
from alpaca_trade_api.stream import Stream
from liua... |
import tensorflow as tf
from tensorflow.python import keras
class Spade(keras.Model):
"""SPatially-Adaptative (DE)normalization (SPADE)
See https://arxiv.org/abs/1903.07291.
"""
def __init__(self,
kernel_depth: int,
semantic_map: tf.Tensor):
"""Initializer.
Args:
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import base64
import binascii
from datetime import datetime
import calendar, time
import hashlib
import hmac
import sys
import getopt
try:
from datetime import timezone
utc = timezone.utc
except:
# python 2 variant
from datetime import timedelta, tzinfo
... |
#
# Copyright (c) 2021, Motion Workshop
# 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 a... |
# -*- coding: utf-8 -*-
"""
python -W ignore -m pytest -v -s -x tests
"""
from __future__ import unicode_literals
from setuptools import find_packages
import logging
import os
import codecs
import sys
from io import open
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
f... |
from tweepy import Stream
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
import json
import sqlite3
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
from unidecode import unidecode
import time
import re
from textblob import TextBlob
#sentiment analyzer
analyzer = Senti... |
# Copyright 2016-present Facebook. All Rights Reserved.
#
# fastannotate: faster annotate implementation using linelog
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""yet another annotate implementation that might be faster (EXP... |
"""Store a model part and simulation results after each solution step with HDF5.
This process:
- stores the initial model part in an .h5 file.
- stores the current model part and historical and non-historical results in
one .h5 file per output step.
This process works with or without MPI.
license: HDF5Applicati... |
#!/usr/bin/env python
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2020 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
"""Thermalblock with GUI demo
Usage:
thermalblock_gui.py [-h] [--product=... |
################################################
################################################
################################################
#########*******###*******####**********########
########**#####**#**#####**###**######**########
########**#####**#**#####**###**######**########
########**#####**#**... |
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2021 <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 without restriction, including without limitation... |
# Copyright (c) 2013 <NAME> (<EMAIL>)
# Released under the MIT License
#
# 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,... |
from math import *
del pi
from .constants import *
from functools import reduce
from time import time
# Functions missing from math.
def nott(n):
"""Negative One To The n, where n is an integer."""
return 1 - 2*(n & 1)
def div_ignore(a, b):
"""Divide a by b, ignoring any divides by zero."""
import ... |
"""
problog.core - Binary Decision Diagrams
----------------------------------------------
Provides core functionality of ProbLog.
..
Part of the ProbLog distribution.
Copyright 2015 <NAME>, DTAI Research Group
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file... |
from datetime import datetime
from functools import reduce
from typing import Optional
import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.python.keras.losses import LossFunctionWrapper
from tensorflow.python.keras.utils import losses_utils
class PolicyWrapper(layers.Layer):
def __init__(... |
import os
import re
import sys
import logging
# Pipeline imports
from avalon import api, io, pipeline
import avalon.fusion
# Config imports
import pype.lib as pype
import pype.fusion.lib as fusion_lib
log = logging.getLogger("Update Slap Comp")
self = sys.modules[__name__]
self._project = None
def _format_version... |
# Copyright (c) 2006-2009 <NAME> http://garnaat.org/
#
# 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, mer... |
"""Low-level tests of the almanac search routines."""
import numpy as np
from skyfield.api import load
from skyfield.searchlib import find_discrete, find_maxima
bump = 1e-5
epsilon = 1e-10
def make_t():
ts = load.timescale()
t0 = ts.tt_jd(0)
t1 = ts.tt_jd(1)
return t0, t1
def make_stairstep_f(steps... |
# !/usr/bin/python
# -*- coding:utf-8 -*-
"""
Created on 09 Nov, 2020
Author : <EMAIL>
"""
import os
import sys
src_path = os.path.abspath("..")
print(src_path)
sys.path.append(src_path)
from src.conf_loader import (
MODEL_DIR, n_epoch, emb_dim, n_layer,
item_max_len, user_max_len,
batch_size, lr, l2_reg,
... |
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Prefix-list-optimizing tree
#
# Tree is a binary tree containing prefixes.
# Each prefix is represented as sequence of the bits.
# All prefixes start with root.
# Zero bit on apropriative position in prefix means
# the pre... |
from collections import defaultdict
from enum import Enum
from typing import NamedTuple, Type, Any, Union, Callable, Mapping, Tuple, get_type_hints, Iterable, Optional, TypeVar
import inflection
from pyrsistent import pmap, pvector
from pyrsistent.typing import PMap, PVector
from typeit.combinator.constructor import _... |
# Copyright (c) 2013 OpenStack Foundation.
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.