content stringlengths 5 1.05M |
|---|
# Copyright 2020 The DDSP 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 wri... |
__author__ = 'oglebrandon'
class Account(object):
def __init__(self):
self._packets = {}
self.child_accounts = []
def __getitem__(self, ref):
return self._packets[ref]
def append_request(self, ref, acct_packet, port_packet):
self._packets[ref] = {'account': acct_packet, 'p... |
import glob
import os
[os.popen(f"pyuic5 -x {file} > {file.removesuffix('.ui')}.py") for file in glob.glob("*.ui")] |
def generateAllBinaryStrings(n):
pattern = [-1]*n
allCombs = []
# create an empty stack (we can also use set, list, or any other container)
stack = deque()
stack.append(pattern) # push the pattern into the stack
# loop till stack is empty
while stack:
# pop a str... |
# Name:zeke
# Date:7/12/17
#
# """
# proj04
#
# Asks the user for a string and prints out whether or not the string is a palindrome.
#
# """
name = raw_input('Name: ')
date = raw_input('Date: ')
str = raw_input('What word would you like me to check to see if it is a palindrome:')
lst = []
for letter in str:
lst.app... |
from django.urls import include, path
from django.contrib import admin
urlpatterns = [
path("api/", include(("next_scraper.api.urls", "api"), namespace="api")),
path("api/docs/", include("rest_framework.urls")),
# Admin
path("admin/", admin.site.urls),
]
|
from setuptools import setup
setup(name='visilens',
version='0.1',
description='Module for modeling gravitational lensing systems in which the data are not images but interferometric visibilities.',
classifiers=[
'Development Status :: 7 - Inactive',
'License :: OSI Approved :: MIT License',
'P... |
# Given an array nums and a value val, remove all instances
# of that value in-place and return the new length.
# Do not allocate extra space for another array, you must do
# this by modifying the input array in-place with O(1) extra memory.
# The order of elements can be changed. It doesnt matter what you leave beyond... |
# python3 linkBots.py SUBSCRIBE? REMIND?
from minds import Minds, Profile
import sys
import json
import time
import random
import _thread
blacklist = ['1063155407067082752']
nosub_list = [
testmode = 0
subscribe_to = '1048152926922481673'
maximum = 100
data = {}
data['people'] = []
data['people'].append({
'name': '... |
'''
Given an unsorted integer array, find the smallest missing positive integer.
Example 1:
Input: [1,2,0]
Output: 3
Example 2:
Input: [3,4,-1,1]
Output: 2
Example 3:
Input: [7,8,9,11,12]
Output: 1
Note:
Your algorithm should run in O(n) time and uses constant extra space.
'''
class Solution {
public:
int firs... |
import discord
import logging
from tortoise.expressions import Subquery
from seraphsix.models.database import ClanMember, Guild, Role
log = logging.getLogger(__name__)
async def convert_sherpas(bot, sherpas):
for sherpa in sherpas:
yield await bot.fetch_user(sherpa)
async def find_sherpas(bot, guild... |
from setuptools import setup
setup(
name='jsons',
version='0.1',
url='https://github.com/ctomkow/jsons',
author='Craig Tomkow',
author_email='craig.tomkow@gmail.com',
license='MIT',
packages=['jsons'],
zip_safe=False
) |
import inspect
from typing import Optional
from cx_const import ActionFunctionWithParams, PredefinedActionsMapping, TypeAction
from cx_core.action_type.base import ActionType
from cx_core.integration import EventData
def _get_action(action_value: TypeAction) -> ActionFunctionWithParams:
if isinstance(action_valu... |
# GnabarMultiThread runs multiple simulations concurently for collecting data
import sys
import subprocess
import time
import math
import os
start = time.clock()
THIS_FOLDER = os.path.dirname(os.path.abspath(__file__))
my_file = os.path.join(THIS_FOLDER, 'GnabarExperiment.py')
procs = []
numProcesses = 5
lowerGnaba... |
import numpy as np
class Asset:
def __init__(self, ticker:str, slippage=0, fee=0, max_leverage=1, min_amount=1e-7):
self.ticker = ticker
self.slippage = slippage / 100
self.fee = fee / 100
self.max_leverage = max_leverage
self.margin_percentage = 1 / max_leverage
se... |
class Graph:
def __init__(self, path: str):
self.nodes = []
with open(path, 'r') as graph_file:
for line in graph_file:
if '@' not in line and '.' not in line:
continue
self.nodes.append(list([x == '.' for x in line]))
def is_walk... |
from collections import namedtuple
from dataclasses import dataclass
from functools import cached_property, reduce
import math
# import sys
ABS_TOL = 0.01
def isclose(a, b):
return math.isclose(a, b, abs_tol=ABS_TOL)
Point = namedtuple("Point", ["x", "y"])
@dataclass(repr=False, eq=False, order=False, froze... |
nome_user = input('Digite seu nome: ')
print(f'Bem vindo {nome_user}')
|
import unittest
from tests.utils import order_insert_statements
class TestUtilsTest(unittest.TestCase):
def test_nothing_changed(self):
sql = [
'BEGIN;',
'--',
'COMMIT;',
]
ordered_sql = order_insert_statements(sql)
self.assertEqual(len(ordered... |
from openpyxl import load_workbook
from apps.client.models import Client
def load(path, worksheet):
wb = load_workbook(path, read_only=True)
ws = wb[worksheet]
return ws
def _get(data, index):
try:
return data[index].value
except IndexError:
return None
def parse():
data... |
from dataclasses import dataclass, fields
from datetime import datetime
import numpy as np
import pandas as pd
import re
ROTARY_ENCODER_UNITS_PER_TURN = 8845.0
format_string = "%Y-%m-%d %H:%M:%S.%f" # for parsing the time strings
@dataclass
class Reward:
"""Holds information about a reward event in a logfile"""
... |
#! /usr/bin/env python3
from setuptools import setup, Extension
from distutils.command.build import build
import os
import subprocess
import sys
try:
import numpy
try:
numpy_include = numpy.get_include()
except AttributeError:
numpy_include = numpy.get_numpy_include()
except ImportError:
... |
"""This module defines fixtures for testing Helm Charts."""
import logging
import random
import string
import sys
from typing import Callable, Iterable, Dict, List
import pykube
import pytest
from _pytest.config import Config
from pytest_helm_charts.clusters import ExistingCluster, Cluster
from pytest_helm_charts.uti... |
from darknet import Darknet
def partial(cfgfile, weightfile, outfile, cutoff):
m = Darknet(cfgfile)
m.print_network()
m.load_weights(weightfile)
m.seen = 0
m.save_weights(outfile, cutoff)
print('save %s' % (outfile))
if __name__ == '__main__':
import sys
if len(sys.argv) == 5:
... |
class Solution:
def countOrders(self, n: int) -> int:
MOD = 1000000007
dp = [[0 for _ in range(n+1)] for _ in range(n+1)]
dp[0][0] = 1
for i in range(n+1):
for j in range(n+1):
if dp[i][j] == 0:
continue
if i < j:
... |
from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
from oops_fhir.r4.code_system.care_plan_activity_status import (
CarePlanActivityStatus as CarePlanActivityStatus_,
)
__all__ = ["CarePlanActivityStatus"]
_resource = _ValueSet.parse_file(P... |
# Copyright 2016 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 agre... |
from __future__ import unicode_literals
from crispy_forms.helper import FormHelper
from django import forms
from django.core.exceptions import ValidationError
from django.forms import inlineformset_factory
from django.utils import timezone
from django.utils.dates import MONTHS
from django.utils.translation import uget... |
"""
epic.py - Epic data structure
Provides an Epic object for storing Epic data from the API
Copyright (c) 2018 The Fuel Rat Mischief,
All rights reserved.
Licensed under the BSD 3-Clause License.
See LICENSE.md
"""
from functools import reduce
from operator import xor
from typing import Optional
from uuid import ... |
# Copyright 2020 getcarrier.io
#
# 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... |
import time
import os
import sys
from flask import Flask, render_template, request, url_for
import oauth2 as oauth
import urllib.request
import urllib.parse
import urllib.error
import json
import twitter
import tweepy
app = Flask(__name__)
app.debug = False
request_token_url = 'https://api.twitter.com/oauth/request_... |
from djitellopy import Tello
tello = Tello() # connect to tello drone
tello.connect() # connect to tello drone socket
tello.takeoff() # take off with the drone
# small movement
tello.move_left(100)
tello.rotate_counter_clockwise(90)
tello.move_forward(100)
tello.land() #tello land |
from cmath import log, pi, sqrt
import mpmath as mp
import numpy as np
import torch
from hypothesis import assume, given, strategies as st
from pytest import mark
from scipy import special as sp
from scipy.special._mptestutils import exception_to_nan
from torch import allclose, isclose, isnan, tensor
from phytorch.sp... |
from __future__ import absolute_import
from django.utils.translation import ugettext as _
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success, json_error
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
from zerver.models import Client, UserP... |
"""
A script to define the polymerase wave frontier based on 2 state HMM, for 4SU-DRB-seq.
"""
import os
import requests
import numpy as np
from scipy.io import loadmat
# reuse the code for hmm and sequence publishing
import pandas as pd
from hmm_kit import HMMModel
import hmm_kit.bwiter as bwiter
from config import... |
#!/usr/bin/env python3
import requests
import logging
import os
from dotenv import load_dotenv
import paho.mqtt.client as mqtt
import paho.mqtt.publish as publish
import time
logging.basicConfig(level=logging.INFO)
load_dotenv()
api_key = os.getenv('API_KEY')
pw = os.getenv('PASSWORD')
mqttBroker ="192.168.1.199"... |
import math
thisdict = { # dictionary containing all room data
}
thisdict[1]=[[3,9],[4,8],[5,5]]#first number = room number. second = distance of connection
thisdict[2]=[[4,3],[5,6]]
thisdict[3]=[[1,9],[5,10]]
thisdict[4]=[[1,8],[2,3]]
thisdict[5]=[[1,5],[2,6],[3,10]]
def findifconnect(room1,room2): # function t... |
import numpy as np
from fvcore.common.file_io import PathManager
from pycocotools.coco import COCO
import contextlib
import io
import os
from detectron2.data import DatasetCatalog, MetadataCatalog
from detectron2.structures import BoxMode
import pycocotools.mask as mask_util
"""
This file contains functions to parse ... |
#!/usr/bin/env python
import json
import logging
import signal
import sys
from os import getenv
from watchdog.observers.polling import PollingObserver
from geoserver_fs_handler import GeoServerFileSystemEventHandler
GS_SYNC_DEBUG = json.loads(getenv('GS_SYNC_DEBUG', 'false').lower())
logging.basicConfig(level=(logg... |
"""
Class for reading/writing data in a raw binary interleaved compact file.
Sampling rate, units, number of channel and dtype must be externally known.
This generic format is quite widely used in old acquisition systems and is quite universal
for sharing data.
Supported : Read/Write
Author: sgarcia
"""
import os
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... |
from utils import balanced_resample, desample_binary
import boost
|
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE.GPL.txt, distributed with
# this software.
#
# SPD... |
import os
from rl_trainer.episode_serializer.proto import episode_pb2
from typeguard import typechecked
from rl_trainer.commons import Episode, ExperienceTuple
from rl_trainer.episode_serializer.episode_serializer import EpisodeSerializer, EpisodeParser
class ProtobufEpisodeSerializer(EpisodeSerializer, EpisodePars... |
#######################################################################################
#### THE FOLLOWING FILE CONTAINS ALL THE NECESSARY FUNCTIONS RELATED ADINUMBERS ####
#### ####
#### Author: Jorge Marinez Garrido ####
#### ####
####... |
import math
INFINITY = 1e200 * 1e200
try:
from rpython.rlib.rfloat import formatd, DTSF_ADD_DOT_0, DTSF_STR_PRECISION, round_double
def float_to_str(value):
return formatd(value, "g", DTSF_STR_PRECISION, DTSF_ADD_DOT_0)
except ImportError:
"NOT_RPYTHON"
def float_to_str(value):
retur... |
# -*- coding: utf-8 -*-
import logging
from flask import request
from roger import config
from roger_common import errors, flask_extras
def enforce_https():
if not request.is_secure:
return 'Try again with HTTPS.', 403
def set_up(app, **kwargs):
"""Add standard header and error handlers to an API... |
# -*- coding: utf-8 -*-
# Copyright 2018 Ross Jacobs 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... |
from datetime import datetime
from django.db import models
from django.contrib.comments.models import Comment
from django.contrib.auth.models import User
from django.contrib.contenttypes import generic
from django.contrib.sitemaps import ping_google
from django.contrib.comments.moderation import CommentModerator, mode... |
from rest_framework.status import HTTP_400_BAD_REQUEST, HTTP_404_NOT_FOUND
ERROR_VIEW_DOES_NOT_EXIST = (
"ERROR_VIEW_DOES_NOT_EXIST",
HTTP_404_NOT_FOUND,
"The requested view does not exist.",
)
ERROR_VIEW_FILTER_DOES_NOT_EXIST = (
"ERROR_VIEW_FILTER_DOES_NOT_EXIST",
HTTP_404_NOT_FOUND,
"The vi... |
#
# Copyright (c) 2021, NVIDIA 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 applicable law or agreed ... |
'''
Created on 2017年1月8日
@author: Think
题目:求s=a+aa+aaa+aaaa+aa...a的值,其中a是一个数字。例如2+22+222+2222+22222(此时
共有5个数相加),几个数相加有键盘控制。
1.程序分析:关键是计算出每一项的值。
2.程序源代码:
'''
from pip._vendor.distlib.compat import raw_input
from _functools import reduce
def jcp018():
tn = 0
sn = []
n = int(raw_input('n = :\n'))
a = ... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import random
import string
from threading import Timer
from enc.rsa_oaep import RsaOAEP
from db.account_db import AccountDB
from Crypto.Hash import SHA256 as PASSWD_HASH
from enc.aes_cbc_pkcs7 import AesCBCPkcs7
class Session:
KOK_IDLE = 10
RENEW_IDLE = 600
active = {... |
from epics import caget, caput
from time import sleep
from IEX_29id.devices.slits import SetSlit_BL
from IEX_29id.utils.misc import dateandtime
from IEX_29id.devices.beamline_energy import SetMono
from IEX_29id.devices.eps import Open_MainShutter
from IEX_29id.devices.eps import Close_MainShutter
def Reset_Mono_Limi... |
#!/usr/bin/env python3
import argparse
import pandas as pd
import os
# Preprocess the data from Statistics Bureau Japan
# (https://www.stat.go.jp/data/nihon/02.html)
# to the common csv format that contains 'name' and 'population'.
def preprocess(input, output):
assert(os.path.exists(input))
data = pd.read_cs... |
#!/usr/bin/python3
import argparse
import sys
import re
# Check correct usage
parser = argparse.ArgumentParser(description="Check your Train Ticket.")
parser.add_argument('input', metavar='input', type=str,
help='Ticket list input.')
args = parser.parse_args()
rules = {}
myticket = []
tickets = [... |
import gc
def divide(a,b):
return a/b
DIX = const(10)
def print_div():
for i in range(10):
if i%2 == 0:
print('le nombre ',i,' est pair et ',i,' divisé par ', DIX, ' = ', divide(i,DIX))
else:
print('le nombre ',i,' est impair et ',i,' divisé par ', DIX, ' = ', divide(i,DIX))
def print_tab(a):
for i in ... |
"""
Custom API exception reponses.
API specification requires custom messages upon error.
"""
import json
import logging
from aiohttp import web
from .. import __apiVersion__
from ..conf import CONFIG_INFO
LOG = logging.getLogger(__name__)
class BeaconError(Exception):
"""BeaconError Exception specific class.
... |
import time
import functools
import collections
import multiprocessing
# NOTE: How to include facetFactory?
import facet
# from ..factory import FacetFactory
from ..formatter import get_formatter
from ..helpers import corpus_generator
from typing import (
Any,
Dict,
Union,
Iterable,
)
__all__ = ['Para... |
import os
import matplotlib.patches as mpatches
import numpy as np
import pkg_resources
import copy
from PyQt5 import QtWidgets, QtCore, uic
from PyQt5.QtCore import QSettings
from PyQt5.QtWidgets import QMenu
from PyQt5.Qt import Qt
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas, \
... |
"""Module to be used for exposing the web service with other WSGI
servers. It initializes Palladium's configuration and provides the
Flask object.
"""
from .util import initialize_config
from .server import app
# Initialization is needed to obtain same behavior of pld-devserver
# and other WSGI servers (e.g., gunicorn... |
from src.common.communication.serial_handler import SerialHandler
from src.common.models.instruction import Instruction
from src.common.movement.direction import Direction
from src.common.movement.drive import Drive
from configparser import ConfigParser
import logging
def get_instruction(position_pictogram: int, posi... |
#!/usr/bin/env python
def get_method_and_genes(best_chromosome_file):
with open(best_chromosome_file) as fp:
for i, line in enumerate(fp):
if i == 1:
parts = line.rstrip().split('\t')
return parts[:4] # [method, gene1, gene2, gene3]
def get_method_genes_decisio... |
#!/usr/bin/env python
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('CHANGELOG.rst') as history_file:
history = history_file.read()
REQUIREMENTS = [
'algoliasearch',
'kinto'
]
TEST_REQUIREMENTS = [
'webtest',
]
ENTRY_POINTS = {
'c... |
# ----------------------------------------------------------------------
# 3Com.SuperStack.get_vlans
# ----------------------------------------------------------------------
# Copyright (C) 2007-2010 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# Py... |
def mine(raw_data):
"""
This function transforms an already strictly formatted set of .json data
into a useful list of records in a specific format. Badly formatted data may
lead to an empty list being returned.
- raw_data: The .json data as retrieved from 11888.gr to be formatted.
"""
# L... |
# 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
#s
# Unless required by applic... |
# Generated by Django 2.2.6 on 2019-11-28 18:27
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('reporter', '0002_auto_20191128_1923'),
]
operations = [
migrations.AddField(
model_name='schedu... |
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Function
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
import create_dic_fuc
from FCDecomp import FCDecomp
im... |
# -*- coding: utf8 -*-
"""
This is part of shot detector.
Produced by w495 at 2017.05.04 04:18:27
"""
from __future__ import absolute_import, division, print_function
import logging
from scipy import stats
from ..base_stat_swfilter import BaseStatSWFilter
class BaseStatTestSWFilter(BaseStatSWFilter):
... |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 23 09:12:35 2019
@author: Mihai Boldeanu
@goal: A library of useful functions for working with RPG-94 radar systems
@contents:
- Reading and plotting raw data
- Cleaning noise from raw data
- Averaging in height and time
"""
import time
from ne... |
from setuptools import find_packages, setup
setup(
name='dockerphile',
version='0.0.0',
packages=find_packages(),
install_requires=[
'dockerfile==1.0.0'
],
)
|
# Copyright 2019 Hewlett Packard Enterprise Development LP
# 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... |
# -*- coding: utf-8 -*-
import os
import logging
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
from model import Classifier
from pytorch_lightning import Trainer
from pytorch_lightning.loggers import WandbLogger
from src.config import DOGCATConfig, register_configs
import hydra
from hyd... |
# #########################################################################
# Copyright (c) 2020, UChicago Argonne, LLC. All rights reserved. #
# #
# Copyright 2020. UChicago Argonne, LLC. This software was produced #
# under U.S. Gov... |
#!/usr/bin/env python
# coding: utf-8
import os
import sys
import re
import numpy as np
import pandas as pd
def extract_file(logfile, max_epoch=40):
with open(logfile) as infp:
pat = re.compile(r"Epoch = ([0-9]+) \| EM = ([0-9]+\.[0-9]+) \| F1 = ([0-9]+\.[0-9]+)")
res = []
for line in infp... |
import aiohttp
import asyncio, time
import json
import datetime
'''
async def main(loop):
async with aiohttp.ClientSession(loop=loop) as session:
time_start=time.time()
for i in range(0, 1000):
async with session.get('http://127.0.0.1/API/host_policy_user/FQDN/nest0.gwa.demo.') as resp:
... |
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import (QApplication, QGraphicsView,
QGraphicsPixmapItem, QGraphicsScene, QGraphicsPolygonItem,
QGraphicsEllipseItem, QGraphicsLineItem, QOpenGLWidget)
from PyQt5.QtGui import QPainter, QPixmap, QPo... |
from hmac import compare_digest
from os import environ
from dotenv import load_dotenv
from fastapi import FastAPI, Request, Response
load_dotenv()
from src.impl.database import database
from .routing import router
API_KEY = environ.get("API_KEY")
if not API_KEY:
raise Exception("API_KEY not set")
app = FastA... |
from abc import ABC, abstractmethod
from typing import List
import pyglet
from game.entities import Ship, Particle, Asteroid
class Perception(ABC):
"""
A base class to describe a perception of the game at a certain point in it's running.
"""
@abstractmethod
def __init__(self, ship: Ship=None, pa... |
import json
import os
import time
import boto3
client = boto3.client('iot-data')
topic = os.environ.get('RESPONSE_TOPIC')
if not topic:
raise EnvironmentError('Unable to read topic name from environment')
def _check_event(event):
if 'device' not in event:
raise AttributeError('Missing "device" att... |
import re
from conf import db_conf2
from sqlalchemy import create_engine
import pandas as pd
pattern = re.compile('^[sS][hHzZ]\w{6}$')
engine = create_engine(db_conf2)
rv = engine.execute('show tables;').fetchall()
exist_tables = [i[0].upper() for i in rv if pattern.search(i[0])]
print(exist_tables)
rv =... |
import os
import sys
from collections import namedtuple
import logging
from ansible.parsing.dataloader import DataLoader
from ansible.vars.manager import VariableManager
from ansible.inventory.manager import InventoryManager
from ansible.executor.playbook_executor import PlaybookExecutor
from ansible.playbook.play imp... |
import os
import pytest
import numpy as np
from w90utils import io as w90io
@pytest.mark.parametrize('example', ['example03', 'example04'])
def test_kpoints_io(data_dir, example):
os.chdir(os.path.join(data_dir, example))
kpoints_ref = w90io.read_kpoints('wannier_band.kpt')
kpoints_1 = w90io.postw90.r... |
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ##... |
from .cov import Cov
from .plot import Plot
from .gr import Entry, Gr, bed, gff3, appris, depth_alt_depth_function, Variant, vcf
from .panel import Panel
|
from typing import List, Optional, Union
from model import Entry, NormalFile, VirusFile, SaveFile
from model.abstract import Listable
class Directory(Listable, Entry):
"""The Directory class is the structure that acts as an actual Directory
on a filesystem that can hold Files and other Directories
:para... |
import math
class Solution:
#Function to find list of all words possible by pressing given numbers.
def possibleWords(self, a, N):
#Your code here
dict_1 = {2: "abc", 3: "def", 4: "ghi", 5: "jkl",
6: "mno", 7: "pqrs", 8: "tuv", 9: "wxyz"}
ans = []
def help... |
# Copyright 2016 Invisible Institute
#
# 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 i... |
from django.dispatch import Signal
#: Emitted upon contact creation. Receives the user and contact instance
#: and the new password in cleartext.
contact_created = Signal(
providing_args=['user', 'contact', 'password', 'request'],
)
#: Emitted upon order confirmation. Receives an order instance.
order_confirmed =... |
class CommandOption:
def __init__(self, name: str, value: str):
self.name = name
self.value = value
class CommandBuilder:
"""
Helper class to build a command line
"""
def __init__(self, executable: str):
"""
:param executable: Path/name of the executable to... |
tupla = ('um','dois','tres','quatro','cinco')
n = int(input('digite um numero entra 1 e 5:'))
while n<1 or n>5:
n = int(input('digite um numero entra 1 e 5:'))
print(f'o nuemro que voce digitou foi {tupla[n-1]}')
|
import argparse
import torch
from timm.models import create_model
from models.CoAt import *
try:
from mmcv.cnn import get_model_complexity_info
from mmcv.cnn.utils.flops_counter import get_model_complexity_info, flops_to_string, params_to_string
except ImportError:
raise ImportError('Please upgrade mmcv to... |
import os
import sys
from random import choice
import pprint
from cltl.brain.long_term_memory import LongTermMemory
from cltl.brain.utils.helper_functions import brain_response_to_json
from cltl.combot.backend.api.discrete import UtteranceType
from cltl.reply_generation.data.sentences import ELOQUENCE
from cltl.reply_... |
# BEGIN_COPYRIGHT
#
# Copyright 2009-2018 CRS4.
#
# 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 agree... |
from . import TaggedTextDocument as TTD
class TaggedTextDocument(TTD.TaggedTextDocument):
"""
Class representing a document as a list of TaggedTextBlocks
"""
@classmethod
def fromAST(cls, ast, width=80, **kwargs):
"""Parse an AST representation of a markdown document into a TaggedTextDocu... |
from pyinaturalist.constants import (
NODE_OBS_ORDER_BY_PROPERTIES,
HistogramResponse,
IntOrStr,
JsonResponse,
)
from pyinaturalist.converters import (
convert_all_coordinates,
convert_all_timestamps,
convert_histogram,
convert_observation_timestamps,
)
from pyinaturalist.docs import doc... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Clione Software
# Copyright (c) 2010-2013 Cidadania S. Coop. Galega
#
# 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
#
# ... |
r"""@package motsfinder.metric.base
Base classes for implementations of different metrics.
These base classes implement some of the functionality any metric needs to
provide such as computing Christoffel symbols. Child classes may override some
of these for better accuracy/perfomance.
Good examples of implementation... |
from __future__ import with_statement
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import inputs
inputs_classifiers = [
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Intended Audience :: Developers",
"License :: OSI ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.