text stringlengths 3.07k 22.1k |
|---|
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script can move pages.
These command line parameters can be used to specify which pages to work on:
¶ms;
Furthermore, the following command line parameters are supported:
-from and -to The page to move from and the page to move to.
-noredirect Leave... |
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2001-2017 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permis... |
# encoding: utf-8
import time
import requests
import urllib3
from requests import Request, Response
from requests.exceptions import (InvalidSchema, InvalidURL, MissingSchema,
RequestException)
from httprunner import logger, response
from httprunner.utils import lower_dict_keys, omit_... |
import numpy as np
import tensorflow as tf
from typing import List
from solartf.data.bbox.type import BBoxesTensor
class BBoxLabeler:
def __init__(self, anchor_tensor: BBoxesTensor):
"""
return positive and negative masks along the anchor axis
"""
self.anchor_tensor = anchor_tensor... |
# Copyright 2020 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 agreed to... |
#!/usr/bin/python
#
# Copyright: Ansible Project
# 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',
'status': ['preview'],... |
import os
import re
import sys
import tempfile
import tensorflow as tf
debug_messages = False
def vlog(level):
os.environ['TF_CPP_MIN_VLOG_LEVEL'] = str(level)
# this helper is here in case we later want to capture huge stderr that doesn't fit in RAM
class TemporaryFileHelper:
"""Provides a way to fetch contents... |
import glob
import json
import logging
import os
from collections import OrderedDict
from more_itertools import flatten
from nltk.corpus import wordnet as wn
from ..base import SlotBase, TemplateBase, TemplateCollectionBase
from ..masker import MaskerBase, PoSMasker, RoleMasker, StopWordsMasker, LastObservationMaske... |
"""Intermediate representation of functions."""
from typing import List, Optional, Sequence
from typing_extensions import Final
from mypy.nodes import FuncDef, Block, ArgKind, ARG_POS
from mypyc.common import JsonDict, get_id_from_name, short_id_from_name
from mypyc.ir.ops import (
DeserMaps, BasicBlock, Value, ... |
#!/usr/bin/python
# (c) 2018, NetApp, Inc
# 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',
'status': ['preview'],
... |
import gym
from mujoco_py import MujocoException
from gym.spaces import Dict, Box
import numpy as np
from copy import deepcopy
import logging
def update_obs_space(env, delta):
spaces = env.observation_space.spaces.copy()
for key, shape in delta.items():
spaces[key] = Box(-np.inf, np.inf, shape, np.flo... |
from sympy import symbols, Integer
from sympy import Symbol, nan, simplify
import re
def arith_op (op, s1, s2):
assert isinstance(s1, DimExpr)
s2 = DimExpr(s2)
s1e = s1.exp
s2e = s2.exp
#print (f'arith_op: {op} {s1} {s2}')
if op == 'add':
se = s1e + s2e
elif op == 'mul':
s... |
"""InDel calling using Scalpel
https://sourceforge.net/p/scalpel/code/ci/master/tree/
"""
from __future__ import print_function
import os
import shutil
try:
import vcf
except ImportError:
vcf = None
from bcbio import utils
from bcbio.distributed.transaction import file_transaction
from bcbio.pipeline import... |
import logging
import requests
import json
import os
import jwt
import base64
from collections import namedtuple
from datetime import datetime, timedelta
from enum import Enum
from abc import ABCMeta, abstractmethod
from six import add_metaclass
from urllib.parse import urljoin
from jsonschema import validate, RefRes... |
# Copyright (c) Microsoft Corporation and Fairlearn contributors.
# Licensed under the MIT License.
import numpy as np
import sklearn.metrics as skm
from sklearn.utils import Bunch
from ._extra_metrics import (
true_positive_rate, true_negative_rate,
false_positive_rate, false_negative_rate,
_root_mean_sq... |
#
# 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... |
# Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd.
# 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/LI... |
from __future__ import with_statement, absolute_import
import re
from contextlib import closing
import MySQLdb
import MySQLdb.cursors
re_column_length = re.compile(r'\((\d+)\)')
re_column_precision = re.compile(r'\((\d+),(\d+)\)')
re_key_1 = re.compile(r'CONSTRAINT `(\w+)` FOREIGN KEY \(`(\w+)`\) REFERENCES `(\w+)`... |
#!/usr/bin/env python
# Copyright 2017 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.
"""Updates the Fuchsia SDK to the given revision. Should be used in a 'hooks_os'
entry so that it only runs when .gclient's target_os i... |
import torch
from collections.abc import Mapping
from tqdm import tqdm
import time
from typing import Tuple, Union,Dict,Optional,List
class LayerNode:
def __init__(self,name,parent=None,value=None,fullname=None):
self.name = name
self.fullname = fullname
self.value = None
self.child... |
"""
Volumio Platform.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.volumio/
Volumio rest API: https://volumio.github.io/docs/API/REST_API.html
"""
from datetime import timedelta
import logging
import asyncio
import aiohttp
import voluptu... |
#
# 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... |
#!/usr/bin/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
# "Licens... |
"""Tweet text preprocessing module, processes Line Delimited JSON files.
Reads Line Delimited JSON file and and processes tweet's text. In text it
replaces entities specified in replacements.json.
"""
from __future__ import print_function
import json
import argparse
import sys
from functools import partial
from Mult... |
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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 a... |
from __future__ import absolute_import
import json
from contextlib import contextmanager
import mock
import pytest
from detect_secrets import pre_commit_hook
from detect_secrets import VERSION
from detect_secrets.core.potential_secret import PotentialSecret
from testing.factories import secrets_collection_factory
fr... |
import re
from typing import Any, Callable, List, Tuple, Dict, Set, Union, Optional
from functools import lru_cache
from xml.etree import ElementTree as ET # type: ignore
import xmlschema # type: ignore
from xmlschema.validators import ( # type: ignore
XsdAttribute,
XsdAtomicBuiltin,
XsdAtomicRestriction,... |
from django.utils.translation import gettext_lazy as _
from django.utils import formats, timezone
from django.db import transaction
from django.utils.safestring import mark_safe
from django.core import validators
from django import forms
from froide.foirequest.models import FoiMessage
from froide.publicbody.models imp... |
# Copyright (c) 2015 VMware, 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 b... |
import re
from . import AWSObject, AWSProperty, Join, Tags
from .validators import boolean, integer, positive_integer
MEMORY_VALUES = [x for x in range(128, 3009, 64)]
RESERVED_ENVIRONMENT_VARIABLES = [
'AWS_ACCESS_KEY',
'AWS_ACCESS_KEY_ID',
'AWS_DEFAULT_REGION',
'AWS_EXECUTION_ENV',
'AWS_LAMBDA_FU... |
from batou.utils import call_with_optional_args
from batou.utils import hash, CmdExecutionError
from batou.utils import remove_nodes_without_outgoing_edges, cmd
from batou.utils import resolve, resolve_v6, MultiFile, locked, notify, Address
from batou.utils import revert_graph, topological_sort, flatten, NetLoc
from io... |
__author__="<NAME>"
import json
from lambdo.utils import *
from lambdo.resolve import *
from lambdo.transform import *
import logging
log = logging.getLogger('WORKFLOW')
class Workflow:
"""
The class represents a workflow.
"""
workflowNo = 0
def __init__(self, workflow_json: dict):
s... |
import os
import copy
import time
import line_mesh
import numpy as np
import open3d as o3d
from sklearn.neighbors import KDTree
from timeit import default_timer as timer
import bench_utils
import teaserpp_python
VISUALIZE = True
NOISE_BOUND = 0.05
FRAG1_COLOR = [1, 0.3, 0.05]
FRAG2_COLOR = [0, 0.629, 0.9]
GT_COLOR = ... |
from collections import OrderedDict, namedtuple
from ..language.printer import print_ast
from ..utils.ast_from_value import ast_from_value
from .definition import (GraphQLArgument, GraphQLEnumType, GraphQLEnumValue,
GraphQLField, GraphQLInputObjectType,
GraphQLInterfac... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import unittest
import caffe2.python.hypothesis_test_util as hu
from caffe2.python import core, utils
from caffe2.proto import caffe2_pb2
ROI_CANONIC... |
# -*- coding: utf-8 -*-
import numpy as np
import scipy.io
from sklearn.base import BaseEstimator, RegressorMixin
from sklearn.model_selection import KFold
from joblib import Parallel, delayed
from HSIC import hsic_gam
from mutual_info import mutual_information
class LeastSquaresIndependenceTest(RegressorMixin):
... |
"""Classes of: playing card, card deck, deck holder, hand with cards.
"""
import random
RANKS = ('A', 'K', 'Q', 'J', 'T', '9', '8', '7', '6', '5', '4', '3', '2')
SUITS = ('♠', '♥', '♦', '♣')
CARD_BACK_STRUCT = [
' ____ ',
'|? | ',
'| * | ',
'|__?| '
]
class InvalidCardRankError(Exception):
... |
#!/usr/bin/env python3
import argparse
import os
import os.path
import ctypes
from shutil import rmtree, move
from PIL import Image
import torch
import torchvision.transforms as transforms
import model
import dataloader
import platform
from tqdm import tqdm
# For parsing commandline arguments
parser = argparse.Argumen... |
import crcmod
from selfdrive.car.hyundai.values import CAR, CHECKSUM
hyundai_checksum = crcmod.mkCrcFun(0x11D, initCrc=0xFD, rev=False, xorOut=0xdf)
def create_lkas11(packer, car_fingerprint, bus, apply_steer, steer_req, cnt, enabled, lkas11, hud_alert,
lane_visible, left_lane_depar... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 5 12:35:23 2018
@author: ben
"""
# Script to benchmark performance of the KDE method
# There are two main computational costs
# 1. Convolving kernels with the data.
# This depends upon: the kernel, bandwidth, number of points and the algorithm
# 2... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the
# Pyedra Project (https://github.com/milicolazo/Pyedra/).
# Copyright (c) 2020, <NAME>
# License: MIT
# Full Text: https://github.com/milicolazo/Pyedra/blob/master/LICENSE
# ===================================================================... |
"""Parsers for FASTA and related formats.
"""
import re
from collections.abc import Callable
import cogent3
from cogent3.core.info import Info
from cogent3.core.moltype import ASCII, BYTES
from cogent3.parse.record import RecordError
from cogent3.parse.record_finder import LabeledRecordFinder
from cogent3.util.io im... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import dgl
import dgl.function as fn
import numpy as np
from torch.nn import init
import torch.utils.data as data
from torch.autograd import Variable
import torch.autograd as autograd
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_seque... |
import functools
import types
import warnings
from enum import Enum
from typing import Callable, Iterable, Mapping, Optional, Sequence, Union
from loguru import logger
from flexget import plugin
from flexget.utils.lazy_dict import LazyDict, LazyLookup
from flexget.utils.serialization import Serializer, deserialize, s... |
#!/usr/bin/env python
from __future__ import print_function
from __builtin__ import list as pylist
from sapversion import version
import git
import optparse
import os
import saplib
import subprocess
import sys
def log(message, *args, **kwargs):
print(message % args, file = sys.stderr, **kwargs)
def usage(message,... |
#!/usr/bin/env python
'''
Generates constants necessary for using switch on strings
'''
# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'''
C code for switch-statement:
// djb2 by <NAME>... |
from .dot import make_dot, make_dot_blitz
import graphviz
import torch
from torch import nn, Tensor
from typing import List, Dict, Any, Set, Type, Union, Tuple, Optional
from copy import deepcopy
import logging
import os
from glob import glob
import shutil
import subprocess
import matplotlib.pyplot as plt
# add modu... |
import torch
import torch.nn as nn
EPS = 1e-4
class InceptionV3(nn.Module):
def __init__(self, in_channels, num_classes=1, logit=False, multilabel=False):
super().__init__()
self.in_channels = in_channels
self.num_classes = num_classes
self.logit = logit
self.multilabel = ... |
# Copyright (c) 2021 PPViT Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
#!/usr/bin/env python3
"""
Read BAM files to extract all splice junctions
Takes manifest of BAM false
Outputs bed files with
"""
import os
import pysam
from multiprocessing import Pool
import numpy as np
class BamToJuncBed:
def __init__(self,args):
self.args = args
... |
#!/usr/bin/env python
#
# Copyright (c) 2015 - 2021, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, thi... |
import inspect
import typing
import discord
from .error import IncorrectFormat, IncorrectGuildIDType
from .model import CogBaseCommandObject, CogComponentCallbackObject, CogSubcommandObject
from .utils import manage_commands
from .utils.manage_components import get_components_ids, get_messages_ids
def cog_slash(
... |
#!/usr/bin/env python
import os
import sys
import csv
import json
import tqdm
import numpy as np
import pandas as pd
from osgeo import osr
from osgeo import gdal
gdal.SetConfigOption('GDAL_PAM_ENABLED', 'NO')
names = [
'01_rio',
'02_vegas',
'03_paris',
'04_shanghai',
'05_khartoum',
'06_atlant... |
import sys
import os
import re
import argparse
import pyexcel
import numpy
from datetime import date, datetime
import pyexcel
import logging
import re
import demjson
import json
import copy
import LocationRange as lr
import LocationParser as lp
logging.basicConfig(format='%(name)s - %(levelname)s - %(message)s', level... |
# ----------------------------------------------------------------------------
# Copyright (c) 2017-2018, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
import webbrowser
import logging
import requests
from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.parse import parse_qs, urlparse
from socket import socket
from requests_auth.errors import *
logger = logging.getLogger(__name__)
class OAuth2ResponseHandler(BaseHTTPRequestHandler):
def do_GE... |
# 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, ... |
# -*- coding: utf-8 -*-
from django.db import models
from django.core.validators import RegexValidator, MinValueValidator
from django.template.defaultfilters import date
from decimal import Decimal
import os
import re
from djangosige.configs.settings import MEDIA_ROOT, APP_ROOT
IND_PAG_ESCOLHAS = (
(u'0', u'Pa... |
# Copyright (c) 2015 Hewlett-Packard Co.
# 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 r... |
# encoding: utf-8
"""
codec.py
Created by <NAME> on 2012-02-08.
Copyright (c) 2011-2013 Exa Networks. All rights reserved.
"""
import struct
import convert
from definition import DNSRequestType, DNSResponseType
from dnstype import DNSTypeCodec
class DNSHeader:
def __init__(self, packet_s):
self.identifier = con... |
import torch
import math
import time
import multiprocessing
from algorithms.utils import to_device
import numpy as np
from algorithms.utils import Memory
# Reference: https://github.com/pythonlessons/Reinforcement_Learning/blob/master/BipedalWalker-v3_PPO/BipedalWalker-v3_PPO.py
# Reference: https://slm-lab.gitbook.io... |
import re
import sys
import langid
from urllib.error import HTTPError
try:
from ipdb import set_trace
except ImportError:
from pdb import set_trace
from flashtext import KeywordProcessor
import carmen
from falconet.tokenizer import tokenize_raw_text
import falconet
from falconet import settings
from falconet.c... |
"""
IMPORTING LIBS
"""
import dgl
import numpy as np
import os
import socket
import time
import random
import glob
import argparse, json
import pickle
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import DataLoader
from tensorboardX import ... |
# nmigen: UnusedElaboratable=no
import unittest
from nmigen import *
from nmigen.back.pysim import *
from nmigen_soc.memory import MemoryMap
from .utils.wishbone import *
from ..periph.base import Peripheral, CSRBank, PeripheralBridge
def simulation_test(dut, process):
sim = Simulator(dut)
sim.add_clock(1e... |
"""
utils.py
Utilities
Copyright (C) 2016 <NAME>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... |
from flask import Flask, render_template, request, session, url_for, send_from_directory, send_file
from flask_session import Session
from flask_navigation import Navigation
import os
import cv2
import json
import shutil
from werkzeug.utils import secure_filename
from PIL import Image # Python Image Library - Image Pr... |
import copy
import platform
import os
from conans.tools import environment_append, args_to_string, cpu_count, cross_building, detected_architecture
sun_cc_libcxx_flags_dict = {"libCstd": "-library=Cstd",
"libstdcxx": "-library=stdcxx4",
"libstlport": "-library=s... |
from textwrap import dedent, indent
from ast import literal_eval
from os.path import commonprefix
import re
from typing import Optional
from uuid import UUID
from ruamel.yaml import YAML
from ruamel.yaml.comments import CommentedMap
from jinja2 import Template
from auto_class import intermediate_representation as ir
... |
import torch
import torch.nn as nn
# import torch.nn.functional as F
# import numpy as np
from utils import TINY_NUMBER, HUGE_NUMBER
from collections import OrderedDict
from nerf_network import Embedder, MLPNet
import os
import logging
logger = logging.getLogger(__package__)
##########################################... |
"""
The expressions module contains classes to represent an expression. The main
class is ExpressionNode. ExpressionNode's most useful method is py_string(),
which returns a Python string representing that expression.
"""
import warnings
import keyword
from ctypesgen.ctypedescs import (
CtypesPointer,
CtypesS... |
# Copyright (C) 2009-2014 <NAME>
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provided
# that existi... |
#!/usr/bin/env python
'''CREMA beats and downbeats'''
import argparse
import os
import sys
from glob import glob
import six
import pickle
import pandas as pd
import keras as K
from sklearn.model_selection import ShuffleSplit
import pescador
import librosa
import crema.utils
from jams.util import smkdirs
OUTPUT_PAT... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
filament_watch.py
Cancel the print on OctoPrint if the filament is not feeding (e.g. due to
jam, out of filament, etc.)
"""
##############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) 2015 <NAME> <<EMAIL>... |
#from halo_handler import *
from calc_cluster_props import *
#from data_handler import *
from functions import *
import h5py as hdf
import numpy as np
import multiprocessing
from os import environ
import time
import myglobals
def make_work(truth, halo, inds):
#for i in range(len(inds)):
for i in range(25):
... |
# coding=utf-8
# Copyright 2019 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
"""Functionality for converting a standard Galaxy workflow into a format 2 workflow."""
from collections import OrderedDict
import json
from ._yaml import ordered_dump
def _copy_common_properties(from_native_step, to_format2_step):
annotation = from_native_step.get("annotation", "")
if annotation:
t... |
from argparse import ArgumentParser
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import pytorch_lightning as pl
from typing import Tuple, Dict
class Generator(nn.Module):
"""
DCGAN Generator. Takes an noise vector of size z_dim and outputs
an image... |
#!/usr/bin/env python3
######
#
# Program name: dupReport.py
# Purpose: Print summary reports from Duplicati backup service
# Author: <NAME> for <NAME>
# Copyright: 2017, release under MIT license. See LICENSE file for details
#
#####
# Import system modules
import time
import sys
import os
# Import d... |
import numpy as np
import pickle
import pandas as pd
import os
from scipy.spatial.distance import pdist
import datetime
from geopandas import GeoDataFrame
from shapely.geometry import MultiPoint
from scipy.misc import imread
feature_list = ['area', 'convex_area', 'eccentricity',
'intense_area', 'conve... |
from collections import namedtuple
import numpy as np
from cloudnetpy import utils
class Fmcw94Bin:
"""RPG Cloud Radar Level 1 data reader."""
def __init__(self, filename):
self.filename = filename
self._file_position = 0
self.header = self.read_rpg_header()
self.data = self.re... |
import asyncio
import socket
import time
import weakref
from collections import OrderedDict
from collections.abc import Mapping
from inspect import isawaitable
from keyword import iskeyword
import aiohttp.abc
from colorlog import ColoredFormatter
from .compat import get_running_loop, all_tasks
def timestamp():
... |
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
"""
Basic high-level plugin file for pytest.
See [Writing plugins](https://docs.pytest.org/en/latest/writing_plugins.html)
for more information.
This plugin adds the following command-line options:
* `--test_conf` - Path to test conf... |
import logging
import ray
from ray.rllib.agents.ddpg.ddpg_tf_policy import build_ddpg_models, \
get_distribution_inputs_and_class, validate_spaces
from ray.rllib.agents.dqn.dqn_tf_policy import postprocess_nstep_and_prio, \
PRIO_WEIGHTS
from ray.rllib.models.torch.torch_action_dist import TorchDeterministic, \... |
# Copyright 2019 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
# -*- coding: utf-8 -*-
"""
Define sample class
Revision history:
----------------
2019-08-17: Amromics created
"""
from __future__ import division, print_function, absolute_import
import gzip
import bz2
from collections import defaultdict
complement_dict = defaultdict(lambda: 'N')
complement_dict['A'] = 'T'
c... |
import csv
import os
import copy
import random
import tensorflow as tf
import tensorflow_hub as hub
import tensorflow_addons as tfa
import tensorflow_text as text
from tqdm import tqdm
datasets = [filename for filename in os.listdir(".") if filename.endswith(".csv")]
dataset_file_to_lang = {
"multilingual_fairn... |
# (C) Copyright 2010-2020 Enthought, Inc., Austin, TX
# All rights reserved.
import numpy as np
from functools import partial
from traits.api import (
Enum,
provides,
HasStrictTraits
)
from force_bdss.mco.parameters.mco_parameters import (
RangedMCOParameter,
RangedVectorMCOParameter
)
from for... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# IceCream - Never use print() to debug again
#
# <NAME>
# grunseid.com
# <EMAIL>
#
# License: MIT
#
from __future__ import print_function
import ast
import inspect
import pprint
import sys
from datetime import datetime
from contextlib import contextmanager
from os.pat... |
'''
Algorithms to simplify domain relationships in conditional expressions.
- simplify_flat_and
'''
import collections
from .expressions import And, Not, Le, Lt, Ge, Gt, Eq, In
# Placeholder expression object, never returned as part of an expression.
NotIn = collections.namedtuple('NotIn', ['attribute', 'values... |
from collections import Counter
from csv import DictReader
import csv
from os import path
import os
import logging
from urllib.request import urlretrieve
from urllib.request import urlopen
import codecs
from datetime import datetime
import dateutil.parser as dateparser
#DataReader edits (FYI for Walt):
# -Renamed D... |
# -*- encoding: utf-8 -*-
#
# 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, so... |
# Copyright 2015, 2016 OpenMarket Ltd
# Copyright 2018 New Vector 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... |
# upip - Package manager for MicroPython
# SPDX-FileCopyrightText: Copyright (c) 2015-2018 <NAME>
# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
#
# SPDX-License-Identifier: MIT
import sys
import gc
import uos as os
import uerrno... |
import os, sys
from rdkit import Chem
from rdkit.Chem import AllChem, TorsionFingerprints
from rdkit.ML.Cluster import Butina
from rdkit.Chem import PandasTools
import pandas as pd
from tqdm import tqdm
def gen_conformers(mol, numConfs=1):
"""Generate conformation with local minimization"""
### generate conf... |
#!/usr/bin/env python3
"""
Programmer: <NAME>
Last Edited: 11/3/2018
Project: Automated Self-Serving System
Purpose: This script defines the MainApp class that runs everything.
"""
#Standard library imports
import tkinter as tk
import os
import time
import datetime
from threading import Timer
from cryptography.fernet ... |
# -*- coding: utf-8 -*-
from keras.callbacks import EarlyStopping, ModelCheckpoint, ReduceLROnPlateau, CSVLogger
from keras.layers.normalization import BatchNormalization
from keras.layers.convolutional import MaxPooling2D
from keras.layers.convolutional import AveragePooling2D
from keras.layers.convolutional import Co... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import warnings
import app_manage
from cms.exceptions import DontUsePageAttributeWarning
gettext = lambda s: s
warnings.filterwarnings('ignore', category=DontUsePageAttributeWarning)
def install_auth_user_model(settings, value):
if value is Non... |
# Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
# -*- coding: utf-8 -*-
"""Generic tests that all raw classes should run."""
# # Authors: MNE Developers
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
from os import path as op
import math
import pytest
import numpy as np
from numpy.testing import (assert_allclose, assert_array_almost_equal,
... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from dgl.nn.pytorch.conv import GraphConv
from dgl.nn.pytorch.glob import SortPooling
from . import register_model
from .base import BaseAutoModel
from ....utils import get_logger
LOGGER = get_logger("TopkModel")
def set_default(args, d):
for k, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.