text stringlengths 3.07k 22.1k |
|---|
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2020 ifm electronic gmbh
#
# THE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.
#
"""
This module contains implementations for abstract classes InputPort and OutputPort
"""
import logging
from PySide2.QtCore import QThread, QSemaphore, Signal, QObject, ... |
#!/usr/bin/env python
"""
Gather and consolidate the up-to-date dependencies available and required to install certbot
on various Linux distributions. It generates a requirements file contained the pinned and hashed
versions, ready to be used by pip to install the certbot dependencies.
This script is typically used to... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import sy... |
"""
Created on Tue Jan 30 12:27:39 2018
@author: Emerson
`Recording` class to hold recs as a np.array with built-in methods for plotting
and test-pulse fitting. Implements a factory class `ABFLoader` for loading recordings in
Axon binary format (.abf).
Compatible with python 2 and 3 as of Feb. 5, 2018.
"""
# IMPORT... |
# 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 sys
import operator
import re, string
import csv
import math
import numpy as np
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import chi2
from sklearn.feature_selection import f_regression
from kmodes.kmodes import KModes
from kmodes.kprototypes import KPrototypes
from sklearn... |
# Copyright (c) 2016 MaxPoint Interactive, 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 conditi... |
#!/usr/bin/env python3
# encoding: utf-8
import argparse
import datetime
import itertools
import os
import shutil
import subprocess
import time
from multiprocessing import Pool
import pandas as pd
from rmgpy.molecule.molecule import Molecule
from rmgpy.chemkin import load_species_dictionary
from easy_rmg_model.commo... |
"""This module contains support functions for AOVs."""
# =============================================================================
# IMPORTS
# =============================================================================
# Standard Library
import os
import pickle
from typing import List
# Third Party
from PySide... |
"""
Test the func_inspect module.
"""
# Author: <NAME> <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 <NAME>
# License: BSD Style, 3 clauses.
import functools
from joblib.func_inspect import filter_args, get_func_name, get_func_code
from joblib.func_inspect import _clean_win_chars, format_signature
... |
# Copyright 2021, A10 Networks
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
"""
Based on the OpenFlow tutorial switch
"""
import collections
from pox.core import core
import pox.openflow.libopenflow_01 as of
import pox.lib.packet as pkt
import time
import threading
import datetime
import json
import math
import numpy as np
# Anomaly controller parameters
ac_limit_pps = 20 * 1000 # 20 kpps
... |
"""This module contains the general information for EtherNiErrStats ManagedObject."""
import sys, os
from ...ucsmo import ManagedObject
from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class EtherNiErrStatsConsts():
SUSPECT_FALSE = "false"
SUSPECT_NO = "no"
... |
import argparse
import enum
import os
import shlex
import sys
import lit.reports
import lit.util
class TestOrder(enum.Enum):
EARLY_TESTS_THEN_BY_NAME = enum.auto()
FAILING_FIRST = enum.auto()
RANDOM = enum.auto()
def parse_args():
parser = argparse.ArgumentParser(prog='lit')
parser.add_argument... |
import json
from datetime import datetime, date
from backend import db, logger
from backend import app
from operator import itemgetter
API_HOST = app.config["API_HOST"]
class CustomEncoder(json.JSONEncoder):
"""
Define encoding rules for fields that are not readily serializable.
"""
def default(self... |
from methods import *
import numpy as np
import matplotlib.pyplot as plt
import math
def values(x0, xf, N):
"""
Renvoie un tableau de valeurs uniformément réparties entre x0 et xf
"""
h = ( xf - x0 ) / ( N-1 )
res = np.zeros(N)
for i in range(N):
res[i] = x0 + h * i
return res
... |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... |
'''
Usage: CIRCexplorer2 annotate [options] -r REF -g GENOME -b JUNC [-o OUT]
Options:
-h --help Show help message.
--version Show version.
-r REF --ref=REF Gene annotation.
-g GENOME --genome=GENOME Genome FASTA file.
-b JUNC --bed=JUNC ... |
import json
import logging
import urllib.parse
from json.decoder import JSONDecodeError
from typing import Any, Dict, List, Optional, Type
from avro.schema import RecordSchema
from requests.adapters import Response
from requests.models import HTTPError
from datahub.configuration.common import ConfigModel, Operational... |
"""Component for interacting with a Lutron Caseta system."""
import asyncio
import logging
import ssl
from aiolip import LIP
from aiolip.data import LIPMode
from aiolip.protocol import LIP_BUTTON_PRESS
import async_timeout
from pylutron_caseta.smartbridge import Smartbridge
import voluptuous as vol
from homeassistant... |
# 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 torch
import functools
import cv2
import math
import numpy as np
import imageio
from glob import glob
import os
import copy
import shut... |
"""
.. module: security_monkey.scheduler
:platform: Unix
:synopsis: Runs watchers, auditors, or reports on demand or on a schedule
.. version:: $$VERSION$$
.. moduleauthor:: <NAME> <<EMAIL>> @monkeysecurity
"""
from apscheduler.threadpool import ThreadPool
from apscheduler import events
from apscheduler.sche... |
# Copyright (c) 2020, Qihoo, 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 ... |
# -*- coding: utf-8 -*-
import datetime
from functools import reduce
from django.db import models
from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from cms.models.fields import PageField
from cms.models.fields import PlaceholderField
from adminsortable.models i... |
# -*- coding: utf-8 -*-
# Copyright © 2018 <NAME> <<EMAIL>>
#
# 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 notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ... |
# Copyright 2009-2016 <NAME>
# License: BSD (see file COPYING for details)
"""
A collection of tools around :doc:`multi-table inheritance </dev/mti>`.
"""
from builtins import str
import logging
logger = logging.getLogger(__name__)
from django.db import models
from django.db import router
# from django.db.models.d... |
import os
from asyncio import sleep
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon.tl.functions.messages import ExportChatInviteRequest
from telethon.tl.types import ChannelParticipantsKicked
from userbot import ALIVE_NAME, CMD_HELP, bot
from userbot.events impo... |
"""Testing for Spectral Clustering methods"""
import re
import numpy as np
from scipy import sparse
import pytest
import pickle
from sklearn.utils import check_random_state
from sklearn.utils._testing import assert_array_equal
from sklearn.cluster import SpectralClustering, spectral_clustering
from sklearn.cluster... |
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
import pgl
from layers import *
class GeomMPNN_2D(nn.Layer):
def __init__(self, node_in_dim, edge_in_dim, rbf_dim, hidden_dim, max_dist, \
num_conv, num_pool, dropout, dropout_pool, activation=F.relu):
super(GeomMP... |
# global
import torch
import math
from numbers import Number
from typing import Union, Optional, Tuple, List
import ivy
def roll(
x: torch.Tensor,
shift: Union[int, Tuple[int, ...]],
axis: Optional[Union[int, Tuple[int, ...]]] = None,
out: Optional[torch.Tensor] = None,
) -> torch.Tensor:
# manu... |
# -*- coding: utf-8 -*-
"""
Authors: <NAME> and <NAME>
UNESCO-IHE 2016
Contact: <EMAIL>
<EMAIL>
Repository: https://github.com/wateraccounting/watools
Module: Collect/SSEBop
Restrictions:
The data and this python file may not be distributed to others without
permission of the WA+ team due data restri... |
'''
Generate slurm job submission scripts - one per condition
'''
import argparse, os, sys, errno, subprocess, csv
from pyvarco import CombinationCollector
seed_offset = 100000
default_num_replicates = 30
job_time_request = "16:00:00"
job_memory_request = "4G"
job_account = "devolab"
job_name = "11-16"
cpus_per_node=... |
#!/usr/bin/env python3
#Authors: <NAME>, <NAME>
import numpy as np
import argparse
import os
import isce
import isceobj
import copy
import datetime
from isceobj.Sensor.TOPS import createTOPSSwathSLCProduct
from isceobj.Util.ImageUtil import ImageLib as IML
import s1a_isce_utils as ut
import logging
catalog = ut.cata... |
from __future__ import print_function, division
import os
import cv2
import csv
import torch
from skimage import io, transform
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchv... |
# Copyright 2019 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... |
"""Utilities for fast persistence of big data, with optional compression."""
# Author: <NAME> <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 <NAME>
# License: BSD Style, 3 clauses.
import pickle
import io
import sys
import warnings
import contextlib
from .compressor import _ZFILE_PREFIX
from .compre... |
import asyncio
import os
from pathlib import Path
import tempfile
import uuid
from async_generator import (
asynccontextmanager,
)
import pytest
from eth_utils import (
decode_hex,
to_canonical_address,
to_wei,
)
from eth_keys import keys
from eth import constants as eth_constants
from eth.chains.bas... |
#!/usr/bin/python3
# Build Markov models of text and generate text from Markov models
# Copyright (c) 2013, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions... |
'''
Created on Jul 1, 2015
Recipe: B04829_03_8
@author: Burkhard
'''
#======================
# imports
#======================
import tkinter as tk
from tkinter import ttk
from tkinter import scrolledtext
from tkinter import Menu
from tkinter import Spinbox
class ToolTip(object):
def __init__(sel... |
import logging
import os
import re
from datetime import datetime
from pathlib import Path
import pdfplumber
from bs4 import BeautifulSoup
from .. import utils
from ..cache import Cache
__authors__ = ["chriszs"]
__tags__ = ["html", "pdf"]
logger = logging.getLogger(__name__)
def scrape(
data_dir: Path = utils.... |
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
# Copyright 2020 A10 Networks
# 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 ... |
from __future__ import absolute_import, division, print_function
import logging
import click
from tornado.ioloop import IOLoop, TimeoutError
from distributed.cli.utils import check_python_3, install_signal_handlers
from distributed.preloading import validate_preload_argv
from distributed.security import Security
fr... |
# -*- coding: utf-8 -*-
#############################################################################
# @package ad_hmi
# @brief CAN proxy of python package ad_hmi.
#############################################################################
# @author <NAME>
# @copyright (c) All rights reserved.
######################... |
import os
from tempfile import mkdtemp, NamedTemporaryFile
import pytest
from numpy.testing import assert_array_equal, assert_array_almost_equal
import pandas as pd
import oddt
from oddt.utils import method_caller
from oddt.spatial import rmsd
from oddt.scoring import scorer
from oddt.scoring.functions import rfscor... |
from searx import settings, autocomplete
from searx.languages import language_codes as languages
from searx.url_utils import urlencode
COOKIE_MAX_AGE = 60 * 60 * 24 * 365 * 5 # 5 years
LANGUAGE_CODES = [l[0] for l in languages]
LANGUAGE_CODES.append('all')
DISABLED = 0
ENABLED = 1
class MissingArgumentException(Ex... |
from tkinter import ttk
try:
import tkinter as tk
except ImportError:
import Tkinter as tk
import tkinter.filedialog
import sys
import json
import queue
import threading
import subprocess
import shutil
import glob
import os
from pprint import pprint
class Application(tk.Frame):
paths = []
thread_lock... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
# -*- coding: utf-8 -*-
"""
:Module: khorosjx.places.spaces
:Synopsis: Collection of core places functions that are specific to spaces
:Usage: ``import khorosjx.places.spaces``
:Example: ``space_info = khorosjx.places.spaces.get_space_info(browse_id)``
:Created By: <NAME... |
"""
Utilities for developers.
1. Zip and release datasets to github.
2. Bump package versions.
3. Build packages and apps.
4. Control logger handlers.
Author: <NAME>
Date: 01/30/2020
License: GNU v3
"""
import tarfile
import os
from loguru import logger
import sys
import subprocess
import pathlib
import shutil
import... |
'''
Plot map data in different projections supported by PROJ.4
Call with:
> python plot.py plotdefs outdir [plotname, [plotname, [plotname, ...]]]
The output dir is optional. Uses current dir if not set.
Inputs:
------
plotdefs: A JSON file with setup for each auto-generated plot.
outdir: Dir... |
"""Isekai Quartet S2 script"""
__author__ = 'Vardë'
import sys
import os
import shlex
import subprocess
from typing import NamedTuple, Optional
from pathlib import Path
from acsuite import eztrim
import debandshit as dbs
import vardefunc as vdf
import mvsfunc as mvf
from vsutil import depth, get_w
import lvsfunc as ... |
# Copyright (c) 2014-2015, Heliosphere Research LLC
# 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 c... |
import logging
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)
LOGGER = logging.getLogger(__name__)
import asyncio
import os
import time
import re
import json
import subprocess
import math
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboard... |
# SPDX-License-Identifier: Apache-2.0
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
import re
from typing import List, Text, Sequence, Any, Union
import numpy as np # type: ignore
import onnx
import on... |
# Copyright (c) The Johns Hopkins University/Applied Physics Laboratory
# 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/licen... |
import os
import sys
import json
import re
import click
from tabulate import tabulate
from sonic_py_common import multi_asic
from utilities_common.constants import DEFAULT_NAMESPACE
from swsscommon.swsscommon import ConfigDBConnector
from dump.match_infra import RedisSource, JsonSource, ConnectionPool
from dump import ... |
import sys
import os
import pickle
import shutil
import subprocess
import urllib.parse
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtCore import QSize
from PyQt5.QtWidgets import (
QMainWindow,
QWidget,
QLabel,
QLineEdit,
QInputDialog,
QFileDialog,
QPushButton,
QMessageBox
)
... |
import os
from pathlib import Path
import logging
from bson.objectid import ObjectId
import pyblish.api
from openpype import lib
from openpype.lib import register_event_callback
from openpype.pipeline import (
legacy_io,
register_loader_plugin_path,
register_creator_plugin_path,
deregister_loader_plug... |
#
# Copyright (c) 2019, 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 ... |
"""
画K线文件,反应策略买入卖出节点。
"""
import os
import sys
import time
import threading
from multiprocessing import Pool, RLock, freeze_support
import numpy as np
import pandas as pd
from tqdm import tqdm
from rich import print as print
import CeLue # 个人策略文件,不分享
import func_TDX
import user_config as ucfg
from pyecharts.charts im... |
from pprint import pprint, pformat
import jupyter_kernel_mgmt as jkm
import asyncio
import aionotify
import aiohttp
from aiohttp import web
import re
from itertools import zip_longest
async def aseq(*futs):
for fut in futs:
await fut
class dotdict(dict):
__getattr__ = dict.get
__setattr__ = di... |
import unittest # pylint: disable=cyclic-import
import numpy as np
from scipy.stats import skewnorm
from girth.ability_methods import _ability_eap_abstract
from girth import (ability_eap, ability_map,
ability_mle)
from girth import create_synthetic_irt_dichotomous
from girth.utils import INVALID_... |
#!/usr/bin/env python2
import re
import tokenizer
def joinLine(columns):
return "\t".join(columns)
def clumpFractions(s):
"""
Replaces the whitespace between the integer and fractional part of a quantity
with a dollar sign, so it's interpreted as a single token. The rest of the
string is left a... |
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import os, json
import games
import time
import utils.miscellaneous
from models.mlp import MLP
from models.echo_state_network import EchoState
from models.random import Random
from models.learned_dqn import LearnedDQN
from mode... |
import ctypes
import ctypes.util
import os
########################################################
# constants from linux/gpio.h
########################################################
GPIOHANDLES_MAX = 64
GPIOHANDLE_REQUEST_INPUT = 1 << 0
GPIOHANDLE_REQUEST_OUTPUT = 1 << 1
GPIOHANDLE_REQUEST_ACTIVE_LOW = 1 << 2... |
"""
CEASIOMpy: Conceptual Aircraft Design Software
Developed by CFS ENGINEERING, 1015 Lausanne, Switzerland
Calculate skin friction drag coefficent
Python version: >=3.6
| Author: <NAME>
| Creation: 2019-06-13
| Last modifiction: 2020-03-31
TODO:
* update __specs__ file
* Redo test functions
* (Check ... |
r"""
<NAME>
08-07-18
Analysis of looping probabilities for Sarah's heterogenous chain:
. . . 35, 23, 15, 26, 30, 245, nucleation site, 47, 21, 18, 15, 20, 17, 35 . . .
"""
import numpy as np
from matplotlib import pyplot as plt
from MultiPoint import propagator
from nuc_chain import fluctuations as wlc
from nuc_chain... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This module contains functions for causal discovery from a pair of symbolic sequences
using compression-complexity measures such as ETC and LZ complexity.
Three functions are exposed for application on array.array data types:
ETC_causality: Computes estimates from... |
import re
import sublime
import sublime_plugin
from .cite_completion import CitePlugin
def getRegion(a, b):
return sublime.Region(a, b)
class CompleteWithPanelCommand(sublime_plugin.TextCommand):
'''
Implements the quick panel for auto-triggered completions and the
logic to insert brackets as neces... |
#!/usr/bin/env python3
#
# Copyright 2021 Red Hat, 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
... |
##
#######################################################################################################################
#
# Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associ... |
"""
Visualize output of first 3 layers of intra_comp forks, for testing
"""
from frame_2D_alg.comp_pixel_versions import comp_pixel_m
from frame_2D_alg.intra_comp_ma import *
import cv2
import argparse
import numpy as np
# -----------------------------------------------------------------------------
# Input:
IMAGE_P... |
import sys
import subprocess
import platform
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("path", type=str)
args = parser.parse_args()
sys.path.append(args.path)
import ctff_functions
target_os = "Ubuntu-18.04"
if target_os not in platform.platform():
print("This script is onl... |
# -*- coding: UTF-8 -*-
import requests
import os
import bs4
import sys
import werobot
import re
import datetime
import MySQLdb
import random
from PIL import Image
robot = werobot.WeRoBot(token='<PASSWORD>')
headers = {
'Referer': '',
'Host': '172.16.17.32',
'Content-Type': 'application/x-www-form-urlencod... |
import json
import numpy as np
import pandas as pd
from string import punctuation
from collections import Counter
from bs4 import BeautifulSoup
import os
import requests
import re
def process_politician_db():
member_info = pd.read_csv('tweet_data/parliamentarians/full_member_info.csv', encoding='utf-16',
... |
"""Generate plots for the annotations of the blame verifier."""
import abc
import logging
import typing as tp
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
import numpy as np
import numpy.typing as npt
import pandas as pd
from matplotlib import style
from sklearn import preprocessing
from varats.d... |
import binascii
import base64
class UnexpectedDER(Exception):
pass
def encode_constructed(tag, value):
return chr(0xa0+tag) + encode_length(len(value)) + value
def encode_integer(r):
assert r >= 0 # can't support negative numbers yet
h = "%x" % r
if len(h)%2:
h = "0" + h
s = binascii.u... |
from google.appengine.api import memcache
from google.appengine.api import search
from google.appengine.ext import deferred
from google.appengine.ext import ndb
from protorpc import messages
from protorpc import remote
from protorpc.wsgi import service
from . import users
import bs4
import html2text
import logging
impo... |
import os
import cv2
import collections
import numpy as np
from skimage import color, img_as_float
mask_map = [('left_lung', 1), ('right_lung', 2)]
def fill_hole(mask):
# print('mask in fill hole {}'.format(mask[:-1]))
h, w = mask.shape[:2]
mask_ret = np.zeros((h + 2, w + 2), np.uint8)
mask_ret[1:-1... |
# -*- coding: utf-8 -*-
# Copyright 2017 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 ... |
#!/usr/bin/env python
# Copyright (c) 2009, <NAME>'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Print detailed information about a process.
Author: <NAME>' <<EMAIL>>
$ python scripts/procinfo.py
pid 4600
name chrom... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import base64
import ldap
import struct
import sys
from .exceptions import *
VERSION = (1, 0, 0)
__version__ = VERSION
__versionstr__ = '.'.join(map(str, VERSION))
LDAP_PUBKEY_CLASS = 'ldapPublicKey'
LDAP_PUBKEY_ATTR = 'sshPublicKey'
B... |
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
import numpy
import torch
import pyro
import pyro.distributions as dist
from pyro.ops.tensor_utils import safe_log
# this 8 x 10 tensor encodes the coefficients of 8 10-dimensional polynomials
# that are used to construct the num_q... |
#!/usr/bin/env python
# coding: utf-8
# In[56]:
import pandas as pd
import numpy as np
from alphacast import Alphacast
from dotenv import dotenv_values
API_KEY = dotenv_values(".env").get("API_KEY")
alphacast = Alphacast(API_KEY)
# In[57]:
# In[171]:
def fix_date(df):
df["Date"] = df.index
df["yea... |
#!/usr/bin/python3
#
# Copyright (c) 2012 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modif... |
import smart_imports
smart_imports.all()
class BaseEffect(object):
__slots__ = ()
def __init__(self):
pass
def apply_positive(self, actor_type, actor_name, place, person, positive_heroes, negative_heroes, job_power):
raise NotImplementedError()
def apply_negative(self, actor_type,... |
# botv1.py
import os
import random
import time
import discord
from dotenv import load_dotenv
from discord.ext import commands
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = os.getenv('DISCORD_GUILD')
bot = commands.Bot(command_prefix='!')
# A complete class definition code follows:
bot_fav... |
"""
Firefox-Infra-Changelog: tool which build a
changelog of commits happening on git or hg that
could affect Firefox CI Infra
"""
import logging
from datetime import datetime
import click
import json
import subprocess
import signal
from fic_modules.FICExceptions import FICExceptions
from github import GithubException
... |
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.functional as F
import time
import random
import matplotlib.pyplot as plt
import seaborn as sns
import Levenshtein
from tqdm import tqdm
from torch.utils import data
from torch.autograd import Variable
from torch.nn.utils.rnn impo... |
#@title 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 writing, software
# distributed under... |
import os
from pathlib import Path
from typing import List
import h5py
import numpy as np
from logzero import logger
import trcdproc.compute.absorp as abcomp
import trcdproc.compute.raw as rawcomp
import trcdproc.filter.raw as rawfilter
import trcdproc.reorganize.raw as reorgraw
from trcdproc.core import Group, H5Fil... |
import datetime
import requests
from bs4 import BeautifulSoup
from django.shortcuts import render, reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.db.models import Subquery, Count, Prefetch, Q
from django.contrib.postgres.aggregates import ArrayAgg
from rest_framework import mixins, view... |
# coding: utf-8
from __future__ import unicode_literals
import itertools
from .amp import AMPIE
from ..compat import (
compat_HTTPError,
compat_urlparse,
)
from ..utils import (
ExtractorError,
clean_html,
int_or_none,
sanitized_Request,
urlencode_postdata
)
class DramaFeverBaseIE(AMPIE)... |
from __future__ import unicode_literals
import glob
import json
import os
import re
import sys
import time
import traceback
from builtins import open
from time import sleep
from datetime import datetime
import dateutil.parser
from tqdm import tqdm
from . import secret
from .browser import Browser
from .exceptions im... |
# 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... |
'''
notifier
'''
import re
import sys
import uuid
import urllib
import smtplib
import datetime
import traceback
import time
from pandaserver.config import panda_config
from pandaserver.taskbuffer.OraDBProxy import DBProxy
from pandacommon.pandalogger.PandaLogger import PandaLogger
from pandaserver.dataservice.DDM im... |
import time
import sys
import os
import subprocess
import shlex
from tkinter import *
import tkinter.font as font
import psutil
import clr
import win32api
import threading
import elevate
# elevate.elevate(show_console=True)
#List for hardware types and sensor types that our DLL can open
OHM_hwtypes = [ 'Mainboard', ... |
import copy
import os
import numpy as np
import torch
from torch.utils.data import Dataset
from pie_data import PIE
def generate_mean_std():
data_path = 'PIE_dataset'
data_opts = {'fstride': 1,
'sample_type': 'all',
'height_rng': [0, float('inf')],
'squarify... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.