text stringlengths 2 999k |
|---|
# Generated by Django 2.2 on 2019-04-05 02:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('declaracion', '0015_auto_20190405_0203'),
]
operations = [
migrations.AlterField(
model_name='deudasotros',
name='plaz... |
# Copyright (c) 2013 Per Unneberg
#
# 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,... |
from django.urls import path, include
from rest_framework import routers
from . import views
app_name = 'core'
router = routers.DefaultRouter()
router.register("tag", views.TagViewSet)
router.register("action", views.ActionViewSet)
router.register("category", views.CategoryViewSet)
router.register("transfer", views... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 21 11:55:12 2018
@author: ltetrel
"""
import os
import re
import shutil
import json
import subprocess
import gzip
#import sys
#sys.path.insert(0, os.getcwd())
import numpy as np
import nibabel as nib
import data2bids.utils as utils
... |
# Generated by Django 2.2 on 2019-05-21 22:39
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('tags', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='tag',
old_name='tittle',
new_name='ti... |
# encoding: utf-8
from __future__ import unicode_literals
import pytest
from web.security import Predicate
from web.security.predicate import always, never, Not
from helper import must_be_called
class TestBasicPredicateBehaviour(object):
def test_bare_predicate_fails(self):
with pytest.raises(NotImplementedErr... |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.md') as f:
README = f.read()
with open('LICENSE') as f:
LICENSE = f.read()
setup(
name='raspberry-resources',
version='0.1.0',
description='Raspberry Resources',
long_description=README,
author='Benjamin... |
#!/usr/bin/python
# Copyright (c) 2009 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.
"""
This tool creates a tarball with all the sources, but without .svn directories.
It can also remove files which are not strictly re... |
from __future__ import annotations
import typing as T
import tempfile
import importlib.resources
from pathlib import Path
import subprocess
from . import cmake_exe
def find_library(lib_name: str, lib_path: list[str], env: T.Mapping[str, str]) -> bool:
"""
check if library exists with CMake
lib_name must... |
#-------------------------------------------------------------------------
# Copyright 2012 Milinda Pathirage
#
# 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/license... |
# -*- coding: utf-8 -*-
'''
IPS pkg support for Solaris
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
This ... |
"""
Moved to sage.libs.eclib.constructor
TESTS::
sage: from sage.libs.cremona.constructor import CremonaModularSymbols
doctest:...: DeprecationWarning: the module sage.libs.cremona.constructor has moved to sage.libs.eclib.constructor
See http://trac.sagemath.org/19818 for details.
sage: CremonaModular... |
# Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
from django.contrib.auth.models import Group, Permission
from django.contrib.contenttypes.models import ContentType
from django.http import Http404
from django.test import RequestFactory, override_settings
from django.urls import reverse
from django.utils.translation import gettext_lazy
from wagtail.contrib.simple_tra... |
from argparse import ArgumentParser
import os
import downloader
_COMMAND_DOWNLOAD = 'download'
def _add_parser_category_download(subparsers):
parser = subparsers.add_parser(
_COMMAND_DOWNLOAD, help='downloads the file from the URL.')
parser.set_defaults(command=_COMMAND_DOWNLOAD)
parser.add_arg... |
# -*- 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 or... |
"""Device for Zigbee Home Automation."""
from __future__ import annotations
import asyncio
from collections.abc import Callable
from datetime import timedelta
from enum import Enum
import logging
import random
import time
from typing import TYPE_CHECKING, Any
from zigpy import types
import zigpy.exceptions
from zigpy... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/internal/import_test_package/outer.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.p... |
import os, sys
import numpy as np
from scipy.sparse import csr_matrix
import pandas as pd
from data_io import texts_nwd_csr
def nwd_H_J_w_csr(n_wd):
'''
Calculate the conditional entropy H({d}|w) quantifying the importance of each word.
ADAPTED VESION of nwd_H_J_w for csr-sparse matrices.
IN:
- n... |
from . import config, network
from .messages import EncryptedMessage
from .pk_from_hsm import get_privkey
from .version import __version__
|
import math
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.autograd as autograd
import torch.optim as optim
import numpy as np
from torch.autograd import Variable
from ctextgen.dataset import SST_Dataset
from ctextgen.model import RNN_VAE
import argparse
import random
import... |
"""Instruction descriptions for the "SPIR-V Extended Instructions for GLSL"
version 1.00, revision 2.
"""
INST_FORMAT = {
1 : {
'name' : 'Round',
'operands' : ['Id'],
'has_side_effects' : False,
'is_commutative' : False
},
2 : {
'name' : 'RoundEven',
'operand... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The FATE 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/lic... |
from typing import Type, Any
class Typed:
"""A typed command line argument.
A typed command line argument is used for specifying the type
to convert the value to. For example, consider the following code:
@cli
def double(number: Opt[int]('A number to double.')):
print(number ... |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import nonebot
import random
from nonebot import on_command, require
from nonebot.adapters.onebot.v11.bot import Bot
from nonebot.adapters.onebot.v11.event import GroupMessageEvent
from nonebot.adapters.onebot.v11.message import MessageSegment, Message
from nonebot.typing import T_State
from nonebot.params import Stat... |
# Copyright (c) 2014 Rackspace, 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 wr... |
import sys
import copy
import pprint
import pytest
import numpy as np
from utils import *
from addons import *
import qcdb
from qcdb.physconst import psi_bohr2angstroms
subject1 = """O 0 0 0
no_com
H 1 ,, 0 \t 0 # stuff-n-nonsense"""
ans1 = {'geom': [0., 0., 0., 1., 0., 0.],
'elbl': ['O', 'H'],
... |
# Copyright 2000-2002 by Andrew Dalke.
# Revisions copyright 2007-2010 by Peter Cock.
# All rights reserved.
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included ... |
# Copyright (c) 2012, 2017, 2019 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the fu... |
"""jobarchitect package."""
__version__ = "0.7.0"
|
"""
Module:
genie.libs.parser.ironware.show_ospf
Author:
James Di Trapani <james@ditrapani.com.au> - https://github.com/jamesditrapani
Description:
OSPF parsers for IronWare devices
Parsers:
* show ip ospf neighbor
* show ip ospf interface brief
"""
from genie.metaparser import MetaParser
from g... |
# Copyright (C) 2018-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
from django.conf import settings
from allauth.account import app_settings as allauth_settings
from allauth.account.models import EmailAddress
from cvat.apps.restrictions.models import UserAgreementStatus
from . import AUTH_ROLE
def create_u... |
# -*- coding: utf-8 -*-
# @program: APIAutoTest
# @description: TODO
# @Time : 2022-01-15 21:43
# @Author : Haruki
# @File : myunit.py
# @Version:1.0
import unittest
import requests
from common.log import log
from common.read_yaml import ReadYaml
requestInfo = ReadYaml().read_yaml('get_token.yaml')['login']
class... |
# qubit number=5
# total number=37
import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from ma... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 - 2020 -- Lars Heuer
# All rights reserved.
#
# License: BSD License
#
"""\
Setup script.
"""
from setuptools import setup
setup()
|
"""
## Overview
Vectors are collections of numbers. They can be added, substracted, multiplied and divided, in addition to several useful methods. Because of that they are great for representing locations and directions.
## Creating vectors
- `Vec(iterable)` - creates vector from iterable
- `Vec(*args)` - creates ve... |
import numpy as np
from keras import backend as K
from plotting import lossplot, roc, prcurve
from performance import ACC, MCC
from load_data import load_data
from model import build_model,compileModel,build_model_CNN
K.set_image_data_format('channels_last')
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # ... |
from django.core.exceptions import FieldDoesNotExist, ValidationError
from django.db import models
from django.utils.text import slugify
from dynamic_models import config, cache, compat
from dynamic_models.factory import ModelFactory
from dynamic_models.exceptions import NullFieldChangedError, InvalidFieldNameError
fr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module contains unit tests of the rmgpy.species module.
"""
import unittest
from rmgpy.species import Species
from rmgpy.transport import TransportData
from rmgpy.molecule import Molecule
from rmgpy.thermo import ThermoData
from rmgpy.statmech import Conformer, ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
from warnings import warn
import numpy as np
from zarr.core import Array
from zarr.storage import (DirectoryStore, init_array, contains_array, contains_group,
default_compressor, normalize_storage_path... |
import requests
import typing as t
from sqlalchemy import create_engine
from starlette.responses import JSONResponse
from fastapi import APIRouter, status
from fastapi import Path
from fastapi import Request
from pydantic import BaseModel
from sqlalchemy.sql.schema import BLANK_SCHEMA
from time import time
from datet... |
"""
####################################################################################################
# Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved.
# Filename : mango_r101_ete_pretrain.py
# Abstract : Model settings for mango end-to-end pretrain ... |
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import sys
from .common import check_non_admin, specs_from_args
from .install import handle_txn
from ..base.context impor... |
# coding: utf-8
# Usage:
# python tests/test_pyccel.py --execute
import os
from pyccel.commands.console import pyccel
from utils import clean_tests
# ...
def test_core():
print('============== testing core ================')
# ignored = [15, 18]
ignored = [15, 18, 5]
for i in range(0, 23+1):
... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import boto3
from .session import AwsSessionProvider
def get_session(region: str) -> bo... |
import os
import time
import csv
import numpy as np
import torch
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
cudnn.benchmark = True
import models
from metrics import AverageMeter, Result
import utils
args = utils.parse_command()
print(args)
os.environ["CUDA_VISIBLE_DEVICES"] = ar... |
# coding: utf-8
"""
UbiOps
Client Library to interact with the UbiOps API. # noqa: E501
The version of the OpenAPI document: v2.1
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from ubiops.configuration import Configuration
class DeploymentVer... |
from controller.login import views
url_maps = [
{'url': '/login', 'view': views.Login, 'endpoint': 'login'},
{'url': '/logout', 'view': views.Logout, 'endpoint': 'logout'},
{'url': '/api/get_qrcode', 'view': views.GetQrCode, 'endpoint': 'get_qrcode'},
{'url': '/api/check_login', 'view': views.CheckLogi... |
from storages.backends.s3boto3 import S3Boto3Storage
__all__ =(
'S3StaticStorage',
'S3DefaultStorage',
)
class S3StaticStorage(S3Boto3Storage):
default_acl = 'public-read'
location = 'static'
class S3DefaultStorage(S3Boto3Storage):
default_acl = 'private'
location = 'media' |
from enum import Enum
from logging import getLogger
from typing import List, Union
from eth_account.signers.local import LocalAccount
from hexbytes import HexBytes
from web3 import Web3
from gnosis.eth import EthereumClient
from gnosis.eth.contracts import get_multi_send_contract
from gnosis.eth.ethereum_client impor... |
"""
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... |
'''
Created on Oct 5, 2010
@author: Mark V Systems Limited
(c) Copyright 2010 Mark V Systems Limited, All rights reserved.
'''
from arelle import ViewWinTree, ModelDtsObject, XbrlConst
from arelle.ModelRelationshipSet import ModelRelationshipSet
from arelle.ModelDtsObject import ModelResource
from arelle.ModelInstance... |
from dipy.reconst.cache import Cache
from dipy.core.sphere import Sphere
from numpy.testing import assert_, assert_equal, run_module_suite
class TestModel(Cache):
def __init__(self):
pass
def test_basic_cache():
t = TestModel()
s = Sphere(theta=[0], phi=[0])
assert_(t.cache_get("design_mat... |
#!/usr/bin/env python
from __future__ import division
import numpy as np
import rospy
from visualization_msgs.msg import Marker, MarkerArray
from geometry_msgs.msg import Point
from std_msgs.msg import ColorRGBA
from osprey.msg import path
from safe_traffic_weaving.msg import VehicleTrajectory
from utils.markers impor... |
##############################################################################
#
# Copyright (c) 2003-2018 by The University of Queensland
# http://www.uq.edu.au
#
# Primary Business: Queensland, Australia
# Licensed under the Apache License, version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Development unt... |
import os
import re
import sys
import argparse
import six
import txaio
txaio.use_twisted()
from twisted.internet import reactor
from twisted.internet import stdio
from twisted.internet.defer import inlineCallbacks
from twisted.internet.protocol import Protocol
from twisted.protocols.basic import LineReceiver
from tw... |
from setuptools import setup
def readme():
with open('README.md') as f:
README = f.read()
return README
setup(
name = 'Test_train_validation_split',
packages = ['test_train_validation_split_by_rajeev'],
version = '0.1.1',
license='MIT',
description = 'A pytho... |
# from . import *
from .dataload_parallel import DataLoad as DataLoadP
from .load_cdf import load_cdf
from .mms_load_data_shims import mms_load_fgm
from .mms_load_data_shims import mms_load_mec
from .mms_load_data_shims import mms_load_hpca
from .mms_load_data_shims import mms_load_fpi
from .mms_load_data_shims import... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# skorch documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 13 11:29:12 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
# aut... |
###################################################################################
# Copyright 2021 National Technology & Engineering Solutions of Sandia, #
# LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the #
# U.S. Government retains certain rights in this software. ... |
"""blog URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/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-... |
"""Get info about a File Extension
Syntax: .filext EXTENSION"""
import requests
from bs4 import BeautifulSoup
from uniborg.util import admin_cmd
@borg.on(admin_cmd(pattern="filext (.*)"))
async def _(event):
if event.fwd_from:
return
await event.edit("Processing ...")
sample_url = "https://www.fi... |
# Copyright 1997 - 2018 by IXIA Keysight
#
# 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, p... |
# -*- 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... |
# Copyright (c) 2014 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
#
# Unless require... |
# 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 os
from sanic.response import raw
from prometheus_client import (
start_http_server,
multiprocess,
CollectorRegistry
)
from prometheus_client import CONTENT_TYPE_LATEST, core
from prometheus_client.exposition import generate_latest
from . import metrics, endpoint
from .exceptions import SanicPrometh... |
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework import status
from rest_framework.views import APIView
@api_view(['GET','POST'])
def index (request):
if request.method == 'GET':
return Response(data={'message':'This is test reponse for GET re... |
"""Simulate the chances of getting 5 heads in a row"""
import random
from collections import Counter
def simulation_run(number_of_trials_per_sim=None):
"""A single simulation run"""
count_of_heads = []
for _ in range(number_of_trials_per_sim):
a_value = 0
for _ in range(5):
b_va... |
from unittest import TestCase
from electionguard.schema import get_election_description_schema, validate_json_schema
import electionguardtools.factories.election_factory as ElectionFactory
election_factory = ElectionFactory.ElectionFactory()
class TestSchema(TestCase):
"""Test cases for schema"""
def test_... |
# Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
from . import base, dynamics
from .base import *
__all__ = base.__all__
|
from char import IChar
from config import Config
from logger import Logger
from pather import Location, Pather
from typing import Union
from item.pickit import PickIt
from template_finder import TemplateFinder
from town.town_manager import TownManager
from ui import UiManager
from utils.misc import wait
class Pindle:... |
# -*- encoding: utf-8 -*-
import json
from werkzeug.test import Client
class FakeIP(object):
def __init__(self, app, ip):
self.app = app
self.ip = ip
def __call__(self, environ, start_response):
environ['REMOTE_ADDR'] = self.ip
return self.app(environ, start_response)
cla... |
import io
import os
import json
from girder.models.collection import Collection
from girder.models.folder import Folder
from girder.models.item import Item
from girder.models.upload import Upload
from girder.models.user import User
import pydicom
from tests import base
from girder_dicom_viewer import _removeUniqueMet... |
# 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... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-09-24 05:23
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0025_auto_20170924_1052'),
]
operations = [
... |
import alpaca_trade_api as tradeapi
import time
key = "<YOUR KEY HERE>"
sec = "<YOUR SECRET KEY HERE>"
#API endpoint URL
url = "https://paper-api.alpaca.markets"
#api_version v2 refers to the version that we'll use
#very important for the documentation
api = tradeapi.REST(key, sec, url, api_version='v2')
#Init our ... |
from .client import Client, DevoClientException, DEFAULT, TO_STR, \
TO_BYTES, JSON, JSON_SIMPLE, COMPACT_TO_ARRAY, \
SIMPLECOMPACT_TO_ARRAY, SIMPLECOMPACT_TO_OBJ, ClientConfig
|
# Copyright 2015 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... |
# Copyright 2021, Yahoo
# Licensed under the terms of the Apache 2.0 license. See the LICENSE file in the project root for terms
import tempfile
from unittest import TestCase
from ychaos.app_logger import AppLogger
from ychaos.settings import DevSettings, ProdSettings, Settings
from ychaos.utils.logging import Struc... |
import unittest
import tempfile
import firebirdsql
from firebirdsql.tests.base import *
class TestIssues(TestBase):
def test_issue_39(self):
"""
.description attribute should be None when .execute has not run yet
"""
cur = self.connection.cursor()
self.assertEqual(None, cur.... |
import os
import requests
from discord.ext import commands
from cogs.bot import send_embed
class ESV(commands.Cog):
"""listens for the ESV Bible commands."""
@commands.command()
async def esv(self, ctx, *, passage: str = None):
if passage is None:
return
# Bible verse numbers... |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""
Parsing for the moduli file, which contains Diffie-Hellman prime groups.
Maintainer: Paul Swartz
"""
from twisted.python.compat import long
def parseModuliFile(filename):
with open(filename) as f:
lines = f.readlines()
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutNil in the Ruby Koans
#
from runner.koan import *
class AboutNone(Koan):
def test_none_is_an_object(self):
"Unlike NULL in a lot of languages"
self.assertEqual(True, isinstance(None, object))
def test_none_is_universal(self):
... |
# -*- 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
from ccxt.base.errors import ... |
from django.shortcuts import render
from django.http import HttpResponseRedirect
# <HINT> Import any new Models here
from .models import Question, Choice, Submission
from .models import Course, Enrollment
from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404, render, redirect
from d... |
# Adapted from examples from:
# https://bitbucket.org/brendanlong/python-encryption
# Released into the Public Domain
from Crypto.Cipher import AES
from Crypto.Protocol.KDF import PBKDF2
from Crypto import Random
from Crypto.Hash import HMAC
import base64
import json
# We keep the salt defined to be the same since th... |
from math import ceil # numpy as np
from .initialisation import PSU_OFFICERS
from .agents import ForcePSUAgent
def find_force(forces, name):
for force in forces:
if force.name == name: return force
raise ValueError("Force %s not found" % name)
def find_other_forces(forces, name, alliance, in_alliance=True):
... |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Tickformatstop(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "bar.marker.colorbar"
_path_str = "bar.marker.colorbar.tickformatstop"
_valid_props =... |
# 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 ... |
'''@file seq_convertors.py
this file contains functions that convert sequential data to non-sequential data
and the other way around. Sequential data is defined to be data that is suetable
as RNN input. This means that the data is a list containing an N x F tensor for
each time step where N is the batch size and F is t... |
from bokeh.plotting import ColumnDataSource, figure, gridplot, output_file, show
from bokeh.sampledata.autompg import autompg
output_file("panning.html")
# Load some Automobile data into a data source. Interesting columns are:
# "yr" - Year manufactured
# "mpg" - miles per gallon
# "displ" - engine displacement
# "hp... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
import torch
import torch.utils.data as data
import os, random, json, logging
import numpy as np
import sklearn.metrics
class SentenceREDataset(data.Dataset):
"""
Sentence-level relation extraction dataset
"""
def __init__(self, path, rel2id, tokenizer, kwargs):
"""
Args:
pa... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=no-self-use, C0330
from __future__ import (division, absolute_import, print_function,
unicode_literals, annotations)
import scrapy
class RedditSpider(scrapy.Spider):
name = 'reddit'
start_urls = ['https://www.reddit.com']... |
from torch.cuda import amp
from .scheduler import SchedulerOptimizer
class OptimizationWrap():
def __init__(self, optimizer, enable_amp = False, accumulate_step = 1):
self.optimizer = optimizer
if enable_amp:
self.gradscaler = amp.grad_scaler.GradScaler()
else: self.gradscaler =... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-22 06:11
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('restaurants', '0003_auto_20170822_0521'),
]
operations... |
from functools import partial
from typing import Any, Dict
import pytest
from pydantic import ValidationError
from tests.utils.asserts import assert_validation_error
from todolist.core.todo.entities.todo_item import TodoItem
# Types
DataType = Dict[str, Any]
# Fixtures
@pytest.fixture(name="valid_data")
def valid_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.