text
stringlengths
1
927k
from pyspark import SparkContext from pyspark import SparkConf conf = SparkConf() #conf.set('master','local') conf.set('master','spark://hadoop-maste:7077') sparkContext = SparkContext(conf=conf) rdd = sparkContext.parallelize(range(100)) print(rdd.collect()) sparkContext.stop()
""" Create a program to read in the data from the hurricanes.txt file which the program will use to create a CSV file. The hurricanes.txt file contains the number hurricanes formed during the months of May through December in the years 2005 to 2010 For each year, have your program calculate the total number of hurric...
from textwrap import dedent from operator import ge, lt import re import os import pytest from jedi.inference.gradual.conversion import _stub_to_python_value_set from ..helpers import get_example_dir @pytest.mark.parametrize( 'code, sig, names, op, version', [ ('import math; math.cos', 'cos(x, /)', ['x'...
from torch.utils.data import Dataset from .mol_tree import MolTree import numpy as np class MoleculeDataset(Dataset): def __init__(self, data_file): with open(data_file) as f: self.data = [line.strip("\r\n ").split()[0] for line in f] def __len__(self): return len(self.data) ...
######### # Copyright (c) 2017 GigaSpaces Technologies Ltd. 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import subprocess import shlex import glob try: import argparse except ImportError: sys.exit("Please install or run Python 2.7 or later") HOME = os.path.expanduser("~") # User Home Directory DOTFILES = os.path.join(HOME, ".dotconfig/dotfiles...
# AUTOGENERATED! DO NOT EDIT! File to edit: 01_models.ipynb (unless otherwise specified). __all__ = ['noop', 'shortcut', 'Inception', 'InceptionBlock', 'InceptionTime', 'Squeeze', 'Unsqueeze', 'Add', 'Concat', 'Permute', 'Transpose', 'View', 'Reshape', 'Max', 'LastStep', 'Noop', 'TransformerModel', ...
# coding=utf-8 # *** WARNING: this file was generated by crd2pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** SNAKE_TO_CAMEL_CASE_TABLE = { "api_version": "apiVersion", "completion_time": "completionTime", "context_dir": "contextDir", "http_proxy": "httpProxy...
# -*- coding: utf-8 -*- # Copyright CERN since 2018 # # 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 ...
from __future__ import unicode_literals, division, absolute_import import copy from math import ceil from operator import itemgetter from urllib import unquote from flask import jsonify, request from flask_restplus import inputs from flexget.api import api, APIResource from flexget.plugins.filter import seen seen_a...
# Main GWR classes __author__ = "Taylor Oshan Tayoshan@gmail.com" import copy import numpy as np import numpy.linalg as la from scipy.stats import t from scipy.special import factorial from itertools import combinations as combo from spglm.family import Gaussian, Binomial, Poisson from spglm.glm import GLM, GLMResult...
import collections import logging from typing import Dict, List, Optional, Set, Tuple, Union, Callable from blspy import G1Element from chiabip158 import PyBIP158 from clvm.casts import int_from_bytes from covid.consensus.block_record import BlockRecord from covid.consensus.block_rewards import calculate_base_farmer_...
# -*- coding: utf-8 -*- # Copyright © 2011-2013 Binet Réseau # See the LICENCE file for more informations # This file is a part of Kaoz, a free irc notifier import irc.client import irc.connection import logging import os import socket import sys import threading import traceback import kaoz.channel if sys.version_...
# file IO f = open('test.txt', 'w') f.write('Hello World') f.close()
from crossbox.models.subscriber import Subscriber def reset_wods_to_subscrition_amount(): for sub in Subscriber.objects.all(): fee = sub.fee if fee: num_sessions = fee.num_sessions sub.wods = num_sessions sub.save() if __name__ == '__main__': reset_wods_to...
# Code in this file is copied and adapted from # https://github.com/openai/evolution-strategies-starter. from __future__ import absolute_import from __future__ import division from __future__ import print_function import gym import numpy as np import tensorflow as tf import ray from ray.rllib.evaluation.sampler impo...
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.11.3 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys i...
from django.db import models from django.utils.functional import cached_property from django.utils.translation import ugettext_lazy as _ from i18nfield.fields import I18nCharField from pretalx.common.choices import Choices from pretalx.common.mixins import LogMixin from pretalx.common.phrases import phrases from preta...
# -*- coding: utf-8 -*- ''' cron: 16 6,16 * * * new Env('联通日常任务'); 变量: unicom_config_x,通知服务变量 脚本内或环境变量填写,环境变量优先 通知推送服务环境变量请查看:https://github.com/wuye999/myScripts/blob/main/send.md 环境变量示例: export unicom_config_1="手机号1<<<服务密码1<<<appId1<<<抽奖次数(0-30)中奖几率渺茫<<<手机的imei(可留空)" export unicom_config_2="手机号2<<<服务密码2<<<appId2<<<抽...
from dataclasses import dataclass from pathlib import Path from typing import Any, Dict, List, Optional import pandas import pytest from isolateparser.resultparser.parsers import parse_vcf data_folder = Path(__file__).parent / 'data' / 'Clonal_Output' / 'breseq_output' vcf_filename_real = data_folder / "data" / "out...
def main(request, response): headers = [ ("Content-Type", "text/javascript"), ("Access-Control-Allow-Origin", request.headers.get("Origin")), ("Timing-Allow-Origin", request.headers.get("Origin")), ("Access-Control-Allow-Credentials", "true") ] return headers, "// Cross-orig...
# Copyright (c) 2019, Xilinx, Inc. # 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. Redistributions of source code must retain the above copyright notice, # this list of ...
# -*- coding:utf-8 -*- import re # 读取人物名称 def find_hero(hero): with open('/Users/miraclewong/github/PythonBasic/geekbang/txt/sanguo.txt' ,encoding='GB18030') as f: data = f.read().replace('\n', '') name_num = re.findall(hero, data) # print("主角 %s 出现了 %d 次" %(hero, len(name_num))...
import rlkit.misc.hyperparameter as hyp from rlkit.demos.source.dict_to_mdp_path_loader import EncoderDictToMDPPathLoader from rlkit.launchers.experiments.ashvin.awac_rig import awac_rig_experiment from rlkit.launchers.launcher_util import run_experiment from rlkit.launchers.arglauncher import run_variants from rlkit.t...
import logging import numpy as np import pandas as pd import re from os import PathLike from pathlib import Path from scipy.ndimage import maximum_filter from typing import ( Generator, List, Optional, Sequence, Tuple, Union, ) from steinbock import io try: from readimc import MCDFile, TX...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: tensorflow/core/framework/cost_graph.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 google.protobu...
#!/usr/bin/env python3 import timeit def main(): timeit.timeit('"-".join(str(n) for n in range(100))', number=10000) #print(f"List populated in {toc - tic:0.4f} seconds") if __name__ == "__main__": main()
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2021, Alexei Znamensky <russoz@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = ''' --- module: pipx short_desc...
#!/usr/bin/env python3 # Copyright (C) 2019-2022 The Xaya developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from shipstest import ShipsTest """ Tests the getchannel RPC method of the (generic) channel GSP RPC server. """...
#! /usr/bin/env python from pyquaternion import Quaternion import numpy as np from rclpy.node import Node from px4_msgs.msg import VehicleGlobalPosition class PX4PositionFeedback: def __init__(self, system_state, time_delta): self.node = Node('position_feedback') self.system_state = system_state...
import os import subprocess import shutil import urllib import distutils.dir_util from common import devtools from common.find import sevenz name = "protobuf" zipUrl = "https://github.com/protocolbuffers/protobuf/releases/download/v3.9.0/protobuf-cpp-3.9.0.tar.gz" patches = ["protobuf.patch"] def getRootPath(): ret...
load( "@io_bazel_rules_dotnet//dotnet/private:context.bzl", _core_context_data = "core_context_data", _dotnet_context = "dotnet_context", _dotnet_context_data = "dotnet_context_data", _net_context_data = "net_context_data", ) load( "@io_bazel_rules_dotnet//dotnet/toolchain:toolchains.bzl", _...
#!/usr/bin/env python import sys if len(sys.argv) < 2: sys.stderr.write('Usage: evaluate.py FILENAME') sys.exit(1) filename = sys.argv[1] # load CRF++ output for test data with open(filename, 'r') as file: sentences = file.read().split('\n\n') total_sentences = len(sentences) total_words, correct_words...
# -*- coding: utf-8 -*- # Copyright (C) 2012, Almar Klein # # Visvis is distributed under the terms of the (new) BSD License. # The full license can be found in 'license.txt'. """ Module cameras A camera represents both the camera model and the interaction style. A lot of blood sweat and tears went into this module ...
# # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/) # This module is free software, and you may redistribute it and/or modify # under the same terms as Python, so long as this copyright message and # disclaimer are retained in their original form. # # IN NO EVENT SHALL BIZAR SOFTWARE PTY LT...
# -*- coding: utf-8 -*- """Utility functions for command line commands operating on the repository.""" from aiida.cmdline.utils import echo def cat_repo_files(node, path): """ Given a Node and a relative path to a file in the Node repository directory, prints in output the content of the file. :param...
#!/usr/bin/env python from __future__ import unicode_literals import os.path import re import subprocess import sys import time import urllib.request import datetime from io import BytesIO import gzip from .common import FileDownloader from ..compat import ( compat_setenv, compat_str, ) from ..postprocessor....
"""The tests for the utility_meter sensor platform.""" from contextlib import contextmanager from datetime import timedelta from unittest.mock import patch import pytest from homeassistant.components.select.const import ( DOMAIN as SELECT_DOMAIN, SERVICE_SELECT_OPTION, ) from homeassistant.components.sensor i...
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import BaseHTTPServer import imp import logging import multiprocessing import optparse import os import SimpleHTTPServer # pylint:...
from functools import total_ordering from pathlib import Path from typing import Any, Dict, Generator, List, Optional, Tuple, Union import yaml from pydantic import BaseModel from .util import split @total_ordering class CondaPackage(BaseModel): name: str version: Optional[str] build: Optional[str] ...
import datetime from copy import deepcopy from os import environ from unittest import TestCase, mock from unittest.mock import Mock from pytz import UTC from requests import Timeout import data_conversion_subsystem.data_converter.data_converter as data_converter from data_conversion_subsystem.config.config import DCS...
#!/usr/bin/env python """ Use backend agg to access the figure canvas as an RGB string and then convert it to an array and pass the string it to PIL for rendering """ from pylab import * from matplotlib.backends.backend_agg import FigureCanvasAgg try: import Image except ImportError, exc: raise SystemExit("PIL...
import json import pytest import requests from unittest import mock from tests import factories invalid_work = { 'data': { 'type': 'NormalizedData', 'attributes': { 'data': { '@graph': [ { '@type': 'InvalidWorkType', ...
# Copyright 2020,2021 Sony Corporation. # Copyright 2021 Sony Group 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 ...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Calendars on Orderpoints', 'version': '1.0', 'summary': 'Calendars ', 'description': """ The stock_calendar module handles minimum stock rules (=orderpoints / reordering rules) differen...
from .network import TransceiverConfig, LinkConfig from .edcs import ResourceManagerConfig from .smart_grid import PowerSourceConfig, EnergyStorageConfig
import json from django.contrib.auth import get_user_model from channels.consumer import AsyncConsumer from channels.db import database_sync_to_async from .models import Thread, ChatMessage class ChatConsumer(AsyncConsumer): async def websocket_connect(self, event): print("connected", event) oth...
import math import os import signal import sys from typing import Callable, Any, Tuple, List, Union, Optional import ptan import torch import torch.nn.functional as F from tensorboardX import SummaryWriter from torch import multiprocessing from torch.optim import Adam, SGD import autograph.lib.envs.mazeenv from autog...
from algo import constants as co from algo.asset import Algo from algo.util_algo import get_transfer_asset from common.ExporterTypes import TX_TYPE_LP_DEPOSIT, TX_TYPE_LP_WITHDRAW from common.make_tx import _make_tx_exchange, make_reward_tx, make_swap_tx, make_unknown_tx def handle_unknown(exporter, txinfo): row ...
"""Breadth-first traversing of a tree. Call a function _f on every node of a tree, in breadth-first prefix order Source: programming-idioms.org """ # Implementation author: cpoulet_42 # Created on 2017-08-09T09:52:02.728772Z # Last modified on 2017-08-09T22:27:55.685981Z # Version 2 def BFS(f, root): Q = [root...
# Copyright 2018-2022 Streamlit 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 # # Unless required by applicable law or agreed to in wr...
#Embedded file name: /Users/versonator/Jenkins/live/output/Live/mac_64_static/Release/python-bundle/MIDI Remote Scripts/_Framework/DeviceComponent.py from __future__ import absolute_import, print_function, unicode_literals from builtins import zip from builtins import str from builtins import range import Live from _Ge...
# Copyright 2013 dotCloud 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 # Unless required by applicable law or agreed t...
# -*- coding: utf-8 -*- """ Created by libsedmlscript v0.0.1 """ from sed_roadrunner import model, task, plot from math import sqrt #---------------------------------------------- sqrt(16)
from queue import Queue from typing import Iterable TEST_INPUTS = { '""': (2, 0, 6), '"abc"': (5, 3, 9), '"aaa\\"aaa"': (10, 7, 16), '"\\x27"': (6, 1, 11), } def unescaped_str_len(string: str) -> int: queue = Queue() for char in string: queue.put(char) length = 0 while not que...
# -*- coding: utf-8 -*- ''' Manage VPCs ================= .. versionadded:: 2015.8.0 :depends: - boto >= 2.8.0 - boto3 >= 1.2.6 Create and destroy VPCs. Be aware that this interacts with Amazon's services, and so may incur charges. This module accepts explicit vpc credentials but can also utilize IAM roles assigne...
# # 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...
from __future__ import print_function import numpy as np from openmdao.api import ExplicitComponent from openaerostruct.utils.vector_algebra import compute_cross, compute_cross_deriv1, compute_cross_deriv2 class PanelForces(ExplicitComponent): """ Compute the panel forces acting on all surfaces in the syste...
from pyostie.parsers import * from pyostie.insights_ext import * from pyostie.convert import * from pyostie.utils import * class extract: def __init__(self, filename, insights=False, tess_path=None, extension=None): """ :param filename: :param insights: :param tess_path: :...
# coding: utf-8 # ----------------------------------------------------------------------------------- # <copyright company="Aspose Pty Ltd" file="PdfTextAnnotationAppearance.py"> # Copyright (c) 2003-2021 Aspose Pty Ltd # </copyright> # <summary> # Permission is hereby granted, free of charge, to any person obtain...
NETWORKS = { "main": { "name": "Mainnet", "wif": b'\x80', "p2pkh": b'\x00', "p2sh": b'\x05', "bech32": "bc", "xprv": b'\x04\x88\xad\xe4', "xpub": b'\x04\x88\xb2\x1e', "yprv": b'\x04\x9d\x78\x78', "zprv": b'\x04\xb2\x43\x0c', ...
#!usr/bin/python """ simple python script to remove weight values associated with .mtx graph """ import random import fileinput import sys ### check command line args if len(sys.argv) != 2: print 'Usage: python remove_weights.py file_name.mtx' sys.exit() ### output matrix-market format graph ograph = open(s...
from __future__ import absolute_import, division, print_function __all__ = ['get_viewer_tools'] def get_viewer_tools(cls, tools=None, subtools=None): """ Given a viewer class, find all the tools and subtools to include in the viewer. Parameters ---------- cls : type The viewer class ...
# -*- coding: utf-8 -*- ''' TCP transport classes Wire protocol: "len(payload) msgpack({'head': SOMEHEADER, 'body': SOMEBODY})" ''' # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals import errno import logging import msgpack import socket import os import weakref import ti...
import os, sys, pdb import logging import numpy as np from tensorboardX import SummaryWriter from torch.optim.optimizer import Optimizer, required from transformers import AdamW, get_linear_schedule_with_warmup class ExperienceLogger(object): def __init__(self, args, checkpoint_dir): self.args = args...
#!/usr/bin/python # -*- encoding: utf-8 -*- import torch import torch.nn.functional as F from torch.utils.data import DataLoader import numpy as np import cv2 from PIL import Image from tqdm import tqdm import logging import importlib import argparse import os.path as osp import sys import math from lib.model impor...
import os CURR_DIR = os.path.dirname(__file__) CONFIG_DIR = f'{CURR_DIR}/config' EXP_DIR = f'{CURR_DIR}/exp' DATA_DIR = f'{CURR_DIR}/data'
import inspect from importlib import import_module from inspect import cleandoc from pathlib import Path from django.apps import apps from django.contrib import admin from django.contrib.admin.views.decorators import staff_member_required from django.contrib.admindocs import utils from django.contrib.admindocs.utils i...
# Copyright (c) 2013, PT. UNITEK MAS INDONESIA and contributors # For license information, please see license.txt # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ fr...
""" Django settings for sparkling_breeze_32912 project. Generated by 'django-admin startproject' using Django 2.2.2. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ ""...
# -*- coding: utf-8 -*- ''' update: 2021/5/18 lym ''' import torch import torch.nn.functional as F import torch.nn as nn import math import torch.utils.model_zoo as model_zoo from torchsummary import summary __all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152'] model_urls = ...
# Okta intel module - sync state from typing import List from typing import Optional class OktaSyncState: """ Okta sync state. Object used to store sync data to allow each stages to share data. For example, saving user and group list returned by Okta instead of asking the Graph for factor and role sta...
import collections from django import forms from django.contrib.staticfiles.templatetags.staticfiles import static from django.core.exceptions import ValidationError from django.forms.utils import ErrorList from django.template.loader import render_to_string from django.utils.functional import cached_property from dja...
RED = 0 YELLOW = 1 GREEN = 2 # Image setting IMAGE_HEIGHT = 32 IMAGE_WIDTH = 32 IMAGE_CHANNEL = 3 IMAGE_CLASSIFY = 3 #Training data lr = 0.0001 epochs = 50 batch_size = 128 mu = 0 sigma = 0.1 def get_traffic_name(label): if label == RED: return "red" if label == YELLOW: return "yellow" ...
# $Id: pcap.py 56 2009-11-06 22:28:26Z jon.oberheide $ """Libpcap file format.""" import sys, time import dpkt TCPDUMP_MAGIC = 0xa1b2c3d4L PMUDPCT_MAGIC = 0xd4c3b2a1L PCAP_VERSION_MAJOR = 2 PCAP_VERSION_MINOR = 4 DLT_NULL = 0 DLT_EN10MB = 1 DLT_EN3MB = 2 DLT_AX25 ...
import uuid from datetime import timedelta import requests from client import exceptions as ex from client.sources.common import core from client.utils import auth, format, encryption from client.protocols.grading import grade from client.cli.common import messages import client import collections import glob import...
"""hierarchial_data URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Cl...
import math class calc: def __init__(self): self.result = 0 def add(a,b): self.result += float(b) return self.result def minus(a,b): self.result -= float(b) return self.result def c_(self): self.result = 0 return 0 def mult(a,b)...
#!/usr/bin/env python # Copyright 2018, Nordic Semiconductor ASA # 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. Redistributions of source code must retain the above copyright notice, this...
import json from decimal import Decimal from itertools import chain from unittest.mock import ANY import graphene from ...discount import DiscountValueType, OrderDiscountType from ...product.models import ProductVariant from ..payloads import ( ORDER_FIELDS, PRODUCT_VARIANT_FIELDS, generate_order_payload,...
# -*- coding: utf-8 -*- from ccxt.async.hitbtc import hitbtc import base64 import math import json from ccxt.base.errors import ExchangeError from ccxt.base.errors import InsufficientFunds from ccxt.base.errors import OrderNotFound class hitbtc2 (hitbtc): def describe(self): return self.deep_extend(supe...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Tests for the `drf-rw-serializers` viewsets module. """ from __future__ import absolute_import, unicode_literals from django.utils import version as django_version from model_mommy import mommy from test_utils.base_tests import ( BaseTestCase, TestListRequestSucc...
from typing import cast import pytest from django.conf import settings from django.utils import timezone from rest_framework import status from posthog.constants import RDBMS from posthog.models import User from posthog.models.organization import OrganizationInvite from posthog.test.base import APIBaseTest from posth...
# Copyright (c) 2020 Graphcore Ltd. 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 l...
# Copyright (c) 2016 EMC Corporation, 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 ap...
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.10.1) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x04\x4b\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x18\x...
import argparse import logging import os import string from datetime import datetime from time import time import torch import torchaudio from torch.optim import SGD, Adadelta, Adam, AdamW from torch.optim.lr_scheduler import ExponentialLR, ReduceLROnPlateau from torch.utils.data import DataLoader from torchaudio.data...
#!/usr/bin/env python2 # ______ _ _ _______ # | ____| (_) | | |__ __| # | |__ ___ ___ ___ _ ___| |_ _ _ | | ___ __ _ _ __ ___ # | __/ __|/ _ \ / __| |/ _ \ __| | | | | |/ _ \/ _` | '_ ` _ \ # | | \__ \ (_) | (__| | __/ |_| |_| | | | __...
from CoolProp.CoolProp import PropsSI import pandas as pd class State: self.fluid = T self.T = T self.p = p self.h = PropsSI('H', 'T', T, 'P', p, fluid) self.s = PropsSI('S', 'T', T, 'P', p, fluid) self.D = PropsSI('D', 'T', T, 'P', p, fluid) class Flow(State): self.m_dot = T def def_st...
#!/usr/bin/env python import os import sys import slackweb username = 'CircleCI' icon_url = 'https://i.imgur.com/FLjAA35.png' def main(): message = sys.argv[1] if message == 'started': _notify('Deploy started', '#66d3e4') elif message == 'successful': _notify('Deploy successful', '#41aa5...
"""Barebones reader plugin example, using imageio.imread""" from napari_plugin_engine import napari_hook_implementation from imageio import formats, imread readable_extensions = tuple(set(x for f in formats for x in f.extensions)) @napari_hook_implementation def napari_get_reader(path): """A basic implementatio...
from ipykernel.kernelapp import IPKernelApp from . import UrduPythonKernel IPKernelApp.launch_instance(kernel_class=UrduPythonKernel)
# -*- coding: utf-8 -*- # # Last Change: 2018-01-09 09:24:03 # Copyright 2017 Ricequant, 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....
# universal variable formulation, 3rd order differential equation solver for orbital prediction, # implemented due to huge efficiency issues when using conventional methods (loops, recursion), # algorithms based on Vectorized Analytic Two Body Propagator in MATLAB Copyright (c) 2012, Darin Koblick from scipy.spatial.d...
""" 'relay4_out.py' =================================== Example of turning on and off a LED from the Adafruit IO Python Client Author(s): Brent Rubell, Todd Treece """ # Import standard python modules import time # import Adafruit Blinka import digitalio import board # import Adafruit IO REST client. from Adafruit_IO...
from datetime import date as d ano_nascimento = int(input('Informe o ano de nascimento: ')) atual = d.today().year idade = atual - ano_nascimento print('O atleta tem {} anos'.format(idade)) if idade <= 9: print('Mirin') elif idade <= 14: print('Infantil') elif idade <= 19: print('Júnior') elif idade <= 2...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import logging from jinja2 import Template def gen_tensorflow_client_string(generated_tensor_data, model_name): """ Generate TensorFlow SDK in Bash. Args: generated_tensor_data: Exampl...
"""rest freamwork import""" from . import serializers from rest_framework import status from rest_framework_simplejwt.views import TokenObtainPairView from rest_framework_simplejwt.serializers import TokenObtainPairSerializer from rest_framework.response import Response from rest_framework import ( generics, pe...
import pyrfc3339 import httplib2 import os from apiclient import discovery from oauth2client import client from oauth2client import tools from oauth2client.file import Storage import datetime def ordinal(n): return "%d%s" % (n,"tsnrhtdd"[(n/10%10!=1)*(n%10<4)*n%10::4]) try: import argparse flags = argp...
import pandas as pd import numpy as np import datetime as dt import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func import flask from flask import Flask , jsonify engine = create_engine("sqlite:///hawaii.sqlite") Base = aut...