gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | |
# 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 following disclaimer.
#
# * Redistributions in binary form... | |
# Copyright 2018 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... | |
# 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... | |
#
# 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... | |
"""Google-style docstring parsing."""
import inspect
import re
import typing as T
from collections import OrderedDict, namedtuple
from enum import IntEnum
from .common import (
EXAMPLES_KEYWORDS,
PARAM_KEYWORDS,
RAISES_KEYWORDS,
RETURNS_KEYWORDS,
YIELDS_KEYWORDS,
Docstring,
DocstringExampl... | |
# Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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 applicabl... | |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | |
# -*- coding: utf-8 -*-
from pyramid.view import view_config
from pyramid.response import Response
from pyramid.httpexceptions import HTTPBadRequest
from pyramid.httpexceptions import HTTPUnauthorized
from geoportailv3_geoportal.portail import MesurageDownload, SketchDownload
from geoportailv3_geoportal.models import L... | |
"""Schema module."""
import builtins
import importlib
from typing import Dict, Any, Type, Optional
from . import containers, providers
ContainerSchema = Dict[Any, Any]
ProviderSchema = Dict[Any, Any]
class SchemaProcessorV1:
def __init__(self, schema: ContainerSchema) -> None:
self._schema = schema
... | |
import contextlib
import glob
import os
import re
from functools import partial
from pathlib import Path
import docx
import pandas as pd
from invoke import task
from docx.enum.text import WD_PARAGRAPH_ALIGNMENT as ALIGN
import numpy as np
from babel.numbers import format_currency, format_decimal
from toolz import comp... | |
# -*- coding: utf-8 -*-
# @Author: massimo
# @Date: 2016-03-10 19:21:16
# @Last Modified by: massimo
# @Last Modified time: 2016-03-10 23:29:56
import numpy as np
import theano
import theano.tensor as T
from collections import OrderedDict
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
from da... | |
"""
SoftLayer.tests.CLI.modules.file_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
from SoftLayer.CLI import exceptions
from SoftLayer.CLI import formatting
from SoftLayer import SoftLayerError
from SoftLayer import testing
import json
from unittest import ... | |
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... | |
#!/usr/bin/python
# Copyright (c) 2009, Purdue University
# 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 ... | |
"""
Extensions to ConsIndShockModel concerning models with preference shocks.
It currently only two models:
1) An extension of ConsIndShock, but with an iid lognormal multiplicative shock each period.
2) A combination of (1) and ConsKinkedR, demonstrating how to construct a new model
by inheriting from multiple cla... | |
# File containing the Meta interface to add new languages.
# Please do not change any original code. To add new languages please follow the instruction given in the comments below and the documentation.
import os, pickle
'''
This is the array containing the languages supported by the system. To add a new language jus... | |
# Copyright 2015 Infoblox 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 by... | |
# -*- coding: utf-8 -*-
from PyQt4 import QtGui, QtCore
import AOChannelTemplate, DOChannelTemplate, InputChannelTemplate
from acq4.util.SequenceRunner import *
import numpy
import weakref
from acq4.pyqtgraph import siFormat, SpinBox, WidgetGroup
###### For task GUIs
class DaqChannelGui(QtGui.QWidget):
def __ini... | |
#!/usr/bin/env python
# Copyright (c) 2006-2010 Tampere University of Technology
#
# 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 rig... | |
##########################################################################
#
# Copyright (c) 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:
#
# * Redistrib... | |
# Copyright (c) 2013 MetaMetrics, Inc.
#
# 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 rights
# to use, copy, modify, merge, publish, d... | |
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.battle.RewardPanel
from panda3d.core import Point3, TextEncoder, TextNode, Vec4
import copy
from direct.directnotify import DirectNotifyGlobal
from direct.gui.DirectGui import *
from direct.interval.IntervalGlobal import *
import math
import random
imp... | |
# Copyright 2018 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/python
#
# Copyright (c) 2011 The Eurobit 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
import... | |
import datetime
import os
import pytest
import timeflow.utils
from timeflow import cli
FAKE_TIME = datetime.datetime(2015, 1, 1, 23, 59, 59)
@pytest.fixture
def patch_datetime_now(monkeypatch):
class mydatetime(datetime.datetime):
@classmethod
def now(cls):
return FAKE_TIME
mo... | |
try:
from urllib.parse import parse_qs, urlparse, quote_plus
except ImportError:
from urlparse import parse_qs, urlparse
from urllib import quote_plus
import json
from datetime import datetime, timedelta
import requests
from .exceptions import OAuthTokenRequestException
PRODUCTION='production'
SANDBOX='sa... | |
#!/usr/bin/env python
#
# Copyright 2015 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 o... | |
# -*- coding: utf-8 -*-
# This file is part of the pymfony package.
#
# (c) Alexandre Quercia <alquerci@email.com>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
from __future__ import absolute_import;
from pymfony.component.system import ... | |
# Copyright (c) Los Alamos National Security, LLC, and others.
from collections import defaultdict
import hashlib
import time
from django.contrib.gis import geos
import numpy as np
import scipy.optimize as scopt
import sklearn.mixture as skmix
import multicore
import testable
import u
l = u.l
class Weight(object)... | |
#!/usr/bin/env python
from utils import utils, inspector
from datetime import datetime
from urllib.parse import urljoin
import logging
import os.path
import re
import time
archive = 1997
#
# options:
# standard since/year options for a year range to fetch from.
#
# types - limit reports fetched to one or more typ... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import argparse
__version__ = '0.0.3'
import os
import sys
import random
import difflib
import subprocess
import pkgtools.pypi as pp
import emoji
from travispy import TravisPy
from withlog import Info, Message
import withlog
from time import slee... | |
from mediacrush.processing.invocation import Invocation
from mediacrush.config import _cfg, _cfgi
import sys
import json
import re
# Given a file, this will examine it to learn all of its secrets. It will identify the
# file type, and for certain files, will gather more details about it. It works by
# examining file c... | |
''' Copyright (c) 2013 Potential Ventures Ltd
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 an... | |
from odooku.patch import SoftPatch
class patch_check_super(SoftPatch):
@staticmethod
def apply_patch():
def check_super(passwd):
if odoo.tools.config['admin_passwd'] is not None:
if passwd and passwd == odoo.tools.config['admin_passwd']:
return True
... | |
import os
import math
import cv2
import glob
import numpy as np
import uuid
from fileutils import create_dir_check_exists, get_video_datetime
import constants
def calc_distance(x1, y1, x2, y2):
x_dist = (x2 - x1)
y_dist = (y2 - y1)
return math.sqrt(x_dist * x_dist + y_dist * y_dist)
def increment_dict_... | |
# Copyright 2013-2016 DataStax, 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 writi... | |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import unittest
import PyCode
import sys
class ArrayTestCase(unittest.TestCase):
def setUp(self):
self.code = PyCode.ArrayCode()
self.bit = PyCode.BitCode()
self.tree = PyCode.TreeCode()
self.dp = PyCode.DPCode()
self.bt = PyCode.Ba... | |
from django.utils.six.moves import zip
from django.db.backends.util import truncate_name, typecast_timestamp
from django.db.models.sql import compiler
from django.db.models.sql.constants import MULTI
from django.utils import six
SQLCompiler = compiler.SQLCompiler
class GeoSQLCompiler(compiler.SQLCompiler):
def ... | |
"""
The fileresource provides a basic restish fileresource for assets and images
Requires ImageMagick for image resizing
"""
import tempfile, os, subprocess, shutil
from restish import http, resource
from formish import util
from formish.filestore import CachedTempFilestore, FileSystemHeaderedFilestore
import loggin... | |
"""
Code to proxy logs from the narrative, over a socket, to a DB.
The proxy will tend to have root permissions so it can read protected
configuration files.
"""
__author__ = 'Dan Gunter <dkgunter@lbl.gov>'
__date__ = '8/22/14'
import asyncore
from datetime import datetime
from dateutil.tz import tzlocal
import loggin... | |
# 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... | |
# Joint copyright:
# - Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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 requ... | |
# coding=utf-8
# Copyright 2022 The Uncertainty Baselines 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 ap... | |
# 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... | |
"""
Base backends structures.
This module defines base classes needed to define custom OpenID or OAuth
auth services from third parties. This customs must subclass an Auth and
and Backend class, check current implementation for examples.
Also the modules *must* define a BACKENDS dictionary with the backend name
(whic... | |
import json
from collections import defaultdict
import psycopg2
def less_shitty_geometry(cursor, geometry, crs):
geometry['crs'] = crs
cursor.execute('SELECT ST_AsGeoJSON(ST_Transform(ST_GeomFromGeoJson(%s), 4326));', (json.dumps(geometry), ))
return json.loads(cursor.fetchone()[0])
def generate_park(c... | |
# Copyright 2018 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... | |
# Kapacitor UDF Agent implementation in Python
#
# Requires protobuf v3
# pip install protobuf==3.11.1
from __future__ import absolute_import
import sys
from . import udf_pb2
from threading import Lock, Thread
try:
from queue import Queue
except ImportError:
from Queue import Queue
# Setup default in/out ... | |
from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone
from accounts.models import Address
from categories.models import Category
# Create your models here.
###################################################################################
#items
class Item(models.Mo... | |
# Copyright (c) 2010, 2011 Arek Korbik
#
# 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... | |
# 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 use ... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import colorfield.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("admin_interface", "0005_add_recent_actions_visible"),
]
operations = [
migrations.AlterField(
... | |
# From https://git.geekli.st/daveyoon/khan-academy-lite/blob/14ab3615f66bcdd737909e7951a250da8a10646b/python-packages/memory_profiler.py
# LICENCE: MIT
"""Profile the memory usage of a Python program"""
__version__ = '0.26'
_CMD_USAGE = "python -m memory_profiler script_file.py"
import time, sys, os, pdb
import war... | |
# -*- coding: utf-8 -*-
"""
@file
@brief Improves text comparison.
"""
import numpy
try:
from cpyquickhelper.algorithms.edit_distance import (
edit_distance_string as edit_distance_string_fast)
except ImportError:
edit_distance_string_fast = None
def edit_distance_string(s1, s2, cmp_cost=1.):
"""
... | |
'''
Copyright (C) 2014 Parrot SA
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 following di... | |
# -*- coding: utf-8 -*-
"""
pygments.lexers.parsers
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for parser generators.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, DelegatingLexer, \
include... | |
""" command line options, ini-file and conftest.py processing. """
import argparse
import shlex
import traceback
import types
import warnings
import py
# DON't import pytest here because it causes import cycle troubles
import sys, os
import _pytest._code
import _pytest.hookspec # the extension point definitions
from ... | |
# -*- coding: utf-8 -*-
import numpy as np
import random
import time
import copy
'''
Graph and Tree Objects
'''
class Node:
def __init__(self, node):
self.id = node
self.adjoined = {}
def __str__(self):
return str(self.id) + ' adjoined to: ' + str([x.id for x in self.adjoined])
... | |
#!/usr/bin/env python2.7
# -*- mode: python; coding: utf-8; -*-
##################################################################
# Documentation
"""
Module providing methods for string alignment.
All of these methods take two iterables (can be either lists or strings) as
arguments. The first iterable (L1) represen... | |
from todo.test_base import BaseTestCase
import unittest
from flask import json, url_for
class IndexTestCase(BaseTestCase):
def test_index(self):
response = self.app.get(url_for("index"))
self.assertEqual(response.status_code, 200)
def test_cors_headers(self):
response = self.app.get(... | |
"""
pygments.formatters.html
~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for HTML output.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import functools
import os
import sys
import os.path
from io import StringIO
from pygments.formatter imp... | |
#!/usr/bin/env python
"""A remote data store using HTTP."""
import base64
import binascii
import httplib
import random
import re
import socket
import threading
import time
import urlparse
import logging
from grr.lib import access_control
from grr.lib import config_lib
from grr.lib import data_store
from grr.lib imp... | |
#
# The Multiverse Platform is made available under the MIT License.
#
# Copyright (c) 2012 The Multiverse Foundation
#
# 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 restrict... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bottle import route, request, static_file, error, response, template, redirect, abort, auth_basic
from passlib.hash import bcrypt
from utils import ConnectDB
import utils
import bottle, uuid, importlib, os, traceback, datetime, ConfigParser
import server_reloader
impo... | |
#!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC calls related to net.
Tests correspond to code in rpc/net.cpp.
"""
from decimal import Decim... | |
# Copyright 2015 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 by applicable law or a... | |
# Copyright 2012 NEC 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 ag... | |
# This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from collections import Counter
from copy import deepcopy
from da... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import numpy as np
import warnings
import scipy.constants as const
from monty.json import MSONable
from pymatgen.analysis.structure_matcher import StructureMa... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.... | |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | |
#!/usr/bin/env python
# BSD LICENSE
#
# Copyright(c) 2016 Intel Corporation. All rights reserved.
# 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... | |
"""
Common utilities.
.. note::
Many of these functions are *ad hoc* and may change between versions.
"""
import os
import re
import csv
import math
import json
import uuid
import gzip
import pickle
import cPickle
import string
import random
import hashlib
import logging
import datetime
import base64
import numc... | |
# -*- coding: utf-8 -*-
"""
In-memory data structures to hold the IR. We use a flow-graph of Operations.
An operation is
"""
from __future__ import print_function, division, absolute_import
from itertools import chain
from functools import partial
from collections import defaultdict
from pykit import error, types
fr... | |
# Copyright (c) 2012 Rackspace Hosting
# All Rights Reserved.
# Copyright 2013 Red Hat, 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/license... | |
import subprocess, os, errno, shutil
import tkinter as tk
import os.path
from enum import Enum
from shutil import copyfile
from tkinter.filedialog import askopenfilename
from tkinter.filedialog import askopenfilenames
from tkinter.messagebox import showerror
import tkinter.messagebox
from _thread import start_new_thr... | |
#!/usr/bin/env python
import os, random, subprocess, sys, threading
from decimal import *
import numpy as np
libs = ["atlas", "cublas", "mkl", "plasma"]
# libs = ["cublas", "plasma", "ublas"]
prefix = 1000**3
# Process manipulation
#------------------------------------------------------------------------------#
clas... | |
#!/usr/bin/env python
# Copyright (c) 2013, Nebula, Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file exc... | |
# Copyright (c) 2014, FTW Forschungszentrum Telekommunikation Wien
# 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... | |
# 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... | |
import functools
import struct
from .errors import ClaripyOperationError
from .backend_object import BackendObject
def compare_sorts(f):
@functools.wraps(f)
def compare_guard(self, o):
if self.sort != o.sort:
raise TypeError("FPVs are differently-sorted ({} and {})".format(self.sort, o.sor... | |
"""LAS File Reader
The main class defined here is LASReader, a class that reads a LAS file
and makes the data available as a Python object.
"""
# Copyright (c) 2011, Warren Weckesser
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided ... | |
"""
Authors:
Original FORTRAN77 version of i4_sobol by Bennett Fox.
MATLAB version by John Burkardt.
PYTHON version by Corrado Chisari
Original Python version of is_prime by Corrado Chisari
Original MATLAB versions of other functions by John Burkardt.
PYTHON versions by Corrado Chisari
... | |
"""
Text processing utilities
-------------------------
"""
from functools import partial
from html import unescape
from typing import List, Mapping, Set
import re
import string
from bleach.linkifier import DEFAULT_CALLBACKS, LinkifyFilter
from bleach.sanitizer import Cleaner
from markupsafe import Markup
import html... | |
# Copyright 2015 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
from __future__ import annotations
import copy
import logging
import math
import time
from collections import namedtuple
from typing import Tuple
import libtbx.phil
from cctbx import crystal
from dxtbx.masking import (
mask_untrusted_circle,
mask_untrusted_polygon,
mask_untrusted_rectangle,
)
from dxtbx.m... | |
# Copyright 2013 New Dream Network, LLC (DreamHost)
# Copyright 2015 Rackspace
#
# 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
... | |
import os
import os.path
import shutil
import fnmatch
from .utils import realpath_expanduser, is_link_to
from .compat import symlink
class Dotfile(object):
def __init__(self, name, target, home, add_dot=True, dry_run=False):
if name.startswith('/'):
self.name = name
else:
... | |
#!/usr/bin/env python
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Wrapper around git blame that ignores certain commits.
"""
from __future__ import print_function
from __future__ import unicode_lit... | |
# -*- coding: utf-8 -*-
"""
State tracking functionality for django models
"""
import inspect
from collections import namedtuple
from functools import wraps
from django.db import models
from django.db.models.signals import class_prepared
from django.utils.functional import curry
from django_fsm.signals import pre_tran... | |
#!/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.
"""Makes sure that all files contain proper licensing information."""
import optparse
import os.path
import subprocess
import sys... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import json
import os
from paste import httpserver
import sys
import webapp2
from jinja2 import Template
from data_model import Obstaravanie, Session, Notification, NotificationStatus
from utils import obstaravanieToJson, generateReport, getAddressForIco
s... | |
# @author: Bob Dougherty
# Gunnar Schaefer
# Kevin S Hahn
"""
scitran.data.medimg.montage
===========================
Montage provides montage writing capabilities for MR datasets read by any subclass of MedImgReader.
Provides a MedImgWriter subclass for creating image pyramids.
"""
import os
... | |
import logging
from django.contrib.sites.models import Site
from django.contrib.sites.shortcuts import get_current_site
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import NoReverseMatch, reverse
from django.http import HttpResponseRedirect
from oscar.core.loading import get_cla... | |
"""Test the SteadyPg module.
Note:
We do not test the real PyGreSQL module, but we just
mock the basic connection functionality of that module.
We assume that the PyGreSQL module will detect lost
connections correctly and set the status flag accordingly.
Copyright and credit info:
* This test was contributed by Chri... | |
import unittest
from netjsonconfig import OpenWrt
from netjsonconfig.exceptions import ValidationError
from netjsonconfig.utils import _TabsMixin
class TestWireless(unittest.TestCase, _TabsMixin):
maxDiff = None
_wifi_netjson = {
"interfaces": [
{
"name": "wlan0",
... | |
import numpy as np
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import warnings
import transformations as tf
import pose_estimation as pose_estimate
import utilities as ut
import kalman_pose as kpose
def randrange(n, vmin, vmax):
return (vmax - vmin)*np.random.rand(n) + vmin
def cre... | |
# Copyright 2020 The dm_control 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 i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.