text stringlengths 2 999k |
|---|
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
from pydantic import ValidationError
from rest_framework.request import Request
from drf_stripe.settings import drf_stripe_settings
from drf_stripe.stripe_api.api import stripe_api as stripe
from drf_stripe.stripe_models.event import EventType
from drf_stripe.stripe_models.event import StripeEvent
from .customer_subsc... |
# Natural Language Toolkit: WordNet Browser Application
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Jussi Salmela <jtsalmela@users.sourceforge.net>
# Paul Bone <pbone@students.csse.unimelb.edu.au>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
A WordNet Browser application whic... |
from collections import abc
from typing import Dict, Hashable, Mapping, Sequence, Set
def compare_paths_lt(x, y):
min_length = min(len(x), len(y))
if x[:min_length] == y[:min_length]:
return len(x) == min_length
for i in range(min_length):
a, b = x[i], y[i]
for _type in (int, st... |
from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "mgmtest-32718.botics.co"
site_params = {
"name": "mgmtest",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.update_or_create(d... |
# coding: utf-8
from __future__ import unicode_literals, absolute_import, print_function, division
import asyncio
import pandas as pd
from pathlib import Path
import concurrent.futures
def _read_text_format_lines(lines):
items = []
current_item = None
current_item_key = None
for index, line in enume... |
'''Portfolio optimization local normalization analysis module.
The functions in the module use local normalization to compute the returns, the
normalized returns and the correlation matrix of financial time series.
This script requires the following modules:
* pickle
* typing
* numpy
* pandas
* lo... |
""" Classes for image encapsulation
Used to create a standard interface for ND images which can
be instantiated with either NIFTI files or using numpy arrays """
from copy import deepcopy
from abc import ABC, abstractmethod
from typing import Union, Tuple, Type
import numpy as np
import nibabel as nib
UNITS_METERS... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
import pandas as pd
import random
import itertools
def create_net_edges(start_node, end_node):
node1 = random.randint(start_node,end_node)
node2 = random.randint(start_node,end_node)
return node1, node2
def list_edges(n_edges, start_node, end_node):
edges = [(create_net_edges(start_node, end_node)) f... |
# -*- coding: utf-8 -*-
__author__ = "苦叶子"
"""
公众号: 开源优测
Email: lymking@foxmail.com
"""
from flask import current_app, url_for, redirect, session
from flask_restful import Resource, reqparse
from werkzeug.security import generate_password_hash, check_password_hash
import json
import os
import codecs
from utils.too... |
#!/usr/bin/env python
# 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
# "L... |
from django.apps import AppConfig
class TranscriberConfig(AppConfig):
name = 'transcriber'
|
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from logicbit.quine_mccluskey import *
trueTable = ['0000','0001','0100','0101','1111']
#trueTable = ['0011','0000','0110','1011']
quine_mcCluskey = Quine_mcCluskey(trueTable)
quine_mcCluskey.Compute() |
from typing import Dict, List, Optional
from blspy import AugSchemeMPL, G2Element, PrivateKey
from chiadoge.consensus.constants import ConsensusConstants
from chiadoge.util.hash import std_hash
from chiadoge.types.announcement import Announcement
from chiadoge.types.blockchain_format.coin import Coin
from chiadoge.ty... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def transact(path):
"""Transaction data
Data on transaction times in b... |
import logging
from collections import namedtuple
from datetime import datetime
from datetime import timedelta
logger = logging.getLogger(__name__)
Action = namedtuple('scenario_action', ['meal'])
class Scenario(object):
def __init__(self, start_time):
self.start_time = start_time
def get_action(sel... |
{
"targets": [
{
"target_name": "<(module_name)",
"sources": [
"src/wx.cpp",
"src/misc.cpp",
"src/widgets/wxApp.cpp",
"src/widgets/wxFrame.cpp",
"src/widgets/wxPanel.cpp",
"src/widgets/wxB... |
#!/usr/bin/env python
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
request_path = self.path
print(self.headers['User-Agent'])
self.send_response(200)
self.send_header("S... |
from dataclasses import dataclass
# https://community.finicity.com/s/article/207505363-Multi-Factor-Authentication-MFA
@dataclass
class AnsweredMfaQuestion(object):
text: str
answer: str # Added by the partner for calls to the "MFA Answers" services
_unused_fields: dict # this is for forward compatibili... |
"""Non nullable user info
Revision ID: d4f359418780
Revises: 6e70207979a9
Create Date: 2020-05-01 12:46:57.592752
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "d4f359418780"
down_revision = "6e70207979a9"
branch_labels = None
depends_on = None
def upgrade(... |
#!/usr/bin/env python3
import socket
from util import ip4_range, reassemble4_ether
import unittest
from framework import VppTestCase, VppTestRunner
from template_bd import BridgeDomain
from scapy.layers.l2 import Ether
from scapy.packet import Raw
from scapy.layers.inet import IP, UDP
from scapy.layers.vxlan import V... |
import sys
import time
import tweepy
from tweepy import OAuthHandler
from tweepy import Stream
from tweepy.streaming import StreamListener
import socket
import json
import logging
import csv
#Twitter API credentials
CONSUMER_KEY = 'tOpKHcNzNpu88PSZxAzCI87Ne'
CONSUMER_SECRET = 'EhSEN89oydJi058EkQP3iMjsVlYw6yLYZ2Uq2UAV... |
#Takes in the IP address for which to call svcstats
#iterates through JSON keys for the endpoints, and returns them
import json
import urllib2
import sys
def extract(arg):
arg = arg.strip('\n')
if (arg == ""):
return
url = arg + ":9090/svcstats"
res = urllib2.urlopen(url).read()
parsed = json.loads(str(res))
... |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
'''
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salttesting.mock import MagicMock, patch, NO_MOCK, NO_MOCK_REASON
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Imp... |
import os
import time
import glob
import argparse
import os.path as osp
from tqdm import tqdm
from typing import Optional, List, NamedTuple
import numpy as np
import torch
from torch import Tensor
import torch.nn.functional as F
from torch.nn import ModuleList, Sequential, Linear, BatchNorm1d, ReLU, Dropout
from torc... |
# -*- coding: utf-8 -*-
import datetime
import hashlib
import json
import os
import subprocess
import tempfile
from copy import deepcopy
from decimal import Decimal
from functools import wraps
from zipfile import BadZipfile
from django.conf import settings
from django.core.cache import cache
from django.core.files.st... |
#!/usr/bin/env python
from chips.api.api import *
import sys
import subprocess
from random import randint
from random import seed
def compile():
subprocess.call("iverilog -o test_bench_tb file_reader_a.v file_reader_b.v file_writer.v multiplier.v test_bench.v test_bench_tb.v", shell=True)
def get_mantissa(x):
... |
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import DetailView, ListView
from dfirtrack_main.logger.default_logger import debug_logger
from dfirtrack_main.models import Analysisstatus
class AnalysisstatusList(LoginRequiredMixin, ListView):
login_url = '/login'
model = A... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('changeset', '0022_auto_20160222_2358'),
]
operations = [
migrations.AddField(
model_name='userdetail',
... |
'''Trains WGAN on MNIST using Keras
Trains a GAN using Wassertein loss. Similar to DCGAN except for
linear activation in output and use of n_critic training per
adversarial training. Discriminator weights are clipped as a
requirement of Lipschitz constraint.
[1] Radford, Alec, Luke Metz, and Soumith Chintala.
"Unsup... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import numpy as np
from models.losses import FocalLoss
from models.losses import RegL1Loss, RegLoss, NormRegL1Loss, RegWeightedL1Loss, TagLoss_2
from models.utils import _sigmoid
from utils.debugg... |
"""
Base classes / logic for marshalling go here.
"""
from marshmallow import Schema, fields
from testplan.common.serialization import fields as custom_fields
from testplan.common.serialization.schemas import SchemaRegistry
from .. import base
class AssertionSchemaRegistry(SchemaRegistry):
def get_category(self... |
from __future__ import annotations
from ps4.encryption import EncryptionModule, DecryptionModule
from enum import Enum
class PacketType(Enum):
CLIENT_HELLO = 1
CLIENT_LOGIN = 2
CLIENT_STATUS = 3
CLIENT_SHUTDOWN = 4
CLIENT_KEYEXCHNG = 5
CLIENT_APPLAUNCH = 6
SERVER_HELLO_RSP = 7
SERVER... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
PyEM18
Copyright (C) 2018 Dhaval Savalia <dhaval.savalia6@gmail.com>
All rights reserved.
"""
import os
import serial
class PyEM18(object):
"""
A Python written library for EM-18 reader mudule
@attribute Serial __serial
UART serial connection via PySerial.
@a... |
'''
Given an unsorted array of integers nums, return the
length of the longest consecutive elements sequence.
You must write an algorithm that runs in O(n) time.
Example:
Input: nums = [100,4,200,1,3,2]
Output: 4
Explanation: The longest consecutive elements sequence
is ... |
#!/usr/bin/env python
import sys
sys.path.append("../")
from logparser import Spell
input_dir = "../logs/HDFS/" # The input directory of log file
output_dir = "Spell_result/" # The output directory of parsing results
log_file = "HDFS_2k.log" # The input log file name
log_format = "<Date> <Time> <Pid> <Lev... |
# lat6.py
# Operator dan Ekspresi
bilangan1 = 5
bilangan2 = 3
print("bil1 = ", bilangan1)
print("bil2 = ", bilangan2)
print("bil1 + bil2 = ", bilangan1 + bilangan2)
print("bil1 - bil2 = %s" %(bilangan1 - bilangan2))
print("bil1 * bil2 = {0}".format(bilangan1 * bilangan2))
print("bil1 ** bil2 = ", bilanga... |
from .Shop import Shop
from bs4 import BeautifulSoup
from .Product import Product
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
class ShopMindfactory(Shop):
def getDomain(self):
return 'mindfactory.de'
def getProducts(self, response, url):
products = []
... |
"""
Michael duPont - michael@mdupont.com
tests - avwx test cases
"""
# stdlib
import sys
from pathlib import Path
# Add the parent directory to the test path
parent_dir = Path(__file__).parent.joinpath("..")
sys.path.insert(0, parent_dir)
|
from contextlib import contextmanager
import pytest
from dagster import (
AssetKey,
AssetMaterialization,
DagsterEventType,
Output,
execute_pipeline,
pipeline,
seven,
solid,
)
from dagster.core.events.log import EventRecord
from dagster.core.instance import DagsterInstance, InstanceTyp... |
"""
Simulation environment for stacking duplo bricks in a balance act
"""
import sys
import agx
import agxOSG
import agxPython
import agxIO
import duplo_simulation.agx_duplo_bricks as duplo_bricks
import duplo_simulation.agx_common_functions as common_functions
import rclpy #pylint: disable=import-error
def build_s... |
import ast
import importlib
import logging
import os
from flask import Flask
from amundsen_application.api import init_routes
from amundsen_application.api.v0 import blueprint
from amundsen_application.api.announcements.v0 import announcements_blueprint
from amundsen_application.api.log.v0 import log_blueprint
from a... |
#!/usr/bin/python3
from trash_dash import run
run()
|
import json
import time
from datetime import timedelta, datetime
from flask import render_template, request, session, redirect, url_for
from flask_socketio import emit, join_room
from app import app, socketio, db, celery
from .models import Player, Schedule, Question, Answer, Option, Faction, Weight
from .schedule impo... |
import nltk
class Vocabulary():
"""
Class for building and handling vocabulary in dataset
"""
def __init__(self):
#initialize known tokens
self.index_to_word = {0: "<PAD>", 1:"<START>", 2:"<END>",3:"<UNK>"}
self.word_to_index = {v:k for k, v in self.index_to_word.items()}
... |
from .SSTDataset import * |
import math
from collections import namedtuple
from functools import partial
from inspect import isfunction
import torch
from torch import nn
import torch.nn.functional as F
from fairseq.modules import (
AdaptiveInput,
CharacterTokenEmbedder,
AdaptiveSoftmax,
FairseqDropout,
LayerDropModuleList,
... |
"""
PASSENGERS
"""
numPassengers = 3763
passenger_arriving = (
(9, 9, 5, 5, 1, 0, 10, 10, 5, 1, 5, 0), # 0
(5, 9, 9, 5, 3, 0, 11, 8, 6, 4, 1, 0), # 1
(5, 7, 8, 4, 2, 0, 10, 7, 3, 3, 3, 0), # 2
(6, 7, 13, 6, 1, 0, 4, 9, 9, 4, 7, 0), # 3
(2, 12, 8, 4, 4, 0, 9, 3, 6, 2, 3, 0), # 4
(5, 9, 10, 7, 3, 0, 6, 3, 5... |
from typing import List
import attr
from qaseio.client.models.base import DefaultFilter, DefaultList
@attr.s
class TestSuiteCreate:
title: str = attr.ib()
description: str = attr.ib(default=None)
preconditions: str = attr.ib(default=None)
parent_id: int = attr.ib(default=None)
@attr.s
class TestSu... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mytfm.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
# src/postmodern_python/wikipedia.py
import click
import requests
API_URL = "https://{language}.wikipedia.org/api/rest_v1/page/random/summary"
def random_page(language="en"):
url = API_URL.format(language=language)
try:
with requests.get(url) as response:
response.raise_for_status()... |
# Copyright 2018 The gRPC 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 or agreed to in writ... |
from django.template import TemplateSyntaxError
from django.test import SimpleTestCase, ignore_warnings
from django.utils.deprecation import RemovedInDjango20Warning
from ..utils import setup
class FirstOfTagTests(SimpleTestCase):
libraries = {'future': 'django.templatetags.future'}
@setup({'firstof01': '{%... |
from datasets.dataset_utils import load_dataset_from_pkl, load_dataset_from_from_folder
from datasets.dataset_template import ColorDatasetInMemory, ColorDatasetOnDisk
import os
def get_FishRecognition(args_per_set, setnames=["train", "val", "test"]):
"""
Returns FishRecognition datasets.
"""
datasets ... |
"""Module for testing string variables."""
class TestStringVar(BaseTestCase):
def setUp(self):
BaseTestCase.setUp(self)
self.rawData = []
self.dataByKey = {}
for i in range(1, 11):
stringCol = "String %d" % i
fixedCharCol = ("Fixed Char %d" % i).lj... |
w, b = input().split()
w = int(w)
b = float(b)
if (w % 5 == 0 and b>(w+.5)):
b = b - w - 0.5
print('%.2f' % b)
else:
print('%.2f' % b) |
# Generated by Django 3.2.4 on 2021-06-09 13:33
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('posts', '0002_alter_post_author'),
]
operations ... |
import os
import shutil
# set path
train_path = 'train/'
if not os.path.exists(train_path):
os.makedirs(train_path)
test_path = 'test/'
if not os.path.exists(test_path):
os.makedirs(test_path)
# move data
frame_dir = 'frame/'
f = open('ucfTrainTestlist/trainlist01.txt')
for line in f.readlines():
folder ... |
class _AuxLosses:
def __init__(self):
self._losses = {}
self._loss_alphas = {}
self._is_active = False
self._obs = None
def clear(self):
self._losses.clear()
self._loss_alphas.clear()
self._obs = None
def register_loss(self, name, loss, alpha=1.0):
... |
#-*- coding: utf-8 -*-
from __future__ import print_function
import itertools as it, operator as op, functools as ft
import os, sys, re, errno, types, socket
from cffi import FFI
# Try to work around insane "write_table" operations (which assume that
# they can just write lextab.py and yacctab.py in current dir), ... |
from django.conf import settings
def app_name(request):
name = getattr(settings, 'APP_NAME', 'Unknown')
return {'APP_NAME': name} |
from django.contrib import admin
from .models import Profile, Firm, AppUser
#############################################################
# Defining proper and covenient models to be set in
# adminstration site in order to filter and search on fields
#############################################################
clas... |
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env("DJANGO_SECRET_KEY")
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED... |
import concurrent.futures
import numpy as np
from comancpipeline.Analysis import BaseClasses
from comancpipeline.Analysis import Calibration
from comancpipeline.Tools import WCS, Coordinates, Filtering, Fitting, Types, ffuncs, binFuncs, stats
from comancpipeline.data import Data
from scipy.optimize import fmin, leasts... |
# Copyright 2013-2021 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 spack import *
class PerlTryTiny(PerlPackage):
"""Minimal try/catch with proper preservation of $@"""
home... |
from os import path
from typing import List, Dict
from pathlib import Path
from re import sub
from subprocess import run
class GitGopher():
def __init__(self, command_factory, options):
self._command_factory = command_factory
self._options = options
def process(self, argv: list):
num_a... |
#-----------------------------------------------------------------------------
#
# TSDuck - The MPEG Transport Stream Toolkit
# Copyright (c) 2005-2021, Thierry Lelegard
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... |
from typing import Callable
import pytest
import torch
from rainy.net import GruBlock, LstmBlock, RnnBlock
from rainy.utils import Device
@pytest.mark.parametrize("rnn_gen", [GruBlock, LstmBlock])
def test_rnn(rnn_gen: Callable[[int, int], RnnBlock]) -> None:
TIME_STEP = 10
BATCH_SIZE = 5
INPUT_DIM = 20... |
def escreva(txt):
tam = len(txt) + 4
print('-' * tam)
print(txt)
print('-' * tam)
escreva('Olá Mundo')
escreva('Neymar melhor do mundo')
escreva('Oi') |
# from timeit import timeit
import numpy as np
from kramersmoyal.binning import bincount1, bincount2
# b1 = list()
# b2 = list()
def test_bincount():
for N in [1000000, 10000000]:
for Nw in [1, 5, 10, 20, 40]:
xy = np.random.randint(100, size=(N))
weights = np.random.rand(N, Nw).T... |
import os
import pandas as pd
import numpy as np
from sklearn.feature_selection import VarianceThreshold
adult_data_file = "D:/software/Python/data/chapter5/adult.data"
adult = pd.read_csv(adult_data_file,header=None,
names=["Age", "Work-Class", "fnlwgt",
"Education... |
from __future__ import absolute_import
import bisect
import functools
import itertools
import logging
import math
import operator
import zlib
from calendar import Calendar
from collections import OrderedDict, namedtuple
from datetime import datetime, timedelta
import pytz
from django.utils import dateformat, timezone... |
import itertools
import logging
import zope.component
import zope.interface
import zmq
from zmq.utils import z85
from .interfaces import (AUTHENTICATED,
EMPTY_DELIMITER,
IAuthenticationBackend,
IClient,
IServer,
... |
# Copyright 2019 The Magenta 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 or agreed to in ... |
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: david@reciprocitylabs.com
# Maintained By: david@reciprocitylabs.com
from behave import given, then
from tests.ggrc.behave.utils import get_resourc... |
"""Collects the target info
"""
import os
import tempfile
import thermfit
import automol
import autofile
import mess_io
import autorun
from mechanalyzer.inf import spc as sinfo
from mechanalyzer.inf import thy as tinfo
from mechlib import filesys
import mechlib.amech_io.printer as ioprinter
from mechlib.amech_io imp... |
# -*- 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.async_support.base.exchange import Exchange
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import A... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © Her Majesty the Queen in Right of Canada, as represented
# by the Minister of Statistics Canada, 2019.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... |
from fastapi import FastAPI
app = FastAPI()
# Beware to origins allowed ! In this template by default every IP can reach your API !
from starlette.middleware.cors import CORSMiddleware
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_header... |
'''
====================================================================
Copyright (c) 2016 Barry A Scott. All rights reserved.
This software is licensed as described in the file LICENSE.txt,
which you should have received as part of this distribution.
===========================================================... |
# 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... |
# terrascript/provider/icinga2.py
import terrascript
class icinga2(terrascript.Provider):
pass
__all__ = ["icinga2"]
|
#
# Copyright (c) 2016 Fireeye, Inc. All rights reserved.
#
# Modifications Copyright (c) nexB, Inc. and others. All rights reserved.
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0... |
# -*- encoding: utf-8 -*-
'''
Flexible Data Gathering: curl
=============================
This fdg module allows for querying against URLs
Note that this module doesn't actually shell out to curl. Instead, it uses
the requests library, primarily for performance concerns.
Also note that this module doesn't support ch... |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2014, John McNamara, jmcnamara@cpan.org
#
import unittest
import os
from ...workbook import Workbook
from ..helperfunctions import _compare_xlsx_files
class TestCompareXLSXFiles(unittest.... |
from typing import Union, List, Optional
from pyspark.sql.types import StructType, StructField, StringType, ArrayType, DataType
# This file is auto-generated by generate_schema so do not edit manually
# noinspection PyPep8Naming
class Contract_SignerSchema:
"""
A formal agreement between parties regarding th... |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
'''
Created on 28/03/2014
@author: thiago-amm
'''
class Produto(object):
def __init__(self):
self.__id = None
self.__nome = None
self.__preco = None
@property
def id(self):
return self.__id
@id.setter
def id(self,... |
""" List of all enabled routers"""
from .api_status import router as api_status
from .router import Router
routers = [Router(prefix="/api-status", api_router=api_status)]
|
"""
Library containing various pulse shapes.
"""
import sys
import numpy as np
import scipy as sp
from pycqed.measurement.waveform_control import pulse
import logging
log = logging.getLogger(__name__)
pulse.pulse_libraries.add(sys.modules[__name__])
class SSB_DRAG_pulse(pulse.Pulse):
"""In-phase Gaussian pulse... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Additional basic list exercises
# D. Given a list of numbers, return a list where
# al... |
# Copyright (c) 2019 Graphcore Ltd. All rights reserved.
import argparse
import numpy as np
import tensorflow as tf
from tensorflow.python.ipu import autoshard, ipu_compiler, scopes, utils
parser = argparse.ArgumentParser()
parser.add_argument("--autoshard", action="store_true",
help="Enables au... |
# Copyright 2020 Tensorforce Team. 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... |
r"""
_________ _____.__ .__
\_ ___ \ ____ _____/ ____\__| ____ __ __| | _____ _______
/ \ \/ / _ \ / \ __\| |/ ___\| | \ | \__ \\_ __ \
\ \___( <_> ) | \ | | / /_/ > | / |__/ __ \| | \/
\______ /\____/|___| /__| |__\___ /|____/|____(____ /__|
... |
import json
import numpy as np
from rastervision2.pipeline.file_system import str_to_file, file_to_str
chip_sz = 300
def parallel_variance(mean_a, count_a, var_a, mean_b, count_b, var_b):
"""Compute the variance based on stats from two partitions of the data.
See "Parallel Algorithm" in
https://en.wik... |
#!/usr/bin/env python3
from pathlib import Path
from vunit import VUnit
# ROOT
ROOT = Path(__file__).resolve().parent
VU = VUnit.from_argv()
main = VU.add_library("main")
main.add_source_files(ROOT / "source/fpga_interconnect" / "bus_controller" / "*.vhd")
main.add_source_files(ROOT / "source/fpga_interconnect" / "*... |
# Copyright 2016 Grist Labs, 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 writi... |
from django.apps import AppConfig
class TodoApiConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'todo_api'
|
import unittest
from faker import Faker
from veritranspay.payment_types import CreditCard, Indomaret, VirtualAccountPermata, VirtualAccountBca, \
VirtualAccountBni, VirtualAccountMandiri, BriEpay, MandiriClickpay, CimbClicks, BCAKlikPay, KlikBCA, GoPay
fake = Faker()
class CreditCardTests(unittest.TestCase):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.