content stringlengths 5 1.05M |
|---|
#==========================================================================
#
# Copyright Insight Software Consortium
#
# 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
#
# ... |
import h5py
import numpy as np
import json
from collections import defaultdict
import matplotlib as mpl
import matplotlib.pyplot as plt
from scipy import stats
import matplotlib.pylab as pylab
import seaborn as sns
from scipy import stats
import dill as pkl
rel_cate_recall = pkl.load(open('./output/rel_cat_recall.... |
from django.shortcuts import render
from . models import *
# Create your views here.
def home(request):
context = {}
return render(request, "myprofile/home.html", context)
def about(request):
about = About.objects.all()
context = {
'about': about
}
return render(request, "myprofile/about.html", c... |
import uuid
import graphql
import github
class HTTPClient(graphql.client.HTTPClient):
__slots__ = ("token", "user_agent", "uuid")
def __init__(self, token, session, user_agent):
super().__init__(session=session, url="https://api.github.com/graphql")
self.uuid = str(uuid.uuid4())
s... |
import torch
from torch import nn
from torch.nn import functional as F
from torchvision.ops import nms
from collections import OrderedDict
from ...config import prepare_config
class LocMaxNMSPostprocessor(nn.Module):
"""A score local maxima + nms postprocessor. Keeps predictions that correspond
to local ma... |
from spaceone.core.manager import BaseManager
from spaceone.inventory.connector.identity_connector import IdentityConnector
class IdentityManager(BaseManager):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.identity_conn: IdentityConnector = self.locator.get_connector... |
from django.views.generic import TemplateView
class SubmissionsView(TemplateView):
template_name = 'management/submissions.html'
class UserManagementView(TemplateView):
template_name = 'management/user_management.html'
|
import struct
import random
import socket
import time
import io
import re
import collections
HEADER_SIZE = 12
Header = collections.namedtuple('Header', ['msg', 'len', 'sync'])
def unpack_header(buf):
msg, len_, sync = struct.unpack('<III', buf[:HEADER_SIZE])
return Header(msg, len_, sync), buf[HEADER_SIZE:... |
# -*- coding: utf-8 -*-
"""chapter11.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1xiOWojlWDCiyw8Nt0-boNhmAo8tE_yFE
"""
#last chapter, chapter 11, virtual screening
#A Virtual Screening Workflow Example
#a set of
# molecules known to bind to... |
# 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 applicable law or agreed to in... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
def main(argv):
filename = argv[1]
data = []
with open(filename, 'rb') as f:
header1 = f.readline()
header2 = f.readline()
line = str(f.readline(), 'utf-8')
while line:
i... |
"""
Tests for simple se commands that just output to stdout and don't require
a book as input.
"""
import pytest
import se
from helpers import must_run
SIMPLE_CMDS = [
("dec2roman", "1 4 7 45 900", "I\nIV\nVII\nXLV\nCM"),
("dec2roman", "1867", "MDCCCLXVII"),
("roman2dec", "III XXV LXXVI CXLII DCCCLXIV", ... |
import json
from django.test import TestCase
from django.urls import reverse
from django.contrib.auth.models import AnonymousUser, User
from unittest.mock import patch
from .models import *
class dotdict(dict):
__getattr__ = dict.get
__setattr__ = dict.__setitem__
__delattr__ = dict.__delitem__
# Creat... |
from collections import namedtuple
import pytest
from iroha import Iroha, ed25519_sha2
iroha = Iroha('ADMIN_ACCOUNT_ID')
command = [Iroha.command('CreateDomain', domain_id='domain', default_role='user')]
transaction = Iroha.transaction(iroha, command)
Test_data = namedtuple('Test_data', ['message', 'private_key', 'p... |
"""Current version of package keras_mixed_sequence."""
__version__ = "1.0.27"
|
from numpy.core.fromnumeric import reshape
import streamlit as st
import pickle
import numpy as np
import pandas as pd
st.title("Modeling Earthquake Damage")
st.header("How much damage did the building incur?")
st.markdown("----------------------------------------")
# load model
with open('saved-earthquake-model.pkl... |
from wagtail.documents.models import Document as WagtailDocument, get_document_model
from graphene_django.types import DjangoObjectType
import graphene
from ..registry import registry
from ..utils import resolve_queryset
from .structures import QuerySetList
class DocumentObjectType(DjangoObjectType):
"""
Bas... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-05-02 19:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('parcelhubPOS', '0008_auto_20180429_0142'),
]
operations = [
migrations.AddF... |
import random
import time
import chainer.functions as F
import gym
import numpy as np
def reseed(env, pool_rank):
np.random.seed(pool_rank + get_time_seed())
random.seed(pool_rank + get_time_seed())
env.seed(pool_rank + get_time_seed())
def sym_mean(x):
return F.sum(x) / x.size
def gamma_expand(x... |
# Network para AWS
import ipaddress
import json
import os
from libcloud.compute.drivers.ec2 import VPCInternetGateway, EC2Network
from bastion.component import Component
from bastion.libcloudbastion.ec2 import EC2VPNGateway
from bastion.networking.network.base import Network
from bastion.networking.private_dns.aws imp... |
import RPi.GPIO as GPIO
import os
import subprocess
import sys
def startsystem(channel):
print("Starting!")
subprocess.Popen(["python3", "index.py"])
sys.exit(0)
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(13, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.add_event_detect(13,GPIO.RISING,callback... |
#!/usr/bin/env python
from math import floor
class LaserSpeed:
"""
MIT License.
This is the standard library for converting to and from speed code information for LHYMICRO-GL.
The units in the speed code have acceleration/deceleration factors which slightly modifies the equations used
to conver... |
import json
import os
from typing import Any
import spotipy
from spotipy.oauth2 import SpotifyOAuth
try:
CLIENT_ID = os.environ["SPOTIPY_CLIENT_ID"]
CLIENT_SECRET = os.environ["SPOTIPY_CLIENT_SECRET"]
CLIENT_REDIRECT_URI = os.environ["SPOTIPY_REDIRECT_URI"]
except Exception as e:
print("An Envi... |
"""
Escreva um programa que receba como entrada o valor do saque realizado pelo cliente de um banco e retorne quantas
notas de cada valor serão necessárias para atender ao saque com a menor quantidade de notas possível. Serão utilizadas
notas de 100, 50, 20, 10, 5, 2 e 1 real.
"""
n1 = int(input('Digite o valor do saq... |
#!/usr/bin/env python3
from collections import namedtuple, UserList
Step = namedtuple('Step', ['actor', 'options'])
class MultiStep(UserList):
def __init__(self, iterable=None):
# validation logic
if iterable:
[e.actor for e in iterable]
super().__init__(iterable)
def __... |
"""Description
"""
import sys, os, time, argparse
from collections import OrderedDict, deque
import tensorflow as tf
import numpy as np
from feeder import Feeder
from model import SptAudioGen, SptAudioGenParams
from pyutils.ambisonics.distance import ambix_emd
import myutils
from definitions import *
def parse_argume... |
# encoding: utf-8
# Author: Bingxin Ke
# Created: 2021/10/4
"""
Homogeneous coordinate transformation
"""
from typing import Union
import numpy as np
import open3d as o3d
import torch
def points_to_transform(p1, p2):
raise NotImplemented
def extent_transform_to_points(extents, transform):
# _p1 = np.... |
def soma (x, y):
return x + y
def multiplica (x, y, z):
return x * y * z
def meu_nome():
return "Lucas Zarza"
|
# ipop-project
# Copyright 2016, University of Florida
#
# 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, modify, m... |
import random
from time import time
import warnings
warnings.filterwarnings('ignore')
from tqdm import tqdm
from tree_modules import kd_tree, quad_tree
def test_random_insertions(val_range=100, num_elements=1000, reps=10):
q_time = 0
k_time = 0
print("\nRandom element insertion")
print(f"{num_el... |
import tensorflow as tf
INPUT_HEIGHT = 200
INPUT_WIDTH = 200
class FineNet(tf.keras.Model):
def __init__(self, alpha, lmbda, d_latent):
super(FineNet, self).__init__()
self.alpha = alpha
self.lmbda = lmbda
self.d_latent = d_latent
self.embedder = tf.keras.Sequential(
... |
#!/usr/bin/env python
"""
Created on Wed Apr 8 15:19:52 2015
Author: Oren Freifeld
Email: freifeld@csail.mit.edu
"""
import numpy as np
from of.utils import *
from pyvision.essentials import Img
from pylab import plt
def colored_squares(dimy,dimx,nPixels_in_square_side):
"""
"""
M=nPixels_in_square_si... |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from abc import ABCMeta
from dataclasses import dataclass
from pants.base.build_root import BuildRoot
from pants.core.util_rules.distdir import DistDir
from pants.engine.console... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
# This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, The QuTiP Project
# 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. Redistributi... |
#!/usr/bin/env python
import argparse
import re
import sys
def FixWhitespace(path):
lines = file(path, "rb").readlines()
should_rewrite = False
for i, line in enumerate(lines):
trailing_whitespace, = re.search("(\s*)$", line).groups()
if trailing_whitespace == "\n":
continue
print "%s(%d): in... |
#!/usr/bin/env python
# This fact finds the paths of compiled ardupilot firmwares
# otherwise compile attempts happen every run, which is unnecessary and very slow
import os,re
print "ardupilotfw_test=yes"
if os.path.isfile("/srv/maverick/code/ardupilot/ArduCopter/ArduCopter.elf"):
print "ardupilotfw_arducopter=y... |
from django.shortcuts import render, get_object_or_404
from django.views import View
from .models import Blog
from projects.models import AboutPerson, PersonSocialMedia
# View for all blog posts
class BlogView(View):
def get(self, request):
about = AboutPerson.objects.get(pk=1)
social_medias = Pe... |
""" A Simple CLI to parse text file with League Results"""
__version__ = "0.0.2" |
from .load_docx import load_docx
from .load_chat import load_chat
from .creat_relation import creat_relation, creat_relations
|
# Project Quex (http://quex.sourceforge.net); License: MIT;
# (C) 2005-2020 Frank-Rene Schaefer;
#_______________________________________________________________________________
import quex.input.regular_expression.core as regular_expression
import quex.input.files.mode_option as mode_option
import quex... |
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7, GPIO.IN)
print GPIO.input(7)
|
# Uma empresa possui 30 funcionários e resolveu oferecer um
# auxílio família de R$ 150,00 por filho. O sistema deverá
# perguntar a quantidade de filhos e informar o valor total do
# bônus para cada funcionário.
numFuncionarios = 30
contador = 1
while contador<=numFuncionarios:
numFilhos = int(input('\nDigite ... |
# The MIT License (MIT)
#
# Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved.
#
# 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... |
class LoginForm(forms.Form):
username=forms.UsernameField(required=True,error_messages={'required':"用户名不能为空"})
password=forms.PasswordField(max_length=120,min_length=6,required=True,error_messages={'required':"密码不能为空"})
|
"""The core session used as default when no backend is connected."""
import logging
from .session import Session
from .sparql_backend import SparqlResult, SparqlBindingSet, SPARQLBackend
logger = logging.getLogger(__name__)
class CoreSession(Session, SPARQLBackend):
"""Core default session for all objects."""
... |
from app.api import callback_api, operator_api, task_api, response_api, services_api, database_api, crypto_api
from app.api import payloads_api, analytics_api, c2profiles_api, file_api, operation_api, payloadtype_api
from app.api import command_api, reporting_api, credential_api, keylog_api, transform_api, mitre_api, a... |
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import os
root_path = os.path.dirname(os.path.abspath('__file__'))
# root_path = os.path.abspath(os.path.join(root_path,os.path.pardir))
graphs_path = root_path+'/results_analysis/graphs/'
print("root path:{}".format(root_path))
# plt.rcParams['figu... |
# Script for sending the second mail
#
# Configuration
# - config.yaml.example for the smtp connection
# - text.dat.example for the e-mail's text
# The tags inside < > are replaced with the values
# of the corresponding attributes in the bibtex
# file
#
# @author Open Data in Experimental Mechanics
# Packages
i... |
#!/usr/bin/env python
import os
import sys
import unittest
from client import TestClient
from server import TestServer
from tracecontext import Traceparent, Tracestate
client = None
server = None
def environ(name, default = None):
if not name in os.environ:
if default:
os.environ[name] = default
else:
rai... |
# %%
import torch
from UnarySim.kernel.add import FSUAdd
from UnarySim.stream.gen import RNG, SourceGen, BSGen
from UnarySim.metric.metric import ProgError
import matplotlib.pyplot as plt
import time
# %%
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
# %%
def add_test(rng="Sobol", row=128, c... |
#!/usr/bin/env python3
# SPDX-License-Identifier: MIT
rawdata = []
with open("input") as f:
rawdata = f.read()
data = rawdata.split("\n\n")
any_count = 0
all_count = 0
for group in data:
# probably a bit overkill lol
any_yes = {c for c in group.replace("\n", "")}
any_count += len(any_yes)
all_y... |
# -*- coding: utf-8 -*-
import scrapy
from ..items import QuotesItem
class QuotesSpiderCssSpider(scrapy.Spider):
name = 'quotes_spider_css'
allowed_domains = ['quotes.toscrape.com']
start_urls = ['https://quotes.toscrape.com/']
def parse(self, response):
items = QuotesItem()
all_quo... |
import time
from cube2common.constants import mastermodes, disconnect_types, privileges
from cipolla.game.server_message_formatter import error
from cipolla.punitive_effects.punitive_effect_info import TimedExpiryInfo, EffectInfo
from cipolla.game.client.exceptions import InsufficientPermissions
from cipolla.game.game... |
# --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Jiasen Lu, Jianwei Yang, based on code from Ross Girshick
# --------------------------------------------------------
from __future__ import absolute_import
from __... |
#!/usr/bin/python3
import sys
import rclpy
import math
import random
from rclpy.node import Node
from rclpy.time import CONVERSION_CONSTANT, Duration
from geometry_msgs.msg import Vector3Stamped
class PublishAsyncStddev(Node):
def __init__(self):
super().__init__('publish_async_stddev')
self._pub... |
from django.conf.urls import patterns, include, url
from .views import ReferralListView, ReferralUpdateView
urlpatterns = patterns('',
url(r'^$', ReferralListView.as_view(), name='referral_list'),
url(r'(?P<referral_id>[\w-]+)/$', ReferralUpdateView.as_view(), name='referral_update'),
)
|
from __future__ import print_function
import logging as log
import sys
import os
from argparse import ArgumentParser
import cv2
from openvino.inference_engine import IENetwork, IEPlugin
from lpr.trainer import decode_ie_output
from utils.helpers import load_module
def build_argparser():
parser = ArgumentParser()
... |
import logging
import os
import time
from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.python import PythonOperator
from astronomer.providers.microsoft.azure.operators.data_factory import (
AzureDataFactoryRunPipelineOperatorAsync,
)
from astronomer.providers.microsoft.azure.... |
from flask import request
from flask_restful import Resource
from sqlalchemy import exc
from api import db
from api.models import User
class Users(Resource):
def get(self):
return (
{
"status": "success",
"data": {
"users": [user.to_json() f... |
from typing import Union
import jax.numpy as np
import numpy as onp
import pandas as pd
ArrayLikes = [pd.DataFrame, pd.Series, np.ndarray, np.DeviceArray, onp.ndarray]
ArrayLikeType = Union[pd.DataFrame, pd.Series, np.ndarray, np.DeviceArray, onp.ndarray]
|
__version__ = '1.0.0'
from .corrlib import *
|
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'D:\My_Codes\easylearn-fmri\eslearn\GUI\easylearn_main_gui.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
... |
#!/usr/bin/env python
import rospy
from std_msgs.msg import Int32
from geometry_msgs.msg import PoseStamped, Pose
from styx_msgs.msg import TrafficLightArray, TrafficLight
from styx_msgs.msg import Lane
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
from light_classification.tl_classifier import TLCla... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/contrib/mpi_collectives/mpi_message.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from goog... |
""" Plot functions. """
# pylint: disable=too-many-statements
from numbers import Number
from copy import copy
import colorsys
import cv2
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import patheffects
from matplotlib.cm import get_cmap, register_cmap
from matplotlib.patches import Patch
from mat... |
# -*- coding: utf-8 -*-
host_reduction_timer = 0
host_quantize_timer = 0
host_unquantize_timer = 0
host_average_timer = 0
host_c_timer = 0
alloc_dealloc_timer = 0
def reset_timers():
global host_reduction_timer, host_quantize_timer, host_unquantize_timer, host_average_timer, host_c_timer, alloc_dealloc_timer, hos... |
# alexnet.py COPYRIGHT Fujitsu Limited 2021
#!/usr/bin/env python
# coding: utf-8
##### Reference #####
# https://github.com/sh-tatsuno/pytorch/blob/master/tutorials/Pytorch_Tutorials.ipynb
# https://github.com/sh-tatsuno/pytorch/blob/master/tutorials/Learning_PyTorch_with_Examples.ipynb
# https://pytorch.org... |
from subprocess import call
from datetime import datetime
import os
import pandas as pd
from sty import fg, rs
import time
import csv
import json
import re
import sys
import requests
import shutil
start_time = time.time()
headers_Get = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Fi... |
"""Test FOLIO Operators and functions."""
import pytest
import requests
from pytest_mock import MockerFixture
from ils_middleware.tasks.folio.login import FolioLogin
@pytest.fixture
def mock_request(monkeypatch, mocker: MockerFixture):
def mock_post(*args, **kwargs):
post_response = mocker.stub(name="p... |
import numpy as np
import pandas as pd
import threading
from sklearn.externals import joblib
from sklearn.ensemble import RandomForestRegressor
from pprint import pprint
df = pd.read_csv('https://drive.google.com/uc?export=download&id=1XoV8SfvHmzaxRuDRe81OWSQu10dYTbO5',sep=',')
print("Number of data points: %d \n" % ... |
from django.contrib import admin
from .models import SearchQuery
# Register your models here.
admin.site.register(SearchQuery)
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
__title__ = ''
__author__ = 'xuzhao'
__email__ = 'xuzhao@zhique.design'
from rest_framework.routers import DefaultRouter
from .viewsets import CarouselViewSet, SocialAccountViewSet
router = DefaultRouter(trailing_slash=False)
router.register(r'carousels', CarouselViewSet)
ro... |
#!/usr/bin/env python3
# @author: marcelf
'''
Utility class to connect to ldap and generate secure passwords
'''
ciphers256 = "TWOFISH CAMELLIA256 AES256"
ciphers192 = "CAMELLIA192 AES192"
ciphers128 = "CAMELLIA128 AES"
ciphersBad = "BLOWFISH IDEA CAST5 3DES"
digests = "SHA512 SHA384 SHA256 SHA224 RIPEMD160 SHA1"
compr... |
def test_distinct(man):
errors = []
G = man.setGraph("swapi")
count = 0
for i in G.query().V().distinct():
count += 1
if count != 39:
errors.append("Distinct %s != %s" % (count, 39))
count = 0
for i in G.query().V().distinct("_gid"):
count += 1
if count != 39:
... |
#!/usr/bin/env python3
import sys
import os
from bioblend import galaxy
gi = galaxy.GalaxyInstance(url='https://usegalaxy.eu')
wfs = gi.workflows.get_workflows()
owners = ['wolfgang-maier', 'bgruening']
output_dir = 'workflows'
if not os.path.isdir(output_dir):
os.mkdir( output_dir )
for wf in wfs:
# ... |
## @file
# Hardware feature class definition.
#
# Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license m... |
from selenium.webdriver.common.by import By
class HomeLocators(object):
FIRST_ENTRY_TITLE = (By.CSS_SELECTOR, ".entries > li > h2 ")
LOGIN = (By.CSS_SELECTOR, '.metanav > a')
class LoginLocators(object):
TITLE = (By.CSS_SELECTOR, "h2")
SUBMIT = (By.CSS_SELECTOR, "#login")
ERROR = (By.CSS_SELECTOR... |
from requirement import db, bcrypt, login_manager
from flask_login import UserMixin
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
class User(db.Model, UserMixin):
id = db.Column(db.Integer(), primary_key=True)
name = db.Column(db.String(length=30), nullable=False... |
from django.urls import path
from chatchannels import consumers
app_name = 'chatchannels'
websocket_urlpatterns = [
path('connect/<chat_channel_id>', consumers.ChatChannelConsumer, name="connect")
]
|
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2022, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
import sys
import os
import platform
from PySide2 import QtCore, QtGui, QtWidgets
from PySide2.QtCore import (QCoreApplication, QPropertyAnimation, QDate, QDateTime, QMetaObject, QPoint, QRect, QSize,
QTime, QUrl, QEvent)
from PySide2.QtGui import (QBrush, QColor, QConicalGradient, QCu... |
import sys
def A():
n = sys.stdin.readline().rstrip()
if "3" in n:
print("YES")
elif int(n) % 3 == 0:
print("YES")
else:
print("NO")
def B():
mod = 10007
t = [0, 0, 1]
for _ in range(1001001):
t.append(t[-1] + t[-2] + t[-3])
t[-1]... |
"""
This module have all the web elements in the
home page
"""
class HomePageLocators:
""" Home Page Class """
"""Xpaths for Home Page """
select_location_text_box = "//input[@placeholder='Select Location']"
select_location_list = "//label[@class = 'localityName']"
select_date_and_time_button = "//... |
#since 1939 , T12 no longer manufactured since T8 propagated
import bpy
bpy.context.object.data.type = 'AREA'
lampdata = bpy.context.object.data
lampdata.size = 0.038
lampdata.size_y = 1.2192
lampdata.shadow_ray_samples_x = 1
lampdata.shadow_ray_samples_y = 2
lampdata.color = (0.901, 1.0, 0.979)
lampdata.energy = 2.1... |
# @Author: chunyang.xu
# @Email: 398745129@qq.com
# @Date: 2020-06-08 14:02:33
# @Last Modified time: 2021-03-08 15:09:19
# @github: https://github.com/longfengpili
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
from .redshift import RedshiftDB
from .sqlite import SqliteDB
from .mysql import MysqlDB
# f... |
#!/bin/bash
# --------------------------------------------------
# Filename: Calculate_BBs.py
# Revision: 1.0
# Data: 2018/9/13
# Author: Yue Cao
# Email: ycao009@cs.ucr.edu
# Description: Merge new flipping branches (Basic block form) with target value to the branch set, and print out all new ones.... |
# -*- coding: utf-8 -*-
import urllib.request
import json
import requests
import os
path = 'result\\'
#id = '2093492691'
id = '2089576957'
proxy_addr = "122.241.72.191:808"
pic_num = 0
weibo_name = "-樱群-"
def use_proxy(url, proxy_addr):
req = urllib.request.Request(url)
req.add_header("User-Agent",
... |
# Copyright (C) 2020 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
#
# Unless required by applicable law or agreed to in wri... |
# Prirejeno po datotekah iz predavanj in vaj.
import csv
import json
import os
import requests
default_headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'}
# Prenos spletne strani
def url_v_html(url, mapa, ime_datotek... |
from .StupidArtnet import StupidArtnet
from stupidArtnet.StupidArtnetServer import StupidArtnetServer
from stupidArtnet.ArtnetUtils import shift_this, put_in_range, make_address_mask
|
import tkinter as tk
def convert():
input_value = float(var_input.get())
grams_value = input_value * 1000
var_grams.set('{}g'.format(grams_value))
pounds_value = input_value * 2.20462
var_pounds.set('{}lbs'.format(pounds_value))
ounces_value = input_value * 35.274
var_ounces.set('{}oz'.f... |
import logging
import multiprocessing
import time
from c4.messaging import (Envelope,
PeerRouter,
RouterClient)
log = logging.getLogger(__name__)
class TestRouterClient(object):
MESSAGES = 100
def test_sendMessage(self, clusterInfo):
counter = m... |
import numpy as np
import cv2
import tensorflow as tf
class Evaluator(object):
def __init__(self, config):
self.mutual_check = False
self.err_thld = config['err_thld']
self.matches = self.bf_matcher_graph()
self.stats = {
'i_avg_recall': 0,
'v_avg_recall': 0... |
class ObservableProperty:
def __init__(self, signal_name: str):
self.attr_name = ''
self.signal_name = signal_name
def __set_name__(self, owner, name):
self.attr_name = '_' + name
def __get__(self, instance, owner):
return getattr(instance, self.attr_name)
def __set__(... |
# LICENSE: PSF.
import asyncio
import concurrent.futures
import re
import sys
import threading
import unittest
import uvloop
from asyncio import test_utils
from uvloop import _testbase as tb
from unittest import mock
from test import support
# Most of the tests are copied from asyncio
def _fakefunc(f):
return... |
import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('lowContrast.png',0)
plt.hist(img.ravel(),256,[0,256])
plt.show()
plt.savefig('hist.png')
equ = cv2.equalizeHist(img)
res = np.hstack((img,equ))
cv2.imshow('Equalized Image',res)
cv2.imwrite('Equalized Image.png',res)
plt.hist(re... |
import asyncio
import platform
from dask.distributed import Client
def square(x):
return x ** 2
async def f():
client = await Client("localhost:8786", processes=False, asynchronous=True)
A = client.map(square, range(10000))
result = await client.submit(sum, A)
print(result)
await client.clos... |
from tests.GreetingExtension import GreetingExtension
class AfternoonColorExtension(GreetingExtension):
_name = 'afternoon'
def greet(self, person: str) -> None:
print(f'{self._name} {person}')
|
# Generated by Django 3.0.11 on 2020-12-25 16:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('styles', '0004_auto_20201225_1051'),
('users', '0007_auto_20201222_0922'),
]
operations = [
migrat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.