text
stringlengths
3.07k
22.1k
import numpy as np import os from os.path import join from glob import glob from skimage.io import imread, imsave from keras.utils import to_categorical def read_samples(path, colors, prefix='train', n_samples=None): """ Read all sample slides and subdivide into square tiles. Parameters ---------- ...
# Copyright (C) 2021 <NAME>, ETH Zürich, Information Security Group # Released under the MIT License """ Parses the new minimal format tree dumps and uses it to construct a predictor. Unlike the other script, this one does not utilize arrays, and instead expects dictionaries as feature input. This is done to prepare fo...
import numpy as np import pandas as pd import random import traceback import cv2 import os import string import csv import pickle from datetime import datetime from multiprocessing import Process,Pool,cpu_count import argparse from selenium.webdriver import Firefox import warnings warnings.filterwarnings("ignore") fro...
#!/usr/bin/env python import os import sys import time import pandas as pd import datetime import argparse __author__ = '<NAME>' __version__ = '0.01' # v0.01 : 2020-08-01 : original version def get_parser(): """ Creates a new argument parser. """ parser = argparse.ArgumentParser('niwget', usage='%(prog)s -o ob...
import time import math import mock import pytest from async_jaeger.sampler import ( ConstSampler, ProbabilisticSampler, RateLimitingSampler, GuaranteedThroughputProbabilisticSampler, AdaptiveSampler, get_sampling_probability, get_rate_limit, ) MAX_INT = 1 << 63 def get_tags(type, param...
"""Defines a Vector class, and some mathematical functions""" from math import cos, sin, atan2, sqrt, pi from random import randrange, random, uniform from dataclasses import dataclass import logging SMALL_PRIMES = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73...
"""Resegment a CMAF track to new exact average duration. Useful to get audio segments with a specified average duration.""" # The copyright in this software is being made available under the BSD License, # included below. This software may be subject to other third party and contributor # rights, including patent ri...
#!/usr/bin/env python import numpy as np import numpy.random import os from os.path import join,exists,dirname from sklearn import svm import sys from sklearn.datasets import load_svmlight_file, dump_svmlight_file from sklearn.metrics import f1_score from uda_common import evaluate_and_print_scores, align_test_X_train...
import pygame import random pygame.init() clock = pygame.time.Clock() FPS = 30 # Frames per second. BLACK = (0, 0, 0) WHITE = (255, 255, 255) RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) YELLOW = (255, 255, 0) ORANGE = (255, 127, 0) PURPLE = (128, 0, 128) CYAN = (0, 255, 255) ACTIVE_CELLS_COLOR = RED ...
# Copyright 2021 United States Government as represented by the Administrator of the National Aeronautics and Space # Administration. No copyright is claimed in the United States under Title 17, U.S. Code. All Other Rights Reserved. """ Convert SPC Autoregister results into a GIANT results pickle file format. This ...
# coding=utf-8 """ Modules - pipeline processing modules for CellProfiler """ import logging logger = logging.getLogger(__name__) import re import sys import cellprofiler.module as cpm from cellprofiler.modules.plugins import plugin_list from cellprofiler.preferences import get_plugin_directory # python modules and...
#!/usr/bin/env python """ Created in Jun 2016 @author: <NAME> """ from itertools import groupby from collections import namedtuple, defaultdict import textwrap DEBUG = False FASTA = namedtuple('FASTA', ['header', 'seq']) PDBDATA = namedtuple('PDBDATA', ['entry', 'res', 'rfr', 'comp', 'met']) def as_pairs(fasta): ...
############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: <EMAIL> ## ## This file is part of VisTrails. ## ## "Redistributio...
import datetime import logging import re import urllib.parse import time import requests logger = logging.getLogger(__name__) PARLIAMENT_MEMBER_DUTCH_ITEM_ID = 'Q18887908' REQUEST_TIMEOUT = 60 MAX_LAG = 60 # https://www.mediawiki.org/wiki/Manual:Maxlag_parameter def request_wikidata(url, params, **kwargs): h...
import copy import inspect import pprint from typing import Any, Dict, Optional import qcelemental as qcel import qcengine as qcng from qcelemental.models import AtomicInput from qcelemental.util import which from qcengine.exceptions import InputError from qcengine.programs.gamess import GAMESSHarness from qcengine.pr...
#! /usr/bin/env python import unittest import datetime import logging import os from cStringIO import StringIO from pasta import get_logger from pasta.alignment import Alignment, SequenceDataset, MultiLocusDataset,\ merge_in from pasta.treeholder import read_and_encode_splits from pasta.test import get_testing_c...
#!/usr/bin/env python import numpy as np import os.path import cStringIO import string from basicio import utils import os, sys _here = os.path.dirname(os.path.realpath(__file__)) __all__ = ['file2recarray', 'strarray2recarray', 'file2strarray', 'getheaders', 'arraydtypes'] def file2strarray(file, buffer=False, de...
import xlrd from autograd import grad import autograd.numpy as np import scipy.stats as st import random from copy import deepcopy import xlrd import matplotlib.pyplot as plt import json from sklearn.neighbors import KernelDensity import pandas as pd import dateutil.parser as dparser from scipy.stats import norm from s...
"""Import data into SQLite3 database.""" import datetime import functools import logging import time import warnings import sqlalchemy as sa from .. import _globals from .. import _tools from .. import backend as _backend from .. import languoids as _languoids from .. import config as _config from .. import glottolo...
import math import threadsafe_tkinter as tk from traceback import format_exc from binilla import editor_constants as e_c from binilla import widgets from binilla.widgets.field_widgets import field_widget, data_frame class BoolFrame(data_frame.DataFrame): children_can_scroll = True can_scroll = False che...
# Copyright 2020 The Pigweed 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
import os import sys import time import numpy as np import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec init_time = str(time.asctime()).replace(' ', '-') FLAGS = t...
"""Submodule providing classification evaluation pipeline.""" from typing import Callable, Union, List, Optional, Iterator, Type, Dict, Any from ensmallen import Graph from ensmallen.datasets import get_dataset import pandas as pd import numpy as np from tqdm.auto import tqdm from embiggen.utils.abstract_models import ...
# for calculation import numpy as np import pandas as pd from itertools import product # for visualization and interaction import plotly.graph_objs as go from plotly.subplots import make_subplots # from ipywidgets import interactive, Label, HTML, HBox, VBox #################### # CALCULATION def transfer_matrix_laye...
#!/usr/bin/env python '''log command handling''' import time, os from MAVProxy.modules.lib import mp_module class LogModule(mp_module.MPModule): def __init__(self, mpstate): super(LogModule, self).__init__(mpstate, "log", "log transfer") self.add_command('log', self.cmd_log, "log file handling", ...
# Imports the Pygame module. import pygame # Imports the constants of Pygame to improve readability. from pygame.locals import * # Imports the random module to generate random numbers and values. from random import choice, randint # Initialize the Pygame font module. pygame.font.init() # Initialize the Pygame music mo...
import os import sqlalchemy as sa def checkForTable(engine, table_name): try: sql_table = sa.Table(args.name, sa.MetaData(), autoload=True, autoload_with=engine) return sql_table except sa.exc.NoSuchTable...
""" utility functions for converting between datetime, iso date and 14-digit timestamp """ import re import time import datetime import calendar from email.utils import parsedate, formatdate #================================================================= # str <-> datetime conversion #============================...
# coding=utf-8 """ EXAMPLE-CURVES Simple example that creates a plane using Catmull-Rom curve. GLFW-TOOLBOX Toolbox for GLFW Graphic Library. MIT License Copyright (c) 2019-2020 <NAME>. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (t...
import re from aiogram import types from aiogram.dispatcher import FSMContext from aiogram import exceptions import keyboards from loader import dp from utils.classes import kb_constructor, paint, capture, transaction from utils.db_api import tables, db_api from utils.misc.read_file import read_txt_file from utils.cl...
from warnings import warn import numpy as np import pandas as pd import scipy.stats as stats from scipy import linalg from ..doctools import document from ..exceptions import PlotnineWarning from .stat import stat @document class stat_ellipse(stat): """ Calculate normal confidence interval ellipse {usa...
""" Managerie.py / <NAME> / Jan 2018 Made to automatically sort files from downloads folder to a specified location and subfolders because fuck moodle. See Readme for instructions. """ import os import configparser import shutil import re import tkinter as tk from tkinter import messagebox import time class Sub: ...
import torch import pycuda.autoinit import pycuda.driver as cuda import tensorrt as trt # TensorRT 7 import pdb import torch.nn as nn import os import numpy as np import torch TRT_LOGGER = trt.Logger() class Net(nn.Module): def __init__(self, num_clasess=2): super(Net, self).__init__() self.con...
# TODO(colin): fix these lint errors (http://pep8.readthedocs.io/en/release-1.7.x/intro.html#error-codes) # pep8-disable:E265 """TinyQuery wrapper that acts like BigQuery's Python API Client. This can be used in place of the value returned by apiclient.discovery.build(). """ from __future__ import absolute_import imp...
import argparse import glob import os import random import shutil from functools import partial from multiprocessing.dummy import Pool from pathlib import Path from subprocess import call import cv2 as cv import numpy as np from common import * # region copy from https://github.com/opencv/opencv/blob/master/samples/...
import torch, sys, os, argparse, textwrap, numbers, numpy, json, PIL from torchvision import transforms from torch.utils.data import TensorDataset from netdissect.progress import verbose_progress, print_progress from netdissect import retain_layers, BrodenDataset, dissect, ReverseNormalize from netdissect import ablate...
import hashlib import json import os import operator import random import time from typing import Dict, List, Optional from jinja2 import Template # 清理的命令 ClearCmd: str = ( 'find ./ -mindepth 2 -type f ! -name "*.py" ! -name "*.json" ! ' '-path ".//.idea/*" ! -path ".//.mypy_cache/*" ! -path ".//.git/*" ' ...
#!/usr/bin/env python3 from os import mkdir, remove from os.path import isdir from datetime import datetime, timezone, timedelta #import struct import numpy as np from LoLIM.utilities import processed_data_dir, v_air from LoLIM.IO.raw_tbb_IO import filePaths_by_stationName, MultiFile_Dal1, read_station_delays, read...
#!/usr/bin/env python import sys from collections import OrderedDict import subprocess as sp from textwrap import dedent import random as rnd import string import os import os.path import tempfile as tmpf import atexit import time import signal #import pdb # Set this to true to enable debugging debug = False doc...
# LIBTBX_SET_DISPATCHER_NAME dxtbx.radial_average # LIBTBX_PRE_DISPATCHER_INCLUDE_SH export PHENIX_GUI_ENVIRONMENT=1 # LIBTBX_PRE_DISPATCHER_INCLUDE_SH export BOOST_ADAPTBX_FPE_DEFAULT=1 from __future__ import absolute_import, division, print_function import math import os import sys import libtbx.phil from libtbx i...
import sys import ast import inspect import typing from itertools import chain from types import FunctionType from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union namespace = globals() def escape_xml(s: str): replacements = (("<", "&lt;"), (">", "&gt;"), ...
from data_import.conf import conf from data_import.log import log from typing import Any, Dict, List, Tuple, Union from pandas import DataFrame import numpy as np import pyproj from pyproj import CRS from shapely.geometry import Point from shapely.ops import transform from models.enums import MainActivityCode def _re...
"""Tests for runway.cfngin.util.""" # pylint: disable=unused-argument,invalid-name import unittest import boto3 import mock from runway.cfngin.config import GitPackageSource from runway.cfngin.util import ( Extractor, SourceProcessor, TarExtractor, TarGzipExtractor, ZipExtractor, camel_to_snak...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import functools import json import logging from flask import ( abort, Blueprint, current_app, jsonify, ...
""" Things related to plotting with matplotlib. Replace this class with another class if you prefer gnuplot or something. swhlab.plot.sweep() is the bread and butter of this module. Read the docs. Example usage: abf=swhlab.ABF('../abfs/aps.abf') swhlab.plot.sweep(abf,8,newFigure=True) #single sweep swhlab....
import logging from django import forms from django.core.cache import cache from django.core.exceptions import PermissionDenied, ValidationError from django.db.models import Q from django.http.response import JsonResponse from django.shortcuts import get_object_or_404, redirect from django.template.loader import rende...
""" fitting module """ from core import utils import numpy as np import scipy.optimize as sco import itertools class Fit(object): """ Fit class """ def __init__(self, xs_data, ys_data, function, p0, detached_parameters, fixed_parameters, **kwargs): """ Object constructor :param list, np.nda...
#!/usr/bin/env python3 # Create an SQLite DB from Postfix log for further (error) analysis from argparse import ArgumentParser from email.header import decode_header from os import unlink from os.path import isfile from re import compile as re_compile from sqlite3 import connect, IntegrityError from sys import stdin,...
""" A program that stores the following information about user's current semester Course name, Internal I, II and III scores along with user's total scores for each course User can: 1)View all marks 2)Search for entry: The user can search for the course by entering the course name or the user can als...
""" Usage: import the module (see Jupyter notebooks for examples), or run from the command line as such: # Train a new model starting from pre-trained COCO weights python3 carla.py train --dataset=/path/to/carla/dataset --weights=coco # Resume training a model that you had trained earlier pytho...
"""Base API handlers""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from datetime import datetime import json from http.client import responses from sqlalchemy.exc import SQLAlchemyError from tornado import web from .. import orm from ..handlers import BaseHa...
""" Implements processing techniques applied to bids before mechanisms can use them """ import numpy as np import pandas as pd from typing import Callable, List from pymarket.bids import BidManager def new_player_id(index: int) -> Callable[[List[int]], int]: """Helper function for merge_same_price. Creates a ...
"""Module with classes corresponding to VTK file types. Currently, the following types are implemented: - ImageData - RectilinearGrid - StructuredGrid - UnstructuredGrid The ParaViewData file format, although not part of VTK, is also available. All instances of classes in this file are context managers and can be us...
import os # from typing import OrderedDict from collections import OrderedDict import pandas as pd import numpy as np import pprintpp import csv import json import sys import os import requests import re,csv import json import numpy as np import collections """ Using Word Mover's Distance, 'matches up' counterfactual...
import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl from scipy.stats import gaussian_kde import torch import torch.nn.functional as f from collections import defaultdict from sklearn import metrics import networkx as nx import community as community_louvain import matplotlib.cm as cm import rand...
""" Analysis and plot the word semantic meaning shift over time via wasserstein_distance """ import matplotlib.pyplot as plt from sklearn.feature_selection import mutual_info_classif from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer import seaborn as sns import pandas as pd import numpy as np...
from invoke import task, Collection, call, exceptions import os import pathlib import re import shutil import sys THIS_DIR = pathlib.Path(__file__).parent.resolve() ROOT_DIR = pathlib.Path(THIS_DIR).parent.resolve() BUILDS_DIR = pathlib.Path(THIS_DIR, '..', 'builds').resolve() BUILDS_DIR.mkdir(exist_ok = True) class ...
''' Copyright (c) 2021 <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, sub...
""" Copyright (c) 2020-present Axelancerr 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, distrib...
""" Several helper functions used in various reinforcement learning algorithms. """ from __future__ import division, print_function, absolute_import from warnings import warn import theano import theano.tensor as T from ..utils import insert_dim def get_n_step_value_reference(state_values, ...
from subpopulations import Load_populations from agent import Agent from event import Event, add_method from infection import Infection import json import copy from tracker import Tracker import time import os from clock import Clock from visualiser_geo import build_fig_geo, set_style, draw_tstep, parse_agent_locatio...
""" Utility functions and constants that will be used in the project. """ from django.core.exceptions import ObjectDoesNotExist from logistics.forms import AddressModelForm from logistics.models import Address, Carrier, Country, State, PostalCode from .forms import WaypointModelForm from .models import Waypoint, Entity...
import os from collections import defaultdict import numpy as np import copy import pickle import scipy.sparse from PIL import Image import h5py, json import torch from pycocotools.coco import COCO from torch.utils.data import Dataset from lib.scene_parser.rcnn.structures.bounding_box import BoxList from lib.utils.box ...
# -*- coding: utf-8 -*- """ @author: <NAME> @contact: <EMAIL> """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from libs.box_utils import encode_and_decode from libs.configs import cfgs def _smooth_l1_loss_base(bbox_pred, bbox_ta...
# File: env.py # Description: Building the environment-1 for the Mobile Robot to explore # Agent - Mobile Robot # Obstacles - 'road closed', 'trees', 'traffic lights', 'buildings' # Environment: PyCharm and Anaconda environment # # MIT License # Copyright (c) 2018 <NAME> # github.com/sichkar-valentyn # # Reference to: ...
import os import numpy as np from sklearn.model_selection import train_test_split from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.utils import to_categorical from tensorflow.keras.layers import Conv2D, Dense, Dropout, Flatten, Input, Add, GlobalAveragePooling2D, DepthwiseConv2D...
""" Find position of card in the image, crop, rotate and isolate that card """ import cv2 import numpy as np import matplotlib.pyplot as plt import os from constants import path_debug def rotateImage(image, angle, nocrop=False): """ Rotates an image :param image: (npa) image being processed ...
from collections import defaultdict from nengo import Direct, Ensemble, Node, Probe from nengo.connection import LearningRule from nengo.exceptions import BuildError from nengo_loihi.builder.inputs import ChipReceiveNode from nengo_loihi.config import add_params from nengo_loihi.inputs import ChipProcess from nengo_l...
import gzip import tarfile import wget import shutil import sys import os from pygrank.benchmarks import dataset_processors datasets = { "dblp": {"url": "https://snap.stanford.edu/data/com-DBLP.html", "pairs": "https://snap.stanford.edu/data/bigdata/communities/com-dblp.ungraph.txt.gz", "...
from conans import ConanFile, CMake, tools # import os from ci_utils import BitprimCxx11ABIFixer def option_on_off(option): return "ON" if option else "OFF" class ZMQConan(BitprimCxx11ABIFixer): name = "libzmq" version = "4.2.2" version_flat = "4_2_2" license = "LGPL" url = "https://github.com...
import torch import torch.nn as nn import torch.utils.data as Data import torchvision # this is the database of torch import torchvision.models as models from torchvision.utils import save_image from torch.nn import init from torchvision import datasets, transforms import os # Hyper Parameters EPOCH = 30 ...
import torch import detectron2 from detectron2.utils.logger import setup_logger setup_logger() # import some common libraries import numpy as np import os, json, cv2, random # import some common detectron2 utilities from detectron2 import model_zoo from detectron2.engine import DefaultPredictor from detectron2.config...
# python3 import sys from collections import deque class Edge: """ A class to represent an edge in the graph. ... Attributes ---------- n_start : Edge instance Vertex where the edge starts n_end : Edge instance Vertex where the edge ends capacity : Edge instance ...
from flask import request, render_template from flask_restful import Resource from flask_jwt_extended import get_jwt_identity, jwt_required from flask_mail import Message import boto3 import random import string import json import iot_logging from threading import Thread from datetime import datetime, timedelta from ...
""" This is the main script of main GUI of the OXCART Atom Probe. @author: <NAME> <<EMAIL>> """ import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import RectangleSelector, EllipseSelector from matplotlib.patches import Circle, Rectangle import pandas as pd from pyccapt.calibration import sele...
# <NAME> 170401007 import math import sympy as sp sp.init_printing() x = sp.Symbol('x') veriler=[] korelasyonlar=[] def dosyaOku(): dosya = open('veriler.txt','r') for satir in dosya: veriler.append(int(satir)) dosya.close() def gauss(A): boyut = len(A) for i in range(0, bo...
import os import torch import torch.nn as nn from mimic.utils import utils from mimic.utils.BaseMMVae import BaseMMVae from torch.distributions.distribution import Distribution import typing class VAEtrimodalMimic(BaseMMVae, nn.Module): def __init__(self, flags, modalities, subsets): super(VAEtrimodalMi...
import enum import json import os.path import re from six.moves import urllib from check_mk_web_api.exception import CheckMkWebApiResponseException, CheckMkWebApiException, CheckMkWebApiAuthenticationException class NoNoneValueDict(dict): """Dictionary that does not allow items with None as value""" def __in...
#!/usr/bin/env python3 # vim: et sw=2 sts=2 ts=8 import itertools import yaml import re import os.path import sys def execute(path, content=None): if not content: with open(path) as f: content = f.read() doc = parse(path, content, ParseContext()) result = doc.execute() return yaml.serialize(result,...
# coding = utf-8 # Create date: 2018-11-28 # Author :Hailong from utils.connect_to_os import executor data_source_url = 'https://gist.githubusercontent.com/kingsd041/310b5f0ab89567e93edadf1bbed822fb/' \ 'raw/1ef388e085ffb4b6bb352c8383aa4b7ad3dafd33/test_network_from_url.txt' def test_network_from_...
import torch import torch.nn.functional as F from fvcore.nn import smooth_l1_loss from detectron2.layers import ShapeSpec from detectron2.modeling import ROI_HEADS_REGISTRY, StandardROIHeads from detectron2.modeling.box_regression import Box2BoxTransform from detectron2.modeling.poolers import ROIPooler from detectro...
# Copyright 2013 - Mirantis, Inc. # Copyright 2015 - StackStorm, 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 # # Unl...
# This file is part of the pyMOR project (http://www.pymor.org). # Copyright 2013-2020 pyMOR developers and contributors. All rights reserved. # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) from numbers import Number import numpy as np from pymor.core.base import ImmutableObject, abstr...
from ...expressions import ( Expression, Symbol, FunctionApplication as Fa, Constant as C, ) from ...expression_walker import ( add_match, ExpressionWalker, ReplaceSymbolWalker, ) from .chart_parser import Quote, CODE_QUOTE from .english_grammar import S, V, NP, VP, PN, DET, N, VAR, SL, LIT ...
""" Base models and related models for our robust FEMDA: Flexible EM-Inspired Discriminant Analysis. """ import numpy as np from math import sqrt from ._algo_utils import regularize, get_reg_lambd, fit_t_dof, fit_gaussian from ._models_lda import LDA from ._models_t_lda import t_LDA class _FEM_base(): """Class t...
# -*- coding: utf-8 -*- #!/usr/bin/env python # External imports import os import datetime import json import time import logging import twitter from flask import render_template, redirect # Imports from google from google.appengine.api import taskqueue from google.appengine.api.taskqueue import Queue from google.ap...
from enum import Enum import astropy.units as u import numpy as np from matplotlib.widgets import Cursor from solarviewer.app.plot import PlotWidget from solarviewer.config.base import ViewerController, ItemConfig, DataType, ViewerType from solarviewer.config.impl import ViewerToolController from solarviewer.ui.profi...
import matplotlib.pyplot as plt from scipy.stats import logistic import statsmodels.formula.api as smf import pandas as pd import numpy as np def get_panel_estimates(estimator, df): assert estimator in ["naive", "diff"] subset = df.loc[(slice(None), 10), :] if estimator == "naive": rslt = smf.o...
#!/usr/bin/env python # -*- encoding: utf-8 -*- __author__ = 'andyguo' import re import sys from base import * from config import OIIO_EXEC printf_regex = re.compile(r'.*(\%(\d+)d).*') class OIIO(GlobalStream): _name = 'oiiotools' _input_count = 0 def __init__(self): super(OIIO, self).__init_...
""" :mod:`disco.job` -- Disco Jobs ============================== This module contains the core objects for creating and interacting with Disco jobs. Often, :class:`Job` is the only thing you need in order to start running distributed computations with Disco. :term:`Jobs <job>` in Disco are used to encapsulate and sc...
# # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # 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 u...
import sys import queue import threading import json import collections import time from spirecomm.spire.game import Game from spirecomm.spire.screen import ScreenType from spirecomm.communication.action import Action, StartGameAction def read_stdin(input_queue): """Read lines from stdin and write them to a queue ...
from scipy import constants,linalg import numpy as np from pythonradex import helpers,escape_probability,atomic_transition from pythonradex.molecule import EmittingMolecule import warnings class RateEquations(): '''Represents the equations of statistical equilibrium for the level populations of a molecule'''...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Nov 22 16:34:02 2019 @author: mpolikarpov """ import os os.environ['OMP_NUM_THREADS'] ='1' os.environ['OPENBLAS_NUM_THREADS'] = '1' os.environ['MKL_NUM_THREADS'] = '1' #os.system('taskset -cp 0-100 %d' % os.getpid()) import sys, time import dxchange, ...
from __future__ import print_function from miscc.utils import mkdir_p from miscc.config import cfg, cfg_from_file from datasets import TextDataset from datasets import prepare_data from DAMSM import RNN_ENCODER import os import sys import time import random import pprint import datetime import dateutil.tz import ar...
from flask_login import current_user from src.extentions import mongo from bson.objectid import ObjectId from bson.json_util import dumps, loads from ..users.models import User from ..bookmarks.serializers import bookmark_schema_for_title_and_url, bookmark_schema import datetime from flask import current_app import...
#!/usr/bin/env python3 # # Copyright (c) 2020 m-ll. All Rights Reserved. # # Licensed under the MIT License. # See LICENSE file in the project root for full license information. # # 2b13c8312f53d4b9202b6c8c0f0e790d10044f9a00d8bab3edf3cd287457c979 # 29c355784a3921aa290371da87bce9c1617b8584ca6ac6fb17fb37ba4a07d191 # imp...
"""Firefox Desktop Search Count Datasets This job produces derived datasets that make it easy to explore search count data. The search_aggregates job is used to populate an executive search dashboard. For more information, see Bug 1381140. The search_clients_daily job produces a dataset keyed by `(client_id, submiss...
# -*- coding: utf-8 -*- ########################################################################## # NSAp - Copyright (C) CEA, 2020 # Distributed under the terms of the CeCILL-B license, as published by # the CEA-CNRS-INRIA. Refer to the LICENSE file or to # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html #...
import argparse import csv import datetime import json import gzip import os import numpy as np import pandas as pd import oyaml as yaml from collections import OrderedDict import torch import torch.nn as nn import torchvision import torchvision.transforms as transforms from torch.autograd import Variable from torch....