content stringlengths 0 894k | type stringclasses 2
values |
|---|---|
import boto3
from aws_cdk import (
core as cdk,
aws_events as events,
aws_events_targets as events_targets,
aws_glue as glue,
aws_iam as iam,
aws_lambda as lmb,
aws_lambda_python as lambda_python,
aws_logs as logs,
aws_s3 as s3,
aws_s3_notifications as s3_notifications,
aws_k... | python |
import matplotlib.pyplot as plt
from typing import List, Tuple, Union
from mathplotlib.base import BaseElement, Curve2D
from mathplotlib.style import Style
from mathplotlib.utils import update_with_default
class Text(BaseElement):
"""
Draws a bit of text
"""
on_curve_params = dict(
horiz... | python |
import argparse
import math
import PIL.Image
import PIL.ImageDraw
import sys
def choose_guideline_style(guideline_mod):
if guideline_mod % 16 == 0:
return ('#1f32ff', 3)
if guideline_mod % 8 == 0:
return ('#80f783', 2)
if guideline_mod % 4 == 0:
return ('#f4bffb', 1)
def in_ellipso... | python |
class GQL:
# Client -> Server message types.
CONNECTION_INIT = "connection_init"
START = "start"
STOP = "stop"
CONNECTION_TERMINATE = "connection_terminate"
# Server -> Client message types.
CONNECTION_ERROR = "connection_error"
CONNECTION_ACK = "connection_ack"
DATA = "data"
ER... | python |
# -*- coding:utf-8 -*-
import time
from tqdm import tqdm
import requests
from lxml import etree
headers = {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Encoding': 'gb2312,utf-8',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/201001... | python |
# coding: utf-8
"""
Eclipse Kapua REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
... | python |
import datetime
import sys
import pathlib
current_dir = pathlib.Path(__file__).resolve().parent
sys.path.append( str(current_dir) + '/../' )
from lib.config import get_camera_config
from service.camera import take_pictures
"""
cronによって毎分実行される
その分にタイマーが設定されているカメラの撮影リクエストを送信する
python3 cameras.py
"""
def main():
n... | python |
"""Dataset specification for hit graphs using pytorch_geometric formulation"""
# System imports
import os
# External imports
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset, random_split
import torch_geometric
def load_graph(filename):
with np.load(filename) as f:
... | python |
"""
author: Rene Pickhardt (rene.m.pickhardt@ntnu.no)
Date: 15.1.2020
License: MIT
Checks which nodes are currently online by establishing a connection to those nodes. Results can later be studied with `lightning-cli listpeers` or when `jq` is installed with `lcli getinfo | jq ".num_peers"`
This tool is intended to b... | python |
"""Helper methods."""
from typing import Tuple, Optional
from rest_framework import status
from rest_framework.response import Response
def validate_request_body(
request,
) -> Tuple[Optional[Response], Optional[dict]]:
"""
Validate the json body of a request.
:param request: django request
:ret... | python |
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 3 20:07:19 2020
https://zhuanlan.zhihu.com/p/78452993
@author: lenovo
"""
import torch
from torch.nn import Sequential as Seq, Linear as Lin, ReLU
from torch_geometric.nn import MessagePassing
from torch_geometric.datasets import TUDataset
# dataset = TUDataset(roo... | python |
class Web3ClientException(BaseException):
pass
class MissingParameter(Web3ClientException):
pass
class TransactionTooExpensive(Web3ClientException):
pass
class NetworkNotFound(Web3ClientException):
pass
| python |
import gdo
def f():
import time
time.sleep(10)
gdo.concurrent(
gdo.RunGraph(
"slee", "sleep 2",
"slle2", "sleep 5",
"pysleep", f,
"true", "true")
.req("slee", "true")
) | python |
#!/usr/bin/python
#PIN 0-8 3v3 pull-up default, 9-27 pull-down default
# Pin # for relay connected to heating element (Note: GPIO pin#)
he_pin = 26
brew_pin = 22
steam_pin = 27
led_pin = 13
# Default goal temperature
set_temp = 96.
set_steam_temp = 145.
#Use Fahrenheit?
use_fahrenheit = False
# Default alarm time... | python |
# -*- coding: utf-8 -*-
import os
from codecs import open
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
# load the package's __version__.py module as a dictionary
about = {}
with open(os.path.join(here, "profiler", "__version__.py"), "r", "utf-8") as f:
exec(f.read(), about)
tr... | python |
"""recode entities
Revision ID: 4212acfa7aec
Revises: 235fd19bb942
Create Date: 2016-12-01 10:24:07.638773
"""
import logging
# from pprint import pprint
from alembic import op
import sqlalchemy as sa
import uuid
log = logging.getLogger('migrate')
revision = '4212acfa7aec'
down_revision = '235fd19bb942'
SCHEMA = ... | python |
import os
# Reserves disk space by saving binary zeros to a file a given size
class DiskSpaceReserver:
def __init__(self, path: str, size: int):
self.path = path
self.size = size
def reserve(self):
with open(self.path, 'wb') as f:
f.write(b'\0' * self.size)
def releas... | python |
import uuid
from core import db, logging, plugin, model
from core.models import conduct, trigger, webui
from plugins.occurrence.models import action
class _occurrence(plugin._plugin):
version = 5.0
def install(self):
# Register models
model.registerModel("occurrence","_occurrence","_action",... | python |
#!/usr/bin/env python
import imp
import io
import os
from setuptools import setup, find_packages
def read(*filenames, **kwargs):
encoding = kwargs.get("encoding", "utf-8")
sep = kwargs.get("sep", "\n")
buf = []
for filename in filenames:
with io.open(filename, encoding=encoding) as f:
... | python |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, nishta and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import getdate, validate_email_add, today
from frappe.model.document import Document
from planning.planning.myfunction import ma... | python |
import logging
from impala.dbapi import connect
from .settings import ImpalaConstants, NEED_CERTIFICATE
from .error import ImpalaConnectError, ImpalaQueryError
class ImpalaWrapper:
def __init__(self, host=ImpalaConstants.HOST, port=ImpalaConstants.PORT,
user=ImpalaConstants.USER, database=None, ... | python |
from quixstreaming import QuixStreamingClient
from flask import Flask, request
from datetime import datetime
from waitress import serve
import os
import json
import hmac
import hashlib
# Quix injects credentials automatically to the client.
# Alternatively, you can always pass an SDK token manually as an argument.
cl... | python |
import re
import json
from ..extractor.common import InfoExtractor
from ..utils import (
js_to_json
)
class sexixnetIE(InfoExtractor):
#http://www.txxx.com/videos/2631606/stepmom-seduces-teen-babe/
_VALID_URL = r'https?://(?:www\.)?sexix\.net'
def _real_extract(self, url):
webpage = self._... | python |
"""
https://www.hackerrank.com/challenges/no-idea
There is an array of integers. There are also disjoint sets, and , each containing integers. You like all the integers in set and dislike all the integers in set . Your initial happiness is . For each integer in the array, if , you add to your happiness. If , yo... | python |
from entities import FeedEntity as FE
FEEDS = (
FE('rss', 'The Verge', 'https://www.theverge.com/rss/index.xml'),
FE('rss', 'VB', 'https://feeds.feedburner.com/venturebeat/SZYF'),
# FE('rss', 'TNW', 'https://thenextweb.com/feed/'),
FE('rss', 'ARS Technica', 'http://feeds.arstechnica.com/arstechnica/in... | python |
class RoomAlreadyEmpty(Exception):
pass
class CannotAllocateRoom(Exception):
pass
| python |
a,b = [int(x) for x in input().split(' ')]
print(str(a+b))
| python |
# Source: https://stackoverflow.com/questions/9282967/how-to-open-a-file-using-the-open-with-statement
def filter(txt, oldfile, newfile):
'''\
Read a list of names from a file line by line into an output file.
If a line begins with a particular name, insert a string of text
after the name before append... | python |
"""
SLM test for the cortex-to-hippocampus connectivity for individual subfields
usage: $ python s16_cortex_testSLM.py LSUB
"""
import os, sys
import h5py
import numpy as np
from numpy import genfromtxt
# definde data directories
ddir = '../data/' # data dir
cordir = ... | python |
import csbuilder
from csbuilder.standard import Protocols, Roles, States
@csbuilder.protocols
class SFTProtocols(Protocols):
SFT = 8888
@csbuilder.roles(protocol=SFTProtocols.SFT)
class SFTRoles(Roles):
SENDER = 0
RECEIVER = 1
@csbuilder.states(SFTProtocols.SFT,SFTRoles.SENDER)
class SFTSenderStates(S... | python |
from django.core.management.base import BaseCommand
from django.db.models import Count
from project.pastebin.models import Country
class Command(BaseCommand):
help = 'countries statistics'
def handle(self, *args, **kwargs):
countries = Country.objects.annotate(
pastes_count=Count('users__... | python |
"""Hass cmd."""
def breaking_change(number, cli=False):
"""Create breaking_change list for HA."""
import json
import requests
import os
from github import Github
comp_base = "https://www.home-assistant.io/components/"
pull_base = "https://github.com/home-assistant/home-assistant/pull/"
... | python |
import logging
import boto3
import os
import pandas as pd
import argparse
from datetime import datetime
from dataactcore.models.domainModels import DUNS
from dataactcore.utils.parentDuns import sam_config_is_valid
from dataactcore.utils.duns import load_duns_by_row
from dataactvalidator.scripts.loader_utils import cle... | python |
from datetime import datetime, timedelta
from cymepy.common import DATE_FORMAT
import math
import os
class Solver:
def __init__(self, cymepy, settings, logger):
self.Settings = settings
self._Logger = logger
self.cymepy = cymepy
self._mStepRes = settings['project']['time_step_min'... | python |
from flask import Flask, render_template, request
from github_api import GithubUser
from pprint import pprint
app = Flask('git connect')
MATCHED_PROFILES = {}
userororg = 'user'
ghuser = None
@app.route('/')
def hello():
return render_template('app/index.html', err='')
@app.route('/login', methods=['GET', 'PO... | python |
import urllib2
import logging
from random import choice, randint
from os.path import exists
from time import sleep
from os import getenv
logging.basicConfig(
format='[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s',
datefmt="%d/%b/%Y %H:%M:%S",
level=getenv('LOG_LEVEL', logging.DEBUG)
)
logg... | python |
"""
polarAWB.py
Copyright (c) 2022 Sony Group Corporation
This software is released under the MIT License.
http://opensource.org/licenses/mit-license.php
"""
import json
from pathlib import Path
import shutil
import numpy as np
from myutils.imageutils import MAX_16BIT, my_read_image, my_write_image
from myutils.data... | python |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import OrderedDict, defaultdict
from traceback import print_exc
import wx
from wx import EVT_MENU
from .Controls import CheckBox, RadioButton, Row, StaticText
class FormDialog(wx.Dialog):
def __init__(
self,
parent,
... | python |
'''
Integration Test for creating KVM VM with all nodes shutdown and recovered.
@author: Quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res_... | python |
notebook_list = list()
first_entry=int(input("Enter your first value in the list: "))
second_entry=int(input("Enter your second value in the list: "))
notebook_list.append(first_entry)
notebook_list.append(second_entry)
# for i in range(5):
# val=(int(input("enter a value ")))
# arr.append(val)
# print (ar... | python |
#!/usr/bin/python
#partially based on: http://john.nachtimwald.com/2009/08/15/qtextedit-with-line-numbers/ (MIT license)
from __future__ import print_function
import sys, os, subprocess
from ..share import (Share, Signal, dbg_print, QtCore, QtGui, QtSvg, temp_dir)
##LMY: from highlighter import PythonHighlighter
clas... | python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import yaml
import json
import requests
from copy import deepcopy
from lxml import html
from dateutil.parser import ParserError, parse
# loading external configuration
CONFIG = yaml.safe_load(open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'conf... | python |
#!/usr/bin/env python3
from putarm_ur3e_moveit_config.srv import GoToObj,GoToObjResponse
import sys
import copy
import rospy
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg
from math import pi
from std_msgs.msg import String
from moveit_commander.conversions import pose_to_list
import tf
import... | python |
from os import environ
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import urlparse, parse_qs
import os
import json
from flask import Flask, jsonify, request
import requests
from flask_cors import CORS
def fetch_location():
"""
gets the geocode data for the searched location, ... | python |
def emulate_catchup(replica, ppSeqNo=100):
replica.on_catch_up_finished(last_caught_up_3PC=(replica.viewNo, ppSeqNo),
master_last_ordered_3PC=replica.last_ordered_3pc)
def emulate_select_primaries(replica):
replica.primaryName = 'SomeAnotherNode'
replica._setup_for_non_mas... | python |
""" A tomography library for fusion devices
See:
https://github.com/ToFuProject/datastock
"""
# Built-in
import os
import subprocess
from codecs import open
# ... setup tools
from setuptools import setup, find_packages
# ... local script
import _updateversion as up
# == Getting version ===========================... | python |
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 24 20:47:24 2019
@author: elif.ayvali
"""
import pandas as pd
import numpy as np
import matplotlib.collections as mc
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
from matplotlib.patches import Rectangle
def create_uniform_grid(low, high, bins=(1... | python |
import sys
from je_web_runner import get_desired_capabilities
from je_web_runner import get_desired_capabilities_keys
from je_web_runner import get_webdriver_manager
try:
print(get_desired_capabilities_keys())
for keys in get_desired_capabilities_keys():
print(get_desired_capabilities(keys))
dr... | python |
# Generated by Django 3.1.8 on 2021-04-07 15:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('unievents', '0014_auto_20210407_1416'),
]
operations = [
migrations.RemoveField(
model_name='event_tag',
name='event... | python |
from . import db
from flask import current_app
from flask_login import UserMixin, AnonymousUserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from datetime import datetime
import hashlib, os
import markdown
class User(UserMixin, db.Model):
__tablename__ = 'user'
id = db.Column... | python |
import colander
from cryptography.fernet import Fernet
class EncryptedExportField(colander.String):
"""
Serialize non-encrypted appstruct into encrypted cstruct.
"""
def __init__(self, fernet_key, *args, **kwargs):
self.fernet_key = fernet_key
self.fernet = Fernet(fernet_key)
... | python |
import torch
import torch.nn as nn
from packaging import version
from mmcv.cnn import kaiming_init, normal_init
from .registry import INPUT_MODULES
from .utils import build_norm_layer
def conv1x1(in_planes, out_planes, stride=1):
"""1x1 convolution"""
return nn.Conv2d(in_planes, out_planes, kernel_size=1, ... | python |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# Copyright © 2010, RedJack, LLC.
# All rights reserved.
#
# Please see the LICENSE.txt file in this distribution for license
# details.
# ----------------------------------------------------------------------
import unitt... | python |
#-*- coding: utf-8 -*-
#!/usr/bin/env python
from os import path
# dirs
BASE_DIR = path.dirname(path.realpath(__file__)) + '/'
MODULES_DIR = BASE_DIR + 'modules/'
AUDIO_DIR = BASE_DIR + 'audio/'
# api url (server)
SERVER_API_URL = 'http://localhost:3000/'
# voice lang
LANG = 'en-EN' | python |
""" Main entrypoint for starttls-policy CLI tool """
import argparse
import os
from starttls_policy_cli import configure
GENERATORS = {
"postfix": configure.PostfixGenerator,
}
def _argument_parser():
parser = argparse.ArgumentParser(
description="Generates MTA configuration file according to STARTTL... | python |
import numpy as np
class ValueLog():
"""Implemements a key/value aggregating dictionary log with optional
grouping/precision and custom aggregation modes"""
def __init__(self):
self.log_values = {}
def log(self, key, val, agg="mean", scope="get", group=None,
precision=None):
... | python |
from time import sleep
import threading
import datetime
import paho.mqtt.client as mqtt
#### CONSTANTS ####
#MQTTServer="home.bodhiconnolly.com"
MQTTServer="192.168.1.100"
MQTTPort=1882
waitTime=datetime.timedelta(milliseconds=50)
ledTopic="room/lights/strips/"
functionTopic="room/function/#"
systemTopic="system/fun... | python |
import json
import string
import random
import os
import httplib2
import requests
# Flask Imports
from flask import Flask, render_template, request, redirect, url_for, jsonify
from flask import abort, g, flash, Response, make_response
from flask import session as login_session
from flask_httpauth import HTTPBasicAuth
... | python |
# BaseOperator.py
#
# Base class for all machines and human operators.
#
# Attributes:
# name
# states: a list of states that this operator can be in, at any time. For example: ["busy", idle"]
# start_time: the time at which the behavior starts.
#
# Member functions:
# methods to change state, and print the fra... | python |
# coding=utf-8
import os
import unittest
from parameterized import parameterized
from conans.client.conf import default_settings_yml
from conans.model.editable_cpp_info import EditableCppInfo
from conans.model.settings import Settings
def _make_abs(base_path, *args):
p = os.path.join(*args)
if base_path:
... | python |
from dags.spark_common import SparkJobCfg, spark_job, user_defined_macros, EntityPattern
from dags.spark_common import dag_schema_path, hadoop_options, LOCAL_INPUT, LOCAL_DATAWAREHOUSE
from datetime import timedelta
from airflow import DAG
args = {
'owner': 'alexey',
'start_date': '2021-06-10'
}
dag = DAG(
... | python |
from .mesh import import_mesh
from .curve import import_curve
from .brep import import_brep
#from .default import import_default | python |
#!/usr/bin/python
import sdk_common
# Block in charge of tagging the release
class SDKNewsAndTag(sdk_common.BuildStep):
def __init__(self, logger=None):
super(SDKNewsAndTag, self).__init__('SDK News & Tag', logger)
self.branch_name = self.common_config.get_config().get_branch_name()
self.g... | python |
from .ast_transformers import InvertGenerator, transformAstWith
from .descriptor_magic import \
wrapMethodAndAttachDescriptors, BindingExtensionDescriptor
import six
import inspect
def coroutine(func):
def start(*args, **kwargs):
g = func(*args, **kwargs)
six.next(g)
return g
retur... | python |
import re
import xmlsec
from lxml import etree
def parse_tbk_error_message(raw_message):
message_match = re.search(r'<!--(.+?)-->', raw_message)
if message_match:
message = message_match.group(1).strip()
match = re.search(r'(.+?)\((\d+?)\)', message)
if match:
error = mat... | python |
import os
import djcelery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'findingaids.settings')
os.environ['PYTHON_EGG_CACHE'] = '/tmp'
os.environ['VIRTUAL_ENV'] = '/home/httpd/findingaids/env/'
djcelery.setup_loader()
# from django.core.handlers.wsgi import WSGIHandler
# application = WSGIHandler()
from django.co... | python |
from acme import Product
import random
ADJECTIVES = ['Awesome', 'Shiny', 'Impressive', 'Portable', 'Improved']
NOUNS = ['Anvil', 'Catapult', 'Disguise', 'Mousetrap', '???']
def generate_products(n=30, price_range=(5, 10), weight_range=(5, 100)):
"""Generate n number of products within a specified price and weigh... | python |
import sys, os
sys.path.append('/Users/syrus/Proyectos/exercita/website/')
sys.path.append('/Users/syrus/Sites/exercita/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
TEMPLATE_EXAMPLE = '''<ul>
{% for gender in gender_list %}
<li>{{ gender.grouper }}
<ul>
{% for item in gender.list %}
... | python |
"""
My purpose in life is to take the NWS AWIPS Geodata Zones Shapefile and
dump them into the PostGIS database! I was bootstraped like so:
python ugcs_update.py z_16mr06 2006 03 16
python ugcs_update.py z_11mr07 2007 03 11
python ugcs_update.py z_31my07 2007 05 31
python ugcs_update.py z_01au07 2007 08 01
python ugc... | python |
import requests
import logging
from lxml import html
class HTDownloader():
def __init__(self, htid, res, i):
self.htid = htid
self.i = i
self.res = res
def get(self):
logging.debug("Download image: {}".format(self.i))
return down_img(self.htid, self.i, self.res)
... | python |
import asyncio
from contextlib import asynccontextmanager
from sys import version_info
from typing import AsyncIterator
import pytest
from aioredis import create_redis_pool
from aiohttp_client_cache.backends.redis import DEFAULT_ADDRESS, RedisBackend, RedisCache
from aiohttp_client_cache.session import CachedSession
... | python |
from django.contrib import admin
from .models import Book, Author, Publisher, Loaned
# Register your models here.
class BookAdmin(admin.ModelAdmin):
list_display = ('name', 'date_added')
search_fields = ["name"]
ordering = ["name"]
admin.site.register(Book, BookAdmin)
admin.site.register(Author)
admin.site.register... | python |
from .manage import *
| python |
#!/usr/bin/env python
##
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | python |
import blocksci
import re
import sys
chain = blocksci.Blockchain("/home/hturki/bitcoin-blocksci.bak")
address_file = open("/home/hturki/stackoverflow_addr_raw.txt", "r").read()
addresses = address_file[1:-1].split("', '")
len(addresses)
blocksci_addresses = {}
bad_addresses = set({addresses[10], addresses[18], addre... | python |
#!/usr/bin/env python
'''
We get the lidar point cloud and use it to determine if there are any obstacles ahead
Author:
Sleiman Safaoui
Email:
snsafaoui@gmail.com
Github:
The-SS
Date:
Oct 3, 2018
'''
# python
from __future__ import print_function
import numpy as np
import copy
import math
from numpy import pi
# RO... | python |
from rdflib import Literal
from .namespaces import BRICK, TAG, OWL
parameter_definitions = {
"Parameter": {
"tags": [TAG.Point, TAG.Parameter],
"subclasses": {
"Delay_Parameter": {
"tags": [TAG.Point, TAG.Delay, TAG.Parameter],
"subclasses": {
... | python |
input = """
male(john). republican(john).
male(matt). republican(matt).
female(joana). republican(joana).
female(luise). democrat(luise).
moreMaleRepublicans :-
#count{X:republican(X), female(X)} < N,
#count{Y: republican(Y), male(Y)} = N.
"""
output = """
male(john). republican(john).
... | python |
from auto_yolo import envs
from yolo_air_stage1 import durations, distributions, config
readme = "Running simple on addition task."
envs.run_experiment(
"addition-stage1", config, readme, alg="simple",
task="arithmetic2", durations=durations, distributions=distributions
)
| python |
from singledispatch import singledispatch
from sqlalchemy import types
from sqlalchemy.dialects import postgresql
from sqlalchemy.orm import interfaces
from graphene import (ID, Boolean, Dynamic, Enum, Field, Float, Int, List,
String)
from graphene.types.json import JSONString
try:
from sqla... | python |
#!/usr/bin/python
# TrayIcon
# Access to various monitoring capabilities (HIDS, dashboard, ip configuration, network recognition, etc.)
# Alerting plugin (IM notifications, irssi, OSSEC) that can help to display and monitor notification informations)
# Deamon plugin (sort of tail -f over selected files, RSS gathering... | python |
"""
Pipeline object class for EmrActivity
"""
from .activity import Activity
from ..config import Config
from .schedule import Schedule
from ..utils import constants as const
from ..utils.exceptions import ETLInputError
config = Config()
MAX_RETRIES = config.etl.get('MAX_RETRIES', const.ZERO)
class EmrActivity(Acti... | python |
from django.test import TestCase
from . models import Urls, Statistics
class UrlsTestClass(TestCase):
'''
Class that test the characterics of the Urls objects and its methods
'''
def setUp(self):
'''
Method that runs at the beginning of each test
'''
self.url = Urls(shor... | python |
import ipdb
import numpy as np
import os
from multiprocessing import Process, Queue, Lock
from moviepy.video.io.VideoFileClip import VideoFileClip as Video
import skvideo.measure as skv
from glob import glob
import csv
from tqdm import tqdm
def job(item):
fn, indir, outdir = item
outdir = os.path.splitext(fn.... | python |
from biocrnpyler import *
kb, ku, ktx, ktl, kdeg = 100, 10, 3, 2, 1
parameters = {"kb": kb, "ku": ku, "ktx": ktx, "ktl": ktl, "kdeg": kdeg}
myMixture = BasicExtract(name="txtl", parameters=parameters)
A1 = DNAassembly(name="G1", promoter="pBest",
rbs="BCD2", transcript="T1", protein="GFP", initial_co... | python |
from django.db import models
from django.conf import settings
from django import forms
# Create your models here.
class Dataset(models.Model):
name = models.CharField(max_length=200, null=True, blank=True)
owner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT)
columns = models.Intege... | python |
"""
OpenVINO DL Workbench
Class for annotate dataset job
Copyright (c) 2021 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
... | python |
from bs4 import BeautifulSoup
from contextlib import suppress
RUN_EXAMPLE = 2
class Match:
"""
This class stores information about a class
"""
def __init__(self, team1: str, team2: str, state, _, score1: int, score2: int):
self.team1 = self._sanitize(team1)
self.team2 = se... | python |
from django.apps import AppConfig
class AwewardsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'awewards'
| python |
from setuptools import setup, find_packages
with open("requirements.txt") as f:
requirements = f.readlines()
long_description = "Automated tool to provision Greengrass 2.0"
setup(
name="ggv2_provisioner",
version="0.0.8",
author="Gavin Adams",
author_email="gavinaws@amazon.com",
url="https://... | python |
'''
Load the CIOD module tables from DICOM Standard PS3.3, Annex A.
All CIOD tables are defined in chapter A of the DICOM Standard.
Output the tables in JSON format, one entry per CIOD.
'''
from typing import List, Tuple
import sys
import re
from bs4 import Tag
from dicom_standard import parse_lib as pl
from dicom_st... | python |
import requests
import json
import yaml
def checkDomains(domains):
url = 'https://www.virustotal.com/vtapi/v2/url/report'
scans = []
for dom in domains:
params = {'apikey':getApiKey('vt'), 'resource':dom}
try:
response = requests.get(url, params=params)
scans.append... | python |
from torchvision import models
import torch.nn as nn
class model(nn.Module):
def __init__(self, input_dim, output_dim):
super(model, self).__init__()
self.restored = False
self.input_dim = input_dim
self.output_dim = output_dim
num = len(input_dim)
feature = []
for i in range(num):
feature.append(
... | python |
INSTRUCTIONS = """
"""
from utils.decorators import time_this
@time_this
def solution(inputs):
"""
"""
test_case_inputs = [
]
| python |
class SilkObject:
__slots__ = []
def __ne__(self, other):
return not self.__eq__(other)
class SilkStringLike(SilkObject):
__slots__ = []
from . import primitives
| python |
from .transpose import transpose
| python |
from functools import partial
from flask import Blueprint, current_app, g
from api.client import SecurityTrailsClient, ST_OBSERVABLE_TYPES
from api.mappings import Mapping
from api.schemas import ObservableSchema
from api.utils import get_json, jsonify_data, get_key, jsonify_result
enrich_api = Blueprint('enrich', _... | python |
from sqlite3 import dbapi2 as sqlite3
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash, _app_ctx_stack
import requests, os
from bs4 import BeautifulSoup
# configuration
try:
DATABASE = 'simply-billboard.db'
DEBUG = True
SECRET_KEY = 'development key'
USERNAME = ... | python |
#!/usr/bin/env python
# Copyright 2015 Dmitriy Robota.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | python |
from settings import *
class BonusBox:
def __init__(self, data, gui):
self.boxID = int(data["boxID"])
self.x = int(data["x"])
self.y = int(data["y"])
self.type = int(data["type"])
self.size = 2
self.gui = gui
if self.type == 1: # cargo
... | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.