text stringlengths 2 999k |
|---|
import numpy as np
from metaworld.policies.action import Action
from metaworld.policies.policy import Policy, assert_fully_parsed, move
class SawyerWindowOpenV2Policy(Policy):
@staticmethod
@assert_fully_parsed
def _parse_obs(obs):
return {
'hand_xyz': obs[:3],
'wndw_xyz'... |
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
from __future__ import print_function
import glob
import hashlib
impo... |
from __future__ import annotations
from typing import Union, Iterator, Tuple, Optional
import numpy as np
from morphzero.core.common.connect_on_matrix_board import ConnectOnMatrixBoardResult, ConnectOnMatrixBoardState, \
ConnectOnMatrixBoardRules, ConnectOnMatrixBoardEngine, ConnectOnMatrixBoardMove
from morphze... |
"""
Internal package providing a Python CRUD interface to MLflow experiments and runs.
This is a lower level API than the :py:mod:`mlflow.tracking.fluent` module, and is
exposed in the :py:mod:`mlflow.tracking` module.
"""
import time
from six import iteritems
from mlflow.store import SEARCH_MAX_RESULTS_DEFAULT
from ... |
import sys
from docopt import docopt
from kubernetes import config
from kuku.__version__ import __version__
from kuku.dump import dump
from kuku.render import render
from kuku.templates import find
from kuku.values import resolve
def cli():
"""kuku: Kubernetes templating tool.
Usage:
kuku apply [... |
from sqlalchemy.orm import Session
from sqlalchemy.orm.exc import NoResultFound
#########need to be refactor################
from ICECREAM.http import HTTPError
def get_nested_list_data(model, data, db_session):
if not data:
return []
_list_object = []
if hasattr(model(), "id"):
for _objec... |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 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 -alertnotify, -blocknotify and -walletnotify options."""
import os
from test_framework.test_f... |
import traceback
import xml.dom.minidom
from spitfire.compiler.ast import *
import spitfire.compiler.util
enable_debug = False
def debug(func_name, dom_node):
if not enable_debug:
return
if dom_node.attributes:
print func_name, dom_node.nodeName, dom_node.attributes.keys()
else:
print func_name, do... |
# defaults settings
# For standalone use.
PIPELINE_KEY = '%(spider)s:items'
# default queue key
DEFAULT_QUEUE_KEY = "dq"
# scheduler
SCHEDULER_QUEUE_CLASS = 'scrapy_mysql.queue.RemoteQueue'
# Sane connection defaults.
# or use `MYSQL_URL_REMOTE_PARAMS` in scrapy settings
# QUQUE: the remote url server will support ... |
import json
import logging
from dagster import PipelineDefinition
from dagster.core.execution.context.logger import InitLoggerContext
from dagster.utils.log import define_json_file_logger
from dagster.utils.test import create_test_pipeline_execution_context, get_temp_file_name
def setup_json_file_logger(tf_name, nam... |
#
# 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 us... |
from __future__ import absolute_import
# -*- coding: UTF-8 -*-
from .AutoTimer import AutoTimer
from .AutoTimerConfiguration import CURRENT_CONFIG_VERSION
from RecordTimer import AFTEREVENT
from twisted.internet import reactor
from twisted.web import http, resource, server
import threading
import six
from six.moves.url... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cloud_compare.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
import os
from datetime import datetime
from common.constants import *
from common.liquibase_utils import *
from common.query_builder import (
get_create_constraint_query,
get_create_index_query,
get_create_relationships_query,
get_create_synonym_relationships_query,
get_create_update_nodes_query
)... |
import utils
from utils import *
sys.stdout = Logger('D:\\2014_mobilectr\\2_generate_dataset_for_lr_fm.txt')
t0 = load(utils.tmp_data_path + 't0.joblib_dat')
print("t0 loaded with shape", t0.shape)
t0['dev_id_cnt2'] = np.minimum(t0.cnt_dev_id.astype('int32').values, 300)
t0['dev_ip_cnt2'] = np.minimum(t0.cnt_dev_ip.a... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.9.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... |
# -*- coding: utf-8 -*-
"""Converter for the Integrated Taxonomic Information System (ITIS)."""
import os
import sqlite3
import zipfile
from contextlib import closing
from typing import Iterable
from pyobo.io_utils import multidict
from pyobo.path_utils import ensure_path, get_prefix_directory, prefix_directory_join... |
import nep
import time
client = nep.client('127.0.0.1', 8000) # Create a new client instance
while True:
msg = {"message":"client request"} # Message to send as request
client.send_info(msg) # Send request
print (client.listen_info()) # Wait for server response
time.sleep(1) # Wait one second
|
from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "oakland-community-32011.botics.co"
site_params = {
"name": "Oakland Community",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.object... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
import graphene
from graphene_django.filter import DjangoFilterConnectionField
from .filters import ReviewFilter
from .mutations import CreateReview, UpdateReview, DeleteReview
from .types import ReviewType
class ReviewMutations(graphene.ObjectType):
create_review = CreateReview.Field()
update_review = Updat... |
# -*- 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
#... |
from collections import UserDict
from cerberus import Validator
from genesis.platforms import PLATFORM_MAPPINGS
class ConfigException(Exception):
pass
class Config(UserDict):
SCHEMA = {
'name': {
'type': 'string',
'required': True,
},
'description': {
... |
from tensorflow.keras.preprocessing.text import Tokenizer
import numpy as np
# Loading all the captions data into a dictionary with the image_name as key
# Enter the path of "Flickr8k.token.txt" present in Dataset in "caps_path" variable
caps_path = "../input/flickr8k/Flickr_Data/Flickr_Data/Flickr_TextData/Flickr8k.... |
'''
from a given operator, looking to project the operator into the constant number
space
'''
from hqca.tools import *
import numpy as np
import sys
from copy import deepcopy as copy
from hqca.operators import *
import scipy as sp
class ConstantNumberProjection:
def __init__(self,op,transform,verbose=False):
... |
import numpy as np
from bokeh.layouts import row
from bokeh.plotting import figure, output_file, show
N = 1000
x = np.random.random(size=N) * 100
y = np.random.random(size=N) * 100
radii = np.random.random(size=N) * 1.5
colors = ["#%02x%02x%02x" % (int(r), int(g), 150) for r, g in zip(50+2*x, 30+2*y)]
def make_plot(... |
# Copyright 2018 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 a... |
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
#from flask_httpauth import HTTPBasicAuth
from led2 import *
#from temp2 import *
import os, subprocess
from subprocess import Popen, PIPE
app = Flask(__name__, static_url_path = "")
@app.errorhandler(400)
def not_found(error)... |
#
# Copyright (c) 2020, Neptune Labs Sp. z o.o.
#
# 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 agr... |
""" VLC Player module """
import os
import logging
import time
import random
import pafy
import vlc
from susi.hwmixer import mixer
import urllib.parse
import requests
import xml
#
# we have two mixers available
# - software mixer via python-vlc
# - hardware mixer via hwmixer/mixer which controls Master only
# The t... |
from apps.fifth_edition.models import AbilityScore, Spellcasting
from django.test import TestCase
from rest_framework.test import APIClient
class TestSpellcastingViewPOST(TestCase):
"""
Test class to verify functionality of the SpellcastingViewPOST API view.
"""
def setUp(self):
"""
M... |
# coding: utf-8
# /*##########################################################################
#
# Copyright (C) 2016-2018 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... |
import logging
from asyncio import iscoroutinefunction, Future
from typing import Iterable, Type, TYPE_CHECKING
from aiohttp import web, web_response
from posixpath import join as urljoin
from slim.base.ws import WSRouter
from ..utils.async_run import sync_call, async_call
if TYPE_CHECKING:
from .view import BaseV... |
from .auth import PixivAuth
from .login_response_types import (
LoginCred,
LoginInfo,
LoginUserInfo,
OAuthAPIResponse,
PixivLoginFailed,
ProfileURIs,
)
from .selenium import (
AUTH_TOKEN_URL,
CALLBACK_URI,
CLIENT_ID,
CLIENT_SECRET,
LOGIN_URL,
REDIRECT_URI,
REQUESTS_KW... |
# Copyright 2018 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
"""
sentry.utils.safe
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging
import six
from django.conf import settings
from django.db import transaction
from... |
def xs_count(acq_time:int = 1, num_frames:int =1):
yield from bps.mv(xs.settings.acquire, 0)
yield from bps.mv(xs.settings.erase,1)
yield from bps.mv(xs.settings.trigger_mode,1)
yield from bps.mv(xs.settings.acquire_time,acq_time)
yield from bps.mv(xs.settings.num_images, num_frames)
yield fro... |
import time
# 3rd party
from nose.tools import eq_, ok_
from django.core.cache import caches
# testing
from .utils import DjangoTraceTestCase, override_ddtrace_settings
from ...util import assert_dict_issuperset
class DjangoCacheWrapperTest(DjangoTraceTestCase):
"""
Ensures that the cache system is properly... |
import FWCore.ParameterSet.Config as cms
l1emulator = cms.Sequence()
from SimCalorimetry.HcalTrigPrimProducers.hcaltpdigi_cff import *
from CalibCalorimetry.CaloTPG.CaloTPGTranscoder_cfi import *
from L1Trigger.L1THGCal.hgcalTriggerPrimitives_cff import *
l1emulator += hgcalTriggerPrimitives
from SimCalorimetry.Eca... |
from __future__ import print_function, unicode_literals
import json
import sys
from type_alias import create_type_alias, find_type_aliases, find_union_types
from decoder import create_decoder, create_encoder, create_union_type_decoder, create_union_type_encoder
from helpers import *
def test():
testJson = """... |
import json
import os
import tempfile
import shutil
import importlib
from typing import Optional
import docker
from notebook.base.handlers import IPythonHandler, APIHandler, HTTPError
from notebook.utils import url_path_join
from pigar.core import parse_packages
from ..container.creator import ContainerCreator
from ... |
#!/usr/bin/env python3
from cereal import car
from selfdrive.config import Conversions as CV
from selfdrive.car.hyundai.values import Ecu, ECU_FINGERPRINT, CAR, FINGERPRINTS, Buttons, FEATURES
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, is_ecu_disconnected, gen_empty_fingerprint
fro... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
mslib.mswms.mswms
~~~~~~~~~~~~~~~~~
The module can be run with the Python Flask framework and can be run as
python mswms.py.
:copyright: Copyright 2016 Reimar Bauer
:copyright: Copyright 2016-2020 by the mss team, see AUTHORS.
:license: AP... |
from tests.package.test_lua import TestLuaBase
class TestLuaLuaGD(TestLuaBase):
config = TestLuaBase.config + \
"""
BR2_PACKAGE_LUA=y
BR2_PACKAGE_LUA_GD=y
BR2_PACKAGE_FONTCONFIG=y
BR2_PACKAGE_JPEG=y
BR2_PACKAGE_LIBPNG=y
"""
def test_run(self):
s... |
## 104. Maximum Depth of Binary Tree(EASY)
##
## Given a binary tree, find its maximum depth.
##
## The maximum depth is the number of nodes along the
## longest path from the root node down to the farthest leaf node.
class Solution(object):
def maxDepth(self, root):
"""
:type root: TreeNode
... |
# Copyright 2018 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... |
"""STK500v2 protocol implementation for programming AVR chips.
The STK500v2 protocol is used by the ArduinoMega2560 and a few other
Arduino platforms to load firmware.
"""
__copyright__ = 'Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License'
import os
import struct
import sys
import time
from... |
from sanic import response,Blueprint
user_views = Blueprint('v1_users', url_prefix='/users')
@user_views.route("/")
def home(request):
products = [{"user":123}]
return response.json(products)
|
# coding: utf-8
from django.test import TestCase
from corehq.apps.users.models import WebUser
from corehq.apps.domain.shortcuts import create_domain
from django.test.client import Client
from django.core.urlresolvers import reverse
import os
from couchforms.dbaccessors import get_forms_by_type, clear_forms_in_domain
fr... |
from const.color import Color
from component.component import Component
from logcat.logcat import LogCat
class Button(Component):
@LogCat.log_func
def __init__(self, x:int, y: int, text: str):
super().__init__(x, y, 6)
self._place_holder = ' ' * 6
self._text = text
@LogCat.log_f... |
# -*- coding: utf-8 -*-
#
# 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 writing, software... |
# -*- coding: utf-8 -*-
"""
modules of info class, including cashinfo, indexinfo and fundinfo class
"""
import os
import csv
import datetime as dt
import json
import re
import logging
from functools import lru_cache
import pandas as pd
from bs4 import BeautifulSoup
from sqlalchemy import exc
import xalpha.remain as ... |
"""
Unit test for the data check endpoint
"""
# Import from libraries
import json
# Import from internal modules
from cornflow.models import ExecutionModel, InstanceModel
from cornflow.tests.const import (
INSTANCE_PATH,
EXECUTION_PATH,
EXECUTION_URL_NORUN,
DATA_CHECK_URL_NORUN,
INSTANCE_URL,
)
fr... |
"""__version__.py
Versioning only.
This file contains not functions.
"""
__version__ = '0.1.0' |
import numpy as np
import json
from collections import Counter
import utils.qonversion_tools as qonvert
import utils.bit_tools as bit
import utils.linalg_tools as la
import itertools
from copy import deepcopy
# Qiskit libraries
from qiskit_nature.operators.second_quantization.fermionic_op import FermionicOp
from qiskit... |
from django import forms
from django.forms import fields, widgets
from.models import Register
from django.contrib.auth.models import User
from .models import Profile
class LoginForm(forms.Form):
username = forms.CharField(label="Kullanıcı Adı")
password = forms.CharField(label="Şifre",widget=forms.PasswordInpu... |
#!/usr/bin/env python
# -*- encoding: UTF-8 -*-
# Battleship Game Server
# Abel Castilla Rodríguez, Alejandro Muñoz Del Álamo, Damián Nimo Járquez
# Copyright © 2016
# ---------------------------------------1. Bibliotecas---------------------------------------
# Librerías para la comunicación TCP/IP
impo... |
#!/usr/bin/env python3
import subprocess
import os
import sys
import json
sys.path.append("../")
sys.path.append("../../system/lib/")
sys.path.append("../array/")
import json_parser
import pos
import cli
import api
import pos_constant
import volume
import CREATE_VOL_BASIC_1
import CREATE_VOL_BASIC_2
import CREATE_VOL_... |
SECONDS_BUFFER = 5
MIN_FILES = 5
NUM_LABELS = 100
CROP_SIZE = 512
CUTOFF_SCORE = 0
FPS = 30
CATEGORY = ["paper", "plastic", "compost", "trash"]
CURRENT_BIN = "recycle"
SAVE_FILE = "data"
PRINT = False
SAVE = False |
import datetime
import logging
import os
import pickle
import functools
import sys
import numbers
import time
import numpy as np
import pandas as pd
import qutip
from src.utils import ground_state
import src.protocol_ansatz as protocol_ansatz
class TimeDependentHamiltonian:
def __init__(self, model_parameters):... |
# encoding: utf-8
from django.contrib.auth.models import User
from django.db import models
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from knesset.utils import get_thousands_string
import logging
logger = logging.getLogger(... |
#!/usr/bin/env python3
# -*- coding=utf-8 -*-
def print_scores(**kw):
print(' Name Score')
print('------------------')
for name,score in kw.items():
print('%10s %d' % (name, score))
print()
print_scores(Adam=99,Lias=88,Bart=77)
data = {
'Adam Lee': 99,
'Lisa S': 88,
'F.Bart... |
from setuptools import setup
version = '0.2'
setup(
name='avel',
version=version,
description='Python ffmpeg wrapper for audio and video editing (trim, subtitles/overlay, concat, merge, & more!)',
license='MIT',
author='evliang',
packages=['avel'],
classifiers=[
'Intended Audience :... |
"""Class to check attributes read from the AWS S3."""
import datetime
import re
class Checker:
"""Class to check attributes read from the AWS S3."""
def __init__(self):
"""Initialize the checker."""
pass
def check_attribute_presence(self, node, attribute_name):
"""Check the attr... |
import random
import warnings
from collections.abc import Sequence
from distutils.version import LooseVersion
import cv2
import mmcv
import numpy as np
from torch.nn.modules.utils import _pair
from ..builder import PIPELINES
from .formating import to_tensor
def _combine_quadruple(a, b):
return (a[0] + a[2] * b[... |
import os
import sys
import logging
import unittest
from mock import Mock, patch
import predix.security.uaa
class TestUAA(unittest.TestCase):
def setUp(self):
self.uaa_uri = 'https://1234.predix-uaa.run.aws-usw02-pr.ice.predix.io'
os.environ['PREDIX_SECURITY_UAA_URI'] = self.uaa_uri
def te... |
import datetime
import logging
import time
try:
import ipaddress
ip_address = ipaddress.ip_address
ip_type = ipaddress._BaseAddress
except ImportError:
import ipaddr
ip_address = ipaddr.IPAddress
ip_type = ipaddr._BaseIP
import six
from ircu import consts
class Numeric(object):
_length ... |
import torch.nn.functional as F
import torch.nn as nn
import torch
import torch.optim as optim
import numpy as np
import math
from torch.nn import init
from torch.distributions.normal import Normal
class Flatten(nn.Module):
def forward(self, input):
return input.view(input.size(0), -1)
class CnnActorCrit... |
"""
## w3act_data.py
Tasks handling the W3ACT database and data exports.
"""
import json
import os
from airflow.decorators import task
from airflow.utils.decorators import apply_defaults
from airflow.utils.dates import days_ago
from airflow.operators.bash import BashOperator
from airflow.providers.ssh.ope... |
from flask import current_app as server
from functools import wraps
from colour import Color
import ast
import os
import sqlalchemy as sa
from pathlib import Path
def get_url(path):
"""Expands an internal URL to include prefix the app is mounted at"""
return "{}{}".format(server.config['ROUTES_PATHNAME_PREFIX... |
# Third Party (PyPI) Imports
import requests
# HTK Imports
from htk.lib.esv.constants import *
def esvapi_get_passage(passage, key='IP', archive=False):
params = {
'key' : key,
'passage' : passage,
'include-footnotes' : 0,
'include-footnote-links' : 0,
'include-copyright' ... |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
# Point export_dir to the folder you will be keeping your module
# Make sure you use forward slashes (/) and NOT backward slashes (\)
export_dir = "../"
#export_dir = "C:/Program Files/Mount&Blade/Modules/Native/"
|
from __future__ import absolute_import, division, print_function
class Test(object):
def __init__(self):
pass
def run(self):
from iotbx.xds import xparm
import os
import libtbx.load_env
from libtbx.test_utils import open_tmp_file
iotbx_dir = libtbx.env.dist_path('iotbx')
filename = ... |
from abc import ABC, abstractmethod
class StudentTaxes(ABC):
def __init__(self, name, semester_tax, average_grade):
self.name = name
self.semester_tax = semester_tax
self.average_grade = average_grade
@abstractmethod
def get_discount(self):
pass
class ExcellentStudent(St... |
# This file is automatically generated by the rmf-codegen project.
#
# The Python code generator is maintained by Lab Digital. If you want to
# contribute to this project then please do not edit this file directly
# but send a pull request to the Lab Digital fork of rmf-codegen at
# https://github.com/labd/rmf-codegen
... |
"""Tasks and utility functions and classes for working with project
documentation."""
import re
from paver.easy import *
try:
import sphinx
has_sphinx = True
except ImportError:
has_sphinx = False
def _get_paths():
"""look up the options that determine where all of the files are."""
opts = optio... |
galera = [['João', 19], ['Ana', 33], ['Joaquim', 13], ['Maria', 45]]
#criar uma lista.
for p in galera:
print(p) |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RoctracerDev(CMakePackage):
"""ROC-tracer library: Runtimes Generic Callback/Activity API... |
#!/usr/bin/python
#########
# GLOBALS
#########
import os
import sys
import json
from datetime import datetime, timedelta
from crontab import CronTab
# Local
from retriever import retrieve
from trader import make_prediction, make_trade, allocate_funds, TradingClient
DIR_PATH = os.path.dirname(os.path.abspath(__fil... |
# Need Python 3 string formatting functions
from __future__ import print_function
from threading import Thread
import ttfw_idf
# Define tuple of strings to expect for each DUT.
master_expect = ("TWAI Master: Driver installed", "TWAI Master: Driver uninstalled")
slave_expect = ("TWAI Slave: Driver installed", "TWAI S... |
"""
Wireless BlueROV2 control.
This is the receiver which decodes the message from the Water Linked modem and
sends MavLink messages to control a BlueROV2.
"""
from __future__ import print_function, division
import time
import struct
import sys
from wlmodem import WlModem
from pixhawk import Pixhawk
def byte_to_but... |
import itertools
import math
from copy import copy
from django.core.exceptions import EmptyResultSet
from django.db.models.expressions import Func, Value
from django.db.models.fields import DateTimeField, Field, IntegerField
from django.db.models.query_utils import RegisterLookupMixin
from django.utils.functional impo... |
# -*- coding: utf-8 -*-
#
# 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.0
#
# Unless required by applicable ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# questioner documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# ... |
'''
Problem 36
31 January 2003
The decimal number, 585 = 1001001001 (binary), is palindromic in both bases.
Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2.
(Please note that the palindromic number, in either base, may not include leading zeros.)
-------------... |
# Generated from C.g4 by ANTLR 4.7.1
from antlr4 import *
if __name__ is not None and "." in __name__:
from .CParser import CParser
else:
from CParser import CParser
## @file
# The file defines the parser for C source files.
#
# THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.
# This file is gen... |
from typing import Callable, Optional
import numpy as np
import torch
try:
from image_dataset_viz import render_datapoint
except ImportError:
raise RuntimeError("Install it via pip install --upgrade git+https://github.com/vfdev-5/ImageDatasetViz.git")
def tensor_to_numpy(t: torch.Tensor) -> np.ndarray:
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import widgy.contrib.form_builder.models
class Migration(migrations.Migration):
dependencies = [
('form_builder', '0001_initial'),
]
operations = [
migrations.AlterField(
... |
#!/usr/bin/env python
""" Package setup/installation and metadata for lambdata
"""
import setuptools
REQUIRED = [
"numpy",
"pandas"
]
with open("README.md", "r") as fh:
LONG_DESCRIPTION = fh.read()
setuptools.setup(
name="lambdata-shreyasjothish",
version="0.0.7",
author="shreyasjothish",
... |
# -*- coding: utf-8 -*-
#
# Copyright 2018-2019 Data61, CSIROß
#
# 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... |
#
# Copyright 2016-2021 Razorbill Instruments Ltd.
# This file is part of the Razorbill Lab Python library which is
# available under the MIT licence - see the LICENCE file for more.
#
"""
Module for interfacing with Keysight products
"""
from . import ScpiInstrument, _scpi_property
class E4980A(ScpiInstrument):
... |
__version__ = '6.2.50 f.LUM'
|
"""Example to evaluate WAV files"""
import sys
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser, FileType
from pathlib import Path
from scipy.io import wavfile
# This is to make the local vibromaf package available
try:
sys.path.append(str(Path(__file__).absolute().parents[1]))
except IndexErro... |
# 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 ... |
"""
A simple HTTP interface for making GET, PUT and POST requests.
"""
import http.client
import json
from urllib.parse import urlparse
from base64 import b64encode
from functools import partial
from collections import namedtuple
Response = namedtuple("Response", ("payload", "headers", "status", "is_json"))
def req... |
codon = {'ttt': 'F', 'tct': 'S', 'tat': 'Y', 'tgt': 'C',
'ttc': 'F', 'tcc': 'S', 'tac': 'Y', 'tgc': 'C',
'tta': 'L', 'tca': 'S', 'taa': '*', 'tga': '*',
'ttg': 'L', 'tcg': 'S', 'tag': '*', 'tgg': 'W',
'ctt': 'L', 'cct': 'P', 'cat': 'H', 'cgt': 'R',
'ctc': 'L', 'ccc': 'P', 'c... |
"""
Regularized Discriminant Analysis
"""
import warnings
import numpy as np
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.covariance import ledoit_wolf, empirical_covariance
from sklearn.covariance import shrunk_covariance
from sklearn.utils import check_array, check_X_y
from sklearn.utils.va... |
import sys
with open('input.txt', 'r') as reader:
earliest = int(reader.readline())
ids = [i for i in reader.readline().strip().split(',')]
def part1():
# depart = min((id * (earliest // id) + 1) for id in ids)
min = sys.maxsize * 2
for id in ids:
if id == 'x':
continue
... |
import os
import time
import pickle
import datetime
from keras.callbacks import TensorBoard, ModelCheckpoint, EarlyStopping
from dfi.test import test
from dfi.data import load_data
from dfi.utils import reset_seeds
def train(model, hparams, session_name: str = None):
reset_seeds(hparams.training.seed)
star... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.