text stringlengths 1 927k |
|---|
# Basic demo of hapiclient. Install package using
# pip install hapiclient --upgrade
# from command line.
# Note:
# In IPython, enter
# %matplotlib qt
# on command line to open plots in new window. Enter
# %matplotlib inline
# to revert.
# For more extensive demos and examples, see
# https://colab.research.g... |
from ..arrays import DocumentArray
from ...proto import jina_pb2
class DocsPropertyMixin:
"""Mixin class of docs property."""
@property
def docs(self) -> 'DocumentArray':
"""Get the :class: `DocumentArray` with sequence `body.docs` as content.
:return: requested :class: `DocumentArray`
... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
#
# Copyright (C) 2018 Pico Technology Ltd. See LICENSE file for terms.
#
# PS3000A BLOCK MODE MSO EXAMPLE
# This example opens a 3000a driver device, sets up one digital port and a trigger to collect a block of data.
# This data is then split into the indivual digital channels and plotted as the binary value against ... |
import copy
import os
import torch
from . import geom
from .cell import WaveCell
from .probe import WaveIntensityProbe
from .rnn import WaveRNN
from .source import WaveSource
from .utils import set_dtype
def save_model(model,
name,
savedir='./study/',
history=None,
history_geom_state=None,
... |
import requests
dev_key = "redacted"
username = "redacted"
password = "redacted"
header = {"Content-Type": "application/json; charset=utf8"}
privatepaste = 1 #limits for this are confusing http://192.184.83.59/SPG%20All/pastebin.com/faq.html#11a
def pastebin(pastedata):
params = {"api_option": "paste", "api_user_key... |
from urllib.parse import urlencode
from django.conf import settings
from django.db.models import F
from ...checkout.utils import (
get_checkout_from_request, get_or_create_checkout_from_request)
from ...core.utils import get_paginator_items
from ...core.utils.filters import get_now_sorted_by
from ...core.utils.ta... |
'''
Technical Indicator Node Unit Tests
To run unittests:
# Using standard library unittest
python -m unittest -v
python -m unittest tests/unit/test_indicator_node.py -v
or
python -m unittest discover <test_directory>
python -m unittest discover -s <directory> -p 'test_*.py'
# Using pytest
# "conda install pytest... |
#!/usr/bin/python
from Demo import Demo
from Swarm import Swarm
from Taxi import Taxi
swarm= Swarm(count=24)
demo= Demo(swarm)
while demo.is_open:
demo.draw(Taxi(swarm))
if not demo.paused:
swarm.move(demo.step) |
"""Tests for plugin.py."""
import ckanext.hdx_service_checker.plugin as plugin
def test_plugin():
pass |
"""
Distributed under the MIT License. See LICENSE.txt for more info.
"""
# Templates for different emails
VERIFY_EMAIL_ADDRESS = dict()
VERIFY_EMAIL_ADDRESS['subject'] = '[GW Cloud] Please verify your email address'
VERIFY_EMAIL_ADDRESS['message'] = '<p>Dear {{first_name}} {{last_name}}: </p>' \
... |
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
import pytest
from scipy.fft import dct, idct, dctn, idctn, dst, idst, dstn, idstn
import scipy.fft as fft
from scipy import fftpack
# scipy.fft wraps the fftpack versions but with normalized inverse transforms.
# So, the forward transfo... |
"""
ASGI config for spotter_proj project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_... |
from starling_sim.basemodel.agent.agent import Agent
class SpatialAgent(Agent):
"""
Class describing a spatial agent, with a position and origin in the simulation environment.
"""
SCHEMA = {
"properties": {
"origin": {
"type": ["number", "string"],
... |
import networkx as nx
import numpy as np
import torch
from torch.utils.data import Dataset
from dsloader.util import kron_graph, random_binary, make_fractional
class KroneckerDataset (Dataset):
def __init__(self, kron_iter=4, seed_size=4, fixed_seed=None, num_graphs=1, perms_per_graph=256, progress_bar=False):
... |
import sys
import numpy as np
sys.path.append('../..')
from pgm.inference.MetropolisHastings import MH
from matplotlib import pyplot as plt
def Gamma(theta, k = 1):
def G(k):
if k <= 0: return 1
elif k == 0.5: return np.pi **0.5
return k*G(k-1)
def distribution(x):
x = np.abs(x)... |
from django.shortcuts import render, redirect
from .models import Impassionuser
from django.http import HttpResponse
from django.contrib.auth.hashers import make_password, check_password
from .forms import LoginForm
# Create your views here.
def home(request):
return render(request, 'home.html')
def about_us(requ... |
# Copyright 2018-2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the 'license' fil... |
# -*- coding: utf-8 -*-
"""
Copyright Enrique Martín <emartinm@ucm.es> 2020
Forms used in LSQL
"""
from datetime import date
from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
class FunctionProblemAdminForm(forms.ModelForm):
"""Custo... |
def minimumTotal(triangle):
if not triangle: return 0
res = triangle[-1]
for i in range(len(triangle) -2, -1, -1):
for j in range(len(triangle[i])):
res[j] = min(res[j], res[j+1]) + triangle[i][j]
return res[0]
def minimumTotal1(triangle):
if not triangle:
return 0
... |
from setuptools import setup
setup(
name='sdk-py-datalayer-provider',
version='2.0.0',
description='This sample shows how to provide data to ctrlX Data Layer',
author='SDK Team',
install_requires = ['ctrlx-datalayer', 'ctrlx_fbs'],
packages=['app', 'sample.schema'],
# https://stackoverf... |
"""
===========================================================================
Motor imagery decoding from EEG data using the Common Spatial Pattern (CSP)
===========================================================================
Decoding of motor imagery applied to EEG data decomposed using CSP.
Here the classifier... |
#!/usr/bin/python
from __future__ import absolute_import, division, print_function
# Copyright 2019-2020 Fortinet, Inc.
#
# 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 ... |
# 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 cv2
import numpy as np
import time
# A required callback method that goes into the trackbar function.
def nothing(x):
pass
# Initializing the webcam feed.
cap = cv2.VideoCapture(0)
cap.set(3, 1280)
cap.set(4, 720)
# Create a window named trackbars.
cv2.namedWindow("Trackbars")
# Now create 6 trackbars ... |
from floodsystem import datafetcher
from floodsystem.station import MonitoringStation, inconsistent_typical_range_stations
from floodsystem.stationdata import build_station_list
stations = build_station_list() #builds list of stations
inconsistent_stations = inconsistent_typical_range_stations(stations)
print (inc... |
<a href="https://colab.research.google.com/github/AvijeetPrasad/laputas/blob/main/notebooks/high_energy_protons.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# High energy protons
## Summary
Protons have a rest mass equivalent to an energy of ar... |
"""add_exception_in_trace_result
Revision ID: eab8d977bfb9
Revises: 06302deefc58
Create Date: 2021-08-26 02:10:55.283203
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'eab8d977bfb9'
down_revision = '06302deefc58'
branch_labels = None
depends_on = None
def u... |
'''
Exercício Python 071: Crie um programa que simule o funcionamento de um caixa
eletrônico. No início, pergunte ao usuário qual será o valor a ser sacado
(número inteiro) e o programa vai informar quantas cédulas de cada valor
serão entregues.
'''
print('=' * 30)
print('{:^30}'.format('BANCO CEV'))
print('=' * 30)
... |
"""Test correct treatment of hex/oct constants.
This is complex because of changes due to PEP 237.
"""
import sys
platform_long_is_32_bits = sys.maxint == 2147483647
import unittest
from test import test_support
import warnings
warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning,
... |
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import logging
import os
from typing import TYPE_CHECKING
from ..._constants import EnvironmentVariables
from ..._internal import get_default_authority, normalize_autho... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from .annealed_guassian import AnnealedGaussianProcess
__author__ = "Christian Heider Nielsen"
# Based on http://math.stackexchange.com/questions/1287634/implementing-ornstein-uhlenbeck-in-matlab
import numpy
__all__ = ["OrnsteinUhlenbeckProcess"]
class OrnsteinUhlenb... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import vtk
import sys
# Test speed of compute bounds in vtkPolyData, vtkPoints, and
# vtkBoundingBox.
# Control model size
res = 500
timer = vtk.vtkTimerLog()
# Uncomment if you want to use as a little interactive program
#if len(sys.argv) >= 2 :
# res = int(sys.argv... |
import mysql.connector
class StudentDAO:
db=""
def __init__(self):
self.db = mysql.connector.connect(
host="localhost",
user="root",
password="root",
#user="datarep", # this is the user name on my mac
#passwd="password" # for my mac
database="datarep"
)
def create(self, values):
... |
# coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... |
""" generate random strings of logic
v2 - randomly adds 'not' before values
TODO: 1. add random parentheses, 2. add expressions like 'i==1' or 'print()' for values
TODO: Make it more explicit as to which True or False value it is evaluating to.
The cycle:
1. Start with a True
a. keep doing 'and Tru... |
"""
>>> set(filter(lambda t: t not in ('AFC', 'NFC'), nflteams.fullinfo.keys())) - set(team_locations.keys())
set()
>>> set(filter(lambda t: t not in ('AFC', 'NFC'), nflteams.fullinfo.keys())) == set(team_locations.keys())
True
"""
import geopy.distance
from django import template
from redditnfl.nfltools import nflteam... |
from pj import *
class KF(enum.Enum):
OTV, ZATV = '()'
class ATOM(Token):
def Mr(self, **atomi):
return pogledaj(atomi,self)
class BROJ(Token):
def vrijednost(self,**_):
return int(self.sadržaj)
class N(Token):
literal='n'
def vrijednost(self, **a... |
from __future__ import absolute_import
from __future__ import unicode_literals
from six.moves import map
from corehq.apps.userreports.models import StaticDataSourceConfiguration, get_datasource_config
from corehq.apps.userreports.util import get_table_name
from custom.icds_reports.const import AWC_LOCATION_TABLE_ID, ... |
sum= lambda a,b: a+b
print(sum(5,6)) |
from .receipt import Receipt, ReceiptItem # noqa |
# -*- coding: utf-8 -*-
"""label_TrainCatSet.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1vDyBZ7Ql-8qQ3l7EWJB9TfnwGy66qGGn
"""
import pandas as pd
import os
import numpy as np
# Enlisto los nombres de las imagenes
imagenes = os.listdir('/con... |
from chainer.backends import cuda
from chainer.backends import intel64
from chainer import function_node
from chainer.utils import type_check
_kern = None
def _get_kern():
global _kern
if _kern is None:
_kern = cuda.elementwise(
'T cond, T x, T slope', 'T y',
'y = cond >= 0 ?... |
import logging
import george
import numpy as np
import inspect
from pybnn import BaseModel
from pybnn.dngo import DNGO
from robo.priors.default_priors import DefaultPrior
from robo.models.base_model import BaseModel as BaseModel_
from robo.models.wrapper_bohamiann import WrapperBohamiann
from robo.models.gaussian_pro... |
"""Test unused import retention."""
from logging import DEBUG # unused-import
from typing import Any, List
var1: List[str]
var2: Any |
import requests
import json
import sys
import os
from pprint import pprint
# This is so that below import works
sys.path.append(os.path.realpath("."))
import src.utils.utils as utils
import src.constants as constants
def fetch(review_channel):
# Since searchman allows us to have limited credits, we iterate over... |
# Generated by Django 3.0.7 on 2020-06-29 15:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('warehouse', '0008_auto_20200629_2114'),
]
operations = [
migrations.AlterField(
model_name='order',
name='date_order... |
"""
The MIT License (MIT)
Copyright (c) 2015-2021 Rapptz
Copyright (c) 2021-present Pycord Development
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 limit... |
# Generated by Django 3.0.7 on 2020-06-22 16:14
import apps.categories.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('categories', '0002_auto_20200616_1853'),
]
operations = [
migrations.AddField(
model_name='categor... |
n = int(input())
count = 1
_n = int(str(n % 10) + str((n // 10 + n % 10) % 10))
while _n != n:
count += 1
_n = int(str(_n % 10) + str((_n // 10 + _n % 10) % 10))
print(count) |
import json
from geventwebsocket import WebSocketApplication
from controllers.controller import Controller
from services.browserquest import BrowserQuestImpl
class BrowserQuestApplication(WebSocketApplication):
browserquest = BrowserQuestImpl()
def __init__(self, *args, **kwargs):
super(BrowserQuestAp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# lwar_aws.py
#
# Copyright 2013 Leandro <Leandro@leandrowar>
# Fontes:
# http://aws.amazon.com/articles/Amazon-S3/3998
# http://boto.s3.amazonaws.com/s3_tut.html
#Imports
import boto.s3
from boto.s3.connection import S3Connection #para estabelecer a conexão
import s... |
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def plot(filepath, theta):
path = os.getcwd() + filepath
dataset = pd.read_csv(path, header=None)
X = dataset.iloc[:, 0:-1].values
y = dataset.iloc[:, -1:].values
t = np.arange(0, 25, 1)
plt.scatter(X, y, color=... |
import streamlit as st
st.title("GPT2 ") |
# Copyright (C) 2011-2012 Canonical Services Ltd
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, ... |
import setuptools
setuptools.setup(
name='track-web',
version='0.0.1',
long_description='',
author='GSA 18F, CDS-SNC',
author_email='pulse@cio.gov, cds-snc@tbs-sct.gc.ca',
url='https://github.com/cds-snc/track-web',
include_package_data=True,
packages=[
'track',
],
class... |
#!/usr/bin/env ccp4-python
"""Module to run phaser rotation search on a model"""
__author__ = "Adam Simpkin"
__date__ = "12 April 2018"
__version__ = "1.0"
import os
from phaser import InputMR_DAT, runMR_DAT, InputMR_FRF, runMR_FRF
class Phaser(object):
"""Class to run PHASER
Attributes
----------
... |
import argparse
import os
import random
import shutil
import time
import warnings
import copy
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torchvision.transforms as transforms
import torchvision.datasets as datasets
... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
from .labels import LabelsPlugin
from electrum_blk.plugin import hook
class Plugin(LabelsPlugin):
@hook
def load_wallet(self, wallet, window):
self.start_wallet(wallet)
def on_pulled(self, wallet):
self.logger.info('labels pulled from server') |
# coding: utf-8
"""
TheTVDB API v2
OpenAPI spec version: 3.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import tvdb_api
from tvdb_api.models.series_actors_data import SeriesActorsData # noqa: E501
from tvdb_api.r... |
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from dataloader import dataloader
import seaborn as sns
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
pd.set_option('display.float_format', '{:.6f}'.format)
def countNullPercent(... |
import random, copy
import cv2 as cv
from .augmenter import Augmenter
class Rotator(Augmenter):
'''
Augmenter that rotates the SampleImages randomly based on
the min_angle and max_angle parameters.
'''
def __init__(
self,
min_angle,
max_angle,
**kwargs
):
super().__init__(**kwargs)
... |
"""
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... |
import math
from pytopojson import transform
class BBox(object):
def __init__(self):
self.transform = transform.Transform()
self.x_0 = math.inf
self.y_0 = self.x_0
self.x_1 = -self.x_0
self.y_1 = -self.x_0
self.t = None
def __call__(self, topology, *args, **kw... |
#!/usr/bin/env python3
#
# Retrieve templates from fastlane/frameit
#
import sys
import os
from os import path
from shutil import copyfile
from tempfile import gettempdir
import re
import json
import cv2
import numpy as np
from common import sanitize_color, sanitize_device_name, sanitize_device_key, apply_default_co... |
"""
Copyright 2019 Samsung SDS
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 -*-
# 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 o... |
import subprocess
from config.directory import temp_builds
from .. import directory, output_release_file_checksum
def deploy_to_pypi() -> None:
directory.working.set_as_project_base_path()
subprocess.call(f"twine upload {temp_builds()}/*".split())
if __name__ == "__main__":
output_release_file_checksu... |
# Copyright 2020 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... |
# -*- coding: utf-8 -*-
#
# nodegraph documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 9 15:53:41 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import compas_rhino
from compas.artists import PrimitiveArtist
from .artist import RhinoArtist
class FrameArtist(RhinoArtist, PrimitiveArtist):
"""Artist for drawing frames.
Parameters
----------... |
from django.db import models
from livesettings import config_value_safe
def shipping_choices():
try:
return config_choice_values('SHIPPING','MODULES')
except SettingNotSet:
return ()
class ShippingChoiceCharField(models.CharField):
def __init__(self, choices="__DYNAMIC__", *args,... |
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='ml',
version='0.0.1',... |
def default_param_func(a, b=1):
"""
默认参数必须在参数后面,如default_param_func(a=1, b)是错误的
"""
return a + b
if __name__ == '__main__':
print(default_param_func(1))
print(default_param_func(1, 2)) |
#!/usr/bin/env python
#
# Copyright 2006, Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
"""This module provides different adapter classes that allow
for a smoother combination of Qt and the Deep Learning ToolBox.
"""
# standard imports
from typing import Iterator, Iterable, Any, Callable
import logging
# Qt imports
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QKeyEvent
from PyQt5.QtWidgets impor... |
nota1 = float(input('Digite a primeira nota: '))
nota2 = float(input('Digite a segunda nota: '))
media = (nota1+nota2)/2
if media >= 7:
print('Aprovado! Com média {:.2f}'.format(media))
elif media >= 5 and media < 7:
print('Recuperação! Com média {:.2f}'.format(media))
else:
print('Reprovado! Com média {:.2f}'.... |
"""This module contains the exporters for the ``pybook`` package"""
import os
from operator import itemgetter
from scrapy.exporters import BaseItemExporter
from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Image, PageBreak
from reportlab.lib.units import inch
from bookscra... |
# Copyright 2014 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 ag... |
#import numpy as np
#import pandas as pd
#import seaborn as sns
#import matplotlib
#%matplotlib inline
def plot_history(network_history, n_epochs):
print('Plot is not implemented yet')
#matplotlib.use('agg')
#import matplotlib.pyplot as plt
#df = pd.DataFrame(dict(time=np.arange(n_epochs), value=[netwo... |
'''
Utility functions for easy_db.
'''
import os
import sqlite3, pyodbc
from typing import List, Dict, Any
def check_if_file_is_sqlite(filename: str) -> bool:
'''
Check if file is a sqlite database.
See: https://stackoverflow.com/questions/12932607/how-to-check-if-a-sqlite3-database-exists-in-python
... |
# -*- coding: utf-8 -*-
"""Unit test package for am4894pd.""" |
'''
Copyright 2021 D3M Team
Copyright (c) 2021 DATA Lab at Texas A&M University
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... |
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from ..utils import (
get_cart_data_for_checkout, get_taxes_for_cart,
update_delivery_address_in_anonymous_cart, update_delivery_address_in_cart)
def anonymous_user_delivery_address_view(request, cart):
"""Display... |
import random
import secrets
from collections import deque
from typing import Deque, Dict, Optional
from config.constants import (CALLBACK_ACTIVE_NO, CALLBACK_ACTIVE_YES,
CALLBACK_CAMPUS_KAZAN, CALLBACK_CAMPUS_MOSCOW,
USER_DATA_V1_AUTHORIZED,
... |
from django.test import RequestFactory, TestCase, Client
from .models import Project, Category
from .views import portfolio, portfolio_detail
class PortfolioViewTests(TestCase):
def setUp(self):
# Every test needs access to the request factory.
self.factory = RequestFactory()
self.client ... |
import os
import threading
from System.Core.Global import *
from System.Core.Colors import *
from System.Core.Modbus import *
import ipcalc
class Module:
info = {
'Name': 'Brute Force UID',
'Author': ['@enddo'],
'Description': ("Brute Force UID"),
}
options = {
'RHOSTS' :['' ,True ,'The target a... |
import re
import subprocess
from subprocess import CalledProcessError
import tempfile
import pytest
import optuna
from optuna.cli import _Studies
from optuna.exceptions import CLIUsageError
from optuna.storages.base import DEFAULT_STUDY_NAME_PREFIX
from optuna.storages import RDBStorage
from optuna.testing.storage im... |
# -*- coding: utf-8 -*-
#
# threat_prep documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 15 11:37:04 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... |
# 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... |
from symbolic import SymbolicReference
from git.util import (
LazyMixin,
Iterable,
)
from gitdb.util import (
isfile,
hex_to_bin
)
__all__ = ["Reference"]
#{ Utilities
def require_remote_ref_path(func):
"""A decorator raising a TypeError if we are not a valid remote, based on the path"""
d... |
import torch
import torch.nn as nn
import torch.nn.functional as F
class AddGate(nn.Module):
"""
Add gate similar to LSTM add gate: :math: `y = σ(W_mul * inp + b_mul) * tanh(W_add * inp + b_add)`
Outputs information that can be added to some state
where the network learns: if and how much ... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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
__a... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : test_gnn.py
@Author : yyhaker
@Contact : 572176750@qq.com
@Time : 2020/04/22 15:19:24
'''
# here put the import lib
import torch
from torch_geometric.data import Data
import torch.nn.functional as F
from torch_geometric.nn import GCNConv
edge... |
# 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... |
from __future__ import print_function
# -----------------------------------------------------------------------
# This is an example illustrating how to use the user graphing functionality
# in Python
# (c) Hex-Rays
#
from idaapi import *
class GraphCloser(action_handler_t):
def __init__(self, graph):
acti... |
"""Add primary key to worker_dependency
Revision ID: 54725ffc62f3
Revises: 730e212b938
Create Date: 2016-11-15 14:02:41.621934
"""
# revision identifiers, used by Alembic.
revision = '54725ffc62f3'
down_revision = '730e212b938'
from alembic import op
def upgrade():
# Cannot add primary key with auto-increment... |
# This is a copy of the inspect.getcallargs() function from Python 2.7
# so we can provide it for use under Python 2.6. As the code in this
# file derives from the Python distribution, it falls under the version
# of the PSF license used for Python 2.7.
from inspect import getargspec, ismethod
def getcallargs(func, *... |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.