text stringlengths 3.07k 22.1k |
|---|
from abc import ABCMeta, abstractmethod
import sys
from math import ceil
from gurobipy import Model, GRB, LinExpr
from .separation import Solution
class KPPBase(metaclass=ABCMeta):
def __init__(self, G, k, verbosity):
self.G = G
self.model = Model()
self.model.modelSense = GRB.MINIMIZE
self.k = k
... |
from sqlite3 import IntegrityError, Row
from riego.db import get_db
import aiohttp_jinja2
from aiohttp import web
from aiohttp_session import get_session
import bcrypt
import secrets
import json
import asyncio
from logging import getLogger
_log = getLogger(__name__)
router = web.RouteTableDef()
... |
#!/usr/bin/env python
#
# Server that will accept connections from a Vim channel.
# Used by test_channel.vim to test LSP functionality.
#
# This requires Python 2.6 or later.
from __future__ import print_function
import json
import socket
import sys
import time
import threading
try:
# Python 3
import socketse... |
from __future__ import absolute_import
from __future__ import unicode_literals
from django.utils.translation import ugettext as _
from corehq.apps.locations.permissions import location_safe
from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumn, NumericColumn
from corehq.apps.reports.filters.sel... |
#!/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.
"""Determine OS and various other system properties.
Determine the name of the platform used and other system properties such as
t... |
# std-lib
from dataclasses import dataclass
from datetime import datetime
from enum import Enum
# type-hints
from typing import Dict, List, Type, TypeVar, Union
# helper function
def timestamp():
return datetime.now().strftime("%Y-%m-%d %H:%M:%S")
#
# Mermaid Dataclasses
#
# Subgraph can contain Subgraph, Node... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Last Update: 2015/06/30 10:53:52
'''Implements a simple log library.
This module is a simple encapsulation of logging module to provide a more
convenient interface to write log. The log will both print to stdout and
write to log file. It provides a more flexible ... |
import os
import json
import pickle
import torch
from pytorch_pretrained_bert import BertTokenizer
from collections import defaultdict
### this file is to convert the raw woz data into the format required for prepross.py
bert=True
bert_type='bert-large-uncased'
tokenizer=BertTokenizer.from_pretrained(bert_type)
def _t... |
# (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import asyncio
from collections import defaultdict
import click
import orjson
from aiohttp import request
from aiomultiprocess import Pool
from packaging.markers import InvalidMarker, Marker
from packagin... |
from beeprint import pp
from plotly import tools
from sklearn.base import clone, BaseEstimator
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import confusion_matrix, precision_score, recall_score, f1_score, precision_recall_curve, roc_curve
from sklearn.model_selection import cross_val_score,... |
# -*- coding: utf8 -*-
import unittest
import sys
import re
import os
import os.path
import time
import multiprocessing
import tempfile
import shutil
import requests.exceptions
import acme.messages
from free_tls_certificates import client
from free_tls_certificates.utils import get_certificate_domains
ACME_SERVER = ... |
#file: printDecorators.py
# prints with ANSI color and also send the message to logger for file logging
from logManager import *
# Print Color Constants
ENDC = '\033[m' # reset to the defaults
TWHITE = '\033[37m'
COLOR_BRIGHT_GREEN = '\033[1;32;40m' # Green Text
COLOR_BRIGHT_RED = '\033[1;31;40m' # B... |
import os
import pickle
import warnings
import platform
import tempfile
import numpy as np
from pytransform3d.rotations import (
q_id, active_matrix_from_intrinsic_euler_xyz, random_quaternion)
from pytransform3d.transformations import (
random_transform, invert_transform, concat, transform_from_pq,
transfo... |
# Copyright (c) 2015 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute,... |
import numpy as np
import onnx
import pytest
import torch
from torch import nn
from onnx.backend.test.case.node.pad import pad_impl
from onnx2pytorch.helpers import to_onnx
from onnx2pytorch.utils import (
is_constant,
get_ops_names,
get_selection,
assign_values_to_dim,
get_activation_value,
ex... |
import os
import random
import re
import torch
import numpy as np
from sklearn.cluster import KMeans
from datasets.lifelong_fewrel_dataset import LifelongFewRelDataset
from datasets.text_classification_dataset import AGNewsDataset, AmazonDataset, YelpDataset, DBPediaDataset, \
YahooAnswersDataset
def batch_enco... |
import csv
import io
import itertools
import json
import re
from collections import defaultdict
import conllu
from chardet import UniversalDetector
from django.db import transaction
from django.conf import settings
from colour import Color
import pyexcel
from rest_framework.renderers import JSONRenderer
from seqeval.m... |
import matplotlib.pyplot as plt
from matplotlib import rcParams, rcParamsDefault
from matplotlib.lines import Line2D
import numpy as np
from automon import AutomonNode
from test_utils.functions_to_monitor import func_inner_product
from experiments.visualization.visualization_utils import get_figsize
from automon.automo... |
import pytest
import raccoon as rc
from raccoon.utils import assert_frame_equal
try:
# noinspection PyUnresolvedReferences
from blist import blist
except ImportError:
pytest.skip("blist is not installed, skipping tests.", allow_module_level=True)
def test_use_blist():
def check_blist():
asse... |
import abc
from collections import OrderedDict
import numpy as np
from gym.spaces import Box
from rlkit.core.eval_util import create_stats_ordered_dict
from rlkit.envs.wrappers import ProxyEnv
from rlkit.core.serializable import Serializable
from rlkit.core import logger as default_logger
class MultitaskEnv(object,... |
"""
A python scripts for generating all batch files for parameter tuning
"""
import shutil
import os
import numpy as np
import itertools
import copy
def mkdir(path):
path = path.strip()
path = path.rstrip("\\")
isExists = os.path.exists(path)
if isExists:
raise ValueError(path + " already exist... |
"""
Description:
This is a simple script to demonstrate Scipy's curve_fit module using a few common mathematical functions.
============================================================================================
License_info:
LCD-Composer is subject to the terms of the MIT license.
"""
__author_... |
# Copyright (C) 2009 Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import boto3
import bottle
import functools
import dataclasses
from dataclasses import dataclass, asdict
from mypy_boto3_dynamodb.service_resource import Table
import typing as t
from enum import Enum
from mypy_boto3_sqs.client import SQSClient
f... |
import json
import logging
import os
import pickle
import numpy as np
import tensorflow.lite as tfl
from bert_serving.client import BertClient
from deeppavlov.models.embedders.elmo_embedder import ELMoEmbedder
from gensim.models import KeyedVectors
from isanlp.annotation import Event, TaggedSpan
from scipy.optimize im... |
import inspect
import logging
import os
import random
import sys
import urllib3
import string
from urllib import parse
from ava.common.constant import HTTP
from ava.common.exception import InvalidFormatException, UnknownKeyException
from ava.parsers.cookie import SimpleCookie, ComplexCookie
from ava.parsers.javascript ... |
#!/usr/bin/env python3
# #############################################################################
# - Pull information from the JHU Covid-19 Dataset
# - * https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_daily_reports
# - Requirements: requests, psycopg2
#
# Note:
# JHU has... |
import os
import sys
import configr
import ccxt
import time
import threading
configs = {}
running = False
# using taker fees as all orders will be placed at market due to complications with
# limit chasing and risk of not being filled. Slippage is negligible as trade sizes will
# be low and only configs using liquid... |
import json
import time
import os
import zmq
class MessagePart:
__slots__ = 'content_type', 'compression_algorithm', 'compression_level', 'payload'
def __init__(self):
for f in ('content_type', 'compression_algorithm', 'payload'): setattr(self, f, '')
self.compression_level = 0
def parse(se... |
import argparse
import copy
import json
import os
from os.path import join
import sys
import matplotlib.image
from tqdm import tqdm
from PIL import Image
import torch
import torch.utils.data as data
import torchvision.utils as vutils
import torch.nn.functional as F
from torchvision import transforms
from AttGAN.data... |
import tkinter
import configparser
import random
import os
import tkinter.messagebox
import tkinter.simpledialog
window = tkinter.Tk()
window.title("minesweeper")
rows = 10
cols = 10
mines = 10
field = []
buttons = []
colors = ['#FFFFFF', '#0000FF', '#008200', '#FF0000', '#000084', '#840000', '... |
# pylama:ignore=E252
import os
import json
from typing import List
from opentrons.config import get_config_index
"""
There will be 3 directories for json blobs to define labware:
- `labware_data`: Definitions live in the `shared-data` project in the
root of the Opentrons/opentrons GitHub repo. These are copied... |
# ===============================================================================
# Copyright 2011 <NAME>
#
# 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/... |
from datetime import date, datetime
import pytz
from django.db import models
from apps.accounts.models import Account
utc = pytz.UTC
def calculate_age(born):
today = date.today()
return today.year - born.year - ((today.month, today.day) < (born.month, born.day))
def busca_valor(idade, conferencia):
v... |
# encoding: utf-8
from __future__ import unicode_literals, absolute_import
import os
import sys
import locale
from itertools import chain
from six import iterkeys, iteritems
from six.moves.configparser import ConfigParser
from .autocomplete import SIMPLE as default_completion, ALL_MODES
from .keys import cli_key_dis... |
import json
import pathlib
import struct
import soundfile
import scipy.signal
import numpy as np
import oddvoices.phonology
def midi_note_to_hertz(midi_note):
return 440 * 2 ** ((midi_note - 69) / 12)
def seconds_to_timestamp(seconds):
minutes = int(seconds / 60)
remaining_seconds = seconds - minutes * ... |
"""Static type checking helpers"""
from abc import ABCMeta, abstractmethod, abstractproperty
import inspect
import sys
import re
__all__ = [
# Type system related
'AbstractGeneric',
'AbstractGenericMeta',
'Any',
'Dict',
'Generic',
'GenericMeta',
'IO',
'List',
'Match',
'Pat... |
from flask import Flask, render_template, request, redirect, session
from flask_bcrypt import Bcrypt
import psycopg2
import psycopg2.extras
from psycopg2 import Error
import os
import re
import random
import string
import uuid
import json
import hashlib
app = Flask(__name__)
bcrypt = Bcrypt(app)
DATABASE_URL = os.en... |
#!/usr/bin/env python
import os
import unittest
if os.environ.get('KS_DEBUG') and os.environ.get('KS_DEBUG') != 'false':
from ks_primitives import *
else:
from ks_primitives_unchecked import *
class ByteTest(unittest.TestCase):
def test_equality(self):
self.assertEqual(Byte.zero(), Byte.zero(), '0 == 0')
... |
from __future__ import print_function
# bustersAgents.py
# ----------------
from builtins import str
from builtins import range
from builtins import object
import util
from game import Agent
from game import Directions
from keyboardAgents import KeyboardAgent
import inference
import busters
class NullGraphics(object)... |
import itertools
from partsdb import PartsDB
from tables import *
from sqlalchemy.schema import DropTable
from sqlalchemy.ext.compiler import compiles
from sqlalchemy import or_
from Bio import SeqIO
from Bio.SeqFeature import SeqFeature, FeatureLocation
import json
@compiles(DropTable, "postgresql")
def _compile_... |
import asyncio
import json
import os
from http.client import HTTPConnection
from urllib.parse import quote
import pytest
from tornado.websocket import websocket_connect
PORT = os.getenv('TEST_PORT', 8888)
TOKEN = os.getenv('JUPYTER_TOKEN', 'secret')
def request_get(port, path, token, host='localhost'):
h = HTTPC... |
#!/usr/bin/env python
# coding: utf-8
import os
import sys
import pandas as pd
import numpy as np
import tqdm
import wandb
import argparse
from torchtext.vocab import Vectors
from torchtext.data import get_tokenizer
import torch
from torch.utils.data import Dataset, DataLoader
from torch import nn, optim
import torc... |
import json
from woodwork import logical_types
from .binary_classification_pipeline import BinaryClassificationPipeline
from .multiclass_classification_pipeline import (
MulticlassClassificationPipeline
)
from .regression_pipeline import RegressionPipeline
from .time_series_classification_pipelines import (
T... |
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: <EMAIL>
# Maintained By: <EMAIL>
import datetime
from abc import ABCMeta, abstractmethod
from ggrc_workflows.services.workflow_cycle_calculator.go... |
#!/usr/bin/python
"""
Author: <NAME>, <EMAIL>
Salt tcpdumper to visualize whats happening network-wise on
the salt-master. It uses pcapy and inspects all incoming networks
packets and filters only the ones relevant to salt-communication.
based on: http://oss.coresecurity.com/projects/pcapy.html
$ salt-tcpdump.py -n ... |
import serial
import time
import thread
import sys
# ============================= Variables ==================================
global pid_p_gain_roll, pid_i_gain_roll, pid_d_gain_roll
pid_p_gain_roll = 0.45; #Gain setting for the roll P-controller
pid_i_gain_roll = 0.0008; #Gain setting for ... |
#!/usr/bin/env python
'''
A module for formatting videos.
Info:
type: eta.core.types.Module
version: 0.1.0
Copyright 2017-2018, Voxel51, Inc.
voxel51.com
<NAME>, <EMAIL>
'''
# pragma pylint: disable=redefined-builtin
# pragma pylint: disable=unused-wildcard-import
# pragma pylint: disable=wildcard-import
fro... |
import os
import sys
import torch
import dgl
import pandas as pd
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
from torch.utils.data import DataLoader
from ..models import GatLit
from .graph_loader_opt import GraphECMLoaderBalanced
def collate(samples):
'''
dgl batch to gpu
h... |
import pandas as pd
import numpy as np
from sklearn import preprocessing
#from sklearn.mixture import GMM
from sklearn.mixture import GaussianMixture as GMM
from scipy.stats import norm
from scipy.spatial.distance import pdist
import scipy.cluster.hierarchy as sch
from collections import Counter
def get_label(tabl... |
# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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... |
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 18 12:27:16 2017
@author: <NAME>
This script reads sgf files from a file directory, converts them into pairs of "current board - next move" and stores
them either in a dictionary or in a sqlite3 database.
"""
import os
from collections import defaultdict
from Board impo... |
import numpy as np
from torch import from_numpy
from torch.autograd import Variable
from transformer_architecture import *
# Variables globales
global max_src_in_batch, max_tgt_in_batch
"""
####################################################################
#################### Funciones importantes ######... |
'''
agents
======
The following methods allow for interaction into the Tenable.io
`agents <https://cloud.tenable.com/api#/resources/agents>`_
API endpoints.
Methods available on ``tio.agents``:
.. rst-class:: hide-signature
.. autoclass:: AgentsAPI
.. automethod:: details
.. automethod:: list
.. autom... |
import os
import numpy as np
from numpy import pi
from scipy import signal
from dmtools import colorspace, adjustments
from dmtools.animation import clip, to_mp4
from dmtools import sound
def mod(M,k):
M = colorspace.RGB_to_gray(M)
M = np.array(list(map(lambda x: x % k, M)))*int(256/k)
return colorspace.g... |
import os
import json
import numpy as np
import scipy
import scipy.linalg
__all__ = ["load_aircraft", "read_json", "calculate_stability"]
def load_aircraft(name):
import pkg_resources
name = os.path.join('data', name)
name += '.json'
filename = pkg_resources.resource_filename(__name__, name)
ret... |
#!/usr/bin/env python3
# CC0 - free software.
# To the extent possible under law, all copyright and related or neighboring rights to
# this work are waived.
"""
A simple Mail class (and CLI), wrapping Python's :py:mod:`smtplib`.
The only login/transport security mode supported is STARTTLS.
Run `sendmail.py -h` to see... |
"""
Module responsible for translating sequence annotation data
into GA4GH native objects.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import random
import ga4gh.protocol as protocol
import ga4gh.datamodel as datamodel
import ga4gh.sqli... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2-Clause
"""
SPDX document generator
"""
import datetime
import hashlib
from tern.formats.spdx.spdx import SPDX
from tern.utils.general import get_git_rev_or_version
from tern.report import content
from te... |
import json
import warnings
from dataclasses import dataclass
from dataclasses import field
from typing import Any
from typing import Callable
from typing import Dict
from typing import Iterable
from typing import List
from typing import Optional
from typing import Sequence
from typing import Type
from typing import Un... |
"""Read transaction logs from AceMoney
An investment Action from AceMoney has fields
"Date", "Action", "Symbol", "Account", "Dividend", "Price",
"Quantity", "Commission", "Total", "Comment"
"""
import argparse
from datetime import datetime
import logging
import os
import pickle
from typing import Dict
import pandas a... |
import os
import re
from collections import defaultdict
from typing import Iterable, Tuple, Dict, List
import numpy as np
import tensorflow as tf
from tensorflow.compat.v1 import logging
from tensorflow.compat.v1 import trainable_variables
from tensorflow.python.lib.io import file_io
from tfnlp.common.bert import BER... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.ops import control_flow_ops
slim = tf.contrib.slim
_R_MEAN = 123.68/255.
_G_MEAN = 116.78/255.
_B_MEAN = 103.94/255.
_RESIZE_SIDE_MIN = 473
_RESIZE_SIDE_MAX = ... |
from __future__ import absolute_import, print_function, division
import numpy as np
import theano
from theano import Op
import theano.tensor as T
from theano.gradient import DisconnectedType
from .basic_ops import (gpu_contiguous, as_gpuarray_variable,
infer_context_name)
from .type import Gpu... |
# Copyright 2021, 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... |
import os
from .t5 import generate_nmt
from .nlpcode import compose_nmt
from .log import trans_log
import uuid
import json
import time
import socket
try:
import IPython
from google.colab import output
try:
from slackweb import Slack
except ModuleNotFoundError:
import os
os.... |
from rpython.jit.backend.x86.regloc import *
from rpython.jit.backend.x86.assembler import Assembler386
from rpython.jit.backend.x86.regalloc import X86FrameManager, get_ebp_ofs
from rpython.jit.metainterp.history import BoxInt, BoxPtr, BoxFloat, ConstFloat
from rpython.jit.metainterp.history import INT, REF, FLOAT
fro... |
from typing import Any, Dict, List, Optional, Tuple
from pygdbmi.gdbcontroller import GdbController
from ..pwn_wrapper import ELF, Coredump
class CoredumpGDB:
def __init__(
self, elf: ELF, coredump: Coredump, lib_opts: Dict[str, Dict[str, int]]
) -> None:
self.coredump = coredump
sel... |
import sys
import pygame
from time import sleep
from game.bullet import Bullet
from game.alien import Alien
def check_keydown_events(event, ai_settings, screen, ship, bullets):
"""Responde a pressionamentos de tecla."""
if event.key == pygame.K_RIGHT:
ship.moving_right = True
elif event.key == p... |
from pathlib import Path
from tkinter import Tk, Canvas, Entry, Text, Button, PhotoImage
from PIL import Image, ImageTk
import sys
from seleniumwire import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import requests
import uuid
import time
import shutil
impor... |
# Copyright (c) 2016 PaddlePaddle 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 applic... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
CLI tool to generate fake data for testing MPC
Usage:
gen_fake_data <output_path> [options]
gen_fake_data ... |
import numpy as np
import os
import argparse
#import torch
def parse_args(args=None):
parser = argparse.ArgumentParser(
description='Generating graph features for datasets',
usage='python extract_graph_features.py --path <path to dataset folder>'
)
parser.add_argument('--path', default="..... |
#!/usr/local/bin/python
from sprint import sprint as print
import string # don't judge me
import basics
import config
import mbdata
import single
import useful
# ----- mack -----------------------------------------------------------
def mack_models(pif, start, end, series):
mseries = 'MB' if 'RW' not in seri... |
# -*- coding: utf-8 -*-
"""
This module contains functions to preprocess the input files to compute
a Finite Element Analysis.
"""
from __future__ import division, print_function
import sys
import numpy as np
def readin(folder=""):
"""Read the input files"""
nodes = np.loadtxt(folder + 'nodes.txt' , ndmin... |
from protmapper import uniprot_client
from nose.plugins.attrib import attr
@attr('webservice')
def test_query_protein_exists():
g = uniprot_client.query_protein('P00533')
assert g is not None
@attr('webservice')
def test_query_protein_nonexist():
g = uniprot_client.query_protein('XXXX')
assert g is ... |
import copy
import datetime
import json
import re
from collections import ChainMap
from collections import defaultdict
import requests
from jose import jwt
from octokit import errors
from octokit import utils
page_regex = re.compile(r'[\?\&]page=(\d+)[_&=\w\d]*>; rel="(\w+)"')
class Base(object):
base_url = 'h... |
"""
Experiment1: propagation by top-k nodes
Crate: 2014/03/16
Check: 2016/05/01
@auth: <NAME>
"""
# ###
# 1.Import packages
# ###
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import sys
import time
# Import modules
import util.sir_model as sir
import util.rea... |
import os
from pathlib import Path
import lxml.etree as et
from msgpack import dump
from tqdm import tqdm
import random
from frdocs.config import data_dir
from frdocs import CitationFinder, load_info_df
def element_to_dict(e):
d = {}
if len(e):
for child in e:
key = child.tag.lower()
... |
import sys
import time
import pickle
import argparse
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import matplotlib.lines as mlines
sns.set_style(style='whitegrid')
plt.rc('text', usetex=True)
plt.rc('font', size=12.0, family='Times New Roman')
plt.rcParam... |
import copy
import math
from fractions import Fraction
from typing import *
from util import lcm_many, compare_trees, Tree, SMTUtilOption, get_tag, get_coefs_fraction, convert_int2list, \
find_subtrees_by_tags, get_lets
def look_into_floor(to_int: Tree, vars: Dict[str, Tuple[int, int]], lets: Dict[str, Any]) -> ... |
from __future__ import unicode_literals
import logging
import os
import shutil
import tempfile
from io import open
from logging.handlers import BufferingHandler
from unittest import TestCase
from ..db import Database
def create_file(temp_folder, path, size):
path = os.path.join(temp_folder, *path)
dirname =... |
""" Sky model """
from collections import OrderedDict as odict
import numpy as np
import h5py as hp
from cfgmdl import Model, Property, cached
from .utils import is_not_none, cfg_path
from . import physics
#from .unit import Unit
from .cfg import Variable
GHz_to_Hz = 1.e+09
m_to_mm = 1.e+03
mm_to_um = 1.e+03
de... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import pandas as pd
import plotly.tools as tls
import plotly.graph_objs as go
import statsmodels.api as sm
import matplotlib.pyplot as plt
from scipy import stats
from ..graph import ScatterGraph, SubplotsGraph, BarGraph, HeatmapGraph
def _... |
"""
Quantilization functions and related stuff
"""
from pandas.core.dtypes.missing import isna
from pandas.core.dtypes.common import (
is_integer,
is_scalar,
is_categorical_dtype,
is_datetime64_dtype,
is_timedelta64_dtype,
_ensure_int64)
import pandas.core.algorithms as algos
import pandas.cor... |
"""
A collection of templatetags and helper functions for declaratively defining a
property table layout with multiple (optionally named) tables of some number of
rows of possibly differing length, where each row consists of a number of names
and values which are calculated based on an expression and a data source.
Su... |
#!/usr/bin/env python
# coding: utf-8
# ## Algoritmo de avaliação personalizado (ICD)
#
# <NAME>
# In[1]:
import pandas as pd
import numpy as np
import random
# ##### Alunos Ativos no SIGAA (em ordem alfabética)
# In[2]:
alunos = pd.read_excel("notas_GDCOC0089_T01_20211.xls")
# In[3]:
matriculas_alun = ["... |
"""ConEdison or Orange and Rockland Utility Smart Energy Meter"""
import requests
import logging
import asyncio
from pyppeteer import launch
import os
import json
import pyotp
_LOGGER = logging.getLogger(__name__)
class MeterError(Exception):
pass
class Meter(object):
"""A smart energy meter of ConEdison o... |
#
# Copyright 2017 Red Hat | Ansible
#
# This file is part of Ansible
#
# Ansible 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 License, or
# (at your option) any later version.
#
# ... |
from sympy import sin, cos, symbols, lambdify, exp
import numpy as np
from scipy import optimize
from scipy.optimize import least_squares
from matplotlib import pyplot as plt
from astropy.io import fits
"""
多高斯拟合 2021/09/16
"""
def gauss_2d_A(A):
"""
二维多高斯模型
:param A: [A0, x0, y0, s0_1,s0_... |
# demandimport.py - global demand-loading of modules for Mercurial
#
# Copyright 2006, 2007 <NAME> <<EMAIL>>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''
demandimport - automatic demandloading of modules
To enable this mod... |
import copy
import logging
import os
import yaml
import string
import random
from kubernetes import config
import ibm_spectrum_scale_csi.kubernetes_apis.csi_object_function as csiobjectfunc
import ibm_spectrum_scale_csi.spectrum_scale_apis.fileset_functions as filesetfunc
LOGGER = logging.getLogger()
def get_test_dat... |
'''KELFI code is adapated from https://github.com/Kelvin-Hsu/kelfi '''
import numpy as np
import tensorflow as tf
import pandas as pd
import pickle, time, os, sys
from os import path
import elfi
from elfi.examples import dgp_funcs, bdm_dgp, navworld
from kelfi.utils import halton_sequence
from kelfi.kernel_means_inf... |
'''
Modules
=======
Modules are classes that can be loaded when a Kivy application is starting. The
loading of modules is managed by the config file. Currently, we include:
* :class:`~kivy.modules.touchring`: Draw a circle around each touch.
* :class:`~kivy.modules.monitor`: Add a red topbar that indicates th... |
import os
import sys
import shlex
import threading
import time
from subprocess import Popen
import re
import six
if six.PY2:
from castervoice.lib.util.pathlib import Path
else:
from pathlib import Path # pylint: disable=import-error
from dragonfly import Function, Choice, Dictation, ContextAction
from caster... |
# coding=utf-8
# Copyright 2019 The Google AI Language Team 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 ... |
from io import BytesIO
import re
from config import CREDENTIALS_PATH
from google.oauth2 import service_account
from googleapiclient.discovery import build
from googleapiclient.http import MediaIoBaseUpload, MediaIoBaseDownload
from bs4 import BeautifulSoup
DOCS_FOLDER = '1_qWammKogC1_s__Dzwmekm6w28ruhppZ'
SPREADSHEET... |
"""Django-like (in the sense of "class-based") forms for tkinter"""
import inspect
import copy
import tkinter as tk
import tkinter.messagebox as tk_msg
from .. import tkstuff as mtk
try:
import typing
except ImportError:
typing = None
import enum
import collections
class FormWidget(mtk.ContainingWidget):
... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import List, Optional, Tuple, Type
import torch
from ax.core.search_space import SearchSpaceDigest
from ax... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This file is part of my-weather-indicator
#
# Copyright (c) 2012 <NAME> <a.k.a. atareao>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.