text stringlengths 3.07k 22.1k |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Get your Spotify folder hierarchy with playlists into JSON.
:license: MIT, see LICENSE for more details.
"""
from __future__ import print_function
import argparse
import json
import os
import re
import subprocess
import sys
try:
from urllib import unquote_... |
#! /usr/bin/env python
# GPTune Copyright (c) 2019, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of any
# required approvals from the U.S.Dept. of Energy) and the University of
# California, Berkeley. All rights reserved.
#
# If you have questions ab... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""HLS color space.
"""
from __future__ import annotations
import math
import cv2
import numpy as np
import torch
from multipledispatch import dispatch
from torch import nn
from torch import Tensor
from onevision.cv.utils import batch_image_processing
from onevision.cv... |
from bs4 import BeautifulSoup
import numpy as np
import requests
import itertools
import sys
from wordcloud import WordCloud
def find_between(in_str, start='>', end='<'):
""" Find string between two search patterns.
"""
return in_str.split(start)[1].split(end)[0]
def unquote_str(in_str):
""" Decode ... |
#! /usr/bin/env python3
"""Create an OTU table for ProPhyle's classification output for NCBI-based indexes
Author: <NAME> <<EMAIL>>
Licence: MIT
"""
import argparse
import enum
import sys
from collections import Counter
# EXTERNAL
from ete3 import Tree, NCBITaxa
desc = """\
Program: prophyle_otu_table
Create an O... |
'''
Copyright (c) 2021, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the followi... |
import lzma
from pathlib import Path
import pytest
import bagit
import zipfile
import os
import csv
import gzip
import json
from datetime import datetime
from django.db import connections, utils
from capapi.documents import CaseDocument
from capdb.models import CaseMetadata, Court, Reporter, Citation, Jurisdiction, Ex... |
#!/usr/bin/env python3
# coding: utf-8
# Copyright 2016 <NAME>, https://github.com/tywtyw2002, and https://github.com/treedust
#
# 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:/... |
# Copyright 2021 AI Redefined Inc. <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
#!/usr/bin/env python3
import re
import warnings
from sys import exit
from os import path, makedirs
from urllib.parse import unquote
from dataclasses import dataclass
from concurrent.futures import ThreadPoolExecutor, as_completed
try:
import requests
import colorama
import threading
from tqdm import tq... |
import shutil
import tempfile
import unittest
import asyncio
import logging
import hashlib
from lbry.testcase import AsyncioTestCase
from lbry.conf import Config
from lbry.extras.daemon.storage import SQLiteStorage
from lbry.blob.blob_info import BlobInfo
from lbry.blob.blob_manager import BlobManager
from lbry.stream.... |
#!/usr/bin/env python
import re
import sys
import os
import time
import subprocess
def convert_registry_db(mysql_dump_file, pgsql_dump_file):
mysql_dump = open(mysql_dump_file)
pgsql_dump = open(pgsql_dump_file, "w")
insert_lines = []
for i, line in enumerate(mysql_dump):
line = line... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Benchmark definition
======================
"""
import copy
import itertools
from tabulate import tabulate
from orion.client import create_experiment
class Benchmark:
"""
Benchmark definition
Parameters
----------
name: str
Name of the b... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Implement a model-free approach called Deep DPG (DDPG)
@author: udacity, ucaiado
Created on 10/07/2018
"""
import numpy as np
import random
import copy
import os
import yaml
from collections import namedtuple, deque
import torch
import torch.nn.funct... |
"""
Demo code
To run our method, you need a bounding box around the person. The person needs to be centered inside the bounding box and the bounding box should be relatively tight. You can either supply the bounding box directly or provide an [OpenPose](https://github.com/CMU-Perceptual-Computing-Lab/openpose) detecti... |
"""
"""
import re
import os
import glob
import subprocess
import argparse
import tempfile
import xml.etree.ElementTree as ET
import parmed
import mdtraj
import seekr2.modules.common_base as base
import seekr2.modules.runner_browndye2 as runner_browndye2
MAX_B_SURFACE_FHPD_STRUCTURES = 1000
def make_proc_file_las... |
"""
The main fuzzer code.
"""
import hashlib
import logging
import random
import string
import time
# from byte_feedback import ByteFeedback, ByteIOFeedback
from collections import defaultdict
from pathlib import Path
import coverage
from target import plist_target
class ShouldTrace:
trace = True
def __ini... |
import meshed as ms
import pytest
@pytest.fixture
def example_graph():
return dict(a=['c'], b=['c', 'c'], c=['a', 'b', 'd', 'e'], d=['c'], e=['c', 'z'])
@pytest.fixture
def graph_children():
return {0: [1, 2], 1: [2, 3, 4], 2: [1, 4], 3: [4]}
@pytest.fixture
def digraph_children():
return {0: [1, 2], ... |
"""
Allow Panflute to be run as a command line executable
to be used as a Pandoc filter or used in Pandoctools
shell scripts as Pandoc filter with arguments.
Exports ``main`` and ``panfl``.
"""
import os
import os.path as p
from pathlib import Path
import sys
import click
from io import StringIO
from .io import load... |
"""
This module creates the app gallery
Enter details for new cards in the order you want them to appear in the gallery
"""
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, MATCH
import dash_bootstrap_components as dbc
from apps import text
from u... |
# -*- coding: utf-8 -*-
import os
from copy import deepcopy
from decimal import Decimal, ROUND_HALF_UP
from uuid import uuid4
from openregistry.lots.loki.utils import get_now
from openregistry.lots.core.constants import (
SANDBOX_MODE,
)
from openregistry.lots.loki.tests.fixtures import PARTIAL_MOCK_CONFIG
from op... |
# Copyright 2020 Canonical Ltd.
#
# 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, s... |
"""App
========
The base App class.
"""
import os
import inspect
import traceback
import sys
import logging
from functools import wraps
from os.path import dirname, join, isdir, expanduser
from more_kivy_app.config import apply_config, read_config_from_file, \
read_config_from_object, dump_config
if not os.envi... |
"""
The code below is based on the demo ridgeregression.py from the MPyC library on Feb 26th, 2020,
as implemented by <NAME>.
https://github.com/lschoe/mpyc/blob/2de1dd76db632bdc2a48acfbbaab841fa73cf8bd/demos/ridgeregression.py.
The underlying theory is published in the paper 'Efficient Secure Ridge Regression from
Ran... |
# Copyright 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# Python imports
import logging
# Third party imports
... |
"""By <NAME>"""
import xarray as xr
import requests
from pydap.client import open_url
from pydap.cas.urs import setup_session
def get_era5_pressure(username, password, date, var, session):
vrb = {'pv':'060',
'crwc':'075',
'u':'131',
'v':'132',
'z':'129',
'cswc':'076',
'q'... |
import numpy as np
import loupe
def asarray(a):
"""Convert the input to an array.
Parameters
----------
a : array_like
Input data, in any form that can be converted to an array. This
includes lists, lists of tuples, tuples, tuples of tuples,
tuples of lists and ndarrays.... |
#!/usr/bin/env python
import numpy as np
import h5py
import re
import sys
import operator
import argparse
from random import sample, seed
from math import ceil
from nltk.corpus import stopwords
from nltk.stem.wordnet import WordNetLemmatizer
from prep_hdf5 import line_to_words
def equal_length_chunks(l1, l2, l3, l4,... |
"""This is an implementation of an on policy batch sampler.
Uses a data parallel design.
Included is a sampler that deploys sampler workers.
The sampler workers must implement some type of set agent parameters
function, and a rollout function
"""
from collections import defaultdict
import pickle
import numpy as np
i... |
import errno
import getpass
import os
import signal
import subprocess
import threading
import time
from twitter.aurora.common.http_signaler import HttpSignaler
from twitter.common import log
from twitter.common.dirutil import chmod_plus_x, safe_mkdtemp
from twitter.common.log.options import LogOptions
from twitter.com... |
# pylint: disable=C0301
# pylint: disable=E0401
# pylint: disable=C0114
# pylint: disable=C0412
# pylint: disable=R1723
# pylint: disable=C0103
# Copyright 2021 - 2022, <NAME> <<EMAIL>>, Dr. <NAME> <<EMAIL>>
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# h... |
# Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Seeds a number of variables defined in chromium_config.py.
The recommended way is to fork this file and use a custom DEPS forked from
config/XXX/DEPS wit... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import math
import random
import logging
import sklearn
import pickle
import numpy as np
import mxnet as mx
from mxnet import ndarray as nd
import argparse
import mxnet.optimizer as optimiz... |
import re
from html.parser import HTMLParser
from typing import Any, Dict, Iterator, List, Optional, Tuple
from docx import Document
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.shared import Pt
from docx.text.paragraph import Paragraph
from docx.text.run import Run
from tinycss2 import parse_declaration_li... |
"""
Copyright 2021 <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... |
import warnings
import yfinance as yf
from pathlib import Path
import numpy as np
import pandas as pd
import requests
import seaborn as sns
import matplotlib as mpl
from matplotlib import pyplot as plt
from datetime import datetime, date
from yahooquery import Ticker
from tensorflow.keras.callbacks import ModelCheckpoi... |
# Based on code from https://towardsdatascience.com/paper-repro-deep-metalearning-using-maml-and-reptile-fd1df1cc81b0
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable as V
import random
from random import shuffle
from collections import OrderedDict
# Redefine a b... |
import re
import unicodedata
from datetime import date
from decimal import Decimal
from django.core.exceptions import ValidationError
from django.utils.timezone import now
from django.utils.translation import ugettext as _
EMAIL_VALIDATOR = re.compile(r'[a-zA-Z0-9\._-]+@[a-zA-Z0-9\._-]+\.[a-zA-Z]+')
PHONE_FILTER = re... |
from functools import reduce
def is_trivial(dependency):
(x, y) = dependency
return y <= x;
def is_superkey(key, dependency):
(x, y) = dependency
return key <= x
def is_bcnf(dependency, key):
return is_superkey(key, dependency) or is_trivial(dependency)
def str_dependency(dependency):
(x, y)... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# 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-... |
import configparser
import abc
from collections import defaultdict
from enum import Enum
from re import match, finditer, Pattern
from typing import Iterable, Union, Sequence
import numpy as np
import scipy.signal as signal
from sigpipes.joiner import Merge
from sigpipes.sigcontainer import SigContainer, DPath
class... |
# -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>
import weakref
import logging
from typing import List, Union
from renormalizer.mps.backend import np, backend, xp, USE_GPU
logger = logging.getLogger(__name__)
class Matrix:
def __init__(self, array, dtype=None):
assert array is not None
array... |
#!/usr/bin/env python3.7
'''A module building off of the cookiecutter templating application to create logical builds with
branching options and the ability to compose many different templates into one repository building
system.'''
from collections import OrderedDict
import argparse
import os
from cookiecutter.main ... |
from csv import writer
from re import sub
from flask import *
from libs.admin_authentication import *
from libs.s3 import s3_upload, create_client_key_pair
from libs.streaming_bytes_io import StreamingBytesIO
from database.models import Participant, Study
from config.constants import *
from pages.admin_page... |
"""TensorFlow utility functions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import namedtuple
import os
import tensorflow as tf
# Disable TensorFlow warnings.
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
# namedtuple for keeping models... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: taiga_issue
short_description: Cre... |
"""
* Experimental *
Like the map function, but can use a pool of threads.
Really easy to use threads. eg. tmap(f, alist)
If you know how to use the map function, you can use threads.
"""
__author__ = "<NAME>"
__version__ = "0.3.0"
__license__ = 'Python license'
import traceback, sys
from pygame... |
#!/bin/python
import numpy as np
import scipy as sp
def read_files(tarfname):
"""Read the training and development data from the speech tar file.
The returned object contains various fields that store the data, such as:
train_data,dev_data: array of documents (array of words)
train_fnames,dev_fnames... |
# -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... |
"""
This example is largely adapted from https://github.com/pytorch/examples/blob/master/imagenet/main.py
Before you can run this example, you will need to download the ImageNet dataset manually from the
`official website <http://image-net.org/download>`_ and place it into a folder `path/to/imagenet`.
Train on ImageN... |
import hashlib
import json
import time
from io import BytesIO
import requests
from websocket import create_connection, ABNF
import lib.streaming_converter as streaming_converter
from lib.yandex.stt_grpc import yandex_stt_grpc
from utils import REQUEST_ERRORS, RuntimeErrorTrace, url_builder_cached
from .audio_utils i... |
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
# -*- coding: utf-8 -*-
"""Helper functions for setting infolabels of list items"""
from __future__ import unicode_literals
from resources.lib.globals import g
import resources.lib.common as common
import resources.lib.cache as cache
import resources.lib.api.paths as paths
import resources.lib.kodi.library as library
... |
import json
import os
import pickle
import re
import traceback
from typing import List
import random
import pandas as pd
import argparse
#from stopwords_tfidf_generator import do_generate_stopwords
from tfidf_classifier import do_classify
from utils import Question, load_data_kse, postag_filter
# from vncorenlp impor... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... |
import collections.abc
from contextlib import suppress
from datetime import timedelta
from typing import (
TYPE_CHECKING,
Any,
Dict,
Hashable,
Iterable,
Mapping,
Optional,
Tuple,
Union,
)
import numpy as np
import pandas as pd
from . import formatting, utils
from .indexing import E... |
"""
This module stores table entries.
Due to the discovery process of the topology it is likely that domains and clusters change.
Thus old table entries (which are connected to old topologies) have to be deleted.
In order to identify those old tables, all (currently) written table entries will be stored. When the new... |
from flask import Flask, request, jsonify
import json
import logging
import os
import random
import string
import sys
import sentencepiece as spm
import torch
import torchaudio
import numpy as np
from fairseq import options, progress_bar, utils, tasks
from fairseq.meters import StopwatchMeter, TimeMeter
from fairseq.... |
import torch
from typing import Callable, Union, Mapping, Any, Sequence
from xitorch._utils.assertfuncs import assert_fcn_params, assert_runtime
from xitorch._core.pure_function import get_pure_function, make_sibling
from xitorch._impls.integrate.ivp.explicit_rk import rk4_ivp, rk38_ivp
from xitorch._impls.integrate.iv... |
import pygame
from random import randrange, randint
from itertools import cycle
pygame.init()
# Colors
COLOR_LIGHT_GREY = (230, 230, 230)
COLOR_LIGHT_BLUE = (51, 153, 255)
# Window
window = (960, 720)
center = (window[0] // 2, window[1] // 2)
screen = pygame.display.set_mode(window)
pygame.display.set_caption("PySna... |
# Source : http://www.sam.math.ethz.ch/~gradinar/Teaching/NumPhys/SomeTemplates/ode45.py
from numpy import double, sign, finfo, array, zeros, dot, mod, size, inf, all, max, min, abs, mat
from numpy.linalg import norm
def warning(type, string):
print('warning: ' + type)
print(string)
def error(type, string):... |
#!/usr/bin/python3
from __future__ import print_function
import sys
import optparse
import os.path
"""
This script can verify consistency of references (linkage) between XCCDF and
OVAL, and also search based on other criteria such as existence of policy
references in XCCDF.
Purpose:
This script can be used to per... |
import pytest
import mercantile
@pytest.mark.parametrize('args', [
(486, 332, 10),
[(486, 332, 10)],
[mercantile.Tile(486, 332, 10)]])
def test_ul(args):
expected = (-9.140625, 53.33087298301705)
lnglat = mercantile.ul(*args)
for a, b in zip(expected, lnglat):
assert round(a - b, 7) =... |
#
# 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 us... |
import os
import cv2
import sys
from metrics import seg_metrics
import imageio
import numpy as np
import json
from copy import deepcopy
from skimage.draw import polygon
from skimage.transform import resize
sys.path.append("/DATA/mishra.4/mishra.4/dsve/")
sys.path.append("/DATA/mishra.4/mishra.4/DeepGrabCut/")
os.chdir... |
from networkx.algorithms.bipartite import hopcroft_karp_matching
from networkx.algorithms.cycles import find_cycle
from networkx.algorithms.matching import is_perfect_matching
from networkx.exception import NetworkXNoCycle
from networkx import DiGraph, connected_components, weakly_connected_components, is_directed
from... |
# %%
import sys
sys.path.append("../../..")
from scipy.linalg import null_space
import copy
import numpy as np
from numpy.linalg import matrix_rank, matrix_power, cholesky, inv
import torch
from torch.optim import Adam
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm
import util.geometry_util ... |
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# -*- coding: utf-8 -*-
"""
_base.py
:Created: 5/13/14
:Author: timic
"""
import logging as _logging
logger = _logging.getLogger(__name__)
import os
from lxml import etree as _etree
from spyne.interface.wsdl.wsdl11 import Wsdl11 as _Wsdl11
from spyne.model.fault import Fault as _Fault
from spyne.const.http import ... |
import scipy as sp
from scipy import linalg as la
def dct_mat(n):
"""Construct an nxn DCT matrix"""
tmp = sp.array(sp.cos([(j*.5)*k*sp.pi/n for j in range(n) for k in range(n)]).reshape((n,n))).T
return sp.array([i/la.norm(i) for i in tmp])
def dct1d_expr(data, blksize, npoints=200, terms=-1):
"""Inte... |
import numpy as np
def float_endf(string):
"""
convert endf-float format to scientific notation
"""
if "Inf" in string:
string = "0.0"
if "." in string:
string = string[0] + string[1:].replace("+", "e+", 1)
string = string[0] + string[1:].replace("-", "e-", 1)
return flo... |
import os
from collections import OrderedDict
from concurrent.futures import ThreadPoolExecutor
from io import BytesIO
from logging import getLogger as get_logger
from math import ceil
from statistics import mean
from typing import Optional
from megfile.errors import S3FileChangedError, patch_method, raise_s3_error, s... |
# encoding: utf-8
import datetime
import json
from django import forms
try:
from django.core.urlresolvers import reverse
except ImportError: # Django 1.11
from django.urls import reverse
from django.forms import Widget
from django.utils import formats
from django.utils.html import format_html
from django.utils... |
#
# @file TestRequiredAttributes.py
# @brief Test hasRequiredAttributes unit tests
#
# @author <NAME> (Python conversion)
# @author <NAME>
#
# $Id$
# $HeadURL$
#
# This test file was converted from src/sbml/test/TestRequiredAttributes.cpp
# with the help of conversion sciprt (ctest_converter.pl).
#
#<!-------... |
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... |
#!/usr/bin/env python3
"""
retdec-color-c
~~~~~~~
Color given C file using the IDA pro tags.
"""
#=====================================================================================
import sys
import re
from pygments import highlight
from pygments.formatter import Formatter
from pygments.formatters import RawT... |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by <NAME> (<EMAIL>)
# Modified by <NAME> (<EMAIL>)
# ------------------------------------------------------------------------------
from __future__ import absolute_impo... |
# Copyright 2020 Google 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 writing,... |
# Дерево двоичного поиска
# Список сыновей
# A = A ⋂ B Из дерева А исключаются узлы, отсутствующие в дереве В.
# А - обратный, B - симметричный
class BinarySearchTree:
def __init__ (self, name):
self.root = None
self.size = 0
self.__name__ = name
def length(self):
return self.... |
#!/usr/bin/env python3
#pylint: disable=line-too-long,missing-docstring,invalid-name
from __future__ import absolute_import
import json
import os
from time import time, strftime
import arrow
import requests
from changelog.gerrit import GerritServer, GerritJSONEncoder
from changelog import get_changes
from config impo... |
#!/usr/bin/env python
# --------------------------------------------------------------
# simple script to submit and monitor aws batch jobs
# --------------------------------------------------------------
import argparse
import boto3
from datetime import datetime
import gevent.monkey
gevent.monkey.patch_all()
import ge... |
from abc import ABC
from typing import Any, Optional, Protocol, Dict, List
from neighborly.core.ecs import Component, GameObject
from neighborly.core.rng import IRandNumGenerator
from neighborly.core.utils.tracery import set_grammar_rng
class AbstractFactory(ABC):
"""Abstract class for factory instances
Att... |
#!/usr/bin/env python2
"""
Generates a price list from CoreCommerce data in PDF form.
Prices are adjusted to include any discount and sales tax. They are
then rounded to the nearest dollar. The intent is to use the price
list at fairs and shows to avoid the handling of change. It also
makes accounting easier becau... |
from functools import wraps
from flask import Flask, render_template, request, redirect, session, jsonify
from SPARQLWrapper import SPARQLWrapper, JSON
from flask_mail import Mail, Message
import requests
import re
app = Flask(__name__)
app.secret_key = b'\<KEY>'
mail= Mail(app)
app.config['MAIL_SERVER']... |
#!/usr/bin/env python
import inspect
import functools
import sys
import weakref
import re
from libmirheo import *
__all__ = ["version", "tools"]
# Global variable for the mirheo coordination class
# Used in decorators to access compute task status
# This variable made a weak reference to not prevent
# cleanup of th... |
"""
HTTP-based download of files.
"""
from __future__ import absolute_import
import logging
import re
from contextlib import closing
import feedparser
import requests
from lxml import etree
from ._core import SimpleObject, DataSource, fetch_file, RemoteFetchException
from .compat import urljoin
DEFAULT_CONNECT_TIME... |
# stdlib
import logging
from typing import Any
from typing import Dict
from typing import List
from typing import Union
# third party
import pandas as pd
# syft absolute
from syft import deserialize
from syft.core.common import UID
from syft.core.node.abstract.node import AbstractNodeClient
from syft.core.node.common... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import os
import re
from functools import reduce
import geopandas as gpd
import pandas as pd
from osgeo import ogr
from shapely.ops import unary_union
"""
Statistical Units, Statistics Finland The material was downloaded from Statistics Finland's
interfac... |
"""Model generic, a dual polarized antenna element."""
# TobiaC 2015-12-02
import numpy
import matplotlib.pyplot as plt
import matplotlib.dates
from antpat.reps.sphgridfun import pntsonsphere, tvecfun
from antpat.io.feko_ffe import FEKOffe
from antpat.radfarfield import RadFarField
class DualPolElem(object):
"""... |
from __future__ import print_function, with_statement
import logging
import os
from contextlib import contextmanager
from file_utils import temporary_file
from subprocess import Popen, PIPE
from urllib2 import urlopen
logger = logging.getLogger(__name__)
class CommandError(Exception):
"""Problem executing or ini... |
from dataclasses import dataclass
from typing import List, Optional, Mapping, Sequence
from datapublic.common_fields import CommonFields
from datapublic.common_fields import FieldName
from datapublic.common_fields import PdFields
import pandas as pd
import structlog
from libs import pipeline
from libs.datasets impor... |
#!/usr/bin/env python3
""" Demonstration of eBPF limitations and the effect on USDT with the
net:inbound_message and net:outbound_message tracepoints. """
# This script shows a limitation of eBPF when data larger than 32kb is passed to
# user-space. It uses BCC (https://github.com/iovisor/bcc) to load a sandboxed... |
"""
file: util.py
-------------
Contains utility functions.
"""
from datetime import datetime
import json
import logging
import os
import xml.etree.ElementTree as ET
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from PIL import Image
import scikitplot as skplt
from sklearn.metrics import balan... |
#!/usr/bin/env python
import rospy
import tf
import sys
import math
import numpy
from geometry_msgs.msg import PointStamped
from deictic_gestures.srv import LookAt, CanLookAt
from deictic_gestures.msg import LookAtStatus
from pepper_resources_synchronizer_msgs.srv import MetaStateMachineRegister, MetaStateMachineRegis... |
'''
Created on August 29, 2017
@author: optas
'''
import numpy as np
import string
import copy
from six.moves import xrange
from shapeglot.simple_utils import iterate_in_chunks
def _all_tensors_have_same_rows(tensor_list):
n = tensor_list[0].shape[0]
for i in xrange(1, len(tensor_list)):
if n != te... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
""" Collection of Request utility functions """
import hashlib
import time
import subprocess
import sys
import ast
import uuid
import types
from engine.errors import ResponseParsingException
from engine.errors import TransportLayerException
from... |
"""Matchzoo toolkit for text pre-processing."""
import re
import abc
import nltk
import typing
import collections
import numpy as np
match_punc = re.compile('[^\w\s]')
class ProcessorUnit(metaclass=abc.ABCMeta):
"""Process unit do not persive state (i.e. do not need fit)."""
@abc.abstractmethod
def tr... |
""" This is a dummy baseline. It is just supposed to check if ingestion and
scoring are called properly.
"""
import os
import logging
import csv
import time
import copy
import json
import random
import psutil
from metadl.api.api import MetaLearner, Learner, Predictor
import numpy as np
import gin
import torch
imp... |
import numpy as np
import numpy.ma as ma
import warnings
import numba
try:
import scipy.sparse as sp
SCIPY_INSTALLED = True
except ImportError:
SCIPY_INSTALLED = False
class InvalidValuesWarning(UserWarning):
pass
def _pad_list(x, padding_val=-999):
if not isinstance(x, list):
raise Typ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.