text stringlengths 2 999k |
|---|
"""Command side-effect execution logic container."""
from logging import getLogger
from typing import Optional
from ..state import StateStore
from ..resources import ModelUtils
from ..commands import CommandStatus
from ..actions import ActionDispatcher, UpdateCommandAction, FailCommandAction
from ..errors import Proto... |
import tempfile
import logging
from django.http import Http404
from django.urls import reverse
from rest_framework import status, mixins
from rest_framework.decorators import action
from rest_framework.exceptions import ValidationError
from rest_framework.response import Response
from rest_framework.viewsets import Ge... |
# Generated by Django 2.2 on 2020-06-24 05:02
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
opera... |
"""Make / Download Telegram Sticker Packs without installing Third Party applications
Available Commands:
.kang [Optional Emoji]
.packinfo
.getsticker"""
from telethon import events
from io import BytesIO
from PIL import Image
import asyncio
import datetime
from collections import defaultdict
import math
im... |
# -*- coding: utf-8 -*-
"""
Created: on 2018-05-14
@author: Four
Project: case\Login.py
Description:登陆
"""
import time,os
import sys
import requests
from ruamel import yaml
from common.log import Logger
logger_message = Logger()
send_time = time.strftime("%Y-%m-%d-%H_%M_%S", time.localtime(time.time()))
current_path = ... |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets 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 appl... |
#!/usr/bin/env python3
# Copyright (c) 2015-2020 The TNGC Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test node responses to invalid network messages."""
import struct
import time
from test_framework.messag... |
import json
import os
from .utils.appdirs import AppDirs
try:
from yaml import load as yaml_load, dump as yaml_dump, YAMLError
except ImportError:
useYAML = False
else:
useYAML = True
try:
from yaml import CLoader as YAMLLoader, CDumper as YAMLDumper
except ImportError:
from yaml i... |
#! /misc/local/python-3.8.2/bin/python3
"""
mosaic-pipeline
This program is the entry point for the MOSAIC pipeline.
"""
import argparse
import os
import re
import json
import math
import time
import datetime
from pathlib import Path, PurePath
from sys import exit
import mosaicsettings2json
def parse_args():
pars... |
#import itertool
import struct
from . import lexicon
from .. import dartsclone
from . import wordidtable
from . import wordparameterlist
from . import wordinfolist
class DoubleArrayLexicon(lexicon.Lexicon):
def __init__(self, bytes_, offset):
self.trie = dartsclone.doublearray.DoubleArray()
byte... |
import os
import re
from pip import call_subprocess
from pip.index import Link
from pip.util import rmtree, display_path
from pip.log import logger
from pip.vcs import vcs, VersionControl
_svn_xml_url_re = re.compile('url="([^"]+)"')
_svn_rev_re = re.compile('committed-rev="(\d+)"')
_svn_url_re = re.compile(r'URL: (.+... |
import datetime
import decimal
import uuid
from dataclasses import field
import pytest
from dataclasses_avroschema import fields, types
from . import consts
@pytest.mark.parametrize("python_type,avro_type,logical_type", consts.LOGICAL_TYPES_AND_DEFAULTS)
def test_logical_types(python_type, avro_type, logical_type)... |
#!/usr/bin/env python3
from os import environ
from pathlib import Path
from subprocess import run
packagedirectory = Path(__file__).parents[1]
assert packagedirectory.exists()
def env(**kwargs):
return {**environ, **kwargs}
run(["cargo", "check"], check=True, cwd=packagedirectory)
run(["cargo", "fmt"], check=... |
# uncompyle6 version 3.2.0
# Python bytecode 2.4 (62061)
# Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)]
# Embedded file name: pirates.inventory.InventoryStackSeller
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from pirates.piratesgui impo... |
min = 9999999999
max = 0
data = []
def find_min_max():
global data, min, max
for i in data:
if i <= min:
min = i
elif i >= max:
max = i
else:
continue
return
if __name__ == '__main__':
size = int(input("Enter the size of the array : "))
print("Enter the element of array : "... |
import compas
if compas.RHINO:
import rhinoscriptsyntax as rs
def apply_conway_operator(singularity_mesh):
conway_operators = {
'back_to_seed',
'conway_dual',
'conway_join',
'conway_ambo',
'conway_kis',
'conway_needle',
'conway_zip',
'conway_truncate',
'conway_ortho',
'conway_expand',
'conway... |
_base_ = [
'../_base_/models/vit-base-p16.py',
'../_base_/datasets/imagenet_bs64_pil_resize_autoaug.py',
'../_base_/schedules/imagenet_bs4096_AdamW.py',
'../_base_/default_runtime.py'
]
model = dict(
head=dict(hidden_dim=3072),
train_cfg=dict(
augments=dict(type='BatchMixup', alpha=0.2,... |
from typing import Generic, List, TypeVar
from OpenGL.GL import (GL_TRIANGLES, GL_UNSIGNED_INT, glBindVertexArray,
glDisableVertexAttribArray, glDrawElements,
glEnableVertexAttribArray)
from ...entities.agent import Agent
from ...entities.entity import Entity
from ...mode... |
""" Utility functions for sparse matrix module
"""
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
__all__ = ['upcast', 'getdtype', 'isscalarlike', 'isintlike',
'isshape', 'issequence', 'isdense', 'ismatrix', 'get_sum_dtype']
supported_dtypes = ['bool',... |
"""Run an example script to quickly test the guardian."""
import asyncio
import logging
from aioguardian import Client
from aioguardian.errors import GuardianError
_LOGGER = logging.getLogger(__name__)
async def main() -> None:
"""Create the aiohttp session and run the example."""
logging.basicConfig(level=... |
#
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
import sys
import time
import random
import logging
import json
from framework.case_base import *
from framework.test_api import *
from harness.harness_api import *
class CTestCase(CTestCaseBas... |
"""webstock 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-base... |
from typing import Dict, Any
import torch
from allennlp.training.optimizers import Optimizer
from allennlp.common.testing import AllenNlpTestCase
from allennlp.training.learning_rate_schedulers import LearningRateScheduler
from allennlp.common.params import Params
class CosineWithRestartsTest(AllenNlpTestCase):
... |
import os
import json
# 读入 groundtruth
gt_all = {}
gt = []
with open("./groundtruth.json", 'r', encoding='utf-8') as f:
for line in f.readlines():
line_dic = json.loads(line)
gt_all[line_dic["raw_file"]] = line
# 遍历图片
find_img = os.walk(r"selected test data")
# 创建文件夹保存测试图片
count = 0
for path, d... |
# Copyright 2018 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
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, soft... |
# coding: utf-8
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environmen... |
#MaBe
import RPi.GPIO as GPIO
import time
#setando os pinos
GPIO.setmode(GPIO.BOARD)
GPIO.setup(17, OUTPUT) #LED Vermelho
GPIO.setup(27, OUTPUT) #LED Amarelo
GPIO.setup(22, OUTPUT) #LED Verde
while True:
#Vermelho ligado
GPIO.output(17, HIGH)
GPIO.output(27, LOW)
GPIO.output(22, LOW)
time.sleep... |
from random import randint
import math
#import sys
#from Test.core import *
if '_Array' not in dir():
from Compiler.types import *
from Compiler.types import _secret
from Compiler.library import *
from Compiler.program import Program
_Array = Array
SORT_BITS = []
def predefined_comparator(x, y):
... |
"""
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 use this ... |
'''OpenGL extension EXT.semaphore
This module customises the behaviour of the
OpenGL.raw.GL.EXT.semaphore to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/EXT/semaphore.txt
'''
from OpenGL import platform, constant, arra... |
#!/usr/bin/env python3
# Copyright 2014 BitPay Inc.
# Copyright 2016-2017 The Karmacoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test framework for karmacoin utils.
Runs automatically during `make check`.... |
"""
NOTE:
the below code is to be maintained Python 2.x-compatible
as the whole Cookiecutter Django project initialization
can potentially be run in Python 2.x environment
(at least so we presume in `pre_gen_project.py`).
TODO: ? restrict Cookiecutter Django project initialization to Python 3.x environ... |
""" version info, help messages, tracing configuration. """
import py
import pytest
import os, inspect, sys
from _pytest.core import varnames
def pytest_addoption(parser):
group = parser.getgroup('debugconfig')
group.addoption('--version', action="store_true",
help="display pytest lib version and ... |
from xiaoai import *
import json
import requests
def outputJson(toSpeakText, is_session_end, openMic=True):
xiaoAIResponse = XiaoAIResponse(to_speak=XiaoAIToSpeak(
type_=0, text=toSpeakText), open_mic=openMic)
response = xiaoai_response(XiaoAIOpenResponse(version="1.0",
... |
for i in range (0, 10):
print "Operacion de Numeros"
print "1. Suma"
print "2. Resta"
print "3. Multiplicacion"
print "4. Division y Residuo"
print "<<<<>>>>"
x=int(raw_input("Digite su Opcion"))
if x==1:
prm=int(raw_input("Ingrese el primer dato"))
prm1=int(raw... |
#! /usr/bin/env python3
def parseArgs(argv):
"""Uses the argparse module to gather information from the user"""
import argparse
parser = argparse.ArgumentParser(description="A short script for splitting one gcode file into parts along layer/height boundaries. This is used to allow material-changes midprint. See ... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from parlai.core.teachers import FbDeprecatedDialogTeacher
from .build import build
import copy
import os
... |
"""Tests for the mllaunchpad.logutil module"""
# Stdlib imports
from unittest import mock
# Project imports
import mllaunchpad.logutil as lu
def test_init_logging():
_ = lu.init_logging()
# pytest itself interferes with log level, need to find workaround
# import logging
# logger = logging.getLogge... |
#!/usr/bin/env python
# Usage:
# ./run-animation.py
#
# Description:
# An example to show the iteration animation
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import shocktube1dcalc.cese as cese
import shocktube1dcalc.helper_plot as helper_plot
fig = plt.figure()
frame_seq = []
# i... |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe
from frappe import _
import functools
import re
def load_address_and_contact(doc, key=None):
"""Loads address list and contact list in `__onload`"""
from frappe.contacts.doctype.address.address import get... |
#!/usr/bin/env python
"""
Version: 1.1
Author: Kirth Gersen
Date created: 6/5/2016
Date modified: 9/12/2016
Python Version: 2.7
"""
from __future__ import print_function
import json
import sys
import csv
db = {}
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def main... |
import sys
import typing as t
import logging
from typing import TYPE_CHECKING
from bentoml import Runner
from bentoml import SimpleRunner
from bentoml.io import IODescriptor
from bentoml.exceptions import BentoMLException
from ..types import Tag
from ..bento.bento import get_default_bento_readme
from .inference_api i... |
import torch
import torch.nn as nn
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class _CustomDataParallel(nn.Module):
def __init__(self, model, device_ids):
super(_CustomDataParallel, self).__init__()
self.model = nn.DataParallel(model, device_ids=device_ids)
self.m... |
# Copyright (c) 2021 Graphcore Ltd. All rights reserved.
"""Defines a Temporal Graph Network (https://arxiv.org/abs/2006.10637) for IPU."""
import functools
from dataclasses import dataclass
from typing import Any, Callable, Dict, Optional, Tuple, TypeVar
import numpy as np
import tensorflow.compat.v1 as tf
import o... |
from enum import IntEnum, unique
@unique
class Role (IntEnum):
Guest = 0
User = 1
Editor = 2
Admin = 3
|
from distutils.core import setup, Extension
c11_hash_module = Extension('c11_hash',
sources = ['dashmodule.c',
'dash.c',
'sha3/blake.c',
'sha3/bmw.c',
... |
#
# Copyright (c) 2013-2018 Quarkslab.
# This file is part of IRMA project.
#
# 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 in the top-level directory
# of this distribution and at:
#
# http:... |
def fizz_buzz(number: int) -> str:
"""
Play Fizz buzz
:param number: The number to check.
:return: 'fizz' if the number is divisible by 3.
'buzz' if it's divisible by 5.
'fizz buzz' if it's divisible by both 3 and 5.
The number, as a string, otherwise.
"""
if number % 15... |
# 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, overload
from ... import _utilities
fro... |
import astropy.units as u
import numpy as np
from astropy.time import Time
from matplotlib import pyplot as plt
from sklearn.decomposition import PCA
from astropy.stats import mad_std
from .regression import regression_coeffs, regression_model
__all__ = ['PCA_light_curve']
def PCA_light_curve(pr, transit_parameters... |
from cumulusci.robotframework.pageobjects import DetailPage
from cumulusci.robotframework.pageobjects import pageobject
from locators_46 import npsp_lex_locators
@pageobject("Detail", "npe01__OppPayment__c")
class PaymentPage(DetailPage):
object_name = "npe01__OppPayment__c"
@property
def npsp(self):
... |
from pythonwhois.net import get_whois_raw
from pythonwhois.parse import parse_raw_whois
from tldextract import extract
from core.analytics import OneShotAnalytics
from core.observables import Email, Text
def link_from_contact_info(hostname, contact, field, klass, description):
if contact is not None and field in... |
import sys
sys.path.append('..')
sys.path.append('../common/')
from common import *
# limit memory usage
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = TRAIN_MEMORY_FRACTION
set_session(tf.Session(config=co... |
#!/usr/bin/env python
import csv
import sys
import json
def gates_from_csv(table, header_map):
gates = []
for row in table:
obj = {}
obj["collection"] = "gates"
obj["regulator"] = row[header_map["cds"]]
obj["group_name"] = row[header_map["cds"]]
obj["gate_name"] = ro... |
# Copyright (c) 2019 Sean Vig
#
# 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, publish, distribute... |
# Copyright 2015-2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
# -*- coding: utf-8 -*-
# Copyright 2018 IBM.
#
# 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 agre... |
#-------------------------------------------------------------
# Name: Google Drive Upload
# Purpose: Uploads a specified file or folder to Google Drive account. Need to get an authorization code manually first from here:
# https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapi... |
"""Test PQR parsing."""
import logging
import pytest
from pathlib import Path
import yaml
import numpy as np
import pandas as pd
from osmolytes.pqr import parse_pqr_file, count_residues
_LOGGER = logging.getLogger(__name__)
PQR_DATA = [
["ATOM", 1, "N", "MET", "1", -22.600, 7.684, -9.315, -0.3200, 2.0000],
["... |
import os
import testinfra.utils.ansible_runner
import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('ssl-certificate-u1604')
@pytest.mark.parametrize("cert", [
'bundled.crt',
'combined.pem',
])
def test_intermediate(host, cert):
... |
from torch import nn
from src.retrieval_core.models.pooling.GeM import GeM
class PoolFactory(nn.Module):
def __init__(self, pool='max'):
super(PoolFactory, self).__init__()
pool_type = {
'avg': nn.AdaptiveAvgPool2d(1),
'max': nn.AdaptiveMaxPool2d(1),
'gem': GeM... |
# Copyright 2018-2019 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS"... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-30 12:08
from __future__ import unicode_literals
from django.db import migrations
from django.contrib.postgres.operations import HStoreExtension
class Migration(migrations.Migration):
dependencies = [
('product', '0012_auto_20160218_0812'),... |
import _plotly_utils.basevalidators
class BelowValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="below", parent_name="layout.mapbox.layer", **kwargs
):
super(BelowValidator, self).__init__(
plotly_name=plotly_name,
parent_name=par... |
from varcode.cli.genes_script import main as run_script
from .data import ov_wustle_variants, db_snp_variants
from tempfile import NamedTemporaryFile
import pandas as pd
def test_varcode_effects_script():
"""
Load a variant collection with combines the ovarian cancer test VCF
and a small number of varian... |
from .test_qiskit_interop import *
|
#
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Intel Corporation
#
# 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 json
from pathlib import Path
from transitions import Machine, State
from wizard.settings import list_conda_available_python_versions
from wizard.functions import erase_lines
from wizard.questions import InitQuestions
from core import init as core_init
from constants import (
INIT, BACK, NO, CONFIG_FILE, DEF... |
from otp.ai.AIBaseGlobal import *
from direct.task.Task import Task
from pandac.PandaModules import *
from toontown.toon.DistributedNPCToonBaseAI import *
class DistributedNPCClerkAI(DistributedNPCToonBaseAI):
def __init__(self, air, npcId):
DistributedNPCToonBaseAI.__init__(self, air, npcId)
self... |
"""
SPDX-License-Identifier: BSD-4-Clause-Clear
Copyright (c) 2018-2019 Qualcomm Technologies, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the
limitations in the disclaimer below) provided that the following conditions are ... |
import math
from collections import deque, Counter
from itertools import product, combinations, permutations
lkopmn, axsder = map(int, input().split())
hyujg = [list(map(int, input().split())) for _ in range(lkopmn - 1)]
anmjki = [list(map(int, input().split())) for _ in range(axsder)]
QWS = [[] for _ in range(lkopmn)... |
import datetime
import time
from decimal import Decimal
import pytz
from django.utils.timezone import now
from django_scopes import scopes_disabled
from i18nfield.strings import LazyI18nString
from pytz import timezone
from tests.base import SoupTest, extract_form_fields
from pretix.base.models import (
Event, Or... |
# Run the tests in Programs/_testembed.c (tests for the CPython embedding APIs)
from test import support
import unittest
from collections import namedtuple
import os
import re
import subprocess
import sys
class EmbeddingTestsMixin:
def setUp(self):
here = os.path.abspath(__file__)
basepath = os.p... |
import json
from os.path import join, abspath, dirname
import jieba
import sys
import copy
root_path = dirname(abspath(__file__))
data_path = join(root_path, 'data')
crosswoz_path = join(data_path, 'crosswoz')
userdict_path = join(crosswoz_path, 'user.dict')
jieba.load_userdict(userdict_path)
# build_ontology
def bu... |
"""Ops used in the DCGAN model
File based on : https://github.com/carpedm20/DCGAN-tensorflow/blob/master/ops.py
It comes with the following license: https://github.com/carpedm20/DCGAN-tensorflow/blob/master/LICENSE
"""
# pylint: disable = C0103, C0111, C0301, R0913, R0903
import tensorflow as tf
class batch_norm(obje... |
# Curso Introdução a Linguagem Python - MIT MISTI Brazil–Unicamp
# Ana Luísa Fogarin - 10/02/2021
# a193948@dac.unicamp.br
# SET 4 - Problema 2 - Triângulos
import math
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def distance_to_origin(self):
return (self.x**2 + self... |
#
# Copyright (c) 2019 by Delphix. All rights reserved.
#
import base64
import compileall
import copy
import json
import logging
import os
import StringIO
import zipfile
from dlpx.virtualization._internal import (codegen, exceptions, file_util,
package_util,
... |
# -*- coding: utf-8 -*-
import time
import pibooth
class LightsPlugin(object):
"""Plugin to manage the lights via GPIO.
"""
def __init__(self, plugin_manager):
self._pm = plugin_manager
self.blink_time = 0.3
@pibooth.hookimpl
def state_wait_enter(self, cfg, app):
if app.... |
#!/usr/bin/env python3
import os
import platform
import subprocess
import sys
import unittest
from pathlib import Path
from rules_python.python.runfiles import runfiles
class PipRepositoryAnnotationsTest(unittest.TestCase):
maxDiff = None
def wheel_pkg_dir(self) -> str:
env = os.environ.get("WHEEL_... |
# Copyright 2013-2019 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 PyLrudict(PythonPackage):
""" A fast LRU cache"""
homepage = "https://github.com/ami... |
# -*- coding: utf-8 -*-
'''
The acl module handles publisher_acl operations
Additional information on publisher_acl can be
found by reading the salt documentation:
http://docs.saltstack.com/en/latest/ref/publisheracl.html
'''
# Import python libraries
from __future__ import absolute_import, print_function, unico... |
# Generated by Django 3.0.4 on 2020-04-18 14:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0005_auto_20200416_0937'),
]
operations = [
migrations.AddField(
model_name='user',
name='is_email_unsubscr... |
# Project-CortanaAI, Level 0, Step - 5 (Final source file for CortanaAI_v0)
"""
Developer: Sam Skywalker
Purpose: Cortana AI for a 'Sci-Fi' dream of mine...
Date: 12022.04.25.05:14
"""
import pyttsx3
import speech_recognition as source1
import datetime
import os
import webbrowser
from pyfiglet import figlet_format
... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from net.utils.tgcn import ConvTemporalGraphical
from net.utils.graph import Graph
class Model(nn.Module):
r"""Spatial temporal graph convolutional networks.
Args:
in_channels (int): Number of chann... |
from django.contrib import admin
from inventory.models import Menu, Product, Drink
@admin.register(Menu)
class MenuAdmin(admin.ModelAdmin):
list_display = ['name', 'active']
filter_horizontal = ['products', 'drinks']
actions = ['activate']
def activate(self, request, queryset):
queryset.u... |
# Copyright (C) 2009-2014 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provided... |
from abc import abstractmethod
from neuron import h
import matplotlib.pyplot as plt
from scipy import signal
#This is the base class for all cell wrapper objects reqiured for ASCT to run.
class Cell:
#Constructs a Cell object.
#Takes:
# 1) The HOC template directory.
# 2) The HOC object name for t... |
# Copyright 2019 The Sonnet 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 l... |
### metadata.py
##
## Copyright (c) 2019 - 2021 Regents of the University of Colorado
##
## metadata.py is part of CUDEM
##
## 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 restri... |
import socket
import sys
import requests
import ipinfo
from colorama import Fore, Back, Style
def ns(host, api_key):
try:
print(f'[{Fore.YELLOW}?{Style.RESET_ALL}] DNS check on {Fore.YELLOW}{host}{Style.RESET_ALL}...')
api_key = api_key
handler = ipinfo.getHandler(api_key)
... |
'''
Converts tblout outputs from hmmer to csv.
'''
import argparse
import pandas as pd
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('input_file', type=str)
parser.add_argument('output_file', type=str)
args = parser.parse_args()
column_names=['target', 'access... |
from django.contrib import admin
from .models import Question, Choice
# class QuestionAdmin(admin.ModelAdmin):
# fields = ['pub_date', 'question_text']
# class QuestionAdmin(admin.ModelAdmin):
# fieldsets = [
# (None, {'fields': ['question_text']}),
# ('Date information', {'fi... |
import os
import numpy as np
import errno
import operator
import pickle
from collections import defaultdict
from statistics import mode
import torch
from torch.utils.data import Dataset
from torchvision import transforms
from vqa import VQA
from image_dataset import get_image_ids, get_image_names, load_image
class VQ... |
import pugh_torch.mappings.color
from .color import turbo, get_palette
|
# -*- coding: utf-8 -*-
import os
import sys
import json
import tccli.options_define as OptionsDefine
import tccli.format_output as FormatOutput
from tccli import __version__
from tccli.utils import Utils
from tccli.exceptions import ConfigurationError, ClientError, ParamError
from tencentcloud.common import credential... |
#!/usr/bin/env python3
#
# Copyright (c) 2015 - 2022, Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
import sys
import unittest
import os
import subprocess
import io
import time
import signal
from contextlib import contextmanager
from integration.test import geopm_test_launcher
from integration.test im... |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='Kagura',
version='0.1',
packages=find_packages(),
description='Machine Learning Library',
license='MIT',
url='https://github.com/nishio/kagura',
author='NISHIO Hirokazu',
author_email='nishio.hirokazu@gmai... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import sys
class opts(object):
def __init__(self):
self.parser = argparse.ArgumentParser()
# basic experiment setting
self.parser.add_argument('task', default='ctdet',
... |
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.