content stringlengths 5 1.05M |
|---|
# -*- coding: utf-8 -*-
from time import sleep
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from config import path
options = Options()
options.headless = True
driver = webdriver.Chrome(path, chrome_options=options)
class YouTube(object):
"""Text"""
... |
import os
from eval import predict_captions
import sys
import json
from compare import comp as match_results
from getKeyphrase import getKeyPhrase
import argparse
from readxml import events
import shutil
def final_evaluation(folder='test_data'):
print("=========start generate image captions=========")
image_cap... |
"""
d1lod.interface
A high-level wrapper around a d1lod.graph that implements a variety
of d1lod-specific methods.
The most common method that will be called by will be addDataset(). This method
takes care of the work of adding the dataset, its digital objects, and its
people and organizations to the graph. All state... |
from netapp.netapp_object import NetAppObject
class PriorityEntryInfo(NetAppObject):
"""
A priority associated to the specified priority group.
"""
_priority = None
@property
def priority(self):
"""
The priority associated with the specified priority group.
Range: [... |
import sys
import codecs
import string
def crlf2lf(path, encoding='utf8'):
with codecs.open(path, 'r', encoding=encoding) as fs:
data = fs.read()
with codecs.open(path, 'w', encoding=encoding) as fs:
data = data.replace('\r', '')
fs.write(data)
def lf2crlf(path, encoding='utf8'):
... |
from functools import partial
import copy
import pylab
import multiprocessing as mp
from ea import adult_selection
from ea import parent_selection
from ea import reproduction
from ea import float_gtype
from ea import main
from ea.ea_globals import *
import ctrnn
import min_cog_game
def fitness_thread(agent, game):
... |
"""
Let 1 represent ‘A’, 2 represents ‘B’, etc. Given a digit sequence, count the number of possible decodings of the given digit sequence.
Examples:
Input: digits[] = "121"
Output: 3
// The possible decodings are "ABA", "AU", "LA"
Input: digits[] = "1234"
Output: 3
// The possible decodings are "ABCD", "LCD", "AWD"... |
"""pymoku example: Basic Laser Lock Box
This example demonstrates how you can configure the laser lock box
instrument
(c) 2019 Liquid Instruments Pty. Ltd.
"""
from pymoku import Moku
from pymoku.instruments import LaserLockBox
from scipy import signal
def gen_butterworth(corner_frequency):
"""
Generate co... |
import numpy as np
from sklearn.base import BaseEstimator, ClassifierMixin, clone
from sklearn.utils.validation import check_X_y, check_array, check_is_fitted
from sklearn.utils.multiclass import unique_labels
RULE_DICT = {
'max': np.max,
'min': np.min,
'avg': np.mean,
'prd': np.prod
}
class Aggreg... |
import sys
import os
import dotenv
try:
KEYS = ('PYIGL_PATH', 'SDF_PATH')
dotenv.load_dotenv(verbose=True)
for key in KEYS:
_path = os.environ.get(key, '')
_path = os.path.abspath(os.path.normpath(_path))
if os.path.exists(_path):
sys.path.insert(0, os.path.abspath(... |
# Copyright (c) 2015 Orange.
# 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 a... |
#!/usr/bin/env python3
import numpy as np
import h5py
import argparse
from pathlib import Path
def main():
parser = argparse.ArgumentParser(description="Convert HDF5 to CSV")
parser.add_argument("input", type=Path, help="an HDF5 file")
args = parser.parse_args()
print(f"Reading from HDF5 file: {ar... |
from django.shortcuts import render, get_object_or_404
from django.views import generic
from django.urls import reverse_lazy
from .models import Message
from .forms import MessageCreateForm
class MessageCreate(generic.CreateView):
model = Message
form_class = MessageCreateForm
def get_context_data(self, **kwa... |
from nubes.connectors.openstack import connector as os_connector
# NOTE(blogan): we can probably do a registration of each class that gets
# inherited from via metaclass so we don't have to build this manually. This
# works for now though.
connectors = {os_connector.OpenstackConnector.name():
os_connect... |
from __future__ import print_function
import os
import unittest
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import logging
import textwrap
def downloadFromURL(uris=None, fileNames=None, nodeNames=None, loadFiles=None,
customDownloader=None, loadFileTypes=None, loadFileProperties={}):
""... |
#nothing
from numpy.testing import Tester
test = Tester().test
|
# coding=utf-8
# *** WARNING: this file was generated by crd2pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
SNAKE_TO_CAMEL_CASE_TABLE = {
"api_end_point": "apiEndPoint",
"api_version": "apiVersion",
"application_protocol": "applicationProtocol",
"cpu_limit"... |
import logging
import os
from src.database import Database
from src.irc import TwitchBot
from src.objects.match import Match
from src.objects.waifu import (
LockedBetMessage,
OpenBetExhibitionMessage,
OpenBetMessage,
WinMessage,
)
logger = logging.getLogger(__name__)
FAIL_HOURS = 6
def run() -> Non... |
from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(name='datamanagerpkg',
version='0.1',
description='python package to allow communication between Ion Proton and Galaxy',
long_description=readme(),
author='William Digan',
... |
from fastapi import FastAPI,Request
from fastapi.testclient import TestClient
from main.app import app
from fastapi.responses import PlainTextResponse
import requests
import requests_mock
import sys
sys.path.insert(0, '/home/buinhuphu/Dropbox/FastAPI/covid-chatbot')
import settings
client = TestClient(app)
def test... |
# Copyright 2021 IBM Inc. All rights reserved
# SPDX-License-Identifier: Apache2.0
# 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 ... |
from flask_frozen import Freezer
from main import app
freezer = Freezer(app)
if __name__ == '__main__':
freezer.freeze() |
from __future__ import print_function
import glob2
import os
import warnings
import textract
import requests
import parser1
from flask import (Flask, json, Blueprint, jsonify, redirect, render_template, request,
url_for)
from gensim.summarization import summarize
from sklearn.feature_extraction.text ... |
from setuptools import setup, find_packages
with open('README.rst') as fp:
long_description = fp.read()
setup(
name='roviclient',
version='0.1.0',
description='A simple Python client library for the Rovi API',
long_description=long_description,
author='Devin Sevilla',
author_email='das... |
"http://cms.mpi.univie.ac.at/vasp/vasp/POSCAR_file.html"
from __future__ import absolute_import, division, print_function
from libtbx import slots_getstate_setstate
from six.moves import range
from six.moves import zip
class reader(slots_getstate_setstate):
__slots__ = """
title
scale
lattice_vectors
... |
from copy import deepcopy
from typing import NamedTuple, List
from collections import Counter
class Point(NamedTuple):
x: int
y: int
def __add__(self, other: 'Point'):
return Point(self.x + other.x, self.y + other.y)
grid = []
with open('01.txt') as f:
for line in f.readlines():
gri... |
"""
Copyright 2019 Samsung SDS
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... |
import torch
import torch.nn as nn
lstm = nn.LSTM(300, 100, 2,bidirectional=True)
x = torch.randn(7, 16, 300)
h0 = torch.randn(4, 16, 100)
c0 = torch.randn(4, 16, 100)
output, (hn, cn)=lstm(x, (h0, c0))
print('output {}'.format(output.size()))
print('hn {}'.format(hn.size()))
print('cn {}'.format(cn.size()))
mod... |
"""
Terraform UCTT provisioner plugin
"""
import logging
import json
import os
import subprocess
from typing import Dict, List, Any
from configerus.loaded import LOADED_KEY_ROOT
from configerus.contrib.jsonschema.validate import PLUGIN_ID_VALIDATE_JSONSCHEMA_SCHEMA_CONFIG_LABEL
from configerus.validator import Vali... |
from django.test import TestCase
from .models import Location,Category,Image
import datetime as dt
# Create your tests here.
class LocationTestClass(TestCase):
def setUp(self):
self.Moringa = Location(location='London')
def test_instance(self):
self.assertTrue(isinstance(self.Moringa,Location)... |
from bs4 import BeautifulSoup
import requests, re, os, sys
from urllib.request import urlopen
from glob import glob
import pandas as pd
EN_URL = "https://www.jw.org/en/library/bible/nwt/books/"
AM_URL = "https://www.jw.org/am/ላይብረሪ/መጽሐፍ-ቅዱስ/nwt/መጻሕፍት/"
TI_URL = "https://www.jw.org/ti/ቤተ-መጻሕፍቲ/መጽሓፍ-ቅዱስ/nwt/መጻሕፍቲ/"
... |
# Databricks notebook source
# MAGIC %run /group07/shared
# COMMAND ----------
import os
import pyspark.sql.functions as f
# COMMAND ----------
OUTPUT_DIR = "/mnt/group07/final_data_product"
# Load FULL CSV Dataset
df_flickr = spark.read.format("CSV").option("delimiter", "\t").schema(get_csv_data_scheme()).load("/m... |
#!/usr/bin/python -ci=__import__;o=i("os");s=i("sys");a=s.argv;p=o.path;y=p.join(p.dirname(a[1]),".python");o.execv(y,a)
from photons_app.executor import library_setup
from photons_app.special import FoundSerials
from photons_messages import LightMessages
from delfick_project.logging import setup_logging
import logg... |
# -*- coding: utf-8 -*-
"""DNA Center CustomCaller
Copyright (c) 2019 Cisco and/or its affiliates.
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 limitatio... |
"""Training"""
from datetime import datetime
import os.path
import time
import numpy as np
import tensorflow as tf
from tcl import tcl
from subfunc.showdata import *
FLAGS = tf.app.flags.FLAGS
# =============================================================
# =====================================================... |
"""A class to aid in generating random numbers and sequences
It doesn't seem necessary to create an options class since this class will probably not be extended
"""
import random, sys
nts = ['A','C','G','T']
hexchars = '0123456789abcdef'
uuid4special = '89ab'
class RandomSource:
"""You can asign it a seed if you... |
#! /usr/bin/env python3
# looking for 3 values which satisfy:
#5R
#3R
#R
# tolerance = 0.001 # 0.1%
# tolerance = 0.01 # 1%
#tolerance = 0.005 # 0.5%
tolerance = 0.0025
series_list = ["e6.txt", "e12.txt", "e24.txt", "e48.txt", "e96.txt", "e192.txt"]
series_names = ["E6", "E12", "E24", "E48", "E96", "E192"]
valid_comb... |
import numpy as np
from gym import spaces
import gym
class HERGoalEnvWrapper(gym.Env):
def __init__(self, env, activate_sparse_reward=False):
"""
:param env: (causal_world.CausalWorld) the environment to convert.
:param activate_sparse_reward: (bool) True to activate sparse rewards.
... |
RESULTS_LOGGER = 'results' |
import json
import os
from github3 import login
from trains import Task
def clone_and_queue():
payload_fname = os.getenv('GITHUB_EVENT_PATH')
with open(payload_fname, 'r') as f:
payload = json.load(f)
task_id, _, queue_name = payload.get("comment", {}).get("body", "").partition(" ")[2].partition... |
import numpy as np
import math
from ..miniworld import MiniWorldEnv, Room
from ..entity import Box
from ..params import DEFAULT_PARAMS
from gym import spaces
class OneRoom(MiniWorldEnv):
"""
Environment in which the goal is to go to a red box
placed randomly in one big room.
"""
def __init__(self,... |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""
Defines a widget for getting a scaled value client-side.
"""
from ipywidgets import Widget, register, widget_serialization
from traitlets import Unicode, Instance, Union, Any... |
from .util import EasyDict, make_cache_dir_path
|
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, 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:
#
# * Redistributions of source code must retain the above... |
import frappe
def get_context(context):
x = frappe.form_dict.docname;
context.employee = frappe.get_doc("CompanyEmployeeDetail",x)
return context
|
import unittest
import os
from surround import Surround, Stage, SurroundData, Config
from .stages.first_stage import FirstStage
class HelloStage(Stage):
def operate(self, surround_data, config):
surround_data.text = "hello"
if "helloStage" in config:
surround_data.config_value = config[... |
# Copyright 2012 OpenStack Foundation
#
# 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... |
#!/usr/bin/env python
import sys
import pmagpy.pmag as pmag
import pmagpy.pmagplotlib as pmagplotlib
import pmagpy.nlt as nlt
def main():
"""
NAME
trmaq_magic.py
DESCTIPTION
does non-linear trm acquisisiton correction
SYNTAX
trmaq_magic.py [-h][-i][command line options]
... |
from .bed_bathing import BedBathingEnv, BedBathingX
class BedBathingPR2Env(BedBathingEnv):
def __init__(self):
super(BedBathingPR2Env, self).__init__(robot_type='pr2', human_control=False)
class BedBathingPR2X(BedBathingX):
def __init__(self):
super(BedBathingPR2X, self).__init__(robot_type='p... |
"""Tries to access all OpenEO processes endpoints - A initial version of 'integration tests' for the processess service.
To run them gateway, RabbitMQ and the processes and data service need to be up and running. Do not
forget to provide required environment variables.
Once the 'backend' is running some environment v... |
"""
# Hello World.
Simplest possible workflow. We define a DAG with a single task: to print "Hello world".
"""
from dagger import DAG, Task
def say_hello_world(): # noqa
print("Hello world")
dag = DAG(
nodes={
"say-hello-world": Task(say_hello_world),
},
)
if __name__ == "__main__":
"""D... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class TheOnionIE(InfoExtractor):
_VALID_URL = r'(?x)https?://(?:www\.)?theonion\.com/video/[^,]+,(?P<article_id>[0-9]+)/?'
_TEST = {
'url': 'http://www.theonion.com/... |
"""Equivalence class based pytests for the pendulum.parse method"""
import pytest
import pendulum
from pendulum.parsing import ParserError
def test_i_16():
text = "5:33:60"
with pytest.raises(ValueError):
pendulum.parse(text)
def test_i_17():
text = "5:33:-01"
with pytest.raises(ParserErro... |
#This file is used to test the code.
import subprocess
def test(filename, method, cutoff, seed):
commandline = ['python', 'TSP.py', '--inst', filename, '--alg',
method, '--time', str(cutoff), '--seed', str(seed)]
subprocess.call(commandline)
if __name__ == '__main__':
file_list = ['bur... |
import random
import numpy as np
import torch
from collections import namedtuple
from SumTree import SumTree
"""
Prioritized experience reply buffer
Get from https://github.com/austinsilveria/Banana-Collection-DQN/blob/master/Banana_DoubleDQN_PER.py which was adjusted from original source: https://jaromiru.co... |
import stribor as st
import torch
def test_ordered_right_half_mask():
gen = st.util.get_mask('ordered_right_half')
assert torch.eq(gen(1), torch.Tensor([1])).all()
assert torch.eq(gen(2), torch.Tensor([0, 1])).all()
assert torch.eq(gen(5), torch.Tensor([0, 0, 1, 1, 1])).all()
def test_ordered_left_ha... |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes, os
from webnotes.modules import scrub, get_module_path, scrub_dt_dn
import webnotes.plugins
def import_files(module, dt=None, dn=None, plugin=None, force=Fa... |
#!/usr/bin/env python
# encoding: utf-8
from unittest import TestCase
from ycyc.ycollections import tagmaps
class TestTagMaps(TestCase):
def test_uasge(self):
maps = tagmaps.TagMaps()
@maps.register("add")
def add(x, y):
return x + y
@maps.register("... |
import numpy as np
from predict_c3d_ucf101 import run_test
from parse_class_index import parse_cls_indx
from evaluate_predictions import evaluate_prediction
ds_dir = "/home/bassel/data/office-actions/office_actions_19/short_clips/unstabilized_resized_frms_112"
testing_files_dic = {
"all_view... |
from __future__ import division
import numpy as np
import neuro #This is MUST be included
import random
random.seed(0)
def neuro_start(inputs, targets, training):
#initializes the neural network
network=neuro.setup_network(inputs)
#The number of repetitions that you will
#be training your network wi... |
from tqdm import tqdm
import requests
chunk_size = 1024
def download_file(url, filename):
r = requests.get(url, stream=True)
total_size = int(r.headers['content-length'])
with open(filename, 'wb') as f:
for data in tqdm(iterable=r.iter_content(
chunk_size=chunk_size), total=total_s... |
from .ast import *
from .ast import __all__ as __ast_all__
from .astprint import *
from .astprint import __all__ as __astprint_all__
from .moduleinfo import *
from .moduleinfo import __all__ as __moduleinfo_all__
from .obj import *
from .obj import __all__ as __obj_all__
from .lexer import *
from .lexer import __all__ ... |
import os
c.NotebookApp.ip = '*'
c.NotebookApp.port = int(os.getenv('PORT', 8888))
c.NotebookApp.open_browser = False
c.NotebookApp.notebook_dir = u'/root/'
|
# This file is part of the Trezor project.
#
# Copyright (C) 2012-2018 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distrib... |
from django.db import models
from django.urls import reverse
# Create your models here.
class Category(models.Model):
name = models.CharField(max_length=250, unique=True)
slug = models.SlugField(max_length=250, unique=True)
description = models.TextField(blank=True)
image = models.ImageField(upload_to=... |
from scoring.models import Judge_Assignment, Project
def cal_average_score():
done_list = []
jas = list(Judge_Assignment.objects.all())
for ja in jas:
if ja.project_id not in done_list:
score = 0
done_list.append(ja.project_id)
project = Judge_Assignment.objects.... |
from bnn import BNN
from collections import OrderedDict
import tensorflow as tf
from tensorflow.python.platform import flags
FLAGS = flags.FLAGS
class EMAML:
def __init__(self,
dim_input,
dim_output,
dim_hidden=32,
num_layers=4,
... |
<<<<<<< HEAD
import torch
import utils
import dataset
import pandas as pd
from model import BertBaseUncased
import CONFIG as config
from tqdm import tqdm
def test_fn(dataloader,model,device):
model.eval()
accuracy = utils.AverageMeter()
fin_outputs = []
tk0 = tqdm(dataloader,total = len(dataloader))
... |
# 10_kapitel_13_repetitionsfragen.py
import re
max_text_length=70
max_text_delta=20
def output(title, string):
print('╔'+''.center(max_text_length+8, '═')+'╗')
print('║ '+title.center(max_text_length+7).upper()+'║')
print('╠'+''.center(max_text_length+8, '═')+'╣')
string=string+' '*max_text_length
... |
"""Code for handling downloading of HPO files used by scout from CLI"""
import logging
import pathlib
import click
from scout.utils.scout_requests import fetch_mim_files
LOG = logging.getLogger(__name__)
def print_omim(out_dir, api_key):
"""Print HPO files to a directory
Args:
out_dir(Path)
""... |
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the extraction tool object."""
from __future__ import unicode_literals
import argparse
import unittest
from plaso.cli import extraction_tool
from tests.cli import test_lib
class ExtractionToolTest(test_lib.CLIToolTestCase):
"""Tests for the extraction ... |
# Demonstrates the Personally Identifiable Information (PII) detection capability of the expert.ai (Cloud based) Natural Language API
import json
from expertai.nlapi.cloud.client import ExpertAiClient
client = ExpertAiClient()
text = "CREDIT CARD CANCELLATION REQUEST\nPERSONAL INFORMATION:\nNAME: Anne Cuthbert\nADDRE... |
__version__ = '4.6.7'
|
#!/usr/bin/env python3
def separate(a: list, length) -> zip:
return zip(*[iter(a)] * length)
n, *a = map(int, open(0).read().split())
b = a[:]
for _ in [0] * (n - 1):
a = [*map(max, separate(a, 2))]
print(b.index(min(a)) + 1) |
#-*- coding: utf-8 -*-
"""
@author:Bengali.AI
"""
from __future__ import print_function
#-------------------------------------------
# globals
#-------------------------------------------
from .base import BaseNormalizer,languages
#-------------------------------------------
# cleaner class
#--------------------------... |
## Method 1: Iterative - stack
## Method 2: Recursive - in-built stack
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def constructMaximumBinaryTree(self,... |
from django.apps import AppConfig
class NotificationsAppConfig(AppConfig):
name = 'gramgram.notifications'
# django-admin startapp notifications
|
from django.contrib import admin
from .models import fb_db
# Register your models here.
admin.site.register(fb_db)
|
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2002-2019 "Neo4j,"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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 L... |
from checkov.common.models.enums import CheckResult, CheckCategories
from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
from typing import List
class GoogleRoleServiceAccountUser(BaseResourceCheck):
def __init__(self):
name = "Ensure that IAM users are not assigned the Ser... |
import argparse
import datetime as dt
from posixpath import dirname
import matplotlib.pyplot as plt
import pandas as pd
import pandas_datareader.data as web
import numpy as np
import os
import pickle
from mpldatacursor import datacursor
# Global variables
TICKER_INFO_FILE = 'ticker_info.csv'
TICKER_DATA_PATH = 'sec_d... |
import re
from itertools import chain
from typing import List
import click
from mach import types
from mach.__version__ import __version__
from mach.exceptions import ValidationError
STORE_KEY_RE = re.compile(r"^[\w_-]*$")
def validate_config(config: types.MachConfig, *, ignore_version=True):
"""Check the confi... |
import time
def sample(a, b):
"""
Test case 1
"""
for _ in range(2):
print("yes")
x = 8
y = 14
x = a + b
y = x * 2
print('Math test: ' + str(y))
fl = 1.234
a_string = "this is a string"
print(a_string)
num_list = []
... |
from __future__ import absolute_import
import unittest
class TestCase(unittest.TestCase):
def __call__(self, result=None):
"""Run a test without having to call super in setUp and tearDown."""
self._pre_setup()
unittest.TestCase.__call__(self, result)
self._post_teardown()
d... |
"""
Author: Justin Cappos
Start Date: July 1st, 2008
Description:
Handles exiting and killing all threads, tracking CPU / Mem usage, etc.
"""
import threading
import os
import time
# needed for sys.stderr and windows Popen hackery
import sys
# needed for signal numbers
import signal
# needed for harshexit
imp... |
import abc
from rsocket.rsocket import RSocket
class LoadBalancerStrategy(metaclass=abc.ABCMeta):
@abc.abstractmethod
def select(self) -> RSocket:
...
@abc.abstractmethod
async def connect(self):
...
@abc.abstractmethod
async def close(self):
...
|
'''where you can set absolute and relative path used in the package'''
import os
import numpy as np
root = os.path.dirname(os.path.abspath(__file__))
M2015_file = os.path.join(root, '../aux/rhoTable_Mobley2015.csv')
M1999_file = os.path.join(root, '../aux/rhoTable_Mobley1999.csv')
rhosoaa_fine_file = os.path.join(roo... |
import sys
class DAOException(Exception):
def __init__(self, parent, error):
print(sys.exc_info()[0])
print('Parent Error : {}'.format(parent))
print("ERROR {}:".format(error.args[0]))
raise error
|
# Generated by Django 3.1.8 on 2021-04-16 11:21
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('lockers', '0003_personal... |
# DADataType.py
from docassemble.base.util import DAObject
__all__ = ['DADTBoolean', 'DADTContinue', 'DADTNumber', 'DADTString', 'DADTEmail', 'DADTDate', 'DADTTime', 'DADTDateTime', 'DADTYesNoMaybe', 'DADTFile', 'DADTEnum', 'DADTObjectRef']
class DADataType(DAObject):
def init(self, input_type="default", *pargs,... |
# file: SubmissionName.py
import re
import Loghelper
'''
Represents the "meta data" of a submission file or directory name
'''
class SubmissionName:
def __init__(self, submissionName):
# subnamePattern1 = "(?P<task>\w+)_Level(?P<level>\w)_(?P<student>[_\w]+)\.zip"
# Der "Trick des Jahres" - non g... |
import os
from .message import Message
from ..limits import get_limits
#receives simple newline terminated message
class LineMessage(Message):
def __init__(self):
Message.__init__(self)
def dataReceived(self, data):
self._buffer += data
if len(self._buffer) > get_limits().max_line_message_length:
self.m... |
#
# This class was auto-generated from the API references found at
# https://support.direct.ingenico.com/documentation/api/reference/
#
from ingenico.direct.sdk.api_resource import ApiResource
from ingenico.direct.sdk.response_exception import ResponseException
from ingenico.direct.sdk.domain.error_response import Erro... |
"""
Fibra is a sophisticated scheduler for cooperative tasks.
It's a bit lke Stackless Python. It uses Python generator functions
to create tasks which can be iterated.
"""
from schedule import *
from handlers.sleep import Sleep
from handlers.nonblock import Unblock
from handlers.tasks import Async, Return, Finished... |
from dash import html
from dash import dcc
import feffery_antd_components as fac
import feffery_utils_components as fuc
import callbacks.AntdDateRangePicker
docs_content = html.Div(
[
html.Div(
[
html.H2(
'AntdDateRangePicker(id, className, style, *args, **k... |
from trinity.exceptions import (
BaseTrinityError,
)
class EventBusNotReady(BaseTrinityError):
"""
Raised when a plugin tried to access an :class:`~lahja.eventbus.EventBus` before the plugin
had received its :meth:`~trinity.extensibility.plugin.BasePlugin.on_ready` call.
"""
pass
class Inval... |
def funcaoQueFazAlgo(a, b):
print('Algo!!')
def outra_funcao(arg1, arg2):
print("Outra funcao!", arg1+arg2)
funcaoQueFazAlgo(1, 2)
outra_funcao(3, 4)
|
"""Defines Python-version calculation "representation" objects"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S... |
#-----------------------------------------------------------------------------
# Title : PyRogue base module - Model Class
#-----------------------------------------------------------------------------
# This file is part of the rogue software platform. It is subject to
# the license terms in the LICENSE.txt file ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.