gt
stringclasses
1 value
context
stringlengths
2.49k
119k
#!/usr/bin/env python # # Copyright (C) 2008, 2009 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 appli...
# Copyright 2014 Modelling, Simulation and Design Lab (MSDL) at # McGill University and the University of Antwerp (http://msdl.cs.mcgill.ca/) # # 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...
########################################################################## # # Copyright (c) 2010-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redis...
"""A client for OBO-sourced identifier mappings.""" import json import logging import os import pickle import re from collections import Counter, defaultdict import obonet __all__ = [ 'OboClient', 'RESOURCES', ] HERE = os.path.dirname(os.path.abspath(__file__)) RESOURCES = os.path.join(HERE, os.pardir, 'res...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (...
# # 1337ris -- mainmenu.py # Henry Weiss # # State class that handles the main menu. # from headers import * # # Constants # MENU_FRAMES = 10 FRAME_DELAY = 100 # ms INITIAL_KEY_DELAY = 500 KEY_REPEAT_DELAY = 30 # Info for each table column HIGH_SCORES_TABLE = ['', 'Name', 'Score', 'Level', 'Time'] HIGH_SCORES_TAB...
from __future__ import division, print_function, absolute_import import os import warnings import numpy as np from numpy.testing import assert_equal, assert_allclose, assert_, \ TestCase, assert_raises from numpy import array, asarray, pi, sin, cos, arange, dot, ravel, sqrt, round from scipy.interpolate.fitpack i...
# Copyright 2017 OVH SAS # 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 applicable law or agreed ...
""" querylib.py This file defines functions for querying the database tables. """ import sys import csv import collections import io import time from multiprocessing import Process import Logic.bool_compare as bc from Interface.helplib import query_options, print_tables, print_attributes, print_query, print_output O...
# 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 unde...
from tests.test_helper import * class TestMerchantAccount(unittest.TestCase): VALID_APPLICATION_PARAMS = { "individual": { "first_name": "Joe", "last_name": "Bloggs", "email": "joe@bloggs.com", "phone": "555-123-1234", "address": { ...
import copy import enum import inspect import logging from contextlib import contextmanager from functools import partial, partialmethod from typing import Any, Callable, Dict, List, Set, Tuple, Union from gen.exceptions import ValidationError from pkgpanda.util import hash_checkout log = logging.getLogger(__name__)...
from __future__ import print_function, division from sympy.core import (Set, Basic, FiniteSet, EmptySet, Dict, Symbol, Tuple) from sympy.core.compatibility import xrange class Class(Set): r""" The base class for any kind of class in the set-theoretic sense. In axiomatic set theor...
import datetime import itertools import json import logging import os import sys from google.appengine.api import mail from google.appengine.api import memcache import stripe import webapp2 import env import handlers import model import templates import util import wp_import class Error(Exception): pass # TODO(hjf...
__author__ = "isparks" from lxml import etree MEDI_NS = "{http://www.mdsol.com/ns/odm/metadata}" ODM_NS = "{http://www.cdisc.org/ns/odm/v1.3}" XLINK_NS = "{http://www.w3.org/1999/xlink}" def getEnvironmentFromNameAndProtocol(studyname, protocolname): """ Extract environment name using studyname and protocol...
# 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...
# 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 # d...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: release-1.23 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import si...
# coding=utf-8 # flake8: noqa E302 """ Cmd2 functional testing based on transcript """ import os import random import re import sys import tempfile from unittest import ( mock, ) import pytest import cmd2 from cmd2 import ( transcript, ) from cmd2.utils import ( Settable, StdSim, ) from .conftest imp...
# -*- coding: utf8 -*- # Copyright (C) 2015 - Philipp Temminghoff <phil65@kodi.tv> # This program is Free Software see LICENSE file for details import xbmc from Utils import * LAST_FM_API_KEY = 'd942dd5ca4c9ee5bd821df58cf8130d4' GOOGLE_MAPS_KEY = 'AIzaSyBESfDvQgWtWLkNiOYXdrA9aU-2hv_eprY' BASE_URL = 'http://ws.audios...
import io import os import shutil import sys from mock import patch, Mock, call import pytest import sphinx from sphinx.application import Sphinx import sphinx.util.logging from autoapi.mappers.python import ( PythonModule, PythonFunction, PythonClass, PythonData, PythonMethod, ) @pytest.fixture...
import test.support, unittest import sys, codecs, html.entities, unicodedata class PosReturn: # this can be used for configurable callbacks def __init__(self): self.pos = 0 def handle(self, exc): oldpos = self.pos realpos = oldpos if realpos<0: realpos = len(ex...
"""Boolean algebra module for SymPy""" from sympy.core.basic import Basic from sympy.core.operations import LatticeOp from sympy.core.function import Application, sympify class Boolean(Basic): """A boolean object is an object for which logic operations make sense.""" __slots__ = [] def __and__(self, othe...
#!/usr/bin/env python # # Author: Mike McKerns (mmckerns @caltech and @uqfoundation) # Copyright (c) 2008-2016 California Institute of Technology. # Copyright (c) 2016-2017 The Uncertainty Quantification Foundation. # License: 3-clause BSD. The full license text is available at: # - http://trac.mystic.cacr.caltech.ed...
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems 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.o...
#!/usr/bin/env python2 # Copyright 2017 Google 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.apache.org/licenses/LICENSE-2.0 # # Unless required...
#!/usr/bin/env python # -*- coding: utf-8 -*- import cPickle import sys import os import codecs import operator from numpy import dot from gensim import matutils from collections import defaultdict from nltk.data import load from BREDS.Seed import Seed from BREDS.Pattern import Pattern from BREDS.Config import Confi...
# -*- coding: UTF-8 -*- ''' Copyright (c) 2015 Scouter Project. 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...
# coding=utf-8 __author__ = 'Anatoli Kalysch' import re from copy import deepcopy from ui.NotifyProgress import NotifyProgress from _collections import defaultdict, deque from lib.VMRepresentation import get_vmr from dynamic.TraceRepresentation import Traceline from ui.PluginViewer import PluginViewer from ui.UIMana...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Spline models and fitters.""" # pylint: disable=line-too-long, too-many-lines, too-many-arguments, invalid-name import warnings import abc import functools import numpy as np from astropy.utils.exceptions import (AstropyUserWarning,) from astropy.ut...
########################################################################## # # Copyright (c) 2019, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
""" A :class:`Batch` represents a collection of `Instance` s to be fed through a model. """ import logging from collections import defaultdict, Counter from typing import Dict, Iterable, Iterator, List, Union import numpy import torch from allennlp.common.checks import ConfigurationError from allennlp.common.util im...
""" Specification objects for the ``Array`` built-in. """ from . import PropertyDescriptor, is_callable from .base import ObjectInstance, FunctionInstance from .function import define_native_method from ..exceptions import ESTypeError, ESRangeError from ..types import Undefined, Null, NumberType, ObjectType, get_argume...
import numpy as np llf = np.array([ -244.3852892951]) nobs = np.array([ 202]) k = np.array([ 5]) k_exog = np.array([ 1]) sigma = np.array([ .81130812929037]) chi2 = np.array([ 73901.783883385]) df_model = np.array([ 3]) k_ar = np.array([ 1]) k...
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """This module is used for handling a single line from a csv file. """ import collections import ggrc.services from ggrc import db from ggrc.converters import errors from ggrc.converters import get_importa...
#!/usr/bin/env python3 ''' This is the clam foot server module for the clam-chatter peer to peer network framework. The only dependency the clam foot server requires is openssl version 1.0.0+. This dependency is supported on ARM chipsets making it possible to run a clam foot server on devices such as phones or Raspberr...
import urllib import urlparse from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponse from django.utils.translation import ugettext_lazy as _ from sentry.models import GroupMeta from sentry.plugins.base import Response from sentry.plugins.bases.issue import Is...
from __future__ import unicode_literals import os from distutils.spawn import find_executable from tempfile import mkstemp import click import six from pyinfra import logger from pyinfra.api.exceptions import InventoryError from pyinfra.api.util import get_file_io from .util import ( execute_command_with_sudo_...
from __future__ import absolute_import, division, print_function import os import pickle import warnings from collections import defaultdict import matplotlib.mlab as mlab import numpy as np import seaborn as sns from matplotlib import pyplot as plt from scipy import stats from tqdm import tqdm from odin.stats impor...
# -*- coding: utf-8 -*- """Report logic class.""" import collections import datetime from cached_property import cached_property from .models import Party class Report(object): def __init__(self, party): """Create a new report from the given party. The report will have standard statistics that a...
# Copyright (c) 2011 Jeff Garzik # # Previous copyright, from python-jsonrpc/jsonrpc/proxy.py: # # Copyright (c) 2007 Jan-Klaas Kollhof # # This file is part of jsonrpc. # # jsonrpc is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # th...
""" make_erdplus_model usage: python3 make_erdplus_model.py --ip=127.0.0.1 --user=postgres python3 make_erdplus_model.py --help Programmatically create a (JSON-formatted) file for viewing in the free online database modeling tool, ERDplus (https://erdplus.com), using Postgres catalog tables to obtain all user...
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the NiBabel package for the # copyright and license terms. # ### ### ### #...
''' OpenDNS Modular Input Script Nicholas Nam ''' import sys, logging, os, time, re, datetime import xml.dom.minidom, xml.sax.saxutils SPLUNK_HOME = os.environ.get('SPLUNK_HOME') RESPONSE_HANDLER_INSTANCE = None SPLUNK_PORT = 8089 STANZA = None SESSION_TOKEN = None REGEX_PATTERN = None EGG_DIR = SPLUNK_HOME + '/e...
from colander import Boolean from colander import Date from colander import Integer from colander import Money from colander import null from colander import Schema from colander import SchemaNode from colander import SequenceSchema from colander import String from deform.form import Button from deform.form import For...
import base64 from .fields import BaseField class BaseTask(object): def serialize(self, **result): return result class ProxyMixin(BaseTask): def __init__(self, *args, **kwargs): self.proxyType = kwargs.pop("proxy_type") self.userAgent = kwargs.pop("user_agent") self.proxyAddr...
from datetime import datetime, timedelta import logging from omgeo.services.base import GeocodeService from omgeo.places import Candidate from omgeo.preprocessors import CancelIfPOBox from omgeo.postprocessors import (AttrFilter, AttrRename, AttrSorter, UseHighScoreIfAtLeast, GroupBy,...
from tcga_encoder.utils.helpers import * from scipy import special #import numpy as np import pdb from sklearn.neighbors import KernelDensity from sklearn import linear_model def logistic_sigmoid( activations ): return 1.0 / (1.0 + np.exp(-activations) ) class NaiveBayesClassifier(object): def fit( self, X, y )...
import calendar import curses import curses.ascii from curses import textpad import datetime import itertools import logging import os import string logger = logging.getLogger('sailor') CTRL_A = 1 CTRL_E = ord('e') - ord('a') + 1 CTRL_J = ord('j') - ord('a') + 1 CTRL_K = ord('k') - ord('a') + 1 CTRL_N = ord('n') - or...
from flask import Flask, render_template import re import sqlite3 import praw import pprint from yt_scraper import channel_recent_10, best_of_users import sys from random import choice reload(sys) sys.setdefaultencoding('utf8') app = Flask(__name__) ''' TODO v0.2 - YT channel scraper __to__ generic csv function - C...
#!/usr/bin/env python3 # Copyright 2017 Google 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.apache.org/licenses/LICENSE-2.0 # # Unless require...
# Copyright 2017 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...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011, Cisco Systems, 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-...
import os from typing import Any, Dict, List, Optional, Union import jinja2 import nbformat from great_expectations import DataContext from great_expectations.core import ExpectationConfiguration from great_expectations.core.batch import ( BatchRequest, standardize_batch_request_display_ordering, ) from great...
#!/usr/bin/env python -W ignore::UndefinedMetricWarning """ This script runs the bootstrap kfold validation experiments as used in the publication. Usage: validation.py [--interpro] [--pfam] [--mf] [--cc] [--bp] [--induce] [--chain] [--verbose] [--binary] [--top=T] [--model=M] [--n_jobs=J]...
__source__ = 'https://leetcode.com/problems/subsets-ii/' # https://github.com/kamyu104/LeetCode/blob/master/Python/subsets-ii.py # Time: O(n * 2^n) # Space: O(1) # Brute Force Search # # Description: Leetcode # 90. Subsets II # # Given a collection of integers that might contain duplicates, S, return all possible subs...
from pylons import c,g from tg import request, url import json import logging from formencode import validators as fev from webhelpers import paginate import ew as ew_core import ew.jinja2_ew as ew log = logging.getLogger(__name__) def onready(text): return ew.JSScript('$(function () {%s});' % text); class Lab...
# -*- coding: utf-8 -*- from strings import trans from sqlalchemy import (create_engine, MetaData, Column, Table, Integer, Unicode, Index, ForeignKeyConstraint, Date, DateTime, Time) from sqlalchemy.dialects.mysql.base import MSEnum from sqlalchemy.orm import relationship, sessionmaker from sqlalchemy.ext.declarativ...
# This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt for license information # See https://swift.org/CONTRIBUTORS.txt for the list o...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # termineter/interface.py # # 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 lis...
#!/usr/bin/env python2 from __future__ import print_function import os import os.path import pkgutil import shutil import sys import tempfile __all__ = ["version", "bootstrap"] _SETUPTOOLS_VERSION = "14.3.2" _PIP_VERSION = "1.6" # pip currently requires ssl support, so we try to provide a nicer # error message w...
from __future__ import print_function, division, absolute_import import ast import json from future import standard_library standard_library.install_aliases() import token from future.utils import raise_from import ntpath import os import types from sys import version_info from typing import TypeVar, Union, List, A...
# # Copyright (c) 2000 Tyler C. Sarna <tsarna@sarna.org> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this lis...
# pylint: disable=invalid-name """Utility to invoke Xcode compiler toolchain""" from __future__ import absolute_import as _abs import os import sys import subprocess from . import util def xcrun(cmd): """Run xcrun and return the output. Parameters ---------- cmd : list of str The command seque...
#!/usr/bin/python # # Copyright (c) 2011 The Yiffcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib impor...
"""Run Cuffdiff 2.2.""" import os from pathlib import Path from plumbum import TEE from resolwe.process import ( BooleanField, Cmd, DataField, FileField, FloatField, JsonField, ListField, Persistence, Process, SchedulingClass, StringField, ) class Cuffdiff(Process): "...
from django.conf import settings from django.conf.urls import patterns, url, include from django.views.generic import TemplateView, RedirectView import os.path import zerver.forms # NB: There are several other pieces of code which route requests by URL: # # - runtornado.py has its own URL list for Tornado views. Se...
"""Function and class decorators for memoizing and logging or adding methods to a Django Model. Shamelessly borrowed from python.org: https://wiki.python.org/moin/PythonDecoratorLibrary#Memoize https://wiki.python.org/moin/PythonDecoratorLibrary#Logging_decorator_with_specified_logger_.28or_default.29 """ import os i...
# Copyright 2014 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.apache.org/licenses/LICENSE-2.0 # # Unless requir...
"""Cancels host maintenance.""" from baseCmd import * from baseResponse import * class cancelHostMaintenanceCmd (baseCmd): typeInfo = {} def __init__(self): self.isAsync = "true" """the host ID""" """Required""" self.id = None self.typeInfo['id'] = 'uuid' self....
from __future__ import absolute_import import os import shlex import signal import subprocess import time from collections import namedtuple from operator import attrgetter from docker import errors from .. import mock from compose.cli.command import get_project from compose.cli.docker_client import docker_client fr...
#!/usr/bin/env python # -*- coding: utf-8 -*- # __BEGIN_LICENSE__ # Copyright (c) 2009-2013, United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. All # rights reserved. # # The NGT platform is licensed under the Apache License, Version 2.0 (the # "Lic...
from itertools import product import pandas as pd import pytest import dask.dataframe as dd from dask.dataframe.utils import assert_eq CHECK_FREQ = {} if dd._compat.PANDAS_GT_110: CHECK_FREQ["check_freq"] = False def resample(df, freq, how="mean", **kwargs): return getattr(df.resample(freq, **kwargs), how)...
# This file is part of the MapProxy project. # Copyright (C) 2011 Omniscale <http://omniscale.de> # # 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...
# Tests for rich comparisons import unittest from test import support import operator class Number: def __init__(self, x): self.x = x def __lt__(self, other): return self.x < other def __le__(self, other): return self.x <= other def __eq__(self, other): return self...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Mar 3 15:48:18 2017 @author: leo """ import json import os from api_helpers import APIConnection PROTOCOL = 'http://' HOST = '127.0.0.1:5000' PRINT = True PRINT_CHAR_LIMIT = 10000 c = APIConnection(PROTOCOL, HOST, PRINT, PRINT_CHAR_LIMIT) def n...
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''Unit tests for grit.format.policy_templates.writers.adm_writer''' import os import sys if __name__ == '__main__': sys.path.a...
class Player(): def __init__(self, p_class, health, mana, strength): self.p_class = p_class self.health = health self.mana = mana self.strength = strength print "What hero do you want to be?" print "1 for prince, 2 for knight, 3 for archer" print "prince is healthier, knight is stronger," print "archer is ma...
""" This is the implementation of Copy-NET We start from the basic Seq2seq framework for a auto-encoder. """ import logging import time import numpy as np import sys import os.path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),os.path.pardir))) import copy from theano.sandbox.rng_mrg import M...
""" This is CLM2BRY """ from datetime import datetime import numpy as np from netCDF4 import Dataset, num2date import IOBry __author__ = 'Trond Kristiansen' __email__ = 'me@trondkristiansen.com' __created__ = datetime(2009, 3, 2) __modified__ = datetime(2019, 3, 12) __version__ = "1.5" __status__ = "Development" d...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Grid Dynamics # 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/l...
from __future__ import print_function import os import gzip import logging from six.moves import cPickle as pickle from importlib import import_module from time import time from weakref import WeakKeyDictionary from email.utils import mktime_tz, parsedate_tz from w3lib.http import headers_raw_to_dict, headers_dict_to_r...
""" Copyright 2017-present Airbnb, 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, sof...
#!/usr/bin/python # # Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. # from optparse import OptionParser import subprocess import os import glob import platform import ConfigParser import socket import requests from StringIO import StringIO from lxml import etree from sandesh_common.vns.constants impor...
from django.core import mail from django.urls import reverse from .office_hours_test_case import OfficeHoursTestCase from ..v1.views import ReserveOfficeHourView from ..v1.views.utils import localized_office_hour_start_time from ..permissions.v1_api_permissions import RESERVE_PERMISSION_DENIED_DETAIL from .factories i...
from __future__ import division from collections import namedtuple from io import IOBase from itertools import chain, islice from threading import Thread from ..buffers import RingBuffer from ..packages.flashmedia import FLVError from ..packages.flashmedia.tag import (AudioData, AACAudioData, VideoData, ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from django.db import models from django.db.models import Sum, Max from django.conf import settings from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext as _ from filer.fields.image ...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# # This source file is part of the EdgeDB open source project. # # Copyright 2019-present MagicStack Inc. and the EdgeDB 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...
# encoding=utf-8 from __future__ import unicode_literals, division import json import os import re from django.core.files.base import File, ContentFile from django.core.files.storage import Storage # , default_storage from django.utils.encoding import force_text from django.utils.functional import LazyObject, empty ...
import numpy as np from scipy import signal def find_sideband(ft_data, which=+1, copy=True): """Find the side band position of a hologram The hologram is Fourier-transformed and the side band is determined by finding the maximum amplitude in Fourier space. Parameters ---------- ft_data: ...
from kivy.logger import Logger from pentai.gui.screen import Screen from kivy.properties import StringProperty, ListProperty, NumericProperty from kivy.clock import Clock from kivy.graphics import Color import pentai.base.gs_observer as gso_m from pentai.base.pente_exceptions import * from pentai.base.defines import ...
import os import pytest import pandas as pd from tests.main import MainTestClass from zeex.core.views.sql.main import DatabasesMainWindow from zeex.core.ctrls.sql import AlchemyConnectionManager, AlchemyConnection from zeex.core.ctrls.dataframe import DataFrameModelManager fixtures_dir = os.path.join(os.path.dirname(...
#! /usr/bin/env python # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) 2011-2015, Michigan State University. # Copyright (C) 2015-2016, The Regents of the University of California. # # Redistribution and use in source and binary forms, with or without # modification, are permitte...
# Copyright 2016 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 csv import os import sys from argparse import ArgumentParser from typing import Set, Callable, Optional, List from rdflib import Graph, Literal, URIRef, BNode from rdflib.plugin import plugins as rdflib_plugins, Serializer as rdflib_Serializer from rdflib.collection import Collection from rdflib.namespace import...
#!/usr/bin/python import random ################################################################## ###################### Testing Tools ############################# ################################################################## ''' Generates inputs for gradient descent. Inputs: voters: the number of voters,...
# coding=utf-8 # Copyright 2021 The HuggingFace Team. 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 requir...
"""Device, context and memory management on CuPy. .. note:: The package ``chainer.cuda`` has been renamed to :mod:`chainer.backends.cuda` as of v4.0.0, but the previous module path ``chainer.cuda`` is also available. Chainer uses `CuPy <https://cupy.chainer.org/>`_ (with very thin wrapper) to exploit the spe...