text stringlengths 2 999k |
|---|
#https://blog.heptanalytics.com/flask-plotly-dashboard/
import plotly
import plotly.graph_objs as go
import pandas as pd
import numpy as np
import json
from config_utils.config import load_configs
import pydevd_pycharm
import os
#pydevd_pycharm.settrace('192.168.0.68', port=1025, stdoutToServer=True, stderrToServer=Tru... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.9.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... |
import unittest
from matminer.datasets import load_dataset
from automatminer.featurization.metaselection.metafeatures import *
__author__ = ["Qi Wang <wqthu11@gmail.com>"]
class TestFormulaMetafeatures(unittest.TestCase):
def setUp(self):
self.test_df = load_dataset('elastic_tensor_2015').rename(
... |
mylist = []
mylist.append(1)
mylist.append(2)
mylist.append(3)
print(mylist[0]) # prints 1
print(mylist[1]) # prints 2
print(mylist[2]) # prints 3
# prints out 1,2,3
for x in mylist:
print(x)
mylist = [1,2,3]
print(mylist[2])
numbers = []
strings = []
names = ["John", "Eric", "Jessica"]
numbers.append(1)
numbe... |
# 2-3 Tree
# balanced tree data structure with up to 2 data items per node
class Node:
def __init__(self, data, par = None):
#print ("Node __init__: " + str(data))
self.data = list([data])
self.parent = par
self.child = list()
def __str__(self):
if self.parent:
return str(self.parent.data) + ' : ' + ... |
# Copyright (C) 2015-2016 Regents of the University of California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
_base_ = [
'../_base_/models/pspnet_r50-d8.py', '../_base_/datasets/potsdam.py',
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'
]
model = dict(
decode_head=dict(num_classes=6), auxiliary_head=dict(num_classes=6))
|
import sys
import numpy as np
import pandas as pd
print("input file:", sys.argv[1])
print("output file:", sys.argv[2])
citations = pd.read_csv(sys.argv[1], sep='\t', header=None)
alpha=float(sys.argv[3])
print("alpha:", alpha)
pd.concat([citations[0], 1+np.log(alpha+citations[1])], axis=1, join="inner").to_csv(sys.arg... |
import random
reussi = False
def jeux(i, b):
if (i==b):
print("Tu as réussi ")
reussi = True
else:
input("Faux")
while(not reussi):
i = random.randint(1,100)
b = input("Trouve un nombre entre 1 à 100 :")
jeux(i, int(b))
|
"""
paper: Pyramid Channel-based Feature Attention Network for image dehazing
file: utils.py
about: all utilities
author: Tao Wang
date: 12/01/2021
"""
# --- Imports --- #
import time
import torch
import torch.nn.functional as F
import torchvision.utils as utils
from math import log10
from skimage import measure
from... |
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 6 18:51:41 2019
@author: Zhou
"""
import json
from math import exp
import numpy as np
import torch
import torch.nn.functional as F
from nltk.translate.bleu_score import sentence_bleu, SmoothingFunction
from nltk.translate.meteor_score import single_meteor_sco... |
import numpy as np
from recommenders.Rec4RecRecommender import Rec4RecRecommender
from recommenders.KNNRecommender import KNNRecommender
from recommenders.RNNRecommender import RNNRecommender
from util import evaluation
from util.make_data import *
from util.metrics import mrr,recall
import os
import argparse
os.envi... |
#!/usr/bin/python2.7
"""
WSGI config for server project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the `... |
from abc import ABC, abstractmethod
import ctypes
# Constatns
STARTBYTE = 0xFF
ENDBYTE = 0x3F
ESCCHAR = 0x2F
class Message(ABC):
def __init__(self, addr_CAN, addr_telem, emulator=None):
self.addr_CAN = addr_CAN
self.addr_telem = addr_telem
self.emulator = emulator
@abstractmeth... |
# This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _Azure
class _Security(_Azure):
_type = "security"
_icon_dir = "resources/azure/security"
class ApplicationSecurityGroups(_Security):
_icon = "application-security-groups.png"
class ConditionalAccess(_Security):
_i... |
"""
Tests for asynchronous vectorized environments.
"""
import gym
import pytest
import os
import glob
import tempfile
from .dummy_vec_env import DummyVecEnv
from .shmem_vec_env import ShmemVecEnv
from .subproc_vec_env import SubprocVecEnv
from .vec_video_recorder import VecVideoRecorder
@pytest.mark.parametrize('kl... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
# -*- coding: utf-8 -*-
"""
* TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-蓝鲸 PaaS 平台(BlueKing-PaaS) available.
* Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except in co... |
equipamentos= []
valores = []
seriais = []
departamentos = []
resposta = "S"
while resposta == "S":
equipamentos.append(input("Equipamento: "))
valores.append(float(input("Valor: ")))
seriais.append(int(input("Número Serial: ")))
departamentos.append(input("Departamento: "))
resposta = input("Digite... |
import pygame
import random
pygame.init()
sw = 800 # Screen width
sh = 600 # Screen height
screen = pygame.display.set_mode((sw, sh))
pygame.display.set_caption("Ping Pong")
clock = pygame.time.Clock()
bg_color = pygame.Color('grey12')
game_font = pygame.font.Font('fonts/SF-Pro-Text-Bold.otf', 60)
lev... |
from .. import cache
def on_command(command_name:str=None, smart_speaker_read_backs:bool=True):
"""Runs whenever a command is called by the smart speaker.
Parameters
----------
`command_name` : str
The actual name the smart speaker will recognise the command as.
`smart_speaker_read_backs`... |
from .db_settings import get_indexes
import datetime
import sys
from django.db.models.sql import aggregates as sqlaggregates
from django.db.models.sql.constants import LOOKUP_SEP, MULTI, SINGLE
from django.db.models.sql.where import AND, OR
from django.db.utils import DatabaseError, IntegrityError
from django.utils.t... |
# -*- coding: utf-8 -*-
#
# 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
#... |
# This is a part of the program which removes the effect of the Differential Reddening from the main sequence of the masive star clusters.
# Reference: A. Milone et al (2012)
# The steps: 1. Plot a CMD, 2. Rotate the main sequence using theta = A_Filter_1/(A_Filter_I - A_Filter_II); A = Absorption Coefficients (Ref. J... |
# Copyright 2017 Google Inc. 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 ag... |
import os
import pytest
from dagster.check import CheckError, ParameterCheckError
from dagster.utils import EventGenerationManager, ensure_dir, ensure_gen, ensure_single_item
def test_ensure_single_item():
assert ensure_single_item({"foo": "bar"}) == ("foo", "bar")
with pytest.raises(ParameterCheckError, mat... |
import logging
import numpy as np
from typing import Dict, List, Optional, Any, Mapping
from mlagents.tf_utils import tf
from mlagents.trainers.sac.network import SACPolicyNetwork, SACTargetNetwork
from mlagents.trainers.models import LearningRateSchedule, EncoderType, ModelUtils
from mlagents.trainers.common.tf_opti... |
# Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
"""Support to set a numeric value from a slider or text box."""
import logging
import typing
import voluptuous as vol
from homeassistant.const import (
ATTR_EDITABLE,
ATTR_MODE,
ATTR_UNIT_OF_MEASUREMENT,
CONF_ICON,
CONF_ID,
CONF_MODE,
CONF_NAME,
SERVICE_RELOAD,
)
from homeassistant.cor... |
import sys
from io import StringIO
import numpy as np
from numpy.testing import assert_allclose
import scipy.sparse as sp
import pytest
from sklearn.neighbors import NearestNeighbors
from sklearn.neighbors import kneighbors_graph
from sklearn.exceptions import EfficiencyWarning
from sklearn.utils._testing import ignor... |
from decimal import Decimal
from sys import float_info
from unittest import TestCase
from django.utils.numberformat import format as nformat
class TestNumberFormat(TestCase):
def test_format_number(self):
self.assertEqual(nformat(1234, '.'), '1234')
self.assertEqual(nformat(1234.2, '.'), '1234.2... |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='z7z8',
version='0.0.1',
description='Some python utils.',
author='ll1l11',
author_email='ll1l11@qq.com',
url='https://github.com/ll1l11/z7z8',
install_requires=['requests'],
packages=find_packages(exclude=("t... |
'''show_interface.py
NXOS parsers for the following show commands:
* show interface
* show vrf all interface
* show ip interface vrf all
* show ipv6 interface detail vrf all
* show interface switchport
* show ip interface brief
* show ip interface brief | vlan
* show interface brief
... |
from PySide2.QtWidgets import QApplication as _QApplication
from .loading import Loading as _Loading
from .home import Home as _Home
from .utils import ScreenManager as _ScreenManager, Screen as _Screen
def start():
"""
TODO: Document
:return:
"""
app = _QApplication()
manager = _ScreenManag... |
# 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
# "License"); you may not u... |
import django
from django.db import models
from django.core.exceptions import ValidationError
from .fields import DictionaryField
if django.get_version() < '1.7':
from . import apps
class SchemaModel(models.Model):
"""
adds support for hstore virtual fields
"""
class Meta:
abstract = Tr... |
__author__ = '562474'
__author__ = '562474'
import unittest
import sys
import os
import json
import time
import datetime
import dateutil.relativedelta
import inspect
from __init__ import LogThisTestCase
try:
import odeClient
except:
current_file_path = os.path.dirname(os.path.abspath(__file__))
sys.path.... |
import os
import pathlib
import shutil
from os.path import expanduser
extpath = os.path.join(expanduser("~"),
".local/share/flatpak/extension/org.freedesktop.Platform.GL.host/arm/1.4")
def has_extension():
return os.path.exists(extpath)
def remove_extension():
if os.path.exists(extpath... |
"""
Tests examples from the documentation.
"""
import unittest
from distutils.version import StrictVersion
import os
import sys
import importlib
import subprocess
import numpy
import onnxruntime
def import_source(module_file_path, module_name):
if not os.path.exists(module_file_path):
raise FileNotFoundEr... |
'''
Copyright 2013 Cosnita Radu Viorel
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, merge, publish, distribute... |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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... |
"""List Object Storage endpoints."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
@click.command(cls=SoftLayer.CLI.command.SLCommand, )
@environment.pass_env
def cli(env):
"""List object storage endpoints.... |
"""
===============================================
vidgear library source-code is deployed under the Apache 2.0 License:
Copyright (c) 2019 Abhishek Thakur(@abhiTronix) <abhi.una12@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with th... |
# Copyright 2020 The PEGASUS 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 applicable law or agreed to in... |
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
STATIC_DIR = os.path.join(BASE_DIR, 'static')
TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates')
# Quick-start development settings - unsuitable for production
# Se... |
from collections import defaultdict
import inspect
from typing import Any, Dict, List, Set, Union, Mapping
from overrides import overrides
import torch
from allennlp.data import Vocabulary, TextFieldTensors
from allennlp.modules import Backbone
from allennlp.models.model import Model
from allennlp.models.heads import... |
import util
import json
from boto.sqs.message import Message
from aws import SQSBase
log = util.get_logger("inviso.publish")
class EventPublisher(object):
def __init__(self, **kwargs):
pass
def publish(self, events):
raise NotImplementedError("Please Implement this method")
class SQSE... |
from setuptools import setup, find_packages
from zendesk_auth import VERSION
setup(
name="zendesk_django_auth",
version=VERSION,
author="Aaron Madison",
description="Use your django app as an auth platform for Zendesk.",
long_description=open('README.rst', 'r').read(),
url="https://github.com... |
import contextlib
import inspect
import random
from typing import Optional
from redbot.core import commands
from redbot.core.utils.chat_formatting import bold, box
class Editor(str):
"""A main class used for the helper functions."""
def _charcount(self, count_spaces: bool):
if count_spaces:
... |
# coding=utf-8
# Copyright 2019 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
import pytest
from peer_lending.users.models import User
from peer_lending.users.tests.factories import UserFactory
@pytest.fixture(autouse=True)
def media_storage(settings, tmpdir):
settings.MEDIA_ROOT = tmpdir.strpath
@pytest.fixture
def user() -> User:
return UserFactory()
|
import logging
logging.basicConfig(level=logging.WARN)
from plex import Plex
from plex_metadata import Library, Metadata
from shove import Shove
import argparse
import cProfile
import os
import subprocess
import time
# Build caches
cache_dir = os.path.abspath('cache')
http_cache = Shove('file://%s' % os.path.join(c... |
# Maior e Menor da Sequência
from emoji import emojize
e = emojize(':arrow_forward:', use_aliases=True)
e1 = emojize(':fast_forward:', use_aliases=True)
people = ['primeira', 'segunda', 'terceira', 'quarta', 'quinta']
ma = me = 0
for p in range(0, 5):
pe = float(input(f'\033[1;34m{e} Digite o peso da {people[p]} pe... |
#
# list of local pv names to use for testing
#### 1
# this pv should be a DOUBLE. It will NOT be set, but
# you should provide the host_name, units, and precision. It
# is assumed to have count=1
double_pv = 'Py:ao1'
double_pv_units = 'microns'
double_pv_prec = 4
double_pv2 = 'Py:ao2'
pause_pv = 'Py:pause'
####... |
#!/usr/bin/env python3
import argparse
import cv2
import json
import matplotlib.pyplot as plt
import numpy as np
import os
import skvideo.io # pip install scikit-video
from pydmd import DMD
parser = argparse.ArgumentParser(description='virtual choir')
parser.add_argument('video', help='video file')
par... |
#demonstrates, how to use the method send_config_from_file
#in netmiko for device configuration.
from netmiko import ConnectHandler
IP_LIST = open ('devices_list')
for IP in IP_LIST:
device = {
'ip': IP,
'username': 'admin',
'password': 'cisco',
'device_type': 'cisco_ios',
'global_delay_fact... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
from collections import OrderedDict
from importlib import import_module
from django.apps import apps
from django.core.management.base import BaseCommand, CommandError
from django.core.management.sql import (
emit_post_migrate_signal, emit... |
# Root of Number
def root(x, n):
return binary_search(1, x, x, n) # log(x)
def binary_search(l, r, x, n):
while l < r:
m = (l + r) / 2.0
cur = pow(m, n)
print(cur)
if abs(x - cur) < 0.001:
return m
elif x > cur:
l = m
else:
r = m
return -1 |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Geranium Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test longpolling with getblocktemplate."""
from decimal import Decimal
from test_framework.test_fram... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 4.14
# In conjunction with Tcl version 8.6
# Jun 21, 2018 09:40:52 AM
import sys
from imutils import paths
import cv2
from PIL import Image as PilImage
from PIL import ImageTk
from tkinter import filedialog
try:
from Tkint... |
#!/usr/bin/env python
#
# mountsnoop Trace mount() and umount syscalls.
# For Linux, uses BCC, eBPF. Embedded C.
#
# USAGE: mountsnoop [-h]
#
# Copyright (c) 2016 Facebook, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
#
# 14-Oct-2016 Omar Sandoval Created this.
from __future__ i... |
# The bullet points associated with this set of tests in the evaluation document
test_set_id = "2.1"
# User friendly name of the tests
test_set_name = "Cap. Statement"
# Mem cache to avoid having to redo the same thing over and over
_capability_statement = None
_resources = None
import logging
logger = logging.get... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
from __future__ import absolute_import, division, print_function
import logging
import sys
import warnings
if sys.version_info.major == 2:
warnings.warn(
"Python 2 is no longer supported. "
"If you need Python 2.7 support please use the DIALS 2.2 release branch.",
UserWarning,
)
loggi... |
# Copyright 2012 OpenStack Foundation
# 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 requ... |
import sys
import os
import glob
import argparse
import yaml
import cv2
import youtube_dl
parser = argparse.ArgumentParser(description='AnAnXingChe video downloader parameters.')
parser.add_argument('--download_dir', required=True, help='target directory to save downloaded videos')
parser.add_argument('--url_file', re... |
################################################################################
# Numba-DPPY
#
# Copyright 2020-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 ... |
import jax.numpy as jnp
from jax import random
from flax import linen as nn
from hparams import HParams
try:
from .conv2d import Conv2D, uniform_init
except (ImportError, ValueError):
from model.conv2d import Conv2D, uniform_init
hparams = HParams.get_hparams_by_name("efficient_vdvae")
class GaussianLatent... |
temperaturaF = input ("Digite a temperatura: ")
temperaturaC = ( float(temperaturaF) - 32)*5/9
print("A temperatura em ºC é", temperaturaC)
|
import requests
import urllib
from uuid import uuid4
from flask import render_template, request, redirect, session
from spotify_flask_web_api import app
CLIENT_ID = app.config['CLIENT_ID']
CLIENT_SECRET = app.config['CLIENT_SECRET']
RESPONSE_TYPE = 'code'
STATE_KEY = 'spotify_auth_state'
REDIRECT_URI = 'http://local... |
from typing import List
from pathlib import Path
from skimage.io import imread as gif_imread
from torch.utils.data import Dataset
from catalyst import utils
class SegmentationDataset(Dataset):
"""Dataset for segmentation tasks
Returns a dict with ``image``, ``mask`` and ``filename`` keys
"""
def _... |
import numpy as np
class LogisticRegression:
def __init__(self, lr = 0.001, n_iters = 1000):
self.lr = lr
self.n_iters = n_iters
self.weights = None
self.bias = None
def fit(self, X, y):
#init parameters
n_samples, n_features = X.shape
self... |
#/************************************************************************************************************************
# Copyright (c) 2016, Imagination Technologies Limited and/or its affiliated group companies.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modificat... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Create country sub-division redirect pages.
Check if they are in the form Something, State, and if so, create a redirect
from Something, ST.
Specific arguments:
-start:xxx Specify the place in the alphabet to start searching
-force: Don't ask whether to create pages, just ... |
import boto3
import json
import logging
from botocore.exceptions import ClientError
logging.basicConfig(
format='%(asctime)s|%(name).10s|%(levelname).5s: %(message)s',
level=logging.WARNING
)
log = logging.getLogger('SubscriptionDefinition')
log.setLevel(logging.DEBUG)
class SubscriptionDefinition(object... |
from api.interests.models import Interest
from api.projects.models import Project, ProjectApplication
from api.users.models import User
def test_user(email="test@example.com", is_supervisor=False, interests=None):
user, created = User.objects.get_or_create(
email=email,
first_name="Test",
... |
import os
import pendulum
from dagster.core.definitions.reconstructable import ReconstructableRepository
from dagster.core.host_representation import (
ExternalRepositoryOrigin,
InProcessRepositoryLocationOrigin,
)
from dagster.core.scheduler.job import JobState, JobStatus, JobType, ScheduleJobData
from dagste... |
from agatereports.basic_report import BasicReport
import logging
logger = logging.getLogger(__name__)
def generate_test_pdf(output_dir='output'):
"""
Generate test pdf reports.
"""
filenames = ['empty_report', 'no_data', 'text_fields', 'text_fields_lastPageFooter', 'shapes',
'current... |
#!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# mininode.p... |
# Generated by Django 3.1.7 on 2021-03-31 04:43
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import tracecap_ui.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_U... |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the importmulti RPC."""
from test_framework import script
from test_framework.test_framework impo... |
import carla
from __init__ import client, world
from environment_setup import wraptopi, calculateDistance, AgentColourToRGB
from path_planner_suite import astar_search, find_nearest
from shapely.geometry import LineString
import math
import numpy as np
import matplotlib.pyplot as plt
from controller import long_lat_c... |
# Made by Emperorc
import sys
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.quest import QuestState
from quests.SagasSuperclass import Quest as JQuest
qn = "77_SagaOfTheDominator"
qnu = 77
qna = "Saga of the Dominator"
class Quest (JQuest) :
def __init__(self,id,name,des... |
import asyncio
import azure.functions as func
import logging
import os
import shutil
import tarfile
import tempfile
import threading
import time
import traceback
from azure.storage.blob import BlobServiceClient
# test comment updated2
STATUS_CONTAINER = 'status'
AUDIT_CONTAINER = 'audit'
SOURCE_CONTAINER = 'source'
DE... |
"""
==========================
Triangular 3D contour plot
==========================
Contour plots of unstructured triangular grids.
The data used is the same as in the second plot of trisurf3d_demo2.
tricontourf3d_demo shows the filled version of this example.
"""
import matplotlib.pyplot as plt
from mpl_toolkits.m... |
# View more python learning tutorial on my Youtube and Youku channel!!!
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial
"""
Please note, this code is only for python 3+. If you are using python 2+, please modify the code acco... |
num = int(input("Diga um número"))
dobro = num * 2
triplo = num * 3
raizQuadrada = num ** (1/2)
print("O dobro de {} é {}".format(num,dobro))
print("O triplo de {} é {}".format(num, triplo))
print("A raiz de {} é {}".format(num, raizQuadrada)) |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/SubstanceProtein) on 2019-01-25.
# 2019, SMART Health IT.
##
from . import domainresource
class SubstanceProtein(domainresource.DomainResource):
""" A SubstanceProtein is defined as a... |
import random
num0 = "0"
num1 ="67"
num = "1234567890"
numr1 = random.choice(num1)
numr2 = random.choice(num)
numr3 = random.choice(num)
numr4 = random.choice(num)
numr5 = random.choice(num)
numr6 = random.choice(num)
numr7 = random.choice(num)
numr8 = random.choice(num)
numr9 = random.choice(num)
print(num0 + numr1 + ... |
#--------Hopping-------#
import os
import sys
sys.path.append('../_Core Functions_')
import Hop
#----CUSTOM CLASSES-----#
import Extractor
import KNN_Trainer
#---SUPPORT LIBRARIES---#
import numpy as np
import time
import re
import time
def test_image(answer_array,index,filename):
image = Extractor.getImage(filena... |
import numpy as np
from torch import nn
from torch.nn import Conv2d, Module
from models.stylegan2.model import EqualLinear
class GradualStyleBlock(Module):
def __init__(self, in_c, out_c, spatial):
super(GradualStyleBlock, self).__init__()
self.out_c = out_c
self.spatial = spatial
... |
from pathlib import Path
import cv2
import dlib
import numpy as np
import argparse
from contextlib import contextmanager
from wide_resnet import WideResNet
from keras.utils.data_utils import get_file
pretrained_model = "https://github.com/yu4u/age-gender-estimation/releases/download/v0.5/weights.28-3.73.hdf5"
modhash ... |
# Copyright 2021 Lucas Fidon and Suprosanna Shit
import os
import yaml
def load_config(config_file=None):
if config_file is None: # default config file is nnUNet
config_file = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"partialseg_fetal_challenge.yml"
)
... |
import json
from unittest import TestCase
from Game.GameController import GameController
from Game.GameMode import GameMode
from python_cowbull_server import app
from python_cowbull_server.Configurator import Configurator
class TestConfigurator(TestCase):
def setUp(self):
self.app = app.test_client()
... |
"""This module contains the general information for BiosVfVgaPriority ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class BiosVfVgaPriorityConsts:
VP_VGA_PRIORITY_OFFBOARD = "Offboard"
VP_VGA_PRIORITY_ONBOARD = "Onboa... |
# Copyright 2013 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... |
import os
import socket
import logging
from airflow.operators.python_operator import PythonOperator
from airflow.operators.dummy_operator import DummyOperator
from jinja2 import Template
from src.module.common import etl_dict, jdbc_ops
from src.utils.enum import etl_layer, conn_id
from src.utils import common
logger = ... |
"""
prepared:
1. chromedriver.exe: download from https://chromedriver.chromium.org/downloads
#. put ``chromedriver.exe`` to {executable}/Scripts/
USAGE::
employee_id_1234 password --action=1 --debug=0
"""
from os.path import abspath, dirname
from os import path, startfile
from time import sleep
from sys im... |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
import json
import os
import colander
from pyramid.security import NO_PERMISSION_REQUIRED
from kinto.core import Service
HERE = os.path.dirname(__file__)
ORIGIN = os.path.dirname(HERE)
class VersionResponseSchema(colander.MappingSchema):
body = colander.SchemaNode(colander.Mapping(unknown="preserve"))
versio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.