gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# Copyright 2013 Philip N. Klein """ A module for working with images in matrix format. An image is represented by two matrices, representing points and colors. The points matrix has row labels {'x', 'y', 'u'} and column labels (0,0) through (w, h), inclusive, where (w, h) are the width and height of the or...
import argparse import os from multiprocessing.pool import ThreadPool import numpy as np import piecewisecrf.helpers.io as io def load_data(predictions_file, labels_file): ''' Loads prediction and label data into numpy arrays Parameters ---------- predictions_file: str Path to the pred...
'''Test the project collaboration route. With views.''' from django.contrib.auth.models import User, Permission from django.test import TestCase, Client from django.test.testcases import SimpleTestCase, TransactionTestCase from django.urls import reverse_lazy from .models import Project, Task, Milestone, TaskComment...
import re import datetime from bson.objectid import ObjectId from .meta import DataTypeDefinition from .errors import DataTypeMismatch def check_defaults(func): def inner(self, value): if value is None: if self.default is not None: return self.default elif self.null...
############################################################################### # EvoMan FrameWork - V1.0 2016 # # DEMO : Neuroevolution - Genetic Algorithm neural network. # # Author: Karine Miras # # karine.smiras@...
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """A module that implements the Architecture class, a neural network architecture description. """ import os from theanolm.backend import IncompatibleStateError, InputError class Architecture(object): """Neural Network Architecture Description A description of ...
# Copyright (c) 2012 OpenStack Foundation # # 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 ...
# -*- coding: utf-8 -*- # # SQLAlchemy documentation build configuration file, created by # sphinx-quickstart on Wed Nov 26 19:50:10 2008. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db.models.fields import Field from django.core import exceptions from django.utils.functional import cached_property from django.utils.text import capfirst from django.utils import six from collectionfield.converter import CollectionConverte...
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). """ The pex.bin.pex utility builds PEX environments and .pex files specified by sources, requirements and their dependencies. """ from __future__ import absolute_import, print_function i...
#!/usr/bin/env python # generate Python Manifest for the OpenEmbedded build system # (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de> # (C) 2007 Jeremy Laine # licensed under MIT, see COPYING.MIT import os import sys import time VERSION = "2.6.4" __author__ = "Michael 'Mickey' Lauer <mlauer@vanille-me...
# -*- coding: utf-8 -*- # Copyright (c) 2013, 2015, 2016, 2018, 2019 Matthew Zipay. # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to deal in the Software without # restriction, including without limitation the ...
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Manage indexing for snapshotter service""" import logging from sqlalchemy.sql.expression import tuple_ from ggrc import db from ggrc import models from ggrc.models import all_models from ggrc.fulltext....
"""Support for the Abode Security System.""" from asyncio import gather from copy import deepcopy from functools import partial from abodepy import Abode from abodepy.exceptions import AbodeException import abodepy.helpers.timeline as TIMELINE from requests.exceptions import ConnectTimeout, HTTPError import voluptuous...
""" Lowest level connection """ import json import logging import random import sys import time import uuid from base64 import b64decode from threading import local from typing import Any, Dict, List, Mapping, Optional, Sequence import botocore.client import botocore.exceptions from botocore.awsrequest import AWSPrepa...
#!/usr/bin/env python """ This is a contextualization script required by CloudMan; it is automatically run at instance startup (via an upstart job). Requires: PyYAML http://pyyaml.org/wiki/PyYAMLDocumentation (easy_install pyyaml) boto http://code.google.com/p/boto/ (easy_install boto) Assumptions: DEFAUL...
""" 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 distri...
# Copyright (c) 2012 OpenStack Foundation # 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 ...
# # Main bot class # Handles routing, config, agent/module loading # import json import threading import os, sys import importlib import collections import halibot.packages from distutils.version import StrictVersion as Version from queue import Queue,Empty from string import Template from .halmodule import HalModul...
# Copyright (c) 2011 Justin Santa Barbara # # 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 applicab...
# Copyright 2016 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, ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from functools import reduce import numpy as np import tensorflow as tf from tensorflow.python.ops import array_ops from utils import * from ops import * class NTMCell(object): def __init__(self, input_d...
from binascii import unhexlify, hexlify from copy import deepcopy from hashlib import sha256 from ecdsa import SigningKey from bitcoin_tools.core.keys import serialize_pk, ecdsa_tx_sign from bitcoin_tools.core.script import InputScript, OutputScript, Script, SIGHASH_ALL, SIGHASH_SINGLE, SIGHASH_NONE, \ SIGHASH_ANYO...
import hashlib import logging import os from django.conf import settings from django.core.files.storage import default_storage as storage from django.db import connection, transaction from celeryutils import task from PIL import Image from addons.models import Persona from editors.models import RereviewQueueTheme im...
import os import platform import shutil from collections import OrderedDict from jinja2 import Environment, select_autoescape, FileSystemLoader, ChoiceLoader, Template from conans.assets.templates import dict_loader from conans.client.cache.editable import EditablePackages from conans.client.cache.remote_registry imp...
from __future__ import absolute_import import django.test import unittest from django.core.management import call_command from django.contrib.auth import get_user_model from challenges.models import Challenge from core.tests.setups import (GargantuanChallengeFactory, ChallengeFactory, ...
# Copyright 2015-2017 Capital One Services, 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 ...
# 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...
"""ACME AuthHandler.""" import itertools import logging import time import zope.component from acme import challenges from acme import messages from letsencrypt import achallenges from letsencrypt import constants from letsencrypt import errors from letsencrypt import error_handler from letsencrypt import interfaces...
# Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net # This file is part of PyGithub. http://vincent-jacques.net/PyGithub # PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation, either vers...
from __future__ import unicode_literals import warnings from sklearn.feature_extraction.text import strip_tags from sklearn.feature_extraction.text import strip_accents_unicode from sklearn.feature_extraction.text import strip_accents_ascii from sklearn.feature_extraction.text import HashingVectorizer from sklearn.fe...
""" Several reinforcement learning algorithms. If they begin with a 'b_' they were implemented allow fitting of behavioral accuracy data. If they begin with a 's_' there were designed to simulate 'online' learning (e.g. a computational agent learning an N-armed bandit task). """ import math def b_delta(rewards,state...
from distutils import util, log from distutils.errors import DistutilsSetupError from distutils import sysconfig from distutils.command.build_scripts import build_scripts as _build_scripts import sys, os, re, glob try: from Cython.Distutils import build_ext has_cython = True except ImportError: from distut...
"""Library of useful functions that apply to many modules.""" from os import getcwd, path import logging.handlers import sys try: import yaml except ImportError as err: sys.stderr.write("ERROR: {}. Try installing python-yaml.\n".format(err)) raise # Global objects _config = None _loaded_config_file = No...
from django.db import connection from django.utils.translation import ugettext_noop as _ from api import status from api.api_views import APIView from api.exceptions import PermissionDenied, PreconditionRequired from api.signals import dc_relationship_changed, group_relationship_changed from api.task.response import S...
# # The Python Imaging Library. # $Id$ # # standard image operations # # History: # 2001-10-20 fl Created # 2001-10-23 fl Added autocontrast operator # 2001-12-18 fl Added Kevin's fit operator # 2004-03-14 fl Fixed potential division by zero in equalize # 2005-05-05 fl Fixed equalize for low number of values ...
# Copyright 2012 the V8 project authors. 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 conditi...
from copy import deepcopy import json from datetime import datetime from flask_login import current_user from werkzeug.datastructures import MultiDict from portality import models, lock from portality.core import app # from portality.formcontext import formcontext from portality.forms.application_forms import Journal...
#! /usr/bin/env python import string import sys from xml.dom import Node try: from xml.ns import XMLNS except ImportError: class XMLNS(object): BASE = "http://www.w3.org/2000/xmlns/" XML = "http://www.w3.org/XML/1998/namespace" try: from io import StringIO except ImportError: from cStri...
""" Tests for field placement (size/position) rendering """ from __future__ import unicode_literals from __future__ import absolute_import, division, print_function __author__ = "Graham Klyne (GK@ACM.ORG)" __copyright__ = "Copyright 2014, G. Klyne" __license__ = "MIT (http://opensource.org/licenses/MIT)" ...
import os import sys import re import simplejson as json from cuddlefish.bunch import Bunch MANIFEST_NAME = 'package.json' DEFAULT_LOADER = 'jetpack-core' DEFAULT_PROGRAM_MODULE = 'main' METADATA_PROPS = ['name', 'description', 'keywords', 'author', 'contributors', 'license', 'url'] RESOURCE_HOS...
import os import sys import logging import argparse from .discovery import UPnPLoopbackException from .environment import Environment from .config import get_cache, in_home, WemoConfiguration from .utils import matcher reqlog = logging.getLogger("requests.packages.urllib3.connectionpool") reqlog.disabled = True NOOP...
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 OpenStack Foundation # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use t...
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
# Copyright 2013 IBM Corp. # # 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 agree...
import sys from django.db import models from django.db.models.fields.related import ForeignObjectRel from django.db.models.fields.related import ( ForeignObjectRel, ManyToManyRel, ManyToOneRel, OneToOneRel, RelatedField ) from django.core.mail import EmailMultiAlternatives, EmailMessage try: # Django >= 1.9 ...
import unittest from test import support import collections, random, string import collections.abc import gc, weakref import pickle class DictTest(unittest.TestCase): def test_invalid_keyword_arguments(self): class Custom(dict): pass for invalid in {1 : 2}, Custom({1 : 2}): ...
#!/usr/bin/env python3 """ This is to assign functional annotation to gene models using a wide variety of evidence. Meant to support unlimited hierarchy rules, this utility relies on a user-created configuration file. Current limitations: - Rules are evaluated on a per-gene basis, so no rules are currently possible...
def fit_2lines(self,wl,spec1d,err1d,a0=n.array([2795.,2802.]),lineName="AA",lineName2="BB", aTR=2797.5,cmin1=2650.,cmax1=2770.,cmin2=2807.,cmax2=2840.,prior=n.array([1.,1.,1e-18,-1e-18]),model="gaussian"): """ fits jointly two gaussian line profiles :param wl: wavelength (array, Angstrom) :param spec1d: flux...
# Copyright 2020 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...
#!/usr/bin/env python3 import os import sys import fnmatch import subprocess import argparse from datetime import date from collections import defaultdict from configparser import SafeConfigParser from fanfic_scraper import current_fanfic from pony.orm import db_session, select, count from fanfic_scraper.db_pony impor...
# 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...
"""Test the cross_validation module""" from __future__ import division import warnings import numpy as np from scipy.sparse import coo_matrix from scipy.sparse import csr_matrix from scipy import stats from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.test...
""" This module makes simple LDAP queries simple. """ import ldap from simpleldap.cidict import cidict # # Exceptions. # class SimpleLDAPException(Exception): """Base class for all simpleldap exceptions.""" class ObjectNotFound(SimpleLDAPException): """ Exception when no objects were returned, but wa...
# Copyright (c) 2012 - 2014 EMC 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 # # Unle...
# Copyright 2012 OpenStack Foundation # # 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...
# -*- coding: utf-8 -*- # # 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 ...
# # 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...
# Mount RPC client -- RFC 1094 (NFS), Appendix A # This module demonstrates how to write your own RPC client in Python. # When this example was written, there was no RPC compiler for # Python. Without such a compiler, you must first create classes # derived from Packer and Unpacker to handle the data types for the # s...
# Copyright (c) 2008,2015,2017,2019 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Test the `basic` module.""" import numpy as np import pandas as pd import pytest import xarray as xr from metpy.calc import (add_height_to_pressure, add_pressure_...
# 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...
#!/usr/bin/env python """ counts indicies from illumina fastq file WARNING... INCOMPLETE """ import sys import os import time import argparse import glob import collections import ConfigParser import shlex import pipes import subprocess import tempfile import re import errno import fileinput import gzip import itertool...
#!/usr/bin/python3 -i # # Copyright (c) 2013-2020 The Khronos Group 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...
# -*- coding: utf-8 -*- # import requests errors = {-1: 'unexpected error', 1: 'validation error', 2: 'email_address not specified', 3: 'password not specified', 4: 'invalid email address password combination', 5: 'both zip code and lat lon specified', ...
"""Verilog simulator modules.""" from __future__ import absolute_import import subprocess import sys import os import ctypes from .. import _api_internal from .._ffi.base import string_types from .._ffi.node import NodeBase, register_node from .._ffi.function import register_func from . import util @register_node cl...
#!/usr/bin/python # -*- coding: utf-8 -*- """ --- Day 22: Wizard Simulator 20XX --- Little Henry Case decides that defeating bosses with swords and stuff is boring. Now he's playing the game with a wizard. Of course, he gets stuck on another boss and needs your help again. In this version, combat still proceeds with...
#!/usr/bin/python """arranges results mgzs into a dataframe for further analyses """ import matplotlib as mpl # we do this because sometimes we run this without an X-server, and this backend doesn't need # one. We set warn=False because the notebook uses a different backend and will spout out a big # warning to that ef...
import os import pytest WARN_NOCOL = ("DEPRECATION: The --no-columns option will be " "removed in the future.") def test_list_command(script, data): """ Test default behavior of list command. """ script.pip( 'install', '-f', data.find_links, '--no-index', 'simple==1.0', ...
# Copyright 2014 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. """Application context management for the cr tool. Contains all the support code to enable the shared context used by the cr tool. This includes the configu...
import abc import csv from collections import namedtuple, defaultdict, OrderedDict, Counter import numpy as np from sklearn.feature_extraction import DictVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.metrics.pairwise import cosine_similarity as sim from sklearn.pipeline import Pi...
<<<<<<< HEAD <<<<<<< HEAD """Fix incompatible imports and module references.""" # Authors: Collin Winter, Nick Edds # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {'StringIO': 'io', 'cStringIO': 'io', 'cPickle': 'pickle', '__builtin__' :...
import os import random import shutil import time from unittest.mock import patch import dask.dataframe as dd import math import numpy as np import pandas as pd import pyarrow as pa import pyarrow.parquet as pq import pytest import ray from ray.util.dask import ray_dask_get from ray.tests.conftest import * # noqa fr...
# Copyright 2011 OpenStack Foundation. # 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 req...
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import sys import socket try: from urllib.parse import quote, urlparse from socketserver import ThreadingMixIn from http.server import HTTPServer except ImportError: from urllib import quote from urlparse import urlparse from...
# -*- coding: utf-8 -*- from heinzel.core import models from heinzel.core import exceptions from heinzel.tests.utils import Fixture, runtests from model_examples import Car, Brand, Manufacturer, Driver, Key models.register([Manufacturer, Brand, Car, Driver, Key]) class BasicAssumptions(Fixture): def runTest(sel...
""" ulid/ulid ~~~~~~~~~ Object representation of a ULID. """ import binascii import datetime import typing import uuid from . import base32, hints __all__ = ['Timestamp', 'Randomness', 'ULID'] #: Type hint that defines multiple primitive types and itself for comparing MemoryView instances. MemoryViewPr...
import math import csv import numpy import matplotlib.pyplot as plt import numpy as np small_threshold = 10 large_threshold = 50 def read_raw(filename): """ Reads in SMI eye data txt files assuming the first row is the timestamp, the 4th are x coordinates 5th y coordinates of eyegaze ...
import numpy as np from menpo.shape import PointCloud from menpo.transform import tcoords_to_image_coords from ..adjacency import mask_adjacency_array, reindex_adjacency_array from .base import TriMesh, grid_tcoords class TexturedTriMesh(TriMesh): r""" Combines a :map:`TriMesh` with a texture. Also encapsul...
from .test_utils import TestCase from confetti import Config from confetti import get_config_object_from_proxy from confetti import exceptions from confetti import Metadata class BasicUsageTest(TestCase): def setUp(self): super(BasicUsageTest, self).setUp() self.conf = Config(dict( a=...
""" #;+ #; NAME: #; x_guis #; Version 1.0 #; #; PURPOSE: #; Module for Plotting GUIs #; 07-Sep-2014 by JXP #;- #;------------------------------------------------------------------------------ """ # Import libraries import numpy as np import pdb import matplotlib.pyplot as plt #from xastropy.xutils import xde...
# -*- coding: utf-8 -*- """ jinja2.testsuite.filters ~~~~~~~~~~~~~~~~~~~~~~~~ Tests for the jinja filters. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import pytest from jinja2 import Markup, Environment from jinja2._compat import text_type, implements_...
# -*- mode: python; coding: utf-8 -*- # Copyright 2014-2019 Peter Williams <peter@newton.cx> # Licensed under the GNU General Public License, version 3 or higher. """ Tools relating to working with NASA's ADS. """ from __future__ import absolute_import, division, print_function import json from .util import * from ....
#!/usr/bin/env python # -*- encoding: utf-8 -*- """ BOSH OpenStack Ironic CPI """ # Python 2 and 3 compatibility from __future__ import unicode_literals import json import requests import copy import logging try: from urllib.parse import urlparse except ImportError: # Python 2 from urlparse import urlparse...
#!/usr/bin/env python #----------------------------------------------------------------------------- # Copyright (c) 2013--, biocore development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #-------------------------...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'DefaultSubscription' db.create_table(u'notifications_defa...
data = ( '[?]', # 0x00 'e', # 0x01 'aai', # 0x02 'i', # 0x03 'ii', # 0x04 'o', # 0x05 'oo', # 0x06 'oo', # 0x07 'ee', # 0x08 'i', # 0x09 'a', # 0x0a 'aa', # 0x0b 'we', # 0x0c 'we', # 0x0d 'wi', # 0x0e 'wi', # 0x0f 'wii', # 0x10 'wii', # 0x11 'wo', # 0x12 'wo', ...
from __future__ import unicode_literals import datetime from django.contrib import admin from django.contrib.admin.models import LogEntry from django.contrib.admin.options import IncorrectLookupParameters from django.contrib.admin.templatetags.admin_list import pagination from django.contrib.admin.tests import AdminS...
# -*- coding: utf-8 -*- from xxhash import xxh64_intdigest from iscc_bench.algos.slide import sliding_window from iscc_bench.textid.normalize import text_normalize import numpy as np R = np.random.RandomState(seed=74) MASKS = R.randint(0, 2 ** 64 - 1, 64, dtype=np.uint64) HEAD_CID_T = b"\x10" HEAD_CID_T_PCF = b"\x11...
############################################################################### ## ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary fo...
#!/usr/bin/env python2.7 # Copyright 2016, Google 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: # # * Redistributions of source code must retain the above copyright # notice, this lis...
# Copyright (c) 2014, Henry Huang # # 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 writ...
# Copyright 2014 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. from collections import defaultdict import fnmatch import json import os import re import subprocess import sys # TODO(dcheng): It's kind of horrible that t...
# Base classes for ASN.1 types import sys from pyasn1.type import constraint, tagmap, tag from pyasn1 import error class Asn1Item: pass class Asn1ItemBase(Asn1Item): # Set of tags for this ASN.1 type tagSet = tag.TagSet() # A list of constraint.Constraint instances for checking values subtypeSpec...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
# -*- coding: utf-8 -*- """Module with the Graphviz drawing calls.""" # # (C) Pywikibot team, 2006-2018 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, division, unicode_literals from collections import Counter import itertools import threading try: import pydot excep...
# Copyright (c) 2018 PaddlePaddle 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 app...
import sys import unittest import warnings warnings.simplefilter('ignore', DeprecationWarning) from eventlet import proc warnings.simplefilter('default', DeprecationWarning) from eventlet import coros from eventlet import event as _event from eventlet import Timeout, sleep, getcurrent, with_timeout from tests import Li...
import asyncio import logging import typing import binascii from lbry.error import InvalidBlobHashError, InvalidDataError from lbry.blob_exchange.serialization import BlobResponse, BlobRequest from lbry.utils import cache_concurrent if typing.TYPE_CHECKING: from lbry.blob.blob_file import AbstractBlob from lbry...
################################################################################ # 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...