text stringlengths 6.04k 39.5k |
|---|
__all__ = [
'RunExposure',
'RunFmTest',
]
import tempfile
import os
import csv
import shutil
from itertools import chain
import pandas as pd
from ..base import ComputationStep
from ..generate.keys import GenerateKeysDeterministic
from ..generate.files import GenerateFiles
from ..generate.losses import Genera... |
#coding=utf-8
'''
Created on 2013.12.13
@author: dell
'''
import numpy as np
from scipy.stats.stats import pearsonr
import matplotlib.pyplot as plt
#from matplotlib.figure import Figure
from matplotlib.pyplot import figure as Figure
import os
import struct
from ..data_transform import Ion2Vector
from .ion_calc impo... |
# Developer: SpatialDev
# Company: Spatial Development International
# standard library
from datetime import datetime
import os
# third-party
import arcpy
# ETL utils
from etl_utils import ETLXMLUtils, FTPDownloadManager
class LandExtractValidator(object):
"""
Class LandExtractValidator determin... |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Tests the utility module
:author: <NAME>
"""
# Same version as the tested bundle
__version_info__ = (1, 0, 1)
__version__ = ".".join(str(x) for x in __version_info__)
# Documentation strings format
__docformat__ = "restructuredtext en"
# --------------------... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import log... |
#!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# 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',
'status': ['pre... |
# from cdk_pywrapper.cdk_pywrapper import Compound
import pandas as pd
import copy
import json
import os
import wikidataintegrator as wdi
from cdk_pywrapper.cdk_pywrapper import Compound
from elasticsearch import Elasticsearch
from elasticsearch.exceptions import RequestError
es = Elasticsearch()
def generate_fing... |
from requests.adapters import HTTPResponse
from auth_helper.utils import requires_scopes
import json
from dataclasses import asdict, is_dataclass
from . import view_port_ops
from django.http import HttpResponse
from rest_framework.decorators import api_view
from django.http import JsonResponse
from . import dss... |
"""Validate a face recognizer on the "Labeled Faces in the Wild" dataset (http://vis-www.cs.umass.edu/lfw/).
Embeddings are calculated using the pairs from http://vis-www.cs.umass.edu/lfw/pairs.txt and the ROC curve
is calculated and plotted. Both the model metagraph and the model parameters need to exist
in the same d... |
import hashlib
import os
import pickle
from urllib.request import urlretrieve
import numpy as np
from PIL import Image
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils import resample
from tqdm import tqdm
from zipfile import ZipFile
print('All m... |
import argparse
import logging
import os
import random
import sys
import numpy as np
import torch
import torch.backends.cudnn as cudnn
from torch.cuda import is_available
import torch.nn as nn
from torch.utils.data import DataLoader
from tqdm import tqdm
from datasets.dataset import SegmentationDataset
from utils impor... |
# -*- coding: utf-8 -*-
"""
Imap Fetch Item
~~~~~~~~~~~~~~~~
Imap Fetch Item
:copyright: (c) 2017 WTFPL.
:license: WTFPL, see LICENSE for more details.
"""
from datetime import datetime
from typing import Any, List, Tuple
from ..utils import parse_datetime, decode_list_items
from .body_structure ... |
#!/usr/bin/env vpython
#
# Copyright 2016 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.
"""Runs the CTS test APKs stored in CIPD."""
import argparse
import contextlib
import json
import logging
import os
import shutil
i... |
"""Implementations of different data feeders to provide data for TF trainer."""
# Copyright 2015-present The Scikit Flow 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 th... |
"""
Useful functions that have been used through out the whole code base.
"""
import os
import torch
import pickle
import random
import logging
import argparse
import numpy as np
import matplotlib as mpl
import torch.nn.functional as F
import matplotlib.pyplot as plt
from torch.autograd import Variable
# To plot grap... |
'''
Save Sample Instance is an example of a plug-in to both GUI menu and command line/web service
that will use a us-gaap style presentation tree to save sample instance facts.
(c) Copyright 2016 Mark V Systems Limited, All rights reserved.
uses exrex for regular expressions (pip install exrex), note exrex is GPL 3 l... |
# -*- coding: utf-8 -*-
import tkinter as tk
from tkinter import ttk, messagebox, simpledialog
from tksheet import Sheet
import subprocess
import os
import json
import shutil
import datetime
import argparse
from pathlib import Path
import socket
from xbutil_gui.xbutil_top import XbutilTop
from xbutil_g... |
# author: github/zabir-nabil
# relevant imports
import os
import cv2
import pydicom
import pandas as pd
import numpy as np
# import tensorflow as tf
# import matplotlib.pyplot as plt
# torch dataset
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, ... |
#!/usr/bin/env python
u"""
read_ICESat2_ATL06.py (10/2021)
Read ICESat-2 ATL06 (Land Ice Along-Track Height Product) data files
OPTIONS:
ATTRIBUTES: read HDF5 attributes for groups and variables
HISTOGRAM: read ATL06 residual_histogram variables
QUALITY: read ATL06 segment_quality variables
PYTHON DEPENDE... |
from seq2seq_loader import *
from random import randint, shuffle
from random import random as rand
import numpy as np
from tqdm import *
import torch
import torch.utils.data
import pickle
import os
from nltk import word_tokenize, pos_tag
from nltk.stem import PorterStemmer
import json
from multiprocessi... |
"""
Module to run tests on arcoadd
"""
import os
import pytest
import numpy as np
from astropy import units
from linetools.spectra.utils import collate
from linetools.spectra.xspectrum1d import XSpectrum1D
from pypeit.core import coadd
from pypeit.spectrographs.util import load_spectrograph
from pypeit import msgs
f... |
# coding=utf-8
# Knowledge Base Representation
# <NAME>, <NAME>
import random
import numpy as np
import pandas as pd
TRAIN_LABEL = "train"
DEV_LABEL = "dev"
TEST_LABEL = "test"
TMP_LABEL = "tmp"
class KB:
"""
KB represents a knowledge base of facts of varying arity
>>> kb = KB()
>>> kb.add_train... |
import os
curDir = os.path.dirname(os.path.abspath(__file__)) # Do't use curDir. curDir maybe pollute by other import module. Using PROJECT_ROOT for safe
PROJECT_ROOT = os.path.dirname(curDir) # mean cd..
#print(PROJECT_ROOT)
#import sys
#sys.path.append(PROJECT_ROOT) #add module search path
#print(sys.path)
from lib... |
# Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2016-2020 Datadog, Inc.
# stdlib
import ConfigParser
from cStringIO import StringIO
import logging
impor... |
from __future__ import print_function, division
from cProfile import label
from logging import raiseExceptions
from typing import Mapping, Union, Optional, Callable, Dict
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import os
from tqdm import tqdm, t... |
import discord
from discord.ext import commands
from main import restart_reason as rr, owners, note
import datetime
import json
import DiscordUtils
from datetime import datetime
from discord.ext.commands import Cog as c, command as cmd
class Miscellaneous(commands.Cog):
""" Cog for miscellaneous commands"""
a... |
# NOTICE
# This software was produced for the U.S. Government under contract FA8702-21-C-0001,
# and is subject to the Rights in Data-General Clause 52.227-14, Alt. IV (DEC 2007)
# ©2021 The MITRE Corporation. All Rights Reserved.
'''
This module is where the ontology and casedata meet.
'''
import pprint # For debug
... |
#!/usr/bin/env python3
# Copyright 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""Evaluate the accuracy of the DrQA retriever module."""
import regex as re
import logging
import argparse
im... |
###############################################################################
# WaterTAP Copyright (c) 2021, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory, Oak Ridge National
# Laboratory, National Renewable Energy Laboratory, and National Energy
# Technology Laboratory ... |
import os
import keras
from keras.models import Sequential, Model
from keras.engine.topology import Input, InputLayer, Layer
from keras.layers.core import RepeatVector, Reshape, Flatten, Dropout
from keras.layers.convolutional import Conv1D, Conv2D, UpSampling2D
from keras.layers import Activation, Dense
from keras.lay... |
import logging
import multiprocessing
import time
import warnings
from typing import Any, Dict, List, Optional, TextIO, Tuple, Type, Union, cast
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.dummy import DummyClassifier, DummyRegressor
from sklearn.ensemble import VotingClassifier, VotingRegr... |
# Copyright 2017 Nokia.
# 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... |
# core data structures
import networkx as nx
import numpy as np
import scipy.sparse as sp
from .decomposition import get_calculation_method
class Class:
def __init__(self, lab_id, name, members):
self.name = name
self.id = lab_id
self.index = -1
self.members = members # ids of me... |
import numpy as np
import matplotlib.pyplot as plt
import skfuzzy as fuzz
from skfuzzy import control as ctrl
from random import gauss
# path = '/home/valentina/Github/AI/FIS/dataset_1.txt'
path = '/home/valentina/Github/AI/FIS/dataset_2.txt'
#### import data ####
# with open(path) as f:
# data = np.loadtxt(f, dt... |
import numpy as np
import os
import sys
from matplotlib import pyplot as plt
from matplotlib import colors
import matplotlib.gridspec as gridspec
from matplotlib.ticker import FormatStrFormatter, AutoMinorLocator
import matplotlib.cm as cm
import starry
import jax.numpy as jnp
from jax import random, jit, vmap, lax
... |
#
# Copyright 2016 Cluster Labs, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
#!/usr/bin/env python
# Copyright (C) 2015, 2019 IBM Corp. 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 r... |
from __future__ import division
from __future__ import print_function
import os
try:
from Queue import Queue
except ImportError:
from queue import Queue
import threading
import random
import sys
import threading
import time
import numpy as np
from joblib import Parallel, delayed
from numpy.random import choi... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
# coding: utf-8
#
# Copyright (C) 2018 <NAME>.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This program... |
from discord.ext import commands
from lxml import html
import asyncio
import discord
import random
import json
class Misc:
""" Miscellaneous things. """
def __init__(self, bot):
self.bot = bot
@commands.command(name="8ball",aliases="8")
async def eightball(self,ctx):
res = [
"Signs point t... |
import os
import re
import logging
logger = logging.getLogger(__name__)
from astropy.io import registry
from astropy.table import Table, MaskedColumn
from astropy.time import Time
def _read_obslog(filename):
"""A customized function use to read the observing log
Args:
filename (str): Filename of the ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# TODO: 考虑ftp异常的处理方法,比如:
# (<class 'ftplib.error_temp'>, error_temp('425 Failed to establish connection.',), <traceback object at 0x7f8a97608e88>)
import re
import os
import shutil
from ftplib import FTP
import sys
# from flask import current_app
# from . import celery
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
SELFIES: a robust representation of semantically constrained graphs with an
example application in chemistry (https://arxiv.org/abs/1905.13741)
by <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
Variational Auto Encoder (VAE) for chemistry
... |
# !/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import numpy as np
import tensorflow as tf
import time
import os
from sys import path
import tf_util as U
from maddpg import MADDPGAgentTrainer
# from maddpg import MADDPGEnsembleAgentTrainer
import tensorflow.contrib.layers as layers
# from tf_slim import laye... |
#!/usr/bin/env python3
import time
import dateutil.parser
import datetime
import json
import requests
from bs4 import BeautifulSoup
import math
import xml.etree.ElementTree as ET
from datetime import timedelta
import ntplib
import threading
import os
import json
import socket
import logging
import re
from dstimer.intel... |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Copyright 2015-2017 Cisco Systems, 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.apa... |
"""
Plotting of Hyperplane Arrangements
PLOT OPTIONS:
Beside the usual plot options (enter ``plot?``), the plot command for
hyperplane arrangements includes the following:
- ``hyperplane_colors`` -- Color or list of colors, one for each
hyperplane (default: equally spread range of hues).
- ``hyperplane_labels`` -... |
import matplotlib.pyplot as plt
import pyVIA.examples as via#examples as via
import pandas as pd
import umap
import scanpy as sc
import numpy as np
import warnings
def run_Toy_multi(foldername="Datasets/"):
via.main_Toy(ncomps=10, knn=30,dataset='Toy3', random_seed=2,foldername=foldername)
def run_Toy_discon(fo... |
# -*- coding: utf-8 -*-
"""
Demons registration with variants of demons forces, as well as the diffeomorphic demons.
@author: <NAME>
"""
import os
import numpy as np
import tensorflow as tf
# import tensorflow_probability as tfp
import nibabel as nib
import cv2
import transformer, utils, metrics
import ... |
#!/usr/bin/env python3
# encoding: utf-8
"""
% Code to fit the history-dependent drift diffusion models as described in
% Urai AE, <NAME>W, <NAME>, <NAME> (2019) Choice history biases subsequent evidence accumulation. eLife, in press.
%
% MIT License
% Copyright (c) <NAME>, 2019
% <EMAIL>
"""
# =====================... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# SKY130 plugin for Hammer.
#
# See LICENSE for licence details.
import sys
import re
import os, shutil
from pathlib import Path
from typing import NamedTuple, List, Optional, Tuple, Dict, Set, Any
import hammer_tech
from hammer_tech import HammerTechnology
from hamm... |
import os
import logging
import tempfile
import argparse
import numpy as np
import torch
import torchmodels
import torch.optim as op
import torch.utils.data as td
import utils
import models
import models.jlu
import dataset
import evaluate
import inference
from . import embeds
MODES = ["word", "label", "intent"]
par... |
import tensorflow as tf
import numpy as np
import gym
import util as U
from scipy import signal
from time import sleep
import policies as pol
LOG_ROUND = 10
MAX_ITERS = 1e7
MAX_LR, MIN_LR = .1 , 1e-6
class Framer(object):
"""
Ceates the augmentd obs features from the bare observations. Any obs fed to Actor &... |
"""Provides functions prepare_data_x and dataclass PrepareDataOutput."""
from dataclasses import dataclass, field
from functools import partial
from typing import Any, Callable, Dict, List, Union
import numpy as np
import pandas as pd
from sklearn.model_selection import KFold
from .util import make_columns_lower_cas... |
from __future__ import division, print_function
import numpy as np
from .DataObjects import PureData, SolutionData, DigitalData,\
CoefficientData
class PureExample(PureData):
def __init__(self):
PureData.__init__(self)
self.name = "ExamplePure"
self.description = "Heat transfer fluid T... |
#!/usr/bin/env python3
"""
Implementation of Ascon v1.2, an authenticated cipher and hash function
http://ascon.iaik.tugraz.at/
"""
debug = False
debugpermutation = False
# === Ascon hash/xof ===
def ascon_hash(message, variant="Ascon-Hash", hashlength=32):
"""
Ascon hash function and extendable-output fun... |
# standard library
import hashlib
import plistlib
from datetime import datetime
from django.utils import timezone
from urllib import quote
# third-party
import unicodecsv as csv
# Django
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import rev... |
import os
import shutil
import tkinter as tk
from tkinter import filedialog
from tkinter import messagebox
import cv2
import numpy as np
from PIL import Image
from PIL import ImageTk
class Button:
def __init__(self, root, frame3):
self.root = root
self.frame3 = frame3
self... |
""" test_game """
import unittest
from common.testLib import TestGameBase
from common.general import logger
# import object
# import room
# import creature
class TestGame(TestGameBase):
def setTestName(self, name=""):
self._testName = __class__.__name__
def testGameInstanciation(self):
game... |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
#
# MAIN
#
# Import des librairies
import tkinter as tk
from PIL import ImageTk, Image
import time
import os
import sys
import subprocess
import requests
import json
# Import des "Feuilles" de GUI
import Handlers.GUI.Home as handlerGuiHome
import Handlers.DataBase.db as databaseHandler
import Handlers.MFRC522.hand... |
# -*- coding: utf-8 -*-
r""" The CORRAL aggregation bandit algorithm, similar to Exp4 but not exactly equivalent.
The algorithm is a master A, managing several "slave" algorithms, :math:`A_1, ..., A_N`.
- At every step, one slave algorithm is selected, by a random selection from a trust distribution on :math:`[1,...,... |
""" Extensions to Matplotlib: Cursor class, and ginput function.
This module contains a Cursor class (cursor that moves with the mouse) and
a ginput function similar to the matplotlib ginput, but with a cursor
and allowing zooming/panning.
"""
# TODO - To allow cursor to appear on multiple figures, it is necessary to... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Blue Yonder Coding Task - Image downloader - 3. Simple and solid solution.
:author <NAME>:
:created 2018/04/05:
Usage: quickanddirty.py <path to input file>
"""
# standard library modules
import argparse
import logging
import os
import sys
import tempfile
import errno
fro... |
# coding:utf-8
import kivy
kivy.require('1.7.2') # replace with your current kivy version !
from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
from kivy.properties import ListProperty, ObjectProperty, StringProperty, NumericProperty
from kivy.factory import Factory
from ki... |
import networkx as nx
import numpy as np
from scipy import stats
from datetime import datetime
import csv
import random
import sys
sys.path.append('./routing')
import shortest_path
import waterfilling
import flash
import speedymurmurs
import max_flow
import ripple_proc
import lightning_proc
# GENERAL TERMINOLOGY
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Exaplanation: sumologic_dashboard_news makes a newspaper from dashboard exports
Usage:
$ python sumologic_dashboard_news [ options ]
Style:
Google Python Style Guide:
http://google.github.io/styleguide/pyguide.html
@name sumologic_dashboa... |
import numpy as np
import os
import cv2
import matplotlib.pyplot as plt
import csv
import json
from collections import Counter
from matplotlib.patches import Rectangle
import math
from skimage.measure import block_reduce
# import tensorflow as tf
# keras = tf.keras
# DOCUMENTATION
############ CLOUD USAGE ... |
"""
implementation of the PWC-DC network for optical flow estimation by Sun et al., 2018
<NAME> and <NAME>
"""
import torch
import torch.nn as nn
from torch.autograd import Variable
import os
# os.environ['PYTHON_EGG_CACHE'] = 'tmp/' # a writable directory
# from correlation_package.modules.corr import Correlation
im... |
import collections
import errno
import functools
import heapq
import itertools
import math
import numbers
import os
import random
import selectors
import threading
import time
from concurrent.futures import ThreadPoolExecutor
from middleman import util
from middleman.log import gen_log
from middleman.process import c... |
import copy
import getopt
import os
import sys
from time import time
import numpy as np
import pandas as pd
from tqdm import tqdm
import pandapower as pp
from pandapower.converter import init_ne_line
from pandapower.converter.powermodels.from_pm import read_ots_results
pm_time_limits = {
"pm_time_limit": 300.,
... |
import random
import textwrap
import itertools
import functools
from plugin import plugin
from typing import Callable, List
ScoreCalculator = Callable[[List[int]], int]
PointsCalculator = Callable[[List[int]], int]
def calc_same_face_score(hand: List[int], face: int) -> int:
'''
In the same face categories ... |
# coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2010-2019 fasiondog/hikyuu
#
# 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 r... |
"""
Sentence Pair Classification with Bidirectional Encoder Representations from Transformers
=========================================================================================
This example shows how to implement finetune a model with pre-trained BERT parameters for
sentence pair classification, with Gluon NLP... |
import hashlib
import logging
import random
import re
import time
from datetime import datetime, timedelta
from django.conf import settings
from django.contrib.auth.models import User, Group
from django.contrib.sites.models import Site
from django.db import models
from celery.task import task
from statsd import stats... |
import pandas as pd
import csv
import numpy as np
from configuration.configuration_api import ConfigurationAPI
from rest_client.AuthenticationRest import AuthenticationAPI
from objects_API.SourceDataJ import SourceDataJson
from objects_API.PersonResponsibleJ import PersonResponsibleJson
from objects_API.WholeDNAJ im... |
import itertools
import json
import os
from collections import MutableMapping, defaultdict
from six import iteritems, iterkeys, itervalues, string_types, binary_type, text_type
from . import vcs
from .item import (ConformanceCheckerTest, ManifestItem, ManualTest, RefTest, RefTestNode,
SupportFile, T... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Author: <NAME> (based on Yue Wang's codes)
@Contact: <EMAIL>
@File: model.py
@Time: 2021/04/23
"""
import os
import sys
import copy
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
def knn(x, k):
inner = -2*torch... |
import datetime
import json
import re
import sys
import time
from email.header import Header
from http.client import responses
from urllib.parse import urlparse
from django.conf import settings
from django.core import signals, signing
from django.core.exceptions import DisallowedRedirect
from django.core.serializers.j... |
#!/usr/bin/env python3.8
# Copyright 2016 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import argparse
import json
import os
import paths
import re
import shutil
import subprocess
i... |
""" miscellaneous sorting / groupby utilities """
from collections import defaultdict
from typing import (
TYPE_CHECKING,
Callable,
DefaultDict,
Dict,
Iterable,
List,
Optional,
Tuple,
Union,
)
import numpy as np
from pandas._libs import algos, hashtable, lib
from pandas._libs.hasht... |
# Copyright Google Inc. All Rights Reserved.
#
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at https://angular.io/license
"""Package Angular libraries for npm distribution
If all users of an Angular library use Bazel (e.g. internal usage in your company)
then yo... |
import torch
from copy import deepcopy
from functools import wraps, partial
from itertools import chain
import torch.nn.functional as F
from torch.testing import make_tensor
from torch.testing._internal.common_dtype import floating_types
from torch.testing._internal.common_device_type import (
_TestParametrizer, _d... |
from time import sleep
import uuid
import requests
from requests import RequestException
import logging
from typing import Union
from prefect import Task
from prefect.engine.signals import FAIL
from prefect.utilities.tasks import defaults_from_attrs
class ConnectionNotFoundException(Exception):
pass
class Ai... |
import os
import uuid
from flask import Blueprint, render_template, jsonify, url_for, redirect, request, flash
from flask_login import login_required, current_user
from application.model import User, Message, Social, About, Education, Category, Skill, Portfolio, Hobbies, Design
from application import Config, db
from h... |
from copy import copy
from sympy.tensor.array.dense_ndim_array import ImmutableDenseNDimArray
from sympy import Symbol, Rational, SparseMatrix, Dict, diff, symbols, Indexed, IndexedBase, S
from sympy.core.compatibility import long
from sympy.matrices import Matrix
from sympy.tensor.array.sparse_ndim_array import Immut... |
'''Core function of PyIOmica'''
from .globalVariables import *
def modifiedZScore(subset, printValues=False):
"""Calculate modified z-score based on "Median absolute deviation".
Parameters:
subset: pandas.Series
Data to transform
Returns:
pandas.Series
... |
import datetime
from django.core.urlresolvers import reverse
from django.utils.html import strip_tags
from canvas.tests.tests_helpers import (CanvasTestCase, create_comment, create_content, create_group, create_user,
create_staff, FakeRequest)
from canvas import util, stickers,... |
# -*- encoding: utf-8 -*-
#
# Copyright © 2018-2020 Mergify SAS
#
# 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 appl... |
# coding: utf-8
"""
Functional ROOT tools that retrieve and interact with existing ROOT objects, but do not create them.
"""
__all__ = [
"apply_properties", "get_canvas_pads", "update_canvas", "setup_style", "setup_canvas",
"setup_pad", "setup_x_axis", "setup_y_axis", "setup_z_axis", "setup_axes", "setup_lat... |
# -*- coding: utf-8 -*-
""" S3 XForms API
@copyright: 2014-2019 (c) Sahana Software Foundation
@license: MIT
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
restr... |
import datetime
import re
from warnings import (
catch_warnings,
simplefilter,
)
import numpy as np
import pytest
from pandas._libs.tslibs import Timestamp
from pandas.compat import is_platform_windows
import pandas as pd
from pandas import (
DataFrame,
Index,
Series,
_testing as tm,
bdat... |
"""PooledDB - pooling for DB-API 2 connections.
Implements a pool of steady, thread-safe cached connections
to a database which are transparently reused,
using an arbitrary DB-API 2 compliant database interface module.
This should result in a speedup for persistent applications such as the
application server of "Webw... |
"""Unittest helpers.
All functions in this file should be considered private APIs,
and can be changed without a notice.
"""
import argparse
import asyncio
import concurrent.futures
import configparser
import functools
import inspect
import json
import logging
import os
import queue
import pathlib
import platform
impo... |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from collections import Counter
from copy import deepcopy
from da... |
# -*- coding: utf-8 -*-
# RSScrawler
# Projekt von https://github.com/rix1337
"""RSScrawler.
Usage:
crawler.py [--config="<CFGPFAD>"]
[--testlauf]
[--docker]
[--port=<PORT>]
[--jd-user=<NUTZERNAME>]
[--jd-pass=<<PASSWORD>WORT>]
... |
import time
from collections import Counter
import pytest
import ray
from ray.util.iter import from_items, from_iterators, from_range, \
from_actors, ParallelIteratorWorker, LocalIterator
def test_metrics(ray_start_regular_shared):
it = from_items([1, 2, 3, 4], num_shards=1)
it2 = from_items([1, 2, 3, 4]... |
import functools
import os
from socket import gethostname
from subprocess import (
check_call,
check_output,
)
from time import sleep, time
import yaml
import apt_pkg
import json
import netaddr
import netifaces
from charmhelpers.core import sysctl
from charmhelpers.core.hookenv import (
config,
log,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.