content stringlengths 5 1.05M |
|---|
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.4
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# Import necessary libraries and packages
... |
from django.views import generic
from django.urls import reverse
from editor.models import Theme
from editor.forms import NewThemeForm, UpdateThemeForm
from editor.views.generic import AuthorRequiredMixin
class CreateView(generic.CreateView):
""" Create a theme """
model = Theme
form_class = NewThemeForm... |
from monitor.notifications.found_proof import FoundProofNotification
from monitor.notifications.lost_sync import LostSyncNotification
from monitor.notifications.lost_plots import LostPlotsNotification
from monitor.notifications.summary import SummaryNotification
from monitor.notifications.notification import Notificat... |
from datetime import date
from mock import patch
from nose.tools import raises, assert_true
from twilio.rest.resources import Notifications
from tests.tools import create_mock_json
BASE_URI = "https://api.twilio.com/2010-04-01/Accounts/AC123"
ACCOUNT_SID = "AC123"
AUTH = (ACCOUNT_SID, "token")
RE_SID = "RE19e96a31ed5... |
################################################################################
# (c) 2007, The Honeynet Project
# Author: Arthur Clune arthur@honeynet.org.uk
#
# 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 Fr... |
class Solution:
# dfs
def pacificAtlantic(self, matrix: List[List[int]]) -> List[List[int]]:
res = []
if len(matrix) == 0 or len(matrix[0]) == 0:
return res
m, n = len(matrix), len(matrix[0])
pacific = [[0 for _ in range(n)] for _ in range(m)]
atlantic = [[0 f... |
# Copyright (c) 2019 Eric Steinberger
import numpy as np
from PokerRL.cfr._CFRBase import CFRBase as _CFRBase
class LinearCFR(_CFRBase):
def __init__(self,
name,
chief_handle,
game_cls,
agent_bet_set,
starting_stack_sizes=Non... |
import io
from espider.utils.tools import cookies_to_dict
from fontTools.ttLib import TTFont
import hashlib
from espider.spider import Spider
import base64
class FontSpider(Spider):
__custom_setting__ = {
'downloader': {
'max_thread': 20
}
}
def before(self):
cookies ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-28 11:44
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import recurrence.fields
class Migration(migrations.Migration):
initial = True
dependen... |
del_items(0x80125114)
SetType(0x80125114, "struct Creds CreditsTitle[6]")
del_items(0x801252BC)
SetType(0x801252BC, "struct Creds CreditsSubTitle[26]")
del_items(0x80125730)
SetType(0x80125730, "struct Creds CreditsText[33]")
del_items(0x80125838)
SetType(0x80125838, "int CreditsTable[224]")
del_items(0x80126A44)
SetTy... |
import torch
from rlpyt.models.mlp import MlpModel
from rlpyt.models.utils import scale_grad
class DuelingHeadModel(torch.nn.Module):
def __init__(
self,
input_size,
hidden_sizes,
output_size,
grad_scale=2 ** (-1 / 2),
):
super()._... |
from dataclasses import dataclass
from ..operation import Op
from isu.models.demo import Demo
from PIL import Image
import os, glob
from typing import Optional, List, Dict, Any, Tuple
@dataclass
class Resize(Op):
new_dim: Tuple[int, int] = (0, 0)
def __str__(self) -> str:
return "resize"
def get_... |
import sys
def format_sys_argv():
"""
From the system arguments, get the specific positional and keyword arguments supported for launchpanel.
These are (with default values):
plugin_locations = None
environment_id = 'launchpanel'
style = 'space'
title = 'Launch Panel'
style_overrides... |
print('hello atom')
print('this my first stash')
6+7
print('ans')
|
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... |
# Log Parser for RTI Connext.
#
# Copyright 2016 Real-Time Innovations, Inc.
#
# 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
#
# ... |
# followed Brant's example from slide 19 of Session 3 pdf
#define a dictionary data structure
example_dict = {
"class" : "Astr 119",
"student": "Rakshya",
"awesomeness":10
}
print(type(example_dict)) #will say dict
#get a value via key
course = example_dict["class"]
print(course)
#change a value via key
example_... |
# Name list (40 of each)
from random import seed
from random import randint
seed(1)
boy_names = ["Noah","Liam","William","Mason","James","Benjamin","Jacob","Michael","Elijah","Ethan","Alexander","Oliver","Daniel","Lucas","Matthew","Aiden","Jackson","Logan","David","Joseph","Samuel","Henry","Owen","Sebastian","Gabriel"... |
class Solution:
def judgePoint24(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
import itertools
import fractions
try:
self.cache[0]
except Exception as e:
self.cache = dict()
def possible(nums):
i... |
import numpy as np
from typing import Union
from .base import Simplifier
from ... import operations
from ...graph import OperationGraph
class ConvertMatMulToGemm(Simplifier):
def visit_MatMul(
self, operation: operations.MatMul
) -> Union[operations.MatMul, operations.Gemm]:
a = operation.a
... |
# this will have some good info https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
HTTP_STATUS_MESSAGES = {
404 : "404 page not found",
500 : "500 Internal server error",
403 : "403 error"
}
|
#fang_test herokuapp
from flask import Flask, request, abort
from linebot import (
LineBotApi, WebhookHandler
)
from linebot.exceptions import (
LineBotApiError, InvalidSignatureError
)
from linebot.models import (
SourceUser,SourceGroup,SourceRoom,LeaveEvent,JoinEvent,
TemplateSendMessage,PostbackEvent... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
from yt.mods import *
import h5py
# In[2]:
# If necessary files aren't in the current dir, download them
if not os.path.isfile("mcnp_n_impr_fluka.h5m"):
from urllib import urlretrieve
urlretrieve("http://data.pyne.io/mcnp_n_impr_fluka.h5m", "mcnp_n_impr_fluk... |
from typing import List, Tuple
def read_input(in_file: str) -> List[str]:
with open(in_file, "r") as f:
return [line.strip().replace(" ", "") for line in f.readlines()]
def get_precedence(op: str) -> int:
if op == "*":
return 1
if op == "+":
return 2
return 0
op_apply_map... |
from rest_framework import serializers
from .models import DailySale
class DailySaleSerializer(serializers.ModelSerializer):
class Meta:
fields=('beer_id','store_id','sales_day','beers_sold','last_updated')
model = DailySale |
# Copyright (c) 2019-2020 SAP SE or an SAP affiliate company. All rights reserved. This file is
# licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... |
#!/usr/bin/env python3
"""
Backfills the instance.readme_blob_id column.
"""
import sys
from quilt_server import db
from quilt_server.const import FTS_LANGUAGE
def main(argv):
result = db.engine.execute('''
UPDATE instance SET blobs_tsv = to_tsvector(%s, s3_blob.preview)
FROM s3_blob
WHE... |
from django.apps import AppConfig
class CheckTrackerConfig(AppConfig):
name = 'Check_Tracker'
|
# -*- coding: utf-8 -*-
# @Author : ydf
# @Time : 2019/7/2 14:11
import atexit
import time
import warnings
from collections import Callable
import gevent
from gevent import pool as gevent_pool
from gevent import monkey
from gevent.queue import JoinableQueue
from nb_log import LoggerMixin, nb_print, LogManager
de... |
import os
import pandas as pd
# from sklearn.ensemble import RandomForestClassifier
from sklearn import preprocessing
from sklearn import metrics
import joblib
from . import dispatcher
TRAINING_DATA = os.environ.get("TRAINING_DATA")
FOLD = int(os.environ.get("FOLD"))
MODEL = os.environ.get("MODEL")
FOLD_MAPPING =... |
"""
๋ฐฑ์ค 21354๋ฒ : รpplen och pรคron
"""
a, b = map(int, input().split())
print('lika' if 7*a == 13*b else 'Axel' if 7*a > 13*b else 'Petra') |
import numpy
from planar import Polygon
from datetime import datetime
from mrjob.job import MRJob
UBER_TIME_COL = 0
UBER_LAT_COL = 1
UBER_LNG_COL = 2
TAXI_PICKUP_TIME = 1
TAXI_DROPOFF_TIME = 2
TAXI_P_LNG = 5
TAXI_P_LAT = 6
TAXI_D_LNG = 9
TAXI_D_LAT = 10
##########################
#### HELPER FUNCTION ####
#########... |
# -*- coding: utf-8 -*-
import numpy as np
from .foundational import DataType
def get_datatype(dtype):
"""
Convert the data type of Numpy to it of Turret.
Args:
dtype: The data type of Numpy.
Returns:
turret.DataType: The data type of Turret.
"""
if type(dtype) is DataType:
... |
#!/usr/bin/python3
import socket
import sys
import binascii
import time
import threading
import logging
import _thread
SDN_CONTROLLER_ADDRESS = '10.0.254.1'
SDN_CONTROLLER_PORT = 14323
TICK_TIME = 1
class RootNode(threading.Thread):
def __init__(self, evntObj, cachLck, cache):
threading.Thread.__init__(s... |
from unittest.mock import MagicMock, patch
from chaosreliably.controls import experiment
from chaosreliably.types import EntityContextExperimentRunLabels, EventType
@patch("chaosreliably.controls.experiment._create_experiment_event")
def test_before_activity_control_calls_create_experiment_event(
mock_create_exp... |
# Version 1: prefix sum, Time: O(n^2), Space: O(n), Time Limit Exceeded
class Solution:
"""
@param: nums: an array with positive and negative numbers
@param: k: an integer
@return: the maximum average
"""
def maxAverage(self, nums, k):
if len(nums) < k:
return 0
n = ... |
from flask import Flask, render_template, Markup, flash, session, redirect, url_for, request
from app import extractFromSite
from app import dataManipulation
import Ref
import sys
reload(sys)
sys.setdefaultencoding('UTF-8')
#add site names here
vendors = Ref.vendors
country = "SG"
currenciesWide = dataManipulation.cur... |
from unittest.mock import DEFAULT
import pytest
import websocket
from _pytest.fixtures import SubRequest
from pytest_mock import MockerFixture
from rembrain_robot_framework.ws import WsDispatcher, WsRequest, WsCommandType
@pytest.fixture()
def ws_test_data() -> str:
return "TEST MESSAGE!"
@pytest.fixture()
de... |
c = int(input('Qual a temperatura em ยบC? '))
f = (c * 9 / 5) + 32
print('{}ยบ Celsius equivale a {}ยบ Fahrenheit'.format(c, f))
|
import os
from pathlib import Path
from typing import Optional
import pytorch_lightning as pl
import torch
import torchvision.transforms
from PIL import Image
from torch.utils.data import ConcatDataset, Dataset
class SimpleImageDataSet(Dataset):
def __init__(self, main_dir, transform, max_n=None):
self.m... |
#!/usr/bin/env python3
import time
import struct
from collections import deque
from typing import Callable, NamedTuple, Tuple, List, Deque, Generator, Optional, cast
from enum import IntEnum
class SERVICE_TYPE(IntEnum):
DIAGNOSTIC_SESSION_CONTROL = 0x10
ECU_RESET = 0x11
SECURITY_ACCESS = 0x27
COMMUNICATION_CON... |
from __future__ import print_function
import sys
# print(*objects, sep=' ', end='\n', file=sys.stdout)
print('spam', 'wonderful spam')
print('spam', 'wonderful spam', sep=', ')
print('spam', 'wonderful spam', sep=', ', end=' FIN\n')
print('stderr', 'spam', 'wonderful spam', sep=', ', end=' FIN\n', file=sys.stderr)
|
import pyvista
from pyvista import examples
helmet_file = examples.gltf.download_damaged_helmet() # doctest:+SKIP
texture = examples.hdr.download_dikhololo_night() # doctest:+SKIP
pl = pyvista.Plotter() # doctest:+SKIP
pl.import_gltf(helmet_file) # doctest:+SKIP
pl.set_environment_texture(cubemap) # doctest:+SKIP
... |
# Copyright (C) 2017-2020 Pascal Pepe <contact@pascalpepe.com>
#
# 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 applic... |
""" Unit tests for pipelines expressed via arlexecute
"""
import logging
import sys
import unittest
import numpy
from astropy import units as u
from astropy.coordinates import SkyCoord
from data_models.memory_data_models import Image, SkyModel
from data_models.memory_data_models import Skycomponent
from data_models.... |
from pyvis.network import Network
from typing import Dict, List, Tuple, Set, Optional
from base import load_attention_weights
def calculate_attention_importances(
attention_weights: Dict[str, Dict[str, float]]
) -> Dict[str, List[Tuple[str, float]]]:
attention_importances: Dict[str, List[Tuple[str, float]]] ... |
from __future__ import absolute_import
import codecs
import hashlib
import json
import os
import re
import subprocess
import sys
from enum import Enum
from detect_secrets.core.baseline import get_secrets_not_in_baseline
from detect_secrets.core.log import CustomLog
from detect_secrets.core.secrets_collection import S... |
import ply.yacc as yacc
from capicua_lex import tokens
from capicua_lex import literals
def p_Capicua_zeros(p):
"Capicua : ZERO ContZ "
p[0] = "0" + p[2]
def p_Capicua_uns(p):
"Capicua : UM ContU "
p[0] = "1" + p[2]
def p_Capicua_vazia(p):
"Capicua : "
p[0] = ""
def p_ContZ_zero(p):
"Co... |
from maltego_trx.maltego import MaltegoMsg, MaltegoTransform, UIM_INFORM
from maltego_trx.transform import DiscoverableTransform
from extensions import registry
from api.utils import create_entity_with_details, get_currency_from_entity_details, get_address_details, get_entity_details
@registry.register_transform(
d... |
# -*- coding: utf-8 -*-
# pylint: disable=expression-not-assigned,line-too-long
"""Security advisory (Finnish: turvallisuusneuvonta) audit tool. API.
Minimal length of CSAF (spam) JSON is 116 bytes:
0 1 2 3 4 5 6 7 8 9
12345678901234567890123456789... |
import gym
import joblib
import numpy as np
import os
import tensorflow as tf
from rllab.baselines.linear_feature_baseline import LinearFeatureBaseline
from rllab.envs.gym_env import GymEnv
import rllab.misc.logger as logger
from rllab.envs.normalized_env import normalize
from sandbox.rocky.tf.envs.base import TfEnv... |
def countCamelCaseCharacter(string):
d = {"UPPERCASE": 0, "LOWERCASE": 0}
for c in string:
if c.isupper():
d["UPPERCASE"] += 1
elif c.islower():
d["LOWERCASE"] += 1
else:
pass
print("Upper Case Characters (Count) : ", d["UPPERCASE"])
print("Low... |
from django.urls import path
from .views import AnalyticsReportConfigureView, AnalyticsReportGenerateView
app_name='report.generator.analytics'
urlpatterns = [
path('configure/', AnalyticsReportConfigureView.as_view(), name='configure'),
path('generate/', AnalyticsReportGenerateView.as_view(), name='generate... |
# Generated by Django 2.0 on 2019-05-06 13:31
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project', '0014_auto_20190505_1708'),
]
operations = [
migrations.AlterField(
model_name='menuitem',
n... |
import pytest
from assertpy import assert_that
import ledger_facade
import utils
from admin.governance.credential_definitions import (
create_credential_definition,
CredentialDefinition,
get_created_credential_definitions,
get_credential_definition,
)
from admin.governance.schemas import SchemaDefiniti... |
# stdlib
import functools
# third party
import pyperf
# syft absolute
import syft as sy
# relative
from .util import generate_data
from .util import make_sept
def create_bench_sept_serialize(
runner: pyperf.Runner, rows: int, columns: int, lower_bound: int, upper_bound: int
):
data = generate_data(rows, co... |
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.keys import Keys
from selenium import webdriver
from selenium.webdriver import Chrome, ChromeOptions
from time import sleep
import sys, random
import threading
if len(sys.argv) != 3:
gamepin = input('Game PIN: ')
... |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import math, gc
import stri... |
from uuid import uuid4
import random
from cqlengine.tests.base import BaseCassEngTestCase
from cqlengine.management import create_table
from cqlengine.management import delete_table
from cqlengine.models import Model
from cqlengine import columns
class TestModel(Model):
id = columns.UUID(primary_key=True, de... |
# TODO: test on false parameter types?
# class TestBaseConfig():
# def test_as_json(self):
# config = BaseConfig(config_file="./dts/config.json")
# string = config.as_json()
# assert string == '{"config_file": "./dts/config.json"}'
# def test_as_dict(self):
# config = BaseCon... |
# coding=utf-8
from django.db import models
from virtualornithology.portraits.models import Portrait
try:
import ujson as json
except ImportError:
import json
def get_client_ip(request):
# from http://stackoverflow.com/questions/4581789/how-do-i-get-user-ip-address-in-django
x_forwarded_for = request... |
# coding=utf8
# Aim of this program is to retrieve data from the SEG database
# and to print the graph with requested industrial companies or country academy
# Data available for the period: 1982-2019
# By default we plot graphs for the 1982-2019
# Timofey Eltsov
# February 12, 2019
import matplotlib.pyplot as p... |
from app.models.post import Post
def test_create_post_model(app):
with app.app_context():
post = Post(title='test creation', content='test content creation',
remote_url='http://creation.local')
post.save()
fresh_post = Post.objects(id=post.id).first()
assert fr... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'VirtualPianoBotGUI.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from PianoKeys import *
from PianoSongs import *
from son... |
import rx
from rx.subjects import Subject
asyncio = rx.config['asyncio']
class TCPSubject(Subject):
def __init__(self):
super().__init__()
@asyncio.coroutine
def handle_request(self, reader, writer):
data = yield from reader.readline()
message = data.decode()
addr = writer... |
from django.http import JsonResponse
from django.shortcuts import render
# Create your views here.
from django.views import View
from apps.areas.models import Area
class ProvienceView(View):
def get(self, request):
from django.core.cache import cache
cache.delete('province')
province_lis... |
colors = [
["#2e3440", "#2e3440"], # background
["#d8dee9", "#d8dee9"], # foreground
["#3b4252", "#3b4252"], # background lighter
["#bf616a", "#bf616a"], # red
["#a3be8c", "#a3be8c"], # green
["#ebcb8b", "#ebcb8b"], # yellow
["#81a1c1", "#81a1c1"], # blue
["#b48ead", "#b48ead"], ... |
"""
This script defines a class to manage the conversion from VCF to Excel
spreadsheets
"""
from cyvcf2 import VCF
import numpy as np
import pandas as pd
import re
import sys
class Vcf2Excel:
"""
A class to store and manage a vcf to Excel spreadsheet conversion
"""
def __init__(self, vcfpath, outpath... |
# -----------------------------------------------------
# Copyright (c) Shanghai Jiao Tong University. All rights reserved.
# Written by Jiefeng Li (jeff.lee.sjtu@gmail.com), Haoyi Zhu
# -----------------------------------------------------
"""Custum training dataset."""
import copy
import os
import pickle as pk
from ... |
import pyblish.api
import openpype.api
class ValidateTextureBatchNaming(pyblish.api.InstancePlugin):
"""Validates that all instances had properly formatted name."""
label = "Validate Texture Batch Naming"
hosts = ["standalonepublisher"]
order = openpype.api.ValidateContentsOrder
families = ["text... |
# OrcaWindTurbine imports
from IO import IO
import AuxFunctions as aux
from OrcaflexModel import OrcaflexModel
# Other imports
from collections import namedtuple
from itertools import product
import numpy as np
def set_and_run_batch(orca_model: OrcaflexModel, post) -> None:
# Get a string with batch type...
... |
from os import system
system('scrapy runspider geny_scrape.py')
|
# OBSS SAHI Tool
# Code written by Fatih C Akyon, 2020.
import copy
from typing import Dict, List, Optional, Union
import numpy as np
from PIL import Image
from osgeo import gdal, ogr
import matplotlib.pyplot as plt
from sklearn.linear_model import HuberRegressor
from sklearn.linear_model import TheilSenRegressor
imp... |
# RGBA format for Font.render
RGBA_WHITE = (255,255,255,255)
RGBA_BLACK = (0,0,0,255)
RGBA_RED = (255,0,0,255)
RGBA_ORANGE = (255,128,0,255)
RGBA_GREEN = (0,255,0,255)
# Server config
SERVER_URL = "http://pi-dir:8180/" |
#!/usr/bin/env python
import rospy
import curses
import socket
import time
import sys
import yaml
from avatar_msg.msg import AUlist
from avatar_msg.msg import expresion
def handle_exp(req):
# call the gestures dictionary from yaml file
global pub
stream = open('../cfg/gestos.yaml')
d... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('weddingServices', '0005_auto_20171106_1927'),
]
operations = [
migrations.AddField(
model_name='caterer',
... |
# The Nexus software is licensed under the BSD 2-Clause license.
#
# You should have recieved a copy of this license with the software.
# If you did not, you can find one at the following link.
#
# http://opensource.org/licenses/bsd-license.php
proxintialdelay = entity[4]
if proxintialdelay <= 0:
closestposition ... |
import numpy as np
def read_matrix(file):
line = file.readline()
index1 = line.find('(') + 1
index2 = line.find(', ')
rows = int(line[index1:index2])
index1 = line.find(', ') + 2
index2 = line.find(')')
cols = int(line[index1:index2])
dataMatrix = np.zeros((rows, cols))
for i in ra... |
import sys
from pathlib import Path
import yaml
import json
import numpy as np
import torch
import click
import argparse
from torch.nn.parallel import DistributedDataParallel as DDP
from segm.utils import distributed
import segm.utils.torch as ptu
from segm import config
from segm.model.factory import create_segmente... |
from nlputils import *
from fa import *
###############################################################################
### Count of capital letters feature annotator
### Note: only designed to work with UDB encapulated TDT4
###############################################################################
class facaps... |
# ------------------------------------------------------------------------
# UP-DETR
# Copyright (c) Tencent, Inc. and its affiliates. All Rights Reserved.
# ------------------------------------------------------------------------
# Modified from DETR (https://github.com/facebookresearch/detr)
# Copyright (c) Facebook,... |
"""
This file is to put preprocessing methods in. My raw data looks like a csv file with headers including
ref, stim1, stim2, ..., stim8, session, participant and clicks.
"""
import ast
import csv
import json
import os
def get_response_files(subject_name, directory):
# directory is path to exp/subject-data
#... |
# CRAN
from app import db
from sqlalchemy.dialects.postgresql import JSONB
import requests
from models import github_api
from lxml import html
from util import elapsed
from time import time
import re
# class CranProject(db.Model):
# project_name = db.Column(db.Text, primary_key=True)
# owner_name = db.Colu... |
'''Training function for Sign video classification.
'''
import argparse
import os
import datetime as dt
import tensorflow as tf
from tensorflow import keras as K
import wandb
from wandb.keras import WandbCallback
import yaml
# from model import Model
from src.model import Model
from utils import *
with open('config... |
"""Generated message classes for iamcredentials version v1.
Creates short-lived credentials for impersonating IAM service accounts. To
enable this API, you must enable the IAM API (iam.googleapis.com).
"""
# NOTE: This file is autogenerated and should not be edited by hand.
from __future__ import absolute_import
fro... |
# -*- coding: utf-8 -*-
# Copyright IBM Corp. 2015, 2017
#
# 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... |
import os
import shutil
import openpype.hosts.fusion
from openpype.lib import PreLaunchHook, ApplicationLaunchFailed
class FusionPrelaunch(PreLaunchHook):
"""
This hook will check if current workfile path has Fusion
project inside.
"""
app_groups = ["fusion"]
def execute(self):
# mak... |
# =============================================================================
# IMPORTS
# =============================================================================
import abc
# =============================================================================
# BASE CLASS
# ===========================================... |
"""
author: Fabian Schaipp
"""
import numpy as np
#from tick.prox import ProxTV
from numba import njit
from ..helper.basic_linalg import trp,Gdot,Sdot
from .fgl_helper import condat_method
# functions specifically related to the GGL regularizer
@njit()
def prox_1norm(v, l):
return np.sign(v) * np.maximum(np.abs... |
from collections import Counter
from functools import reduce
from itertools import chain
from typing import Dict, List, Union
from bookmarks.models import Bookmark
BookmarkDocument = List[str]
Tree = Dict[Union[str, int], Union[Dict, Bookmark]]
def export_netscape_html(bookmarks: List[Bookmark], apply_pseudo_struct... |
# admin_tools/views.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from config.base import get_environment_variable, get_git_merge_date, get_node_version, get_postgres_version, \
get_python_version, LOGIN_URL
from ballot.models import BallotReturned, VoterBallotSaved
from candidate.models import ... |
from .app import App
from .request import Request
from .response import Response
from .json import jsonify
__all__ = [
App.__name__,
Request.__name__,
Response.__name__,
jsonify.__name__
]
|
import os
from IOC import *
class Component(object):
""" Symbolic base class for components
"""
class Bar(Component):
con = RequiredFeature('Console', hasMethods('WriteLine'))
title = RequiredFeature('AppTitle', isInstanceOf(str))
user = RequiredFeature('CurrentUser', isInstanceOf(str))
def ... |
import bubbletea
import numpy as np
import streamlit as st
from datetime import datetime
import pandas as pd
import altair as alt
debugMode = False
showDailyChart = False
urlvars = bubbletea.parse_url_var([{'key':'starttimestamp','type':'int'}, {'key':'endtimestamp','type':'int'}])
try:
end_timestamp = urlvars['en... |
# Generated by Django 2.2.13 on 2020-08-26 22:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pipeline', '0065_censussubdivision_population_count_change'),
]
operations = [
migrations.AddField(
model_name='censussubdivisi... |
# Generated by Django 3.2.6 on 2021-08-19 19:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('worlds', '0019_pipeline_scale_down_delay'),
]
operations = [
migrations.AddField(
model_name='job',
name='port',
... |
# ์ฝ๋ฉ๋์ฅ ๋ฌธ์ ํ์ด
# Question number. 405
# ํญ์ ๊ณต๋ฐฑ ๋ฌธ์๋ก ๋ฐ๊พธ๊ธฐ
# http://codingdojang.com/scode/405
# Author: Lee Jeongwoo
# Github name: zao95
# ========== Question ==========
# A์จ๋ ๊ฐ๋ฐ๋ ์์ค์ฝ๋๋ฅผ ํน์ ์
์ฒด์ ๋ฉํํ๋ ค๊ณ ํ๋ค.
# ๊ฐ๋ฐ๋ ์์ค์ฝ๋๋ค์ ํญ์ผ๋ก ๋ค์ฌ์ฐ๊ธฐ๊ฐ ๋๊ฒ, ๊ณต๋ฐฑ์ผ๋ก ๋ค์ฌ์ฐ๊ธฐ๊ฐ ๋ ๊ฒ๋ค์ด ์์ฌ ์๋ค๊ณ ํ๋ค.
# A์จ๋ ํญ์ผ๋ก ๋ค์ฌ์ฐ๊ธฐ๊ฐ ๋ ๋ชจ๋ ์์ค๋ฅผ ๊ณต๋ฐฑ 4๊ฐ๋ก ์์ ํ ํ ๋ฉํํ ์์ ์ด๋ค.
# A์จ๋ฅผ ๋์์ค ์ ์๋๋ก ์... |
import pandas as pd
import numpy as np
import pytest
from eazieda.outliers_detect import outliers_detect
from eazieda.outliers_detect import outliers_detect_zscore
from eazieda.outliers_detect import outliers_detect_iforest
from eazieda.outliers_detect import outliers_detect_iqr
from eazieda.outliers_detect import rem... |
#!/usr/bin/python3
import os
import random
import yaml
import paho.mqtt.client as mqtt
import paho.mqtt
import re
import json
import logging
import voluptuous as vol
from voluptuous import Any
from lib.garage import GarageDoor
from lib.garage import TwoSwitchGarageDoor
DEFAULT_DISCOVERY = False
DEFAULT_DISCOVERY_PREF... |
#!/usr/bin/env python
'''
show changes in flight modes
'''
import sys, time, os
# allow import from the parent directory, where mavlink.py is
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
from optparse import OptionParser
parser = OptionParser("flightmodes.py [options]")
(opts... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.