text stringlengths 2 999k |
|---|
import sys
import os
import ast
import jsonpickle
import datetime
# PyQt5
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.QtWidgets import QTabWidget, QTabBar
from PyQt5 import uic
from PyQt5 import QtCore
# Own Modules
from NodeManager import NodeManager
from ViewManager import ViewManager
from View... |
# Source: https://arxiv.org/abs/1906.08237
try:
import torch
from transformers import XLNetTokenizer, XLNetLMHeadModel
except ImportError:
# No installation required if not using this function
pass
from nlpaug.model.lang_models import LanguageModels
from nlpaug.util.selection.filtering import *
clas... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... |
import collections
import itertools
class Solution:
def threeSumMulti(self, A: List[int], target: int) -> int:
table = collections.Counter(A)
MOD = 10 ** 9 + 7
total = 0
for Ai, Aj in itertools.combinations_with_replacement(sorted(table), 2):
Ak = target - Ai - Aj
... |
import json
from flask import render_template
from flask import request
from pajbot.managers.adminlog import AdminLogManager
from pajbot.managers.db import DBManager
from pajbot.models.module import Module
from pajbot.models.module import ModuleManager
from pajbot.models.sock import SocketClientManager
from pajbot.ut... |
from datetime import timedelta
from django.conf import settings
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.core import mail
from django.core import management
from django.core.handlers.base import BaseHandler
from django.dispatch import receiver
from django.test... |
'''
netwerk utilities
2017_0604 WeMOS Lolin32 - first version
'''
def doConnect(essid, password):
import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
if not wlan.isconnected():
print('connecting to network... ', essid)
wlan.connect(essid, password)
while not... |
# 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... |
import json
import logging
import websockets
import hmac
import hashlib
import datetime
from typing import List, Callable, Any, Optional
from cryptoxlib.WebsocketMgr import Subscription, WebsocketMgr, WebsocketMessage, Websocket
from cryptoxlib.Pair import Pair
from cryptoxlib.clients.bitvavo.functions import map_pair... |
#!/usr/bin/env python
# coding: utf-8
from hubblestack.utils.platform import is_windows
from hubblestack.utils.user import get_user
from hubblestack.utils.files import remove
def test_run(__mods__):
"""
test return of whoami in both safecommand module and run_catchlog
"""
if not is_windows():
... |
import requests
import os
from .ProvenanceObject import ProvenanceObject
from .dependency import Dependency
from .task_status import TaskStatus
from .dataset import DataSet
from .performance import Performance
from datetime import datetime
dfa_url = os.environ.get('DFA_URL',"http://localhost:22000/")
class Task(Prov... |
#!/usr/bin/python
# Copyright (c) 2012-2015 CORE Security Technologies
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# DCE/RPC lookup sid brute forcer example
#
# Author:
# Alberto Solino (@agsolino)
#... |
# Random Forest Regression
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('Position_Salaries.csv')
X = dataset.iloc[:, 1:2].values
y = dataset.iloc[:, 2].values
# Splitting the dataset into the Training set and Test set
"... |
"""LCM type definitions
This file automatically generated by lcm.
DO NOT MODIFY BY HAND!!!!
"""
try:
import cStringIO.StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
class controller2webots_t(object):
__slots__ = ["q_des_abad", "q_des_hip", "q_des_knee", "qd_des_abad", "qd_des... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from rest_framework.response import Response
from rest_framework.views import APIView
from todo.serializers import TodoSerializer
from todo.models import Todo
# Create your views here.
class TodoView(APIView):
"""... |
# Copyright 2013-2020 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)
from __future__ import print_function
import sys
import inspect
import llnl.util.tty as tty
#: whether we should write... |
from distutils.core import setup
from Cython.Build import cythonize
setup(
ext_modules = cythonize("pyiArduinoI2Cph.pyx")
)
|
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from django.contrib.auth.models import User
from .models import Profile
from django.core.mail import send_mail
from django.conf import settings
def createProfile(sender, instance, created, **kwargs):
if created:
... |
#
# utils.py
#
# Auxiliary functions for the `docmaker' tool (library file).
#
# Copyright 2002, 2004, 2007, 2008, 2014 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.TXT. ... |
# Copyright (c) 2019 Works Applications 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 a... |
print(sum([i for i in range(1000) if i%3==0 or i%5==0]))
|
from mpi4py import MPI
import baselines.common.tf_util as U
import tensorflow as tf
import numpy as np
class MpiAdam(object):
def __init__(self, var_list, beta1=0.9, beta2=0.999, epsilon=1e-08, scale_grad_by_procs=True, comm=None):
self.var_list = var_list
self.beta1 = beta1
self.beta2 = be... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Netius System
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Netius System.
#
# Hive Netius System is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foun... |
from mythic_payloadtype_container.MythicCommandBase import *
import json
class ScArguments(TaskArguments):
def __init__(self, command_line, **kwargs):
super().__init__(command_line, **kwargs)
self.args = [
CommandParameter(
name="query",
cli_name="Query"... |
from CyberSource import *
import os
import json
from importlib.machinery import SourceFileLoader
config_file = os.path.join(os.getcwd(), "data", "Configuration.py")
configuration = SourceFileLoader("module.name", config_file).load_module()
# To delete None values in Input Request Json body
def del_none(d):
for ke... |
"""
Faceting with clean axes
========================
Removing axes help visualising patterns in multiple plots
"""
import matplotlib.pyplot as plt
from wavespectra import read_swan
dset = read_swan("../_static/swanfile.spec", as_site=True)
p = (
dset.isel(site=0)
.sel(freq=slice(0, 0.2))
.spec.plot.cont... |
# -*- coding: utf-8 -*-
from typing import Any, Dict, List
from django.core.management.base import BaseCommand
from zerver.lib.actions import bulk_add_subscriptions, \
ensure_stream, do_add_reaction, do_change_avatar_fields, \
do_create_user, do_send_messages, internal_prep_stream_message
from zerver.lib.emo... |
# pylint: disable=function-redefined
from prompt_toolkit_dev.application.current import get_app
from prompt_toolkit_dev.filters import (
Condition,
emacs_insert_mode,
has_selection,
in_paste_mode,
is_multiline,
vi_insert_mode,
)
from prompt_toolkit_dev.key_binding.key_processor import KeyPress, ... |
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
from nltk.stem.snowball import SnowballStemmer
from ZeW import ZeroWidthSPaceAttack
class HS_evader:
def __init__(self):
#init the sentiment analyser
self.analyser = SentimentIntensityAnalyzer()
#define the stemming parse... |
# -*- coding: utf-8 -*-
"""Query utils functions module."""
from django.db.models import (
Count,
ExpressionWrapper,
F,
IntegerField,
OuterRef,
PositiveIntegerField,
Q,
Subquery,
Sum,
Value,
)
from django.db.models.functions import Coalesce
from mspray.apps.main.models import H... |
# Created by Egor Kostan.
# GitHub: https://github.com/ikostan
# LinkedIn: https://www.linkedin.com/in/egor-kostan/
from selenium.webdriver.common.by import By
from page_locators.base_page_locator import BasePageLocator
from expected_results.page_content.account_overview_content import AccountOverviewContent
clas... |
import random
class SkipNode:
ptrs,v,pred=None,None,None
def __init__(self,v,p=None,s=None):
self.v=v
self.ptrs=[None]
if p is not None:
p.ptrs[0]=self
self.pred=p
if s is not None:
self.ptrs[0]=s
s.pred=self
class SkipList:
h... |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import hashlib
import math
from ccxt.base.errors import ExchangeError
class btcturk(Exchange):
... |
# generar una normal de altura y peso
import numpy as np
height = np.round(np.random.normal(1.75, 0.20, 5000), 2)
weight = np.round(np.random.normal(60.32, 15, 5000), 2)
np_city = np.column_stack((height, weight))
print(np_city)
# Print mean height (first column)
avg = round(np.mean(np_city[:,0]),2)
print("Average: ... |
import random
from itertools import cycle
from twisted.trial.unittest import TestCase
from bl.testlib import ClockRunner, TestReactor
from bl import arp
from bl.ugen import N
from bl.scheduler import BeatClock, Tempo
from bl.arp import (AscArp, DescArp, OrderedArp, RandomArp, OctaveArp,
Adder, PhraseRecordingArp,... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import reagent.types as rlt
import torch
import torch.nn.functional as F
from reagent.gym.types import Sampler
class SoftmaxActionSampler(Sampler):
"""
Softmax sampler.
Equation: http://incompleteideas.net/boo... |
# Don't edit or you gay
# credits: spechide,ravana69,mkaraniya & me
import asyncio
import random
from collections import deque
from telethon import events
from telethon.errors.rpcerrorlist import MessageIdInvalidError
from userbot import ALIVE_NAME, CMD_HELP, bot
from userbot.events import register
# ===============... |
# -*- coding: utf-8 -*-
"""CS246 - Colab 3.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/github/nhutnamhcmus/mining-massive-datasets/blob/main/CS246_Colab_3.ipynb
# CS246 - Colab 3
## K-Means & PCA
### Setup
Let's setup Spark on your Colab environm... |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
import sys
sys.path.append('/home/will/PySeqUtils/')
from GeneralSeqTools import fasta_reader, fasta_writer
import os
os.chdir('/home/will/PySeqUtils/TransToolStuff/')
# <codecell>
from itertools import islice
start = 806
stop = -1
path = 'HIV1_ALL_201... |
from fact.io import read_h5py
from fact.analysis.statistics import li_ma_significance
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from functools import lru_cache, partial
from scipy.optimize import minimize
from numdifftools import Hessian
INVALID = np.finfo(np.float32).max
EPS = 1e-10
# m... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#-- 数字常量
0x9ff, 0X9FF, 0b101010 # 十六进制、二进制数字
int(string, base) # 将字符串转化为整数,base为进制数
#-- 数字的表达式操作符
x if y else z # 三元选择表达式
1 < a < 3 # Python中... |
from __future__ import absolute_import
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from model.utils.config import cfg
from .proposal_layer import _ProposalLayer
from .anchor_target_layer import _AnchorTargetLayer
from model.utils.net_utils import _smooth_l1_lo... |
from flask import Flask, json, request, abort
from flask_restplus import Resource, Api, fields
from flask_cors import CORS
from textblob import TextBlob
from textblob_fr import PatternAnalyzer as PatternAnalyzer_fr
from textblob.sentiments import PatternAnalyzer as PatternAnalyzer_en
from textblob.sentiments import Nai... |
import random
from os import urandom
from data_gateway.dummy_serial.constants import ALPHABET, NUMBERS
def random_bytes(length=8, as_bytearray=False):
"""Generate a random bytes object of a given length.
:param length: Length of bytes object to generate (default 8)
:type length: int
:param as_bytear... |
items = [
("Product1", 34341),
("Product2", 23434),
("Product3", 34535353)
]
items.sort(key=lambda items:items[1])
print(items)
|
#!/usr/bin/env python
"""Demo SSL client #1 for the HOWTO.
Copyright (c) 1999-2001 Ng Pheng Siong. All rights reserved."""
import getopt, sys
from socket import gethostname
from M2Crypto import Err, Rand, SSL, X509, threading
host = '127.0.0.1'
port = 9999
optlist, optarg = getopt.getopt(sys.argv[1:], 'h:p:')
for ... |
# -*- coding: utf-8 -*-
# python3 tests/fx.py -pad 3000
# python3 tests/fx.py -effect distortion -amounts "1,2,4,8,16,24,32,48" -out output/distortion_test.mp3
# python3 tests/fx.py -effect lowpass -amounts "50,100,200,400,800,1600,3200,6400" -out output/lowpass_test.mp3
# python3 tests/fx.py -effect bass -amounts " -... |
from __future__ import absolute_import
import six
from plotly import exceptions, optional_imports
import plotly.colors as clrs
from plotly.figure_factory import utils
from plotly.graph_objs import graph_objs
from plotly.tools import make_subplots
pd = optional_imports.get_module("pandas")
DIAG_CHOICES = ["scatter",... |
"""
StackState.
Static topology extraction
"""
# 3rd party
import csv
import codecs
from checks import AgentCheck, CheckException
class StaticTopology(AgentCheck):
SERVICE_CHECK_NAME = "StaticTopology"
def check(self, instance):
if 'components_file' not in instance:
raise CheckE... |
"""
HyperOne
HyperOne API # noqa: E501
The version of the OpenAPI document: 0.1.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from h1.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
... |
# -*- coding: utf-8 -*-
"""
Helios Django Views
Ben Adida (ben@adida.net)
"""
from django.core.urlresolvers import reverse
from django.core.mail import send_mail
from django.core.paginator import Paginator
from django.core.exceptions import PermissionDenied
from django.http import *
from django.db import transaction
... |
# -*- coding: utf-8 -*-
import unittest
from nose.tools import raises
import torch
from kraken.lib import layers
class TestLayers(unittest.TestCase):
"""
Testing custom layer implementations.
"""
def setUp(self):
torch.set_grad_enabled(False)
def test_maxpool(self):
"""
... |
"""main URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vi... |
import torch
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class DenseAttenGraspNet(nn.Module):
def __init__(self, input_channels=1, dropout=False, prob=0.0, bottleneck=True):
super(DenseAttenGraspNet, self).__init__()
if bottleneck == True:
... |
import unittest
from collections import deque
from deep_flatten import deep_flatten
class DeepFlattenTests(unittest.TestCase):
"""Tests for deep_flatten."""
def assertIterableEqual(self, iterable1, iterable2):
self.assertEqual(list(iterable1), list(iterable2))
def test_deep_lists(self):
... |
#!/usr/bin/env python
# Copyright (c) 2012 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.
# Virtual Me2Me implementation. This script runs and manages the processes
# required for a Virtual Me2Me desktop, which are: X se... |
import logging
import os
import requests
from requests.compat import urljoin
from ._base import BaseClient
from ..bencode import bencode
logger = logging.getLogger(__name__)
TMP_FOLDER_NAME = '__tmp_folder'
class UnableToLoginException(Exception):
pass
class QBittorrentClient(BaseClient):
identifier = ... |
#!/usr/bin/env python
'''
MP2 at an individual k-point
'''
from functools import reduce
import numpy
from pyscf.pbc import gto, scf, mp
cell = gto.Cell()
cell.atom='''
C 0.000000000000 0.000000000000 0.000000000000
C 1.685068664391 1.685068664391 1.685068664391
'''
cell.basis = 'gth-szv'
cell.pseudo = 'gth-p... |
# coding=utf-8
# Copyright 2018 The TF-Agents 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... |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
# Ejercico 2
# Para concatenar texto se utiliza el signo +
# Cree una lista de frutas de 2 elementos, y realice un programa con tkinter que muestre
# un oracion conteniendo los 2 elementos de la lista concatenandolos con texto para formar
# una oracion con sentido
import tkinter as tk
root = tk.Tk()
frutas = ['limon... |
# -*- coding: utf-8 -*-
from ccxt.async.base.exchange import Exchange
import hashlib
import math
from ccxt.base.errors import ExchangeError
class zb (Exchange):
def describe(self):
return self.deep_extend(super(zb, self).describe(), {
'id': 'zb',
'name': 'ZB',
'countr... |
# Soma vários números inteiros e para após digitar 999 utilizando o comando break. Ainda, o programa calcula a soma e quantos números foram digitados.
i = 0
n = 0
soma = 0
while n != 999:
n = int(input('Digite um número inteiro [999 para parar]: '))
if n == 999:
break
i += 1
soma += n
print('For... |
from conans import ConanFile
class TestPackageConan(ConanFile):
settings = "os"
def test(self):
self.run("jom /VERSION")
|
##
# -*- coding: utf-8 -*-
##
##
# Manage SNS topics.
##
# Import community modules.
import sys
import json
import argparse
import boto3
# Initialize SNS client.
SNS = boto3.client('sns',region_name='us-west-2')
# Parse CLI arguments.
cli = argparse.ArgumentParser(description='A CLI to manage SNS topics.')
cli.add_a... |
#!/usr/bin/python
#
# Simple utility script to generate the basic info
# needed in a .pc (pkg-config) file, used especially
# for introspection purposes
# This can be used in various projects where
# there is the need to generate .pc files,
# and is copied from GLib's $(srcroot)/win32
# Author: Fan, Chun-wei
# Date: ... |
"""
Contains implementations of the authentication logic.
"""
import logging
from galaxy.auth.util import get_authenticators, parse_auth_results
from galaxy.exceptions import Conflict
from galaxy.util import string_as_bool
log = logging.getLogger(__name__)
class AuthManager:
def __init__(self, config):
... |
#!/usr/bin/env python
# ===--- runner.py --------------------------------------------------------===
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See ht... |
import FWCore.ParameterSet.Config as cms
minbiasana = cms.EDAnalyzer("Analyzer_minbias",
HistOutFile = cms.untracked.string('analysis_minbias.root'),
hbheInputMB = cms.InputTag("hbherecoMB"),
hoInputMB = cms.InputTag("horecoMB"),
... |
import webbrowser
import sinaweibopy3
import csv
import time
def write_to_csv(url, data_list):
with open(url, "a", newline="") as datacsv:
csvwriter = csv.writer(datacsv, dialect=("excel"))
csvwriter.writerow(data_list)
def read_from_file(url):
ids = []
with open(url, "r") as f:
... |
import logging
import os
import pickle
from abc import ABC, abstractmethod
from contextlib import contextmanager
from dataclasses import dataclass
from functools import partial
from typing import (
TYPE_CHECKING,
Callable,
Iterable,
NamedTuple,
Optional,
Union,
)
from funcy import cached_proper... |
# Copyright 2021 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 json
import os
from datetime import datetime
from urllib.error import URLError
from Bio import Entrez
from django.core.management.base import BaseCommand
from django.db import transaction
from tqdm import tqdm
from bioresources.io.adapters import scopus_extended_publication, NCBIGDSAdapter, NCBIAssemblyAdapter... |
from __future__ import division
from __future__ import print_function
import sys
sys.path.append('/home/yz/caffe2/python')
import caffe
import numpy as np
import tensorflow as tf
import model
FLAGS = tf.app.flags.FLAGS
# tensorflow name to caffename
# output:
# caffename
# caffe blob id
# reshape vector
def _get_caf... |
import datetime
from collections import defaultdict
import matplotlib
matplotlib.use('Qt5Agg')
import matplotlib.pyplot as plt
import matplotlib.dates as md
from .i18n import _
from .bitcoin import COIN
class NothingToPlotException(Exception):
def __str__(self):
return _("Nothing to plot.")
def plot_h... |
import os,sys,string,random
import veri
NewName = os.path.expanduser('~')
sys.path.append('%s/verification_libs3'%NewName)
import logs
Monitors=[]
cycles=0
GIVEUP_TIMEOUT = 1000 # how many cycles to run before retirment.
import sequenceClass
seq = sequenceClass.sequenceClass('tb',Monitors,'',[])
def pymonname(... |
"""
# Copyright (c) 2020 PaddlePaddle 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 ap... |
"""Enrollment event models context fields definitions"""
from typing import Literal, Union
from ...base import BaseContextField
class EdxCourseEnrollmentUpgradeClickedContextField(BaseContextField):
"""Represents the `context` field of the `edx.course.enrollment.upgrade_clicked`
server statement.
In ad... |
"""
MSX SDK
MSX SDK client. # noqa: E501
The version of the OpenAPI document: 1.0.9
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from python_msx_sdk.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
Mod... |
"""Unit test for IPy.py
Further Information might be available at http://c0re.jp/c0de/IPy/
Hacked 2001 by drt@un.bewaff.net
"""
# TODO: unify assert / FilIf usage
import sys
import threading
sys.path.append('.')
sys.path.append('..')
import IPy
import unittest
import random
testloops = 250
class parseAddress(uni... |
# coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outpu... |
"""
Module to handle datasets IO
"""
import logging
from io import BytesIO
from typing import Tuple, Optional
from azure.core.exceptions import HttpResponseError
from ..core.azure_client_authorization import ClientAuthorization
from ..core.io import OsirisFileClient, OsirisFileClientAsync, PrometheusClient
logger = ... |
#!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
__all__ = ["Detrender"]
__author__ = ["Markus Löning"]
from sklearn.base import clone
from sktime.forecasting.base._fh import ForecastingHorizon
from sktime.transformations.base import _SeriesToS... |
# Copyright 2017 Mycroft AI 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 writin... |
import torch
from os.path import join as oj
import os
def train_epoch(model, device, train_loader, optimizer, epoch, criterion):
model.train()
for batch_idx, (data, target) in enumerate(train_loader):
data, target = data.to(device), target.to(device)
optimizer.zero_grad()
outputs = mode... |
import os
import networkx.algorithms.tests.test_threshold
import pytest
from graphscope.nx.utils.compat import import_as_graphscope_nx
from graphscope.nx.utils.compat import with_graphscope_nx_context
import_as_graphscope_nx(networkx.algorithms.tests.test_threshold,
decorators=pytest.mark.use... |
import rospy
import cv2
from .monitor import Monitor
class PerspectiveMonitor(Monitor):
"""
"""
def __init__(self, internal_simulator, rendering_ratio=(1/10.0)):
"""
"""
super(PerspectiveMonitor, self).__init__(internal_simulator=internal_simulator)
self.rendering_ratio = r... |
#!/usr/bin/python3.5
import numpy as np
import matplotlib.pyplot as plt
import scipy.interpolate as si
# parameter
N = 3 # B Spline order
def bspline_planning(points, sn):
x = []
y = []
for point in points:
x.append(point[0])
y.append(point[1])
fit_points = []
#print(points)
... |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_space_comm_rebel_xwing_05.iff"
result.attribute_template_id = ... |
# Copyright 2015 OpenStack Foundation
#
# 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 ... |
# coding:utf-8
from PySide2.QtWidgets import *
import constants as const
class PublishChecker(QWidget):
def __init__(self):
QWidget.__init__(self)
self.setWindowTitle("Publish Cleaner")
self.setMinimumSize(500, 400)
self.init()
self.setStyleSheet(open(const.BARAKA_STYLESHEETS_PATH + "/brkStyle.css").read... |
#!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the SegWit changeover logic."""
from test_framework.test_framework import GuldenTestFramework
from tes... |
__author__ = 'sibirrer'
import numpy.testing as npt
import numpy as np
import pytest
import unittest
from lenstronomy.Analysis.kinematics_api import KinematicsAPI
import lenstronomy.Util.param_util as param_util
class TestKinematicsAPI(object):
def setup(self):
pass
def test_velocity_dispersion(se... |
#
# PySNMP MIB module EQLSTORAGECONTAINER-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/EQLSTORAGECONTAINER-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:51:19 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 ... |
"""
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 2.2.10.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
im... |
import asyncio
import logging
from pathlib import Path
from typing import Any, AsyncIterator, Awaitable, Callable, Dict, Optional
from uuid import uuid4
import pytest
import pytest_asyncio
from neuro_sdk import DEFAULT_CONFIG_PATH, HTTPPort, JobStatus, ResourceNotFound, get
from platform_e2e import Helper, ensure_con... |
# 30th percentile.
class Solution(object):
def productExceptSelf(self, nums):
length = len(nums)
output = [1 for i in range(length)]
left_product = 1
for i in range(length):
output[i] *= left_product
left_product *= nums[i]
right_pro... |
from flask import jsonify
from flask_jwt_extended import *
from flask_restful import Resource, reqparse
from src.models.item_category import ItemCategoryModel
class ItemCategoryRegister(Resource):
"""
This resource allows roles registration by sending a
POST request with the categoryname.
"""
par... |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-TokenManipulation',
'Author': ['@JosephBialek'],
'Description': ("Runs PowerSploit's Invoke-TokenManipulation to "
"enumera... |
"""
core --- Basic functions, mostly time, for ephem.
=================================================
Functions
---------
cal2et
date2et
jd2et
time2et
find_kernel
load_kernel
"""
from ..util import autodoc
from datetime import datetime
import warnings
import numpy as np
import spiceypy as ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.