text stringlengths 6.04k 39.5k |
|---|
#! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2015 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
... |
# Copyright 2021 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... |
import datetime as dt
from copy import deepcopy
from decimal import Decimal as D
from itertools import chain
from django.conf import settings
from django.utils.text import Truncator, capfirst
from django.utils.translation import activate, gettext as _
from pdfdocument.document import (
TA_RIGHT,
Frame,
Ma... |
"""Utilities for file handler operation."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import atexit
import logging
import os
import re
import shutil
import sys
import tarfile
import tempfile
import zipfile
from datetime import datetime
import request... |
# -*- coding: utf-8 -*-
# jsonfile - provides reading of a json file containing
# include references, comments and assignment to
# variables
#
# author: Dr. <NAME>, 2021-08
#====================
import io
import json
from .operatingsystem import OperatingSystem
from .simplelogging import Loggi... |
# Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
# 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... |
import re
from functools import partial
from inspect import signature
from typing import Any, Dict, Optional
from django.http import HttpRequest, HttpResponse
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
f... |
# coding : UTF-8
"""
File Name: setup_and_play_game.py
Description: Hit&Blowの主要なクラス
Created on october 7,2021
Created by <NAME>, <NAME>, <NAME>
"""
import random
import time
import itertools
import argparse
import requests
session = requests.Session()
class Playgame():
"""16進数5桁のHit&Blow
手入力で遊ぶモード, 自動探索で遊ぶモード... |
import logging
import os
import string
from collections import defaultdict
from contextlib import suppress
from dataclasses import dataclass
from typing import TYPE_CHECKING, Dict, Optional
from funcy import cached_property, project
import dvc.prompt as prompt
from dvc.exceptions import (
CacheLinkError,
Chec... |
#!/usr/bin/env python
import numpy as np
import inspect
import functools
from collections.abc import Iterable
from abc import abstractmethod
from dash.development.base_component import Component as DashComponentBase
from dash.development.base_component import ComponentMeta as DashComponentMeta
import dash_bootstrap_c... |
import argparse
import json
import os
from typing import Dict, List, Tuple
from matplotlib import pyplot as plt
from matplotlib import gridspec
import numpy as np
from tqdm import tqdm
from nuscenes import NuScenes
from nuscenes.eval.lidarseg.evaluate import LidarSegEval
from nuscenes.eval.lidarseg.utils import Confu... |
import sys
from newspaper import Article
from requests import head
from tldextract import extract
from urllib.parse import urlparse
import json
import re
import urllib
from decouple import config
from datetime import datetime
from dateutil.parser import parse
try:
from bs4 import BeautifulSoup
except ImportError... |
#!/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.
import json
import logging
from multiprocessing import Process
from time import sleep, time
from typing import Any, Di... |
"""
TEM: ABEM WalkTEM
=================
The modeller ``empymod`` models the electromagnetic (EM) full wavefield Greens
function for electric and magnetic point sources and receivers. As such, it can
model any EM method from DC to GPR. However, how to actually implement a
particular EM method and survey layout can be t... |
# coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... |
"""Submatrix-wise Vector Embedding Learner.
Implementation of SwiVel algorithm described at:
http://arxiv.org/abs/1602.02215
This program expects an input directory that contains the following files.
row_vocab.txt, col_vocab.txt
The row an column vocabulary files. Each file should contain one token per
line;... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
# coding: utf-8
# ### Autoencoders and Neural Network for Place recognition with WiFi fingerprints
# Implementation of algorithm discussed in <a href="https://arxiv.org/pdf/1611.02049v1.pdf">Low-effort place recognition with WiFi fingerprints using Deep Learning </a>
# In[13]:
import pandas as pd
import numpy as n... |
#!/usr/bin/python3.5
"""
BSD 3-Clause License
Copyright (c) 2019, <NAME>, Aalto University, Finland
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 abo... |
#!/usr/bin/env python2
from __future__ import print_function
import argparse
import datetime
import os
import subprocess
import sys
import pysam
percent = lambda small, big: int(100.0 * small / big) if big != 0 else 0.0
def parse_args(args=None):
parser = argparse.ArgumentParser("Runs marginPolish on assembly,... |
"""Create an AWS instance to reproduce Buildkite CI builds.
This script will take a Buildkite build URL as an argument and create
an AWS instance with the same properties running the same Docker container
as the original Buildkite runner. The user is then attached to this instance
and can reproduce any builds commands... |
# limit memory usage..
import glob
import logging
import os
import cv2
import numpy as np
import pandas
# limit memory usage..
from keras import backend as K
from keras.layers import Input, Convolution3D, MaxPooling3D, Flatten, AveragePooling3D
from keras.metrics import binary_accuracy, binary_crossentropy, mean_absol... |
import wandb
# import math
import numpy as np
# import matplotlib.pyplot as plt
import os
# import sys
import argparse
import torch
import torch.nn as nn
# import torch.nn.functional as F
import torchvision.transforms as transforms
import torchvision
# from torch.autograd import Variable
from torch.utils.data import ... |
'''
Created on Oct 6, 2010
@author: Mark V Systems Limited
(c) Copyright 2010 Mark V Systems Limited, All rights reserved.
'''
from collections import defaultdict
import os
from arelle import ViewWinTree, ModelDtsObject, ModelInstanceObject, ModelRenderingObject, XbrlConst, XmlUtil, Locale
from arelle.ModelRelationshi... |
#!/usr/bin/env python3
from testUtils import Utils
from Cluster import Cluster
from WalletMgr import WalletMgr
from Node import Node
from Node import ReturnType
from TestHelper import TestHelper
from testUtils import Account
import re
import os
import time
import signal
import subprocess
import shutil
##############... |
#!/usr/bin/python
# encoding: utf-8
from __future__ import unicode_literals
from capstone import *
from keystone import *
roundtrip_tests = [
("x64", "adc qword ptr [edx + r12d*2], r8"),
("x64", "add qword ptr [ecx + 0x66ccefe4], r11"),
("x64", "and rax, 0xffffffffcf6f1a35"),
("x64", "bsr r12, qword ... |
# coding=utf-8
# Copyright 2020 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
# Copyright 2020 <NAME>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... |
# -*- coding: utf-8 -*-
"""
Twokenize -- a tokenizer designed for Twitter text in English and some other European languages.
This tokenizer code has gone through a long history:
(1) <NAME> wrote original version in Python, http://github.com/brendano/tweetmotif
TweetMotif: Exploratory Search and Topic Summarizati... |
# 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... |
import argparse
import configparser
import os
import subprocess
import sys
import yaml
from openlabcmd import exceptions
from openlabcmd.plugins import base
from openlabcmd import utils
from openlabcmd.utils import _color
from openlabcmd import zk
from openlabcmd import repo
from openlabcmd import hint
class OpenLab... |
"""Some miscellaneous utility functions."""
from __future__ import division
from contextlib import contextmanager
import os
import re
import sys
import math
import warnings
import unittest
from fnmatch import fnmatchcase
from six import string_types, PY2, reraise
from six.moves import range, cStringIO as StringIO
# n... |
# -*- coding: utf-8 -*-
import os
import codecs
from collections import Counter, defaultdict
from itertools import chain, count
import torch
import torchtext.data
import torchtext.vocab
from onmt.Utils import aeq
from pdb import set_trace
PAD_WORD = '<blank>'
UNK = 0
BOS_WORD = '<s>'
EOS_WORD = '</s>'
def _getsta... |
#!/usr/bin/env python
#
# Copyright (C) 2018 <NAME> <<EMAIL>>
# Copyright (C) 2019-2021 <NAME> <<EMAIL>>
#
# 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 witho... |
'''
Copyright 2020 The Microsoft DeepSpeed Team
'''
import json
import math
import importlib
import torch
from torch import nn
from torch.autograd import Function
import time
from ... import op_builder
#from ...inference.engine import inference_cuda_module, specialized_mode
# Cuda modules will be imported if needed
inf... |
# -*- coding: utf-8 -*-
## Copyright 2009-2021 NTESS. Under the terms
## of Contract DE-NA0003525 with NTESS, the U.S.
## Government retains certain rights in this software.
##
## Copyright (c) 2009-2021, NTESS
## All rights reserved.
##
## This file is part of the SST software package. For license
## information, see... |
import math
import sys
import os
import numpy as np
import time
def dist(x1, y1, x2, y2):
return math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
def print_(msg):
print("WCON gen >>> %s"%(msg))
def generate_wcon(pos_file_name,
wcon_file_name,
rate_to_plot=1,
... |
# Copyright 2015 <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/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software... |
# TODO
# implement counter class
import numpy as np
import math
import dlib, cv2
from scipy.spatial import distance as dist
#----------- Supplementary Function Definitions -----------------
def get_gaze_ratio(eye_points, facial_landmarks, img = img):
left_eye_region = np.array([(facial_landmarks.part(eye_point... |
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
#
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#
import hashlib
from typing import Dict, List
from normalization import DestinationType
from normalization.transform_catalog.destination_name_transformer import DestinationNameTransformer
# minimum length of parent name used for nested streams
MINIMUM_PAREN... |
# Copyright 2021 UC Davis Plant AI and Biophysics Lab
#
# 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 ... |
# Copyright 2020 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, ... |
# Tetromino for Idiots, by <NAME> <EMAIL>
# (Pygame) Tetris, but... simpler.
import random, time, pygame, sys
from pygame.locals import *
FPS = 25
WINDOWWIDTH = 640
WINDOWHEIGHT = 480
BOXSIZE = 20
BOARDWIDTH = 10
BOARDHEIGHT = 20
BLANK = '.'
MOVESIDEWAYSFREQ = 0.15
MOVEDOWNFREQ = 0.1
XMARGIN = int((WINDOWWIDTH - ... |
# Copyright 2016-2020 The <NAME> at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");
# you ... |
"""Tools for dealing with album data."""
import musicbrainzngs
import os
import os.path
import shutil
import string
import subprocess
import sys
import tempfile
import textwrap
import unicodedata
import yaml
from .appinfo import __version__, __url__
from .error import CdparacordError
from .xdg import XDG_MUSIC_DIR
cl... |
##########################################################################
#
# Copyright (c) 2011-2012, <NAME>. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provi... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
search.py
This module holds functions used to find and record the diagonals in the
thresholded matrix, T. These functions prepare the diagonals found to for
transformation and assembling later.
The module contains the following functions:
* find_complete_li... |
import copy
import os
from itertools import chain
import typing
from typing import Optional, Set, Sequence, Any, MutableSet
import time
import re
from collections import defaultdict
import logging
import random
import networkx as nx
from conda_forge_tick.contexts import FeedstockContext
from conda_forge_tick.migrator... |
"""
PISA pi stage for the calculation of earth layers and osc. probabilities
Maybe it would amke sense to split this up into a separate earth layer stage
and an osc. stage....todo
"""
from __future__ import absolute_import, print_function, division
import numpy as np
from numba import guvectorize
from pisa import ... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import math
from mrcrowbar import colour, statistics
from mrcrowbar.common import is_bytes, bounds
#: Container for ANSI escape sequences for text formatting
ANSI_FORMAT_BASE = '\x1b[{}m'
#: ANSI escape sequence for resetting the colour settings to the default.
ANSI_FORMAT_RESET_CMD = '0'
ANSI_FORMAT_RESET = ANSI_FOR... |
# -*- coding: utf-8 -*-
import os
import numpy as np
from PIL import ImageEnhance
import pickle
from PIL import Image
import random
import torch.utils.data as data
import torchvision.transforms as transforms
import torch
import cv2
def cv_random_hflip(image, mask, center, boundary):
flip_flag = random.randint(0, 1)... |
import threading
import time
import usb.core
import usb.util
from ThreadConstants import *
STATUS_BAD_STATE = 204
STATUS_OK = 206
STATUS_PACKET_REJECTED = 207
STATUS_FINISH = 236
STATUS_BUSY = 238
STATUS_POWER = 239
STATUS_NO_DEVICE = -1
def get_code_string_from_code(code):
if code == STATU... |
import time
import os
from template_finder import TemplateFinder
from config import Config
from screen import Screen
from utils.misc import color_filter, wait
from logger import Logger
import keyboard
from utils.custom_mouse import mouse
from math import sqrt
class Npc:
#A1
KASHYA = "kashya"
CHARSI = "cha... |
import logging
from scout.constants import CLINSIG_MAP, CALLERS, ACMG_COMPLETE_MAP
from scout.server.links import add_gene_links, ensembl, add_tx_links
LOG = logging.getLogger(__name__)
def add_panel_specific_gene_info(panel_info):
"""Adds manualy curated information from a gene panel to a gene
The panel i... |
#!/usr/bin/env python3
import libspn as spn
import tensorflow as tf
import numpy as np
import collections
from random import shuffle
def _broadcast_to_2D(test_inputs, subset_indices=None, n_stack=2):
# Subset indices is either specified or set to [0, ..., len(inputs)-1]
subset_indices = subset_indices or lis... |
import numpy as np
import torch
import torch.nn.functional as F
def FDM_Darcy(u, a, D=1):
batchsize = u.size(0)
size = u.size(1)
u = u.reshape(batchsize, size, size)
a = a.reshape(batchsize, size, size)
dx = D / (size - 1)
dy = dx
# ux: (batch, size-2, size-2)
ux = (u[:, 2:, 1:-1] - u... |
'''
Pull out HI properties (and/or others) from a set of point sources.
Create a distance map as a function of distance from the nearest source.
'''
import astropy.coordinates as coord
from astropy.table import Table, Column
import astropy.units as u
import astropy.constants as const
import numpy as np
from galaxies... |
#####################################################
# #
# Source file of the Matrix Elements exports for #
# the PyOut MG5aMC plugin. #
# Defines some classes which inherit from #
# those inside create aloha, but use the module ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2020 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://trac.edgewall.org/wiki/TracLicense.
... |
import ast
import decimal
from collections.abc import Iterable
#TODO
"""
- implement imports: make python modules using es3 js module pattern
- implement builtins/exc: make map of builtins and exceptions to js
"""
GLOBALS = set()
def SubscriptPrint(node, nodemap):
value, slice_ = generate_code(node.value), genera... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import unittest
import re
import os
import os.path
import shutil
import tempfile
import tarfile
import xml.etree.ElementTree as ET
import io
import mimetypes
import flask
from werkzeug.exceptions import NotFound
import browsepy
import browsepy.file
import browsepy.manag... |
import pytest
import networkx as nx
class TestSubGraphView:
gview = staticmethod(nx.graphviews.subgraph_view)
graph = nx.Graph
hide_edges_filter = staticmethod(nx.filters.hide_edges)
show_edges_filter = staticmethod(nx.filters.show_edges)
@classmethod
def setup_class(cls):
cls.G = nx... |
from sqlalchemy import (
Table,
Column,
Float,
Integer,
BigInteger,
Unicode,
ForeignKey,
ForeignKeyConstraint,
PrimaryKeyConstraint,
Boolean,
DateTime,
CheckConstraint,
Index,
event,
and_
)
from sqlalchemy.sql.expression import (
func,
select,
)
from... |
# Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
#!/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.
"""
File for miscellaneous utility functions and constants.
"""
from collections import deque, OrderedDict
from typing i... |
import pysam
from pyfaidx import Fasta
from collections import defaultdict
from datetime import datetime
from PIL import Image
import sys
import numpy
import copy
import csv
"""
This module takes an alignment file and produces a pileup across all alignments in a query region, and encodes the
pileup as an image where e... |
"""
Copyright (c) 2016, <NAME>
Description: Sample Python script for Hyperlapse media processor
License: MIT (see LICENSE.txt file for details)
Documentation : https://azure.microsoft.com/en-us/documentation/articles/media-services-hyperlapse-content/
"""
import os
import json
import amspy
import time
import sys
#impo... |
# Copyright The PyTorch Lightning team.
#
# 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 i... |
from __future__ import print_function
#
# This (non-idiomatic) python script is in charge of
# 1) Parsing all .i files in the 'swig/' directory, and
# collecting all function, classes & methods comments
# that can be found between <pydoc>/</pydoc> tags.
# 2) Reading, line by line, the idaapi_<platform>.py... |
# Copyright (c) 2015, Dataent Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import datetime
from dataent import _
import dataent
import dataent.database
import dataent.utils
from dataent.utils import cint, flt, get_datetime, datetime
import dataent.util... |
# -*- coding: utf-8 -*-
"""Some utility functions."""
# Authors: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
from copy import deepcopy
import logging
import json
import numpy as np
from .check import _check_pandas_installed, _check_preload, _validate_type
from ._logging import warn, verbose
from .numerics import o... |
import asyncio
import html
import logging
from typing import Dict
from typing import List
from typing import Optional
from irc.modes import parse_channel_modes
from heisenbridge.command_parse import CommandParser
from heisenbridge.private_room import parse_irc_formatting
from heisenbridge.private_room import PrivateR... |
import matplotlib.pyplot as plt
from numpy.core.defchararray import center
from spatialmath.base.vectors import getvector
import numpy as np
import scipy as sp
# TODO
# axes_logic everywhere
# dont do draw
# return reference to the graphics object
# don't have own color/style options, go for MPL ones
# unit tests
# se... |
import warnings
import numpy as np
import pandas as pd
from pandas.api.types import (
is_categorical_dtype,
is_datetime64tz_dtype,
is_interval_dtype,
is_period_dtype,
is_scalar,
is_sparse,
union_categoricals,
)
from ..utils import is_arraylike, typename
from ._compat import PANDAS_GT_100
f... |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... |
import warnings
from collections import namedtuple
from dagster import check
from dagster.core.errors import DagsterInvalidDefinitionError, DagsterInvariantViolationError
from dagster.utils import frozentags
from .dependency import DependencyDefinition, MultiDependencyDefinition, SolidInvocation
from .hook import Hoo... |
from contextlib import suppress
from operator import itemgetter
import factory
import pytest
from django.core.exceptions import FieldDoesNotExist
from rest_framework import status
from rest_framework.reverse import reverse
from datahub.core.test_utils import format_date_or_datetime
from datahub.interaction.models imp... |
# ! /usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licen... |
# -------------------------------------------------------------------------
#
# Part of the CodeChecker project, under the Apache License v2.0 with
# LLVM Exceptions. See LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# ---------------------------------------------------... |
# Python imports
# Don't add any from __future__ imports here. This code should execute
# against standard Python.
import unittest
from unittest import skipUnless
import datetime
import random
import time
import signal
import threading
# Project imports
import posix_ipc
# Hack -- add tests directory to sys.path so Pyt... |
#!/usr/bin/env python3
import collections
from concurrent.futures import ThreadPoolExecutor
import logging
import asyncio
import ipaddress
import libvirt
import re
import pathlib
import urllib.request
import sys
import distutils.util
from virt_lightning.symbols import get_symbols
from virt_lightning.configuration im... |
# Trezor interaction script
from ..hwwclient import HardwareWalletClient
from ..errors import ActionCanceledError, BadArgumentError, DeviceAlreadyInitError, DeviceAlreadyUnlockedError, DeviceConnectionError, DEVICE_NOT_INITIALIZED, DeviceNotReadyError, UnavailableActionError, common_err_msgs, handle_errors
from .trezo... |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from collections import defaultdict
from casexml.apps.stock.models import StockTransaction
from datetime import timedelta, datetime
from django.template.defaultfilters import floatformat
from corehq.apps.commt... |
#
#*******************************************************************************
# Copyright 2014-2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.a... |
from copy import deepcopy
from pystac.item import (Item, Asset)
from pystac import STACError
class EOItem(Item):
"""EOItem represents a snapshot of the earth for a single date and time.
Args:
id (str): Provider identifier. Must be unique within the STAC.
geometry (dict): Defines the full foo... |
# To maximize python3/python2 compatibility
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from .StarFile import StarBlock,StarFile,StarList,StarDict
from io import StringIO
# An alternative specification for the Cif ... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
#! /usr/bin/env python
"""Just a small little script to help manage Packer templates in this repo."""
import argparse
from datetime import datetime, timezone
import json
import logging
import os
import re
import shutil
import time
import subprocess
import sys
import requests
import git
__author__ = "<NAME>."
__email_... |
# -*- coding: utf-8 -*-
"""
From original at https://github.com/facebookresearch/detectron2/blob/master/detectron2/engine/defaults.py
Original copyright of Facebook code below, modifications by <NAME>, Copyright 2021.
"""
# Copyright (c) Facebook, Inc. and its affiliates.
"""
This file contains components with some d... |
#!/usr/bin/env python3
import argparse
import requests
import urllib3
import sys
import json
import re
import time
# The purpose of this script is to facilitate backup/restore of settings in RP4VMs
# The script exclusively uses the new RESTful API in RP4VMs 5.3
# Author - <NAME> <<EMAIL>>
# Version 1 - A... |
'''This module has a class JSONAble for serialization of tables/list of dicts to and from JSON encoding
Created on 2020-09-03
@author: wf
'''
import json
import datetime
import sys
import re
from lodstorage.lod import LOD
class JSONAbleSettings():
'''
settings for JSONAble - put in a separate class so they... |
import logging
import math
import os
from typing import List, Union
import astropy.io.fits as pyfits
import numpy as np
import pandas as pd
import scipy
import scipy.optimize
import scipy.stats
from astropy.convolution import convolve
from spexxy.data.losvd import LOSVD
from spexxy.data.spectrum import Spectrum
clas... |
##################################################### Import system libraries ######################################################
import matplotlib as mpl
mpl.rcdefaults()
mpl.rcParams.update(mpl.rc_params_from_file('meine-matplotlibrc'))
import matplotlib.pyplot as plt
import numpy as np
import scipy.constants as c... |
"""Container for parameters (:mod:`fluiddyn.util.paramcontainer`)
=================================================================
.. currentmodule:: fluiddyn.util.paramcontainer
Provides:
.. autoclass:: ParamContainer
:members:
:private-members:
"""
import os
import re
from ast import literal_eval
from cop... |
import numpy as np
import scipy as sp
from moment_equations_util import *
# Python version of Tom's Moment equations
def run_moments(params, h, z_interval, energy, current=0.0, pipe_radius=0.0, hardedge_flag=1):
'''
Given a set of params, run the moment equations
params are:
[solenoid start position,... |
from tkinter import *
import math
import parser
import tkinter.messagebox
root = Tk()
root.title("Scientific Calculator")
root.configure(background ="cyan")
root.resizable(width = False, height = False)
root.geometry("480x568+0+0")
calc = Frame(root)
calc.grid()
class Calc():
def __init__(self):
self.total = 0
... |
import doctest
import re
import unittest
import stubs
def iter_public_names():
return (name for name in dir(stubs) if not name.startswith('_'))
def iter_public_objects():
return (getattr(stubs, name) for name in iter_public_names())
def iter_stubs():
for obj in iter_public_objects():
if isins... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.