text stringlengths 2 999k |
|---|
# Copyright 2020 InterDigital Communications, 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 ... |
#!/usr/bin/env python3
# Copyright (c) 2017-2018 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 various command line arguments and configuration file parameters."""
import os
from test_framewo... |
from d import g
def f(x, y):
return g(x, y)
def h(x, y):
return x + y
|
import mxnet as mx
from rcnn.config import config
from rcnn.PY_OP import fpn_roi_pooling, proposal_fpn, mask_roi, mask_output
eps = 2e-5
use_global_stats = True
workspace = 512
res_deps = {'50': (3, 4, 6, 3), '101': (3, 4, 23, 3), '152': (3, 8, 36, 3), '200': (3, 24, 36, 3)}
units = res_deps['50']
filter_list = [256,... |
import yaml
from jsonschema import validate
_META_VAL_JSONSCHEMA = {
'type': 'object',
'definitions': {
'validator_set': {
'type': 'object',
# validate values only
'additionalProperties': {
'type': 'object',
'properties': {
... |
_base_ = [
'../../_base_/models/slowonly_r50.py', '../../_base_/default_runtime.py'
]
# model settings
model = dict(backbone=dict(pretrained=None), cls_head=dict(num_classes=700))
dataset_type = 'VideoDataset'
data_root = 'data/kinetics700/videos_train'
data_root_val = 'data/kinetics700/videos_val'
ann_file_train... |
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return "Hello world!"
if __name__ == "__main__":
app.run()
# hello_world() |
from config import Config
from flaky import flaky
from yandex.Translater import Translater
@flaky(3, 1)
def init(update, context):
bot = context.bot
message_var = update.message.text[8:]
try:
tr = Translater()
tr.set_key(Config.YANDEX_API) # Api key found on https://translate.yandex.com/dev... |
# For loading and preprossing the data
import pandas as pd
import scipy.sparse as sp
import numpy as np
import random
class Data:
def __init__(self):
self.df = pd.read_csv(
'/home/vaibhav/Downloads/archive/drugsComTrain_raw.csv').drop(['uniqueID', 'date'], axis=1)
self.Medical_Condi... |
# coding: utf-8
"""
PowerMeter API
API # noqa: E501
The version of the OpenAPI document: 2021.4.1
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import datetime
import powermeter_api
from powermeter_api.models.paged_contrib_device import P... |
n9k_running_config = """
!Command: show running-config
!Running configuration last done at: Wed Nov 27 18:54:15 2019
!Time: Wed Nov 27 20:21:59 2019
version 9.2(4) Bios:version 07.66
hostname n9k-salt-switch
vdc n9k-salt-switch id 1
limit-resource vlan minimum 16 maximum 4094
limit-resource vrf minimum 2 maximum 4... |
import cv2
import matplotlib.pyplot as plt
# Read an Image
img = cv2.imread('1.jpg')
newImg = cv2.cvtColor(img,cv2.COLOR_BGR2RGB)
plt.imshow(img)
plt.show()
plt.imshow(newImg)
plt.show()
print(img) |
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
import code
import pyqtgraph as pg
import pyqtgraph.examples
from numpy.polynomial.polynomial import Polynomial as Poly
#pyqtgraph.examples.run()
#QtGui.QApplication.setGraphicsSystem('raster')
app = QtGui.QApplication([])
#mw = QtGui.QMainWindow()
#mw.resize... |
#!/usr/bin/env python3.9
# -*- coding: utf-8 -*-
# ██████╗██╗██████╗ ██████╗██╗ ███████╗███████╗
# ██╔════╝██║██╔══██╗██╔════╝██║ ██╔════╝██╔════╝
# ██║ ██║██████╔╝██║ ██║ █████╗ ███████╗
# ██║ ██║██╔══██╗██║ ██║ ██╔══╝ ╚════██║
# ╚██████╗██║██║ ██║╚██████╗███████╗███████╗███████║
... |
# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
class VideoAppItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
# 名称
name = scrapy.Field()
# 标题
title = scrapy.Fi... |
"""
provides a code to compute Inception Score. Inception model is downloaded automatically. The function to compute score is called "get_inception_score"
source: https://github.com/openai/improved-gan/tree/master/inception_score
"""
# Code derived from tensorflow/tensorflow/models/image/imagenet/classify_image.py
f... |
from conan.tools._check_build_profile import check_using_build_profile
from conan.tools._compilers import architecture_flag, build_type_flags, cppstd_flag, \
build_type_link_flags
from conan.tools.apple.apple import apple_min_version_flag, to_apple_arch, \
apple_sdk_path
from conan.tools.cross_building import c... |
from fsmLogic.nodeClasses.actionTemplate import Action
from fsmLogic.actionManager import ActionManager
from fsmLogic.nodeClasses.inputs import ValueInput, EventOutput, ValueOutput
from fsmLogic.nodeClasses.valueTypes import ValueType
@ActionManager.actionclass
class GetIDFromMention(Action):
guildID = -1
gro... |
# Generated by Django 3.2.6 on 2021-08-12 14:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shelves', '0018_delete_shelfmanagement'),
]
operations = [
migrations.AlterField(
model_name='shelf',
name='footer_t... |
from collections import OrderedDict
import numpy as np
from six import string_types, next
from artemis.general.should_be_builtins import all_equal
__author__ = 'peter'
_immutible_types = (int, float, bool, type(None))+string_types
PRIMATIVE_TYPES = (int, float, np.ndarray, type(None), bool)+string_types
def flatt... |
import re
import robin_stocks.robinhood as rh
from functools import lru_cache
def symbol_to_market_mic(symbol):
"""
Get the MIC value of the market for a specified symbol.
"""
markets = rh.get_instruments_by_symbols(symbol, info="market")
if not markets:
return "N/A"
assert (
... |
"""Simple wrapper for standard checkout as implemented in payment.views"""
from django import http
from livesettings.functions import config_get_group
from payment.views import confirm, payship
from satchmo_utils.dynamic import lookup_url
from .forms import PurchaseorderPayShipForm
import logging
log = logging.getLog... |
from typing import Dict
from socutils.hive_connector import Connector
def create_hive_connector(settings: Dict):
hive_settings = settings
return Connector(
auth=hive_settings['auth'],
host=hive_settings['host'],
port=hive_settings.get('port', 10000),
username=hive_settings['us... |
from django.db import models
from datetime import datetime
# Create your models here.
class TipoEmpleado(models.Model):
id = models.AutoField(primary_key=True)
descripcion = models.CharField(max_length=100)
class Persona(models.Model):
rfc = models.CharField(
primary_key=True, max_length=100, nul... |
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 4 09:28:55 2021
@author: bcamc
"""
#%% Reference
# CCMP Wind Speeds (<2007)
# https://podaac.jpl.nasa.gov/dataset/CCMP_MEASURES_ATLAS_L4_OW_L3_5A_MONTHLY_WIND_VECTORS_FLK
# NSIDC sea ice climatology
# https://nsidc.org/data/G02202/versions/4
# fronts
# ... |
from . import utils
from ...domain.entities import trading_states
class FakeBinance:
def __init__(self, config, symbol):
pass
def get_market_depth(self):
return {
'lastUpdateId': 4589770863,
'bids': [
['47286.45000000', '0.00571200'],
['... |
#! /usr/local/bin/python3
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from db import db
from models.item import ItemModel
from models.media import MediaModel
from models.creator import Creato... |
# coding=utf-8
# Copyright 2022 The Deeplab2 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 ... |
# Copyright 2018 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 math
from typing import List, Union
import numpy as np
import torch
import torch.nn as nn
from torch.optim import Optimizer
from torch.optim.lr_scheduler import _LRScheduler
from tqdm import trange
from chemprop.data import CrystalDataset
def compute_pnorm(model: nn.Module) -> float:
"""Computes the norm... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
####################################################################################################################################################################################################################################
############################################... |
#!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
""" Example of FIR model using formula framework
Shows how to use B splines as basis functions for the FIR instead of simple
boxcars.
Requires matplotlib
"""
import numpy as np
try... |
import epipack
import numpy as np
from epipack.stochastic_epi_models import StochasticEpiModel
from math import exp
from numpy import random
import networkx as nx
from smallworld import get_smallworld_graph
from scipy.stats import expon
import numpy as np
import networkx as nx
def _edge(i,j):
if i > j:
ret... |
import json
# From Marseille
class CDCPArgumentationDoc:
def __init__(self, file_root, merge_consecutive_spans=True):
self.doc_id = int(file_root[-5:])
self._ann_path = file_root + ".ann.json"
with open(file_root + ".txt") as f:
self.raw_text = f.read()
# annotation... |
import rostest
import rospy
import unittest
import sensor_msgs.msg
from image_geometry import PinholeCameraModel, StereoCameraModel
class TestDirected(unittest.TestCase):
def setUp(self):
pass
def test_monocular(self):
ci = sensor_msgs.msg.CameraInfo()
ci.width = 640
ci.heigh... |
from saleor.product.filters import ProductCategoryFilter
def test_product_category_filter_filters_from_child_category(
product_type, categories_tree
):
product_filter = ProductCategoryFilter(data={}, category=categories_tree)
(product_attributes, variant_attributes) = product_filter._get_attributes()
... |
a = int(input("Enter First Number : "))
b = int(input("Enter Second Number: "))
m = min(a,b)
hcf = 1
i = m
while i>=1:
if a%i==0 and b%i==0:
hcf = i
break
i-=1
print("HCF of {} and {} is {}".format(a,b,hcf)) |
# from apps.job.models import ScrapingTask
# from config.celery_app import app
# import requests
# from config import celery_app
import logging
logger = logging.getLogger('testlogger')
# # @task()
# @app.task
# def fetch_url(url, **kwargs):
# """
# A simple task that fetches the provided URL and r... |
import heterocl as hcl
from computeGraphs.CustomGraphFunctions import *
############################## 6D DERIVATIVE FUNCTIONS #############################
def spa_derivX6_6d(i, j, k, l, m, n, V, g): # Left -> right == Outer Most -> Inner Most
left_deriv = hcl.scalar(0, "left_deriv")
right_deriv = hcl.scala... |
from . import generate, plot |
from statistics import mean
class Drop:
def __init__(self, name):
self.name = name
class ItemDrop(Drop):
def __init__(self, name, chance):
super().__init__(name)
self.chance = chance
class GoldDrop(Drop):
def __init__(self, name, min_gp, max_gp):
super().__init__(name)
... |
"""
Aver wrapper task
"""
import contextlib
import logging
from subprocess import check_call, Popen, PIPE
log = logging.getLogger(__name__)
@contextlib.contextmanager
def task(ctx, config):
"""
Execute an aver assertion
Parameters:
input: file containing data referred to by the assertions. File... |
# -*- coding: utf-8 -*-
from aiida.orm import Calculation
#from aiida.common.utils import classproperty
__copyright__ = u"Copyright (c), 2015, ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE (Theory and Simulation of Materials (THEOS) and National Centre for Computational Design and Discovery of Novel Materials (NCCR MARVEL)... |
""" test generating preview images """
import pathlib
from unittest.mock import patch
from PIL import Image
from django.test import TestCase
from django.test.client import RequestFactory
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db.models.fields.files import ImageFieldFile
from bookwyr... |
A, B, C, D = [int(x) for x in input().split()]
if B > C and D > A and (C + D) > (A + B) and C >= 0 and D >= 0 and A % 2 == 0:
print('Valores aceitos')
else:
print('Valores nao aceitos')
|
from hamcrest import all_of, has_property, has_item, has_length, has_items
from hamcrest.core.base_matcher import BaseMatcher
from hamcrest.core.helpers.wrap_matcher import wrap_matcher
from river.models import State
def has_permission(name, match):
return HasPermissions(name, wrap_matcher(match))
def has_trans... |
#!/usr/bin/python
"""
ARDrone3 demo with autonomous navigation to two color Parrot Cap
usage:
./demo.py <task> [<metalog> [<F>]]
"""
import sys
import cv2
from bebop import Bebop
from commands import movePCMDCmd
from capdet import detectTwoColors, loadColors
# this will be in new separate repository as com... |
import unittest
from click import Abort
from client_cli.api.inactive_init_api import InactiveInitApi
class InactiveInitApiSpec(unittest.TestCase):
def test_should_fail_all_requests(self):
api = InactiveInitApi()
with self.assertRaises(Abort):
api.state()
with self.assertRa... |
class NegativeValueError(ValueError):
pass
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from workalendar.core import WesternCalendar, ChristianMixin
from workalendar.registry import iso_register
@iso_register('CZ')
class CzechRepublic(WesternCalendar, ChristianMixin):
'Czech Republic'
include_easter_monday = True
include_good_f... |
# Copyright 2020 Google LLC
# Copyright 2020 EPAM Systems
#
# 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... |
"""
jupyterlab_examples_kernel_messaging setup
"""
import json
import sys
from pathlib import Path
import setuptools
HERE = Path(__file__).parent.resolve()
# The name of the project
name = "jupyterlab_examples_kernel_messaging"
lab_path = (HERE / name.replace("-", "_") / "labextension")
# Representative files that... |
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.button import Button
from kivy.uix.popup import Popup
from kivy.uix.label import Label
class GoodByeApp(App):
def build(self, *args, **kwargs):
layout = FloatLayout()
ppp = Popup(title='Goodbye, World!',
... |
from pydantic import BaseModel, EmailStr
class Blob(BaseModel):
id: int
user_id: int
blob_name: str
blob_url: str
content_type: str
class BlobRename(BaseModel):
id: int
new_blob_name: str
class BlobShare(BaseModel):
blob_id: int
user_email: EmailStr |
"""travelpoints URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/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-... |
from django.apps import AppConfig
class DatasenderConfig(AppConfig):
name = 'datasender'
|
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to u... |
import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-easy-ajax',
v... |
# 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 argparse
from tomviz.utility import logging
def main():
parser = argparse.ArgumentParser(
description='Tomviz acquisition server.')
parser.add_argument('-a', '--adapter', help='source adapter to install')
parser.add_argument('-i', '--host', default='localhost',
help=... |
# -*- coding: utf-8 -*-
"""
Test selectors level 4.
```
[foo='bar' i]
:nth-child(an+b [of S]?)
:is(s1, s2, ...) / :matches(s1, s2, ...)
:where(s1, s2, ...) allowed, but due to our environment, works like `:is()`
:not(s1, s2, ...)
:has(> s1, ...)
:any-link
:current
:past
:future
:focus-within
:focus-visible
:target-wit... |
# -*- coding: utf-8 -*-
# Copyright (C) 2001,2002 Python Software Foundation
# csv package unit tests
import sys
import os
import unittest
from StringIO import StringIO
import tempfile
import csv
import gc
import io
from test import test_support
class Test_Csv(unittest.TestCase):
"""
Test the underlying C csv... |
import pyomo.environ as pe
import coramin
from coramin.algorithms.ecp_bounder import _ECPBounder
import unittest
import logging
logging.basicConfig(level=logging.INFO)
class TestECPBounder(unittest.TestCase):
def test_ecp_bounder(self):
m = pe.ConcreteModel()
m.x = pe.Var()
m.y = pe.Var(... |
value = float(input('请输入长度: '))
unit = input('请输入单位: ')
if unit == 'in' or unit == '英寸':
print('%f英寸 = %f厘米' % (value, value * 2.54))
elif unit == 'cm' or unit == '厘米':
print('%f厘米 = %f英寸' % (value, value / 2.54))
else:
print('请输入有效的单位')
|
from abc import ABC
from typing import List, Type
from reamber.base.lists.notes.NoteList import NoteList
class BMSNoteList(NoteList, ABC):
def data(self) -> List[Type]: pass
def samples(self) -> List[float]:
return self.attribute('sample')
|
#!/usr/bin/env python3
from collections import namedtuple
import matplotlib.pyplot as plt
Point = namedtuple('Point', 'x y')
Segment = namedtuple('Segment', 'p q')
Segment.from_floats = lambda x0, y0, x1, y1: Segment.from_points(Point(x0, y0), Point(x1, y1))
Segment.from_points = lambda p, q: Segment(*sorted([p, q... |
#
# PySNMP MIB module MITEL-APPLIST-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MITEL-APPLIST-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:02:49 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Ma... |
import json
import os
import unicodedata
import csv
# Function that converts currency symbol into 3 char string (currency code) to be returned
def curr_symbol_to_code(symbol):
code = ""
if symbol == "£":
code = "GBP"
elif symbol == "€":
code = "EUR"
elif symbol == "₽":
code = "... |
# coding=utf-8
import os
import tensorflow as tf
import numpy as np
from scipy.io.wavfile import write
from tqdm import tqdm
from base.base_predict import BasePredict
from utils.signal_process import spectrogram2wav
def embedding_lookup(lookup_table, text_idices):
return [list(map(lambda x: lookup_table[x], text... |
# Copyright 2018 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... |
# type: ignore[attr-defined]
"""CLI to download videos from https://xvideos.com"""
try:
from importlib.metadata import PackageNotFoundError, version
except ImportError: # pragma: no cover
from importlib_metadata import PackageNotFoundError, version
try:
__version__ = version(__name__)
except PackageNotF... |
#====================================================================
# Ananth Sridharan, Jan 24th 2017
#
# AIRCRAFT WING GROUP: 29-1.2 SECTION IN NDARC THEORY MANUAL V1_11.PDF, pg 249
#
# AFDD 93 Model implemented by AS
# frequency-based sizing also implemented by AS
#==================================================... |
from django.shortcuts import render
from django.http import JsonResponse
import json
def index(request):
return render(request, 'home/index.html')
def run(request):
return render(request, 'home/run.html')
|
# Copyright 2017 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 bokeh
from bokeh import embed, io
from plotting import plot_conjugate
bokeh.io.output_file(filename='conjugate.html', title='conjugate')
fig = plot_conjugate()
script, div = embed.components(fig)
with open('abstract_math.html', 'r') as fin:
htmlstring = fin.read()
newhtmlstring = htmlstring.replace("<... |
"""
ulmo.ncdc.ghcn_daily.core
~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides direct access to `National Climatic Data Center`_
`Global Historical Climate Network - Daily`_ dataset.
.. _National Climatic Data Center: http://www.ncdc.noaa.gov
.. _Global Historical Climate Network - Daily: http:... |
from .challenge_2 import hex_xor
def repeating_key_xor(plaintext, key):
counter = 0
ciphertext = ''
for c in plaintext:
e = hex_xor(bytes.tohex(c), bytes.tohex(key[counter%len(key)]))
ciphertext += e
counter += 1
return ciphertext
|
load(":private/toolchain/cuda_configure_windows.bzl", "configure_windows_toolchain")
load(":private/toolchain/cuda_configure_linux.bzl", "configure_linux_toolchain")
load(":private/toolchain/lib_cuda_configure.bzl",
"get_cpu_value",
"auto_configure_fail"
)
def _cuda_configure_impl(repository_ctx):
... |
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Count
from django.template.defaultfilters import slugify
from aspc.coursesearch.models import Department, Course, Meeting, CAMPUSES_LOOKUP
import re
from datetime import datetime, date, time, timedelta
keyword_regex = re.co... |
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Copyright (c) 2017 The ProofOfGaming Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test recovery from a crash during chainstate writing.... |
# Generated by Django 3.0.2 on 2020-01-13 11:56
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
... |
import requests,json
import urllib.request,json
from .models import Book
# Getting api key
api_key = None
#Getting the book base url
base_url = None
def configure_request(app):
global api_key,base_url
api_key = app.config['BOOKS_API_KEY']
base_url = app.config['BOOK_API_BASE_URL']
def get_books():
'... |
#
# Copyright (C) 2015 Red Hat, 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 ... |
# 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 2.3.33.0
# ... |
# flake8: noqa: E501
import click
import pytest
from click.testing import CliRunner, Result
from salvia.cmds.plotnft import validate_fee
from salvia.cmds.plotnft import create_cmd, show_cmd
pytestmark = pytest.mark.skip("TODO: Works locally but fails on CI, needs to be fixed!")
class TestPoolNFTCommands:
def t... |
# -*- test-case-name: Cowrie Test Cases -*-
# Copyright (c) 2016 Dave Germiquet
# See LICENSE for details.
from __future__ import division, absolute_import
import pickle
import copy
from cowrie.shell import fs
class FakeServer:
"""
@ivar cfg Configuration for honeypot
@ivar hostname Servers Host Name
... |
# -*- coding: utf-8 -*-
# Автор: Гусев Илья
# Описание: Модуль загрузки корпусов.
from typing import List
import nltk
from pymorphy2 import MorphAnalyzer
from russian_tagsets import converters
from rnnmorph.data_preparation.grammeme_vectorizer import GrammemeVectorizer
from rnnmorph.data_preparation.word_vocabulary ... |
from flask import Flask, render_template
from draw_map import DrawMap
from figure_plot import Plotter
web_app = Flask(__name__)
@web_app.route('/home')
def home():
script = []
div = []
plotter = Plotter()
# draw figures
# Trending hashtags -- 0
temp_script, temp_div = plotter.hashtag_plot(d... |
##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
from django.test import TestCase
from django.db import connection
from robber import expect
from data.factories import OfficerFactory
from utils.raw_query_utils import dict_fetch_all
class RawQueryUtilsTestCase(TestCase):
def test_dict_fetch_all(self):
OfficerFactory(first_name='Jerome', last_name='Finn... |
"""
Components/Button
=================
.. seealso::
`Material Design spec, Buttons <https://material.io/components/buttons>`_
`Material Design spec, Buttons: floating action button <https://material.io/components/buttons-floating-action-button>`_
.. rubric:: Buttons allow users to take actions, and make ch... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
##############################################################################
#
# Based on:
# -----------------------------... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
# 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 app... |
import pytest
import torch
from flash.core.serve.types import Label
def test_path(session_global_datadir):
label = Label(path=str(session_global_datadir / "imagenet_labels.txt"))
assert label.deserialize("chickadee") == torch.tensor(19)
assert label.serialize(torch.tensor(19)) == "chickadee"
def test_l... |
# 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 ... |
# ------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -------------------------------------------------------------------------
from ._servi... |
# Copyright (c) 2020 the original author or 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
from mrjob.job import MRJob,MRStep
class reverseWebGraph(MRJob):
""" The class reverseWebGraph inherits from the MRJob library to perform the basic necessary functions.
This class is used to reverse the web-google link graph and output a list of all the possible source nodes for a given target node.
A... |
from .sdk_config import SDKConfig
global_sdk_config = SDKConfig()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.