text stringlengths 2 999k |
|---|
import dataclasses
from deafwave.types.blockchain_format.sized_bytes import bytes32
from deafwave.util.byte_types import hexstr_to_bytes
from deafwave.util.ints import uint8, uint32, uint64, uint128
@dataclasses.dataclass(frozen=True)
class ConsensusConstants:
SLOT_BLOCKS_TARGET: uint32 # How many blocks to tar... |
#############################################################################
# #
# tullingedk/member #
# Copyright (C) 2020 - 2021, Tullinge gymnasium datorklubb, <info@tgdk.se> #
# Create... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# from fileconf import parse_conf_file
def TR(key):
from logger import Logger
originalkey = key
key.replace(" %s", "")
# Logger().warning(u"Looking for translation for key '%s' (in '%s')" %
# (key, SESMANCONF.language))
trans = SESMAN... |
from random import sample
def verify(v,n):
if len(v) == 0: return False
elif n == v[0]: return True
return verify(v[1:],n)
v = sample(range(0,101),10)
print(v)
n = int(input("Digite o valor que deseja verificar: "))
if verify(v,n): print("True")
else: print("False")
|
"""
Sample parsers.
| Copyright 2017-2021, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
import os
import numpy as np
import eta.core.image as etai
import eta.core.serial as etas
import eta.core.utils as etau
import fiftyone as fo
import fiftyone.core.clips as foc
import fiftyone.core.labels as fol
im... |
# Copyright (c) 2012 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.
"""Gclient-specific SCM-specific operations."""
from __future__ import print_function
import errno
import logging
import os
import posixpath
import re
... |
from __future__ import print_function
import sys
if len(sys.argv) != 4:
print('Usage:')
print('python train.py datacfg cfgfile weightfile')
exit()
import time
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.backends.cudnn as cudnn
from torchvision... |
# pyright: reportMissingImports=false
# pylint: disable=import-error, wrong-import-position, import-outside-toplevel, consider-using-from-import
import os
import warnings
from dataclasses import dataclass
from pathlib import Path
from typing import List, Tuple, Union
import jpype
import jpype.imports
from appdirs imp... |
# Django Celery
# https://pypi.org/project/django-celery/
import os
CELERY_BROKER_URL = os.environ.get('CLOUDAMQP_URL')
CELERY_IMPORTS = ('main.tasks',)
CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TIMEZONE = "Asia/Calcutta"
|
# -*- coding: utf-8 -*-
import pytest
from interdiagram.models.node import Action
def _prep_action(
data, diagram, port, section, action_index, part='sections'
):
spec = data[part][section]['actions'][action_index]
node = getattr(diagram, part)[section]
action = Action(spec, port, node)
retu... |
from django.shortcuts import redirect, render, render_to_response, HttpResponseRedirect, reverse
from django.db.models import Count
from django.db import connection
from .models import Kontostand, Kiosk, Einkaufsliste, ZumEinkaufVorgemerkt, Gekauft, Kontakt_Nachricht, Start_News
from .models import GeldTransaktionen, P... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 5
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_0
from i... |
# -*- coding: utf-8 -*-
drek = {u'“': '"', u'”': '"', u"’": "'", u"‘": "'", u'—': '-', u'−': '-', u'…': '...', u'•': '-'}
def clean(text):
for key in drek.keys():
text = text.replace(key, drek[key])
return text
def cleanFile(filename):
import io
with io.open(filename,'r',encoding='utf8') as t:
text = ... |
import boto3
import locale
import json
from pkg_resources import resource_filename
import scrape
# Translate between the API and what is used locally
def translate_platform_name(operating_system, preinstalled_software):
os = {'Linux': 'linux',
'RHEL': 'rhel',
'SUSE': 'sles',
... |
'''
Offline tests
'''
from unittest import TestCase
from mock import MagicMock
from mock import mock_open
from rest_service import RestService
from rest_service import (log_call, error_catch, validate_json,
validate_schema)
import mock
import json
import flask
import six
from kafka.common imp... |
import numpy as np
# data_1 = np.load('train_data_1.npy')
# data_2 = np.load('train_data_2.npy')
label_1 = np.load('train_label.npy')
# label_2 = np.load('train_label_2.npy')
# label_1 = np.squeeze(label_1, axis =1 )
# label_1 = np.expand_dims(label_1, axis = 0)
print(label_1)
print(label_1.shape)
# print(label_2... |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_im... |
from itertools import groupby
from typing import List, Tuple, Any, Sequence
#01
def my_last(listx: list) -> str:
return listx[-1]
#02
def my_but_last(listx: list) -> str:
return listx[-2]
#03
def element_at(listx: list, element: int) -> str:
return listx[element-1]
#04
def list_length(listx: list) -> int:
retur... |
"""Save xls[x] files to s3."""
import os
from tempfile import gettempdir
import pandas as pd
import s3fs
from pandas_ext.common.utils import is_s3_path
def to_excel(df: pd.DataFrame, file_path: str, engine='', **kwargs) -> None:
"""Given a df, write it to s3 if necessary."""
if is_s3_path(file_path):
... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE
"""
This module defines high-level functions and objects for file-writing.
The :doc:`uproot.writing.writable.create`, :doc:`uproot.writing.writable.recreate`, and :doc:`uproot.writing.writable.update`
functions open files for writing,... |
# Copyright (c) 2020, DjaoDjin inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... |
import os
from setuptools import setup, find_packages
import happenings
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-happenings-update',
... |
import unittest
import sys
import os
import re
import mock
import time
import shutil
# Import gslab_scons testing helpers
import _test_helpers as helpers
# Ensure that Python can find and load the GSLab libraries
os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append('../..')
import gslab_scons.log as ... |
"""
Program Description :
List appender is a simple program that allows you to append data, either a single word or a sequence of words,
to a list. To stop adding elements, type !quit. It helps create lists easily when the number of elements
is a lot.
"""
def List_appender():
print("Start entering data to be appen... |
# 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 PyCertifi(PythonPackage):
"""Certifi: A carefully curated collection of Root Certificates ... |
import pandas as pd
import re
from datetime import timedelta
from pyquery import PyQuery as pq
from urllib.error import HTTPError
from .. import utils
from ..constants import AWAY, HOME
from ..decorators import int_property_decorator
from .constants import (BOXSCORE_ELEMENT_INDEX,
BOXSCORE_ELEME... |
#from keras.preprocessing.image import ImageDataGenerator,img_to_array, load_img
import os
from google_images_download import google_images_download
def downloader(search_term="newspaper sudoku"):
response = google_images_download.googleimagesdownload()
absolute_image_paths = response.download({'keywords':sea... |
'''Crie um programa que leia a idade e o sexo de várias pessoas. A cada pessoa cadastrada,
o programa decerá perguntar se o usuário quer ou não continuar. No final, mostre:
a) Quantas pessoas tem mais de 18 anos.
b) Quantos homens foram cadastrados
c) Quantas mulheres tem menos de 20 anos. '''
maioridade = mulher20 =... |
from project import db
from project.api.models import Channel
from project.api.models import Event
from project.api.models import Entry
from project.api.models import Meetup
from project.api.models import Topic
from project.tests.base import BaseTestCase
class TestMeetupModel(BaseTestCase):
def test_add(self):
... |
import torch
from torch.autograd import Variable
from .cholesky import batch_potrf, batch_potrs
def pivoted_cholesky(matrix, max_iter, error_tol=1e-3):
from ..lazy import LazyVariable, NonLazyVariable
# matrix is assumed to be batch_size x n x n
if matrix.ndimension() < 3:
batch_size = 1
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 18 05:31:53 2017
@author: abhilasha
"""
import csv
import os
#import random
from sklearn import tree
x=[]
arr=[0,1]
y=[]
z=[]
connection_result=[]
Connection_info=dict()
with open('Desktop/test1.csv','r') as tcpfile:
reader=csv.reader(tcpfile,d... |
import sys
sys.path.append('..')
import argparse
import keras
import numpy as np
import tensorflow as tf
from keras.models import load_model
import pandas as pd
from tqdm import tqdm
from glob import glob
from BioExp.helpers import utils
from BioExp.graphs import concept
import os
from keras.backend.tensorflow_backend... |
import random
import math
import copy
import numpy as np
import logging
import collections
import pyximport
# pyximport.install()
pyximport.install(setup_args={
# "script_args":["--compiler=mingw32"],
"include_dirs":np.get_include()},
# relo... |
a=[]
assert len(a)!=0,'Empty list'
a[0] = 1
print(a) |
#!/usr/bin/env python3
#
# MIT License
#
# Copyright (c) 2020 EntySec
#
# 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,... |
import logging
import numpy as np
from parallelm.mlops.constants import PyHealth
from parallelm.mlops.data_analysis.categorical_data_analyst import CategoricalDataAnalyst
from parallelm.mlops.data_analysis.continuous_data_analyst import ContinuousDataAnalyst
from parallelm.mlops.stats.health.categorical_hist_stat imp... |
__author__ = 'Sujit Mandal'
#Date : 07-09-2020
from setuptools import setup
def readme():
with open('README.md', 'r', encoding='utf-8') as files:
README = files.read()
return README
setup(
name = 'python-gmail',
version = '0.0.8',
description = 'Automatically Send Gmail with SMTP Server.... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import numpy as np
import types as python_types
import warnings
import copy
import os
import inspect
from six.moves import zip
from .. import backend as K
from .. import initialization... |
import sys
from ignorem import commands
PROGRAM_NAME = "ignorem"
PROGRAM_NAME_FULL = "gitignore manager"
PROGRAM_VERSION = "1.1.3"
PROGRAM_AUTHOR = "Max Loiacono"
PROGRAM_DESCRIPTION = "Easily manage .gitignore files."
PROGRAM_URL = "https://github.com/itsmaxymoo/ignorem"
PROGRAM_CMD = "ignorem"
def _main():
# Comm... |
import discretisedfield as df
def test_version():
assert isinstance(df.__version__, str)
assert '.' in df.__version__
def test_dependencies():
assert isinstance(df.__dependencies__, list)
assert len(df.__dependencies__) > 0
|
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-08-13 09:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0020_auto_20160226_2301'),
]
operations = [
migrations.AddField(
... |
import traceback, time, re, os
from pathlib import Path
from config_private import wb_bot_user
from config_private import wb_bot_pwd
from wikibaseintegrator import wbi_login, WikibaseIntegrator
# from wikibaseintegrator.datatypes.string import String
# from wikibaseintegrator.datatypes.externalid import ExternalID
# fr... |
from __future__ import print_function
import math
from torch.multiprocessing import Pool
import functools
import numpy as np
import pdb
import os
import sys
import argparse
import time
import math
import torchvision.utils as vutils
from torch.utils.data import *
import tensorboard_logger as tb_logger
import torch
imp... |
# Lint as: python2, python3
# Copyright 2019 Google LLC. 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 req... |
from __future__ import absolute_import
import unittest
from testutils import harbor_server
from testutils import TEARDOWN
from testutils import ADMIN_CLIENT
from library.project import Project
from library.user import User
from library.repository import Repository
from library.repository import push_image_t... |
from django.apps import AppConfig
class RoutesConfig(AppConfig):
name = "routes"
|
from django.conf.urls import url
from template_app import views
#Template Tagging
app_name = 'template_app'
urlpatterns= [
url(r'^relative/$',views.relative, name = 'relative'),
url(r'^others/$', views.others, name = 'others')
]
|
# Copyright (c) 2014 Cisco Systems
# 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 (c) 2018 Kurt Jacobson
# <kurtcjacobson@gmail.com>
#
# This file is part of QtPyVCP.
#
# QtPyVCP is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
#... |
from __future__ import annotations
from struct import calcsize
from ..share import COMPRESSIONS
# from zipfile: structCentralDir, structEndArchive, structEndArchive64, structFileHeader
__all__ = ["ZipData", "CentralDirectory"]
class SimpleDataClass:
"""
Provide a neat repr and common methods for the clas... |
from __future__ import division
import sys
import math
import random
import time
from collections import deque
from pyglet import image
from pyglet.gl import *
from pyglet.graphics import TextureGroup
from pyglet.window import key, mouse
class NoiseParameters:
def __init__(self, octaves, amplitude, smoothness, ro... |
import numpy as np
from message import Message
from thespian.actors import *
class Agent(Actor):
def __init__(self):
self.wealth = np.random.randint(1, 10)
def get_wealth(self):
return self.wealth
def receiveMessage(self, message, sender):
if isinstance(message, Message):
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""HTMLParser test for parsing lianjiawang"""
__author__ = "stone"
from html.parser import HTMLParser
from LianJiaWangModel import LianJiaWangModel
class LianJiaWangItemParser (HTMLParser):
MAIN_ATTR_VALUE_KEY = 'content__list--item--main'
TITLE_ATTR_VALUE_K... |
import unittest
from mock import patch
from pyramid.testing import DummyRequest
from pyramid_sna.compat import urlparse
from pyramid_sna.oauth2 import get_user_info, oauth2_step1, oauth2_step2
class Oauth2ClientTests(unittest.TestCase):
def test_oauth2_step1(self):
with patch('uuid.uuid4') as fake:
... |
import asyncio
from hfc.fabric import Client
loop = asyncio.get_event_loop()
cli = Client(net_profile="/home/rohan/Documents/cloudledger/network.json")
org1_admin = cli.get_user(org_name='org1.example.com', name='Admin')
peer_target=cli._peers['peer0.org1.example.com']
requestor=org1_admin
loop.run_until_complete(cli... |
import logging
import os
import librosa
import numpy as np
import tensorflow as tf
from utils.speech_featurizers import SpeechFeaturizer
class VocoderDataLoader():
def __init__(self, config, training=True):
self.config = config
self.batch = config['batch_size']
self.make_file_list(self.c... |
n=int(input())
for i in range(n):
print(i*i) |
"""Bluetooth Low Energy Scanner."""
import asyncio
import logging
import struct
from collections import namedtuple
from datetime import timedelta
from threading import Thread
from time import sleep
import aioblescan as aiobs
from homeassistant.helpers.event import track_point_in_utc_time
from homeassistant.util import... |
from app import db
from app.api import bp
from app.decorators import permissions
from app.models import Settings
from app.utils import send_mail
from app.validators import check_length, is_email
from flask import jsonify, request
from flask_jwt_extended import jwt_required
@bp.route("/settings", methods=["GET"])
@jwt... |
import os
import numpy as np
import SimpleITK as sitk
import random
import pandas as pd
from tqdm import tqdm
from parameters import K, processed_dir, patches_dir, patch_size
def check_out_dirs(base_dir):
if not os.path.exists(os.path.join('..', base_dir)):
os.mkdir(os.path.join('..', base_dir)... |
# Copyright The Linux Foundation and each contributor to CommunityBridge.
# SPDX-License-Identifier: MIT
from unittest.mock import patch, MagicMock
import pytest
from cla.models.dynamo_models import Signature, User, UserModel
@pytest.fixture()
def create_user():
""" Mock user instance """
with patch.object... |
#! /usr/bin/env python
# encoding: utf-8
# DC 2008
# Thomas Nagy 2016-2018 (ita)
import os, re, traceback
from waflib import Utils, Logs, Errors
from waflib.Tools import fc, fc_config, fc_scan, ar, ccroot
from waflib.Configure import conf
from waflib.TaskGen import after_method, feature
@conf
def find_ifort(conf):
f... |
""" Constants used by PyNoon """
# Endpoint URLs
LOGIN_URL = "https://finn.api.noonhome.com/api/login"
DEX_URL = "https://dex.api.noonhome.com/api/endpoints" |
# Copyright 2019 Extreme Networks, 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 i... |
"""
This module controls a PWM I2C module, model Adafruit PCA9685.
"""
############ IMPLEMENTATION NOTES ##############################################
#
# PWM I2C raspberry pi interface.
# See:
# https://github.com/adafruit/Adafruit_Python_PCA9685/blob/master/examples/simpletest.py
# https://learn.adafruit.com/adafr... |
import pdf_to_json as p2j
import json
url = "file:data/multilingual/Latn.BIS/Sans_16/udhr_Latn.BIS_Sans_16.pdf"
lConverter = p2j.pdf_to_json.pdf_to_json_converter()
lConverter.mImageHashOnly = True
lDict = lConverter.convert(url)
print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
|
from .base import base_minimize
from .dummy import dummy_minimize
from .forest import forest_minimize
from .gbrt import gbrt_minimize
from .gp import gp_minimize
from .unscented import ugp_minimize
from .optimizer import Optimizer
__all__ = [
"base_minimize", "dummy_minimize",
"forest_minimize", "gbrt_minimiz... |
"""
`Cargo SQL Extra Type Builders`
--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--
The MIT License (MIT) © 2015 Jared Lunde
http://github.com/jaredlunde/cargo-orm
"""
import re
import time
import psycopg2
from vital.debug import logg
from cargo import Clause, Raw, safe
fro... |
###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompar... |
class Shadow():
"""Reperesent a shadow line."""
def __init__(self, start, end):
"""Shadow line going from start to end."""
self.start = start
self.end = end
def __repr__(self):
return f"{self.start}, {self.end}"
def contains(self, other):
"""Return true if othe... |
from config.db import Base, engine
from .default import routes as default_routes
from .default.models import *
from .file import routes as upload_routes
from .file.models import *
from .oauth import routes as auth_routes
from .oauth.models import *
def create_data():
Base.metadata.create_all(bind=engine)
def re... |
import os
from sys import platform
import argparse
import json
class TrainConfig(object):
def __init__(self):
self.prm = None
def load(self,
model,
optimizer,
data_source,
task_name,
framework_name):
args = self._parse_args(
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class KoubeiMarketingCampaignMerchantActivityQueryModel(object):
def __init__(self):
self._activity_id = None
self._out_request_no = None
@property
def activity_id(self):
... |
#! /usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import unittest
from common.appium_common.element_action import *
from common.appium_common.session import *
from utx import *
class TestAbout(unittest.TestCase):
"""
用户登录
跳过权限弹窗
找到联系人发送消息
"""
@classmethod
def setUpClass(cls): # ... |
from matplotlib.pyplot import contour
from libs.can import CANSocket
from libs.myactuator import MyActuator
from time import perf_counter
import numpy as np
# the serial port of device
# you may find one by examing /dev/ folder,
# this is usually devices ttyACM
serial_device = "ttyACM0"
# Initiate the can bus socket
... |
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Utilities for requesting information for a gerrit server via https.
https://gerrit-review.googlesource.com/Documentation/rest-api.html
"""
impor... |
# Scripts for modeling ATF data.
def atf_article_uri(url, post_id):
return get_url_hash(url)+"/"+post_id
def atf_thread_uri(url):
return get_url_hash(url)
test_date = "Wed Feb 11, 2015 10:31 am"
def atf_date_created(date, format="%a %b %d, %Y %I:%M %p"):
"""Put the date in ISO format"""
return iso86... |
"""Utilities for "fixing" Python imports."""
def fix_imports(file_path):
"""Walks up the directory hierarchy to find the appropriate path to add to PYTHONPATH.
The first directory that does not contain an __init__.py file is the chosen directory. When you call this function,
you usually pass in __file__ ... |
a = {k: v <caret>for k, v in zip('abc', range(3)) if k % 2} |
"""
Django settings for ezequiel_django project.
Generated by 'django-admin startproject' using Django 4.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
from... |
from django.test import TestCase
from django.core.exceptions import ValidationError
from django.db.utils import IntegrityError
from model_mommy import mommy
from ..models import Label, DocumentAnnotation, SequenceAnnotation, Seq2seqAnnotation
from ..serializers import DocumentAnnotationSerializer
from ..serializers im... |
# coding: utf-8
"""
Xero Projects API
This is the Xero Projects API # noqa: E501
OpenAPI spec version: 2.4.0
Contact: api@xero.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
from xero_python.models import BaseModel
class ProjectUser(BaseModel):
"""NOTE: Thi... |
# coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.2863
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class FxForwardAllOf(object):
"""NOTE: This class i... |
import pytest
from theheck.rules.git_branch_delete import match, get_new_command
from theheck.types import Command
@pytest.fixture
def output():
return '''error: The branch 'branch' is not fully merged.
If you are sure you want to delete it, run 'git branch -D branch'.
'''
def test_match(output):
assert ma... |
# Copyright 2013-2022 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 RRviennacl(RPackage):
"""RViennaCL: 'ViennaCL' C++ Header Files"""
homepage = "https:... |
input = """
bk(a,b).
bk(b,c).
bk(m,m).
bk(x,y).
"""
output = """
bk(a,b).
bk(b,c).
bk(m,m).
bk(x,y).
"""
|
import time
import traceback
from json import JSONDecodeError
from requests.exceptions import ReadTimeout, ConnectionError, ConnectTimeout
def retry_on_failure(retries=10):
"""Decorator zum Errorhandling beim Ausführen einer Methode im Loop.
Timeout's, wie beispiel bei Serverüberlastung, werden ignoriert.
... |
from client import Client
from time import sleep
import atexit
class MyClientHandler:
def OnConnect(self, c):
print("Client connected to server!")
c.sendMessage("Hello", "server")
c.broadcast("This is a broadcast!")
c.invokeRPC("server", "kick", ["client11"])
def OnDisconnect(se... |
# -*- coding: utf-8 -*-
"""
This parser will interpret a JSON-LD document as an RDF Graph. See:
http://json-ld.org/
Example usage::
>>> from rdflib.plugin import register, Parser
>>> register('json-ld', Parser, 'rdflib_jsonld.parser', 'JsonLDParser')
>>> from rdflib import Graph, URIRef, Literal
... |
"""
Django settings for frontend project.
Generated by 'django-admin startproject' using Django 1.10.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
... |
#!/usr/bin/python
###############################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License Version 2.0 (the "License... |
# Lint as: python2, python3
# 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
#
... |
"""
Provides factory methods to assemble the Galaxy web application
"""
import atexit
import logging
import sys
import threading
import traceback
from paste import httpexceptions
from tuswsgi import TusMiddleware
import galaxy.app
import galaxy.datatypes.registry
import galaxy.model
import galaxy.model.mapping
import... |
"""
Copyright (c) 2016-2018 Keith Sterling http://www.keithsterling.com
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, m... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.20.7
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unitte... |
import matplotlib.pylab as plt
import numpy as np
from bcipy.signal.model.mach_learning.generative_mods.function_density_estimation import KernelDensityEstimate
import matplotlib as mpl
from scipy.stats import iqr
from bcipy.helpers.load import read_data_csv, load_experimental_data
from bcipy.signal.process.filter impo... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "FaceDetectionWeb.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Dja... |
class TestReportDhcpd:
def test_duplicate_interface(self, host):
result = host.run(
'stack add host interface frontend-0-0 interface=eth0 mac=00:11:22:33:44:55 ip=1.2.3.4 network=private'
)
assert result.rc == 0
result = host.run('stack set host interface interface frontend-0-0 mac=00:11:22:33:44:55 interfa... |
################################################################################
# Copyright (C) 2013-2014 by gempa GmbH
#
# FDSNStation -- Implements the fdsnws-station Web service, see
# http://www.fdsn.org/webservices/
#
# Feature notes:
# - 'updatedafter' request parameter not implemented: The last modification... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.