text stringlengths 3.07k 22.1k |
|---|
#!/usr/bin/env python3
import sys
import math
def main(argv):
if len(argv) < 2:
print("Expected filename", file=sys.stderr)
sys.exit(1)
lexer = Lexer(argv[1])
try:
code = []
parse_program(code, lexer)
evaluate(code)
except SyntaxError as e:
print(e.messa... |
import logging
import random
import sqlalchemy
from .. import config, model, util
def rand_map_size():
# Pick map size. Duplicate entries are used to weight the
# probability of a particular size
map_sizes = [80, 80, 88, 88, 96, 96, 96, 104, 104, 104, 104,
112, 112, 112, 120, 120, 128, ... |
import logging
import threading
from collections import defaultdict
from concurrent.futures.thread import ThreadPoolExecutor
import dbus
import dbus.mainloop.glib
from pybtp.utils import wait_futures
from testcases.utils import EV_TIMEOUT
BLUEZ_SERVICE = "org.bluez"
ADAPTER_INTERFACE = BLUEZ_SERVICE + ".Adapter1"
D... |
import isp_utils
import os
import argparse
import logging
import multiprocessing
import pexpect
import subprocess
import sys
import time
sys.path.append(os.path.join(isp_utils.getIspPrefix(), "runtime"))
import isp_load_image
import isp_pex_kernel
logger = logging.getLogger()
isp_prefix = isp_utils.getIspPrefix()
f... |
#!/usr/bin/python3
# Copyright (c) 2019, SCALE Lab, Brown University
# 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.
import yaml
import os
import subprocess
import sys
import timeit
import re
import random
impor... |
import subprocess
from distutils.dir_util import copy_tree
import time
import h5py
import os
import numpy as np
from scipy.integrate import quad
from pymooIN import *
# from exectBatch import execSims
def runGen(x, gen):
global genDir, n_ind
n_ind = len(x)
genDir = './gen%i' % gen
###################... |
from typing import List, Optional
from collections import defaultdict
from uuid import uuid4
from fastapi import APIRouter, Depends, Header, Body, BackgroundTasks
from sqlalchemy.orm import Session
from sqlalchemy import insert, and_, or_
from starlette.requests import Request
from starlette.responses import JSONRespon... |
# '''Trains a memory network on each of the 2 bAbI datasets.
# References:
# - <NAME>, <NAME>, <NAME>, <NAME>, <NAME>,
# "Towards AI-Complete Question Answering: A Set of Prerequisite Toy Tasks",
# http://arxiv.org/abs/1502.05698
# - <NAME>, <NAME>, <NAME>, <NAME>,
# "End-To-End Memory Networks",
# http:... |
# -*- coding: utf-8 -*-
""".. moduleauthor:: <NAME>"""
import math
from copy import deepcopy
from pathlib import Path
from typing import Dict, List, Tuple, Optional, final, Iterable
from dataclasses import dataclass
import numpy as np # type: ignore
import seaborn as sns # type: ignore
import pandas as pd # type: i... |
#!/usr/bin/python
import numpy as np
import elements
def findAllBonds( atoms, Rcut=3.0, RvdwCut=0.7 ):
bonds = []
bondsVecs = []
ps = atoms[:,1:]
iatoms = np.arange( len(atoms), dtype=int )
Rcut2 = Rcut*Rcut
for i,atom in enumerate(atoms):
p = atom[1:]
dp = ps - p
... |
#TecnoGeppetto
# esercizio construire una rubrica semplice con i dizionari
# Aggiunto la funzione di salvataggio con Shelve (Pickle)
# ed iniziato a progettae l'accesso ai file con PeeWee.
# elemento test di rubrica = [{'nome': 'Paolo', 'cognome': 'White', 'telefono': "['772321', '888888']", 'indirizzo': 'via versi ... |
import csv
from datetime import datetime, timedelta
from haralyzer import HarPage
from urllib.parse import urlparse
from prettytable import from_csv, PrettyTable
class HarFileData:
"""
Data Structure of the information extracted from the HarFile
"""
page_url = ""
log_entries = []
har_page = No... |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
from collections import Counter
import os
from math import log2
from random import randint
def train_count(path):
""" Extracts training data from corresponding files. """
vocab = set()
legit_terms = Counter() # counter for number of each term ... |
import os
import pickle
import time
from threading import Thread
from IPython.display import display, Markdown, clear_output
import ipywidgets as widgets
import matplotlib.pyplot as plt
import numpy as np
import torch
import gym
import gym_deepracer
from ppo import MLP, Actor, ConvNetwork, ppo
abs_path = os.path.dir... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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... |
#!/usr/bin/python
from datetime import datetime
from errno import EINVAL
from imp import load_source
from json import dump
from os import chmod, mkdir, stat
from os.path import dirname, join, isdir, isfile, realpath
from re import search
from sys import exc_info, version_in... |
# _*_ coding: UTF-8 _*_
import time
import json
import main
from openpyxl import Workbook, load_workbook
from openpyxl.utils import get_column_letter
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebD... |
from enum import Enum
from typing import Dict, List
from boa3.model.builtin.interop.blockchain import *
from boa3.model.builtin.interop.contract import *
from boa3.model.builtin.interop.contract.contractmanifest import *
from boa3.model.builtin.interop.crypto import *
from boa3.model.builtin.interop.iterator import *
... |
# Copyright (c) 2016 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to the S... |
# (c) 2012-2019, Ansible by Red Hat
#
# This file is part of Ansible Galaxy
#
# Ansible Galaxy is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by
# the Apache Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
... |
#! /usr/bin/env python
"""
Extract and compare parameters from two ULog files
"""
from __future__ import print_function
import argparse
import sys
import re
from html import escape
from .core import ULog
#pylint: disable=unused-variable, too-many-branches
def get_defaults(ulog, default):
""" get default params ... |
#coding:utf-8
#Created by weimi on 2018/3/8.
# 随机生成迷宫
def random_maze(n, m, max_height=0):
import random
maze = []
# 记录 格子 所在的区域 标记 初始为自己
grid_map_key = {}
global_map = {}
for i in range(n):
arr = []
for j in range(m):
# (向右的墙壁, 向下的墙壁, 格子高度) 0 为不通
arr.app... |
import os
import json
import uuid
import subprocess
import urllib
from multiprocessing import Process
import functools
import logging
import sys
import time
from six import iteritems
from cwltool.main import load_job_order
from argparse import Namespace
from wes_service.util import WESBackend
from wes_service.errors i... |
"""
Copyright (c) 2022 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 required by applicable law or agreed to in writin... |
import argparse
import os
import random
import shutil
import time
import numpy as np
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
from torch.utils.data import DataLoader
from torchvision import transforms
from data import TrashDataset
import resnet... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, <NAME> <<EMAIL>>
# (c) 2021, <NAME> <<EMAIL>>
# 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: cpanm... |
from time import sleep
from datetime import datetime
from socket import socket, timeout
from threading import Thread
from argparse import ArgumentParser
import logging
class Master:
def __init__(self, address: str = "", port: int = 50000):
self.server_address = address
self.server_port ... |
#!/usr/local/bin/python3
#
#
#
# THE CODE IN THIS PYTHON SCRIPT IS NOT WRITTEN BY ME
# I ARRANGED AN ALREADY EXISTING SCRIPT FROM:
# https://github.com/BOHRTECHNOLOGY/quantum_tsp
#
#
#
import itertools
import time
import os
import csv
import numpy as np
import sys
from datetime import datetime, timedelta
f... |
import random
import torch
import numpy as np
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
from torchvision.datasets import CIFAR10
from tensorflow import keras
from torch.utils.data import Dataset, DataLoader
from utils.tools import setup_seed
import matplotlib.pyp... |
"""
<NAME>
https://github.com/aashutoshrathi/
Testcase Generator for HackerRank, HackerEarth and CodeChef
Usage: Run 'python tc_gen.py' and follow the prompt to select
language and platform for testcase generation.
To change input file logic, go to the line with the comment
"# Input area will start here" and ... |
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
""" Demo of using ParkNet 3D parking detector to detect salient locations from a point cloud.
"""
import os
import sys
import numpy as np
import argparse
import importlib
import time
import open... |
"""Author: <NAME>, Copyright 2019
Loads images from the conceptual captions dataset and trains a show and tell model."""
import tensorflow as tf
import pickle as pkl
import os
import time
import numpy as np
import itertools
from tensorflow.contrib.slim.python.slim.nets.resnet_v2 import resnet_v2_101
from t... |
import threading
import time
import re
import logging
from multiprocessing.pool import ThreadPool, TimeoutError
from tests.common.errors import RunAnsibleModuleFail
from collections import deque
logger = logging.getLogger(__name__)
# SSH defines
SONIC_SSH_PORT = 22
SONIC_SSH_REGEX = 'OpenSSH_[\\w\\.]+ Debian'
REBOO... |
# -*- coding: utf-8 -*-
# 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... |
# -*- coding: utf-8 -*-
"""
tox._quickstart
~~~~~~~~~~~~~~~~~
Command-line script to quickly setup tox.ini for a Python project
This file was heavily inspired by and uses code from ``sphinx-quickstart``
in the BSD-licensed `Sphinx project`_.
.. Sphinx project_: http://sphinx.pocoo.org/
L... |
import numpy as np
import scipy.integrate
def test_outlier(out, asd, edge_thresh, over_thresh, tw_mean, tw_std):
#checks whether an outlier is an actual outlier or not. out is of class .outlier.outlier
#asd is of class .density.approximate_esd
# function returns a Boolean whether an outlier or not, and ret... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""A modu... |
#!/usr/bin/env python
# PROGRAM: sst_lat_l3u_l4.py
# ----------------------------------------------------------------------------------
# Version 0.3
# 13 July, 2019
# michael.taylor AT reading DOT ac DOT uk
import os
import os.path
import glob
from optparse import OptionParser
import numpy as np
import xarray
impo... |
"""scrapli.driver.generic.base_driver"""
import re
from typing import (
TYPE_CHECKING,
Any,
Awaitable,
Callable,
Coroutine,
List,
Optional,
Pattern,
Tuple,
Union,
)
from scrapli.exceptions import ScrapliTypeError
from scrapli.helper import resolve_file
from scrapli.response impo... |
import io
import json
import inspect
from importlib.util import spec_from_file_location, module_from_spec
from conf import get_fullname
import os
import sys
import subprocess
from contextlib import redirect_stdout
from flask import Flask
from flask import request
from flask import jsonify
import core.simulate
from co... |
# Copyright 2009 <NAME> (wtwf.com) All rights reserved.
__author__ = 'wtwf.com (<NAME>)'
import datetime
import json
import logging
import os
import rfc822
import time
import urlparse
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from ... |
'''Utility functions for icnn.
Author: <NAME> <<EMAIL>>
'''
import numpy as np
import PIL.Image
import scipy.io as sio
import scipy.ndimage as nd
from scipy.misc import imresize
def img_preprocess(img, img_mean=np.float32([104, 117, 123])):
'''convert to Caffe's input image layout'''
return np.float32(np.t... |
"""Code to generate edge dislocations/singularities in lattices"""
import numpy as np
import dask.array as da
import itertools as itert
from skimage.feature import peak_local_max
from scipy.interpolate import RectBivariateSpline
from scipy.optimize import minimize
from latticegen.transformations import (
rotate,
... |
#############################################################################
# Copyright (c) 2018, Voila Contributors #
# Copyright (c) 2018, QuantStack #
# #
# Distri... |
"""Functions to generate EEG(-like) data for testing and development.
Generators are used by a Producer to stream the data at a given frequency.
"""
import time
import unittest
from bcipy.acquisition.client import DataAcquisitionClient, CountClock
from bcipy.acquisition.processor import Processor, NullProcessor
from b... |
import pandas as pd
import numpy as np
import os
import tensorflow as tf
#from utils import build_vocab_files, show_group_stats_viz, aggregate_dataset, preprocess_df, df_to_dataset, posterior_mean_field, prior_trainable
####### STUDENTS FILL THIS OUT ######
#Question 3
def reduce_dimension_ndc(df, ndc_df):
'''
... |
# coding=utf-8
# Copyright 2020 The SimCLR Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
import argparse
import logging
from keras.models import Sequential
from keras.layers import *
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
import xarray as xr
# ----------------------------------------------------------------------------------------------------------------------
# set up a basic... |
import collections
import logging
import numpy as np
logger = logging.getLogger(__name__)
class RunMode:
NSTEPS='nsteps'
TRAJ='traj'
class Runner:
def __init__(self, env, agent, step=0, nsteps=None,
run_mode=RunMode.NSTEPS, record_envs=None, info_func=None):
self.env = env
... |
import torch
import sys
import seaborn
from torch.autograd import Variable
from Batch import Batch
from Optim import NoamOpt, LabelSmoothing
from Model import make_model
from Train import run_epoch, greedy_decode, beam_search_decode,SimpleLossCompute
from Dataloader import DataLoader_char, DataLoader_token
from HyperPa... |
#
# Copyright (c) 2019 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 required by applicable law or ... |
import sys
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import mock
from pandas_ply.symbolic import Call
from pandas_ply.symbolic import GetAttr
from pandas_ply.symbolic import Symbol
from pandas_ply.symbolic import eval_if_symbolic
from pandas_ply.symbolic import sym_call
f... |
#!/usr/bin/python3
# Can user retrieve reward after a time cycle?
def test_get_reward(multi, base_token, reward_token, alice, issue, chain):
amount = 10 ** 10
init_reward_balance = reward_token.balanceOf(alice)
base_token.approve(multi, amount, {"from": alice})
multi.stake(amount, {"from": alice})
... |
# encoding = utf-8
import re
import os
import sys
import time
import json
import copy
import requests
import datetime
import traceback
LP_CHECKPOINT_KEY = 'LastPass_folders'
CMD_KEY = 'getsfdata'
CMD_KEY = 'getdetailedsfdata'
PAGE_SIZE = 2000
USER_EV_LIMIT = 50
CHECKPOINT_SAVE_LIMIT = 100
'''
IMPORTANT
Edit... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Edgewall Software
# Copyright (C) 2008 <NAME>
# Copyright (C) 2009-2010 <NAME>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://tra... |
from .models import Session, UserProfile, TimeZone, UserQuestion, UserQuestionAnswer, UserQuestionPossibleAnswer, migrate_google_openid_user
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.db import transaction
from django.http import HttpResponse, HttpRespo... |
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from os import walk
import sys
import os
import math
from matplotlib.ticker import AutoMinorLocator
import fnmatch
def read_file():
'''
This function will take input from the user [e.g. name (half name*) of the file
containing data ('... |
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# https://aws.amazon.com/apache2.0/
#
# or in the "license" fil... |
"""
github cite:
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import os
import glob
import random
import imgaug
from imgaug import augmenters as iaa
from PIL import Image
from tqdm import tqdm
import matplotlib.pyplot... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import cpi
import csv
import pandas as pd
import unittest
import warnings
from click.testing import CliRunner
from datetime import date, datetime
from cpi import cli
from cpi.errors import CPIDoesNotExist
class CliTest(unittest.TestCase):
def invoke(self, *args):
... |
"""This subpackage contains functionality for working with accounts elsewhere.
"""
from __future__ import division, print_function, unicode_literals
from collections import OrderedDict
from datetime import datetime
import hashlib
import json
import logging
from urllib import quote
import xml.etree.ElementTree as ET
f... |
#!/usr/bin/env python2.7
"""
barchart: plot a bar chart of a TSV file of numbers. The file should be a
column of int or text labels and a column of floats, with one value per label.
Re-uses sample code and documentation from
<http://users.soe.ucsc.edu/~karplus/bme205/f12/Scaffold.html>
"""
import argparse, sys, os, ... |
from io import BytesIO, StringIO
from pathlib import Path, PurePath
from lxml import etree as lxml_etree
from .core import initComponent
from .helpers import mergeOutlookConditionnals, json_to_xml, omit, skeleton_str as default_skeleton
from .lib import merge_dicts, AttrDict
def ignore_empty(values):
result = ... |
# 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 use ... |
import os
from options.test_options import TestOptions
from data import create_dataset
from models import create_model
from util.visualizer import save_images
from util import html
import time
from util import util
import numpy as np
import cv2
from matplotlib import pyplot as plt
# To run: python3 /home/mcube/pytorch... |
from html.parser import HTMLParser
from collections import namedtuple
import io
# Read and parse an HTNL document for conversion to ReST.
#
Tag = namedtuple('Tag', ['tag', 'attrs'])
SECTIONS = {
'title': '=',
'h1': '-',
'h2': '`',
'h3': ':',
'h4': "'"
}
class ParseError(ValueError):
... |
# -*- coding: utf-8 -*-
fake = None
def init_faker():
"""
Avoid heavy operations when not in fake mode
"""
global fake
from faker import Faker
fake = Faker('en_GB')
from faker.providers import (date_time, internet, )
fake.add_provider(date_time)
fake.add_provider(internet)
import o... |
#!/usr/bin/env python
"""VFS Handler which provides access to the raw physical memory.
Memory access is provided by use of a special driver. Note that it is preferred
to use this VFS handler rather than directly access the raw handler since this
handler protects the system from access to unmapped memory regions such a... |
#
# Copyright 2016 <NAME> (<EMAIL>)
#
# 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 agree... |
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Make animations of rotating polytopes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This script computes the data of a given polytope and writes it
into a POV-Ray .inc file, then automatically calls POV-Ray
to render the frames and calls FFmpeg to convert the frames to
a mp4 movie. Yo... |
from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import objectpath
from indra.databases import uniprot_client, chebi_client, hgnc_client
from indra.literature import id_lookup
from indra.statements import *
logger = logging.getLogger('ndex_cx_processor')
_stmt_... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
import time
import logging
from contextlib import contextmanager
from datetime import datetime, timedelta
from multiprocessing import Process
from threading import Thread, Lock
from flask import Flask, abort, request
import config
from bot import trello, messages
from bot.models import BoardHook, Session
app = Flask... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) 2019, NVIDIA CORPORATION. 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/lic... |
from django.db import models
from django.db.models import JSONField
from django.utils.html import format_html
from apps.bot.models import Chat, Profile, User
class TimeZone(models.Model):
name = models.CharField("Временная зона UTC", null=True, max_length=30)
class Meta:
verbose_name = "таймзона"
... |
import numpy as np
from GPy.kern import RBF
from GPy.models import SparseGPRegression
from hyperopt import fmin, hp, tpe
from scipy.stats import spearmanr
from sklearn import svm
from sklearn.ensemble import (
GradientBoostingClassifier,
GradientBoostingRegressor,
RandomForestRegressor,
)
from sklearn.linea... |
import numpy as np
import pytest
from numpy.testing import (
assert_array_almost_equal, assert_array_equal,
assert_almost_equal
)
from mne.utils import assert_object_equal
from mne_connectivity import vector_auto_regression, select_order
warning_str = dict(
sm_depr='ignore:Using or importing*.:Deprecatio... |
# -*- coding: utf-8; -*-
from __future__ import unicode_literals
import json
import os
import re
from time import sleep
from sys import stdout
import six
from ipaddress import IPv4Address
from functools import wraps
from . import logger
def annotate(gen):
prev_i, prev_val = 0, gen.next()
for i, val in en... |
import os
import pickle
import enum
from abc import ABC, abstractmethod
from Board import Board
from Dice import Dice
from RuleBook import RuleBook
from Colour import Colour
from Player import PlayerType
from HumanPlayer import HumanPlayer
from ComputerPlayer import ComputerPlayer
from MLPlayer import MLPlay... |
"""
This joins our Axes model to matplotlib.axes.Axes. It is used by
bluesky_widgets.qt.figures and bluesky_widgets.jupyter.figures.
"""
import logging
from .models.plot_specs import Axes, Line, Image
class MatplotlibAxes:
"""
Respond to changes in Axes by manipulating matplotlib.axes.Axes.
Note that wh... |
"""
Copyright 2015, Institute for Systems Biology
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 w... |
#!/usr/bin/env python3
"""build-py-package.py
Build ethereumapis protobuf libraries as a standalone Python package using
setuptools. Includes gRPC libraries for service definitions.
In order to compile the proto files themselves, we use a virtualenv to install
buildtime dependencies and invoke protoc. Protobuf librar... |
# ---------------------------*-python-*----------------------------------------#
# file plotting_help.py
# author <NAME>
# date February 2019
# note Copyright (C) 2019, Los Alamos National Security, LLC.
# All rights reserved.
# -----------------------------------------------------------------------------#... |
from copy import deepcopy
import datetime as dt
from datetime import datetime, timedelta
from netCDF4 import Dataset
import netCDF4 as nc
import numpy as np
import os
import sys
ncWriteFormat = 'NETCDF3_64BIT_OFFSET'
fcHours = os.getenv('fcHours', '0')
intervalHours = os.getenv('intervalHours', '6')
fcNums = os.geten... |
import config
import pandas as pd
import pickle
import numpy as np
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import classification_report
import tensorflow as tf
from keras import Sequ... |
#!/usr/bin/env python
import numpy as np
from scipy.optimize import fmin_cg
from scipy.sparse.linalg import svds
from sklearn.metrics.pairwise import pairwise_distances
class ModelBasedRecommender():
def __init__(self, lambda_=0.1, n_features=20):
self.lambda_ = lambda_
self.n_features = n_featur... |
# ******************************************************************************
# pysimm.apps.random_walk module
# ******************************************************************************
#
# psuedo random walk algorithm written using pysimm tools
#
# *************************************************************... |
"""Contains a class which extracts the needed arguments of an arbitrary
methode/function and wraps them for future usage. E.g correctly choosing
the needed arguments and passing them on to the original function.
"""
import inspect
import copy
import torch
from ..problem.spaces.points import Points
class UserFunct... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# author:owefsad
# software: PyCharm
# project: lingzhi-webapi
import logging
import time
from django.db.models import Q
from dongtai.endpoint import R
from dongtai.endpoint import UserEndPoint
from dongtai.models.agent import IastAgent
from dongtai.models.project_version ... |
from agent.yiteam_final_commit_v7.UTILS.colorful import print亮红
from config import ADDRESS, config, POOL_NUM, ISHOST, XSIM_NUM
from ..env.xsim_env import XSimEnv
from ..env.env_runner import EnvRunner
from time import sleep
from multiprocessing import Pool
import time
# 启动单个XSIM
class BattleRunnerSignal(EnvRunner):
... |
#!/usr/bin/env python3
# -------------------------------------------------------------------------
#
# Part of the CodeChecker project, under the Apache License v2.0 with
# LLVM Exceptions. See LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# ----------------------------... |
# Copyright 2021 DeepMind Technologies Limited
#
# 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... |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2021 beyond-blockchain.org.
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... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
import datetime
import logging
import os
import pandas as pd
from dateutil.parser import parse
import copy
import numpy as np
class Order(object):
def __init__(self, id, standard, small, box, demand, start_time, end_time, load_time, unload_time, start_factory,
end_factory):
self.id = id
... |
import argparse
import json
import torch
from torch import nn
from torch.utils.data import DataLoader
from torch.optim.lr_scheduler import ReduceLROnPlateau, ExponentialLR
from torch.nn.parallel import DistributedDataParallel
import pytorch_lightning as pl
from pytorch_lightning.callbacks import ModelCheckpoint, EarlyS... |
from collections import Counter
from datetime import datetime
import re
import pandas as pd
from bokeh.models import ColumnDataSource, HoverTool
from django.shortcuts import render
from bokeh.embed import components
from bokeh.transform import dodge
from bokeh.plotting import figure, output_file, show
from rma.models i... |
"""Homematic base entity."""
from abc import abstractmethod
from datetime import timedelta
import logging
from homeassistant.const import ATTR_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from .const import (
ATTR_ADDRESS,
ATTR_CHANNEL,
ATTR_INT... |
#!/usr/bin/env python3
# Copyright 2017 <NAME>
# 2018 <NAME>
#
# Apache 2.0.
""" This script generates examples for multilingual training of neural network.
This scripts produces 3 sets of files --
egs.*.scp, egs.output.*.ark, egs.weight.*.ark
egs.*.scp are the SCP files of the traini... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.