gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#
# 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... | |
# 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 appl... | |
# encoding: utf-8
import 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 'LegendOption'
db.create_table(u'profiles_legendoption', (
(u'id', self.gf('dja... | |
import requests
from bs4 import BeautifulSoup
from flask import Flask, request, render_template, jsonify, abort, make_response
import config
import decimal
import json
import re
import os
import time
import datetime
from flask_caching import Cache
app = Flask(__name__)
app.config.from_object('config')
cache = Cache(... | |
# Copyright 2017 The Bazel 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 applicable la... | |
import argparse
import base64
from datetime import datetime
import time
import os
import sys
import select
import shutil
import numpy as np
import socketio
import eventlet
import eventlet.wsgi
from PIL import Image
from flask import Flask
from io import BytesIO
from collections import defaultdict
doWithoutKeras = Fa... | |
import mock
import warnings
from django.contrib.sites.models import Site
from django.core.urlresolvers import NoReverseMatch, set_urlconf
from django.test import TestCase
from django.template import Context, Template
try:
from django.test.client import RequestFactory
except ImportError:
from subdomains.compat... | |
# 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 -*-
"""
Objective: create an airfoil with a leading edge restriction, same upper length
restriction, othogonal upper spars and constant thicknesses in four places
Created on Mon Oct 17 10:36:34 2016
@author: Pedro
"""
from __future__ import print_function
import os
import math
import numpy as np
f... | |
# Copyright 2015 The Switch Authors. All rights reserved.
# Licensed under the Apache License, Version 2, which is in the LICENSE file.
"""
This module describes fuel use with considerations of unit commitment
and incremental heat rates using piecewise linear expressions. If you
want to use this module directly in a ... | |
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... | |
"""
sphinx.pycode.ast
~~~~~~~~~~~~~~~~~
Helpers for AST (Abstract Syntax Tree).
:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
from typing import Dict, List, Optional, Type, overload
if sys.version_info > (3, 8):
import... | |
# -*- coding: utf-8 -*-
import os
import six
import sqlalchemy
from sqlalchemy import *
from migrate.versioning import genmodel, schemadiff
from migrate.changeset import schema
from migrate.tests import fixture
class TestSchemaDiff(fixture.DB):
table_name = 'tmp_schemadiff'
level = fixture.DB.CONNECT
... | |
# 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.
# Copyright (c) 2012 X.commerce, a business unit of eBay Inc.
#
# Licensed under the Apach... | |
# Natural Language Toolkit: Paradigm Visualisation
#
# Copyright (C) 2005 University of Melbourne
# Author: Will Hardy
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
# Parses a paradigm query and produces an XML representation of
# that query. This is part of a Python implementation of David
# ... | |
'''
Created on Oct 14, 2014
@author: stefan
@author: Laurent Tramoy
'''
from parser import stpcommands
from ciphers.cipher import AbstractCipher
from parser.stpcommands import getStringLeftRotate as rotl
class KetjeCipher(AbstractCipher):
"""
This class provides a model for the differential behaviour of th... | |
from datetime import datetime
from collections import OrderedDict
import enum
import time
from sqlalchemy import Column, Integer, String, Float, SmallInteger, BigInteger, ForeignKey, UniqueConstraint, create_engine, cast, func, desc, asc, and_, exists
from sqlalchemy.exc import DBAPIError
from sqlalchemy.orm import se... | |
#!/bin/env python
import argparse
import collections
import pprint
import pickle
import os
import re
import cbor
import logging
logr = logging.getLogger( __name__ )
# Exception type is part of the error signature
err_type_re_signature = {
"<type 'exceptions.OSError'>": re.compile( '([^:]+):?' ),
"<type 'e... | |
# 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 ... | |
"""The Fronius integration."""
from __future__ import annotations
import asyncio
from collections.abc import Callable
import logging
from typing import Final, TypeVar
from pyfronius import Fronius, FroniusError
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_MODEL, ATTR_SW_V... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 02 11:26:02 2015
@author: ISTI_EW
test fmm
"""
from __future__ import unicode_literals, division, absolute_import, print_function
from six import string_types
import skfmm
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.gridspec a... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
XMPP-specific SASL profile.
"""
import re
from twisted.internet import defer
from twisted.words.protocols.jabber import sasl_mechanisms, xmlstream
from twisted.words.xish import domish
# The b64decode and b64encode functions from the base64 ... | |
#!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | |
# Easy paver commands for less command typing and more coding.
# Visit http://paver.github.com/paver/ to get started. - @brandondean Sept. 30
import subprocess
import sys
import json
import time
import optparse
import os
import re
from paver.easy import *
from openapi_spec_validator import validate_spec
path = path(".... | |
#!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin P2P ... | |
from scapy.packet import *
from scapy.fields import *
from scapy.layers.l2 import *
from scapy.layers.inet import *
##Layers
#Hello Message Format
#
# The PIM Hello message, as defined by PIM-SM [4], has the following
# format:
#
# 0 1 2 3
# 0 1 2 3 4 5 ... | |
# Author: Christine Staiger
# Date: March 1st 2017
# Version: 0.1
"""
Python functions to test the connectivity and performance of the iRODS icommands iput and iget.
"""
import os
import json
import subprocess
import time
from timeit import default_timer as timer
import hashlib
from tqdm import tqdm
import shu... | |
# -*- coding: UTF-8 -*-
#
"""
history
Press related content, names of papers
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3.0.0 - split all the content into babycontents
evb - note: only one dictionary named 'content' allowed per module
this limitation is to spe... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 except in compli... | |
# -*- coding: utf-8 -*-
#
# 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
#... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from yosaipy2.core import (
SessionSettings,
InvalidSessionException,
)
from session import session_tuple, SimpleSession, SessionKey
from session import NativeSessionHandler
from yosaipy2.core.utils.utils import get_logger
from typing import Dict
import abcs as sess... | |
# Copyright 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 requ... | |
"""
This module is for inspecting OGR data sources and generating either
models for GeoDjango and/or mapping dictionaries for use with the
`LayerMapping` utility.
Author: Travis Pinney, Dane Springmeyer, & Justin Bronn
"""
from itertools import izip
# Requires GDAL to use.
from django.contrib.gis.gdal import DataSourc... | |
import distutils
import sys
import subprocess
import re
import os
import difflib
from functools import wraps
from pkg_resources import resource_filename
from io import StringIO
from collections import namedtuple
from contextlib import contextmanager
import numpy
import pandas
import pytest
def get_img_tolerance():
... | |
import attr
import nltk
import spacy
from collections import OrderedDict
from functools import partial
from nltk.tokenize import word_tokenize
from nltk.tag import pos_tag
from nltk.corpus import wordnet as wn
from pywsd.lesk import simple_lesk as disambiguate
from typos import typos
nlp = spacy.load('en')
# Pen... | |
#!/usr/bin/env python2.5
#
# Copyright 2008 the Melange 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 applic... | |
import socket
import tornado
import tornado.ioloop
import tornado.process
from .routing import RoundRobinRouter, PROTOCOL_HTTP, PROTOCOL_HTTPS
from pyrox.tstream.iostream import (SSLSocketIOHandler, SocketIOHandler,
StreamClosedError)
from pyrox.tstream.tcpserver import TCPServer
... | |
# Copyright (c) 2012 Rackspace Hosting
# 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... | |
"""
ulmo.ncdc.cirs.core
~~~~~~~~~~~~~~~~~~~
This module provides direct access to the `National Climatic Data Center`_
`Climate Index Reference Sequential (CIRS)`_ drought dataset.
.. _National Climatic Data Center: http://www.ncdc.noaa.gov
.. _Climate Index Reference Sequential (CIRS): http:/... | |
# -*- encoding: utf-8
from sqlalchemy.testing import eq_
from sqlalchemy import schema
from sqlalchemy.sql import table, column
from sqlalchemy.databases import mssql
from sqlalchemy.dialects.mssql import mxodbc
from sqlalchemy.testing import fixtures, AssertsCompiledSQL
from sqlalchemy import sql
from sqlalchemy impor... | |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... | |
import warnings
from . import _minpack
import numpy as np
from numpy import (atleast_1d, dot, take, triu, shape, eye,
transpose, zeros, prod, greater,
asarray, inf,
finfo, inexact, issubdtype, dtype)
from scipy.linalg import svd, cholesky, solve_triangular, LinA... | |
# -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import
import re
import os
import uuid
import pytest
import popquotes.pmxbot
import pmxbot.dictlib
import pmxbot.storage
from pmxbot import core
from pmxbot import logging
from pmxbot import commands
from pmxbot import karma
from pmxbot import q... | |
# orm/deprecated_interfaces.py
# Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from sqlalchemy import event, util
from interfaces import EXT_CONTINUE
... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Exceptions in L{twisted.mail}.
"""
from __future__ import absolute_import, division
class IMAP4Exception(Exception):
pass
class IllegalClientResponse(IMAP4Exception):
pass
class IllegalOperation(IMAP4Exception):
pass
cl... | |
#!/usr/bin/python
#
# Copyright (c) 2011 Vince Durham
# Copyright (c) 2013-2014 The Blakecoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING.
#
import logging
import argparse
import os
import sys
import traceback
import json
import base64
from binascii import a2b_hex, ... | |
import idc
import idaapi
import idautils
import time
# This limits the depth of any individual path, as well as the maximum
# number of paths that will be searched; this is needed for practical
# reasons, as IDBs with tens of thousands of functions take a long time
# to exhaust all possible paths without some practica... | |
# 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 ... | |
#!/usr/bin/env python
"""
Copyright 2013 The Trustees of Princeton University
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... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import time
import subprocess
# Import parameters from the setup file.
sys.path.append('.')
from setup import (
setup_dict, get_project_files, print_success_message,
print_failure_message, _lint, _test, _test_all,
CODE_DIR... | |
""" Create splits of the data into train and test data used for cross-validation """
import random
from pySPACE.missions.nodes.base_node import BaseNode
from pySPACE.missions.nodes.decorators import NoOptimizationParameter
from pySPACE.tools.memoize_generator import MemoizeGenerator
import logging
@NoOptimizationPa... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2015 Kitware 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 cop... | |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'main.ui'
#
# Created by: PyQt5 UI code generator 5.9
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("... | |
#!/usr/bin/env python
# VMware vSphere Python SDK
# Copyright (c) 2008-2021 VMware, 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/lic... | |
#!/usr/bin/env python3
# This file is part of the Soletta Project
#
# Copyright (C) 2015 Intel Corporation. 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 ... | |
# -*- coding: utf-8 -*-
#
# scikit-learn documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 8 09:13:42 2010.
#
# 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.
... | |
from django.contrib.auth.decorators import login_required
from django.shortcuts import get_object_or_404, render, redirect
from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseNotAllowed
from django.conf import settings
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.for... | |
# models.py
from django.db import models
from django.db.models.signals import pre_save
import os
import socket
import datetime
import random
# from django.forms import Textarea
from django import forms
from .unique_slugify import unique_slugify
from functools import reduce
def time2s(time):
""" given 's.s' or ... | |
# Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import copy
import logging
import optparse
import os
import random
import sys
import tempfile
import time
from telemetry import decorator... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals
"""
Interface with command line GULP.
http://projects.ivec.org
WARNING: you need to have GULP installed on your system.
"""
__author__ = "Bharat Medasani, Wenhao Sun"
_... | |
# 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 ... | |
# 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 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... | |
# 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... | |
import json
import copy
from itertools import chain
from account.views import SignupView
from django.shortcuts import redirect
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User, Group
from django.contrib.admin.views.decorators import ... | |
# 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 json
import os
from functools import wraps
from flask import Flask, request, abort, redirect, url_for, render_template, \
send_from_directory, Blueprint, g, make_response
from ..api import MissingEntry
app = Flask(__name__, static_url_path='')
blueprint = Blueprint('formgrade', __name__)
def auth(f):
... | |
from sympy.core.add import Add
from sympy.core.mul import Mul
from sympy.core.power import Pow
from sympy.core.function import Function
from sympy.core.symbol import Symbol, Wild
from sympy.core.basic import S, C, Atom, sympify
from sympy.core.numbers import Integer, Rational
from sympy.functions import exp, sin , co... | |
from filebeat import BaseTest
import os
import time
import unittest
"""
Tests for the prospector functionality.
"""
class Test(BaseTest):
def test_ignore_old_files(self):
"""
Should ignore files there were not modified for longer then
the `ignore_older` setting.
"""
self.... | |
import os
import datetime as dt
import time
import glob
import pytz
import netCDF4 as nc
import numpy as np
import extract_utils
import extract_from_file
__version__ = '0.1.5'
# def file_time(f):
# UTC = pytz.timezone('UTC')
# ncf = nc.Dataset(f,mode='r')
# ot = ncf.variables['ocean_time']
# base_time = dt.date... | |
from flask.ext.restful import fields
from flask.ext.restful_swagger import swagger
from AcceptEnvironmentProperties import AcceptEnvironmentProperties
from Asset import Asset
from AssetEnvironmentProperties import AssetEnvironmentProperties
from Attacker import Attacker
from AttackerEnvironmentProperties import Attack... | |
import os
from nose_parameterized import parameterized
import pandas as pd
from toolz import valmap
import toolz.curried.operator as op
from zipline.assets.synthetic import make_simple_equity_info
from zipline.data.bundles import UnknownBundle, from_bundle_ingest_dirname
from zipline.data.bundles.core import _make_bu... | |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 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 BIP68 implementation
#
from test_framework.test_framework import BitcoinTestFramework
from test... | |
#
# This file is part of pyasn1-modules software.
#
# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
# X.509 message syntax
#
# ASN.1 source from:
# http://www.trl.ibm.com/projects/xml/xss4j/data/asn1/grammars/x509.asn
# http://www.ietf.org/rfc/rfc2459.txt... | |
"""JSON Validator
Copyright 2009 Google Inc.
http://code.google.com/p/google-mobwrite/
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... | |
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2020 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... | |
# pylint: disable-msg=E1101,W0612
import operator
from numpy import nan
import numpy as np
import pandas as pd
from pandas import Series, DataFrame, bdate_range
from pandas.core.common import isnull
from pandas.tseries.offsets import BDay
import pandas.util.testing as tm
from pandas.compat import range
from pandas i... | |
# Bundles for JS/CSS Minification
PIPELINE_CSS = {
'common': {
'source_filenames': (
'normalize-css/normalize.css',
'sumo/less/main.less',
'sumo/less/search.less',
'mozilla-tabzilla/css/tabzilla.css',
),
'output_filename': 'build/common-min.cs... | |
import unittest
from io import BytesIO, BufferedReader
from urllib3.response import HTTPResponse
from urllib3.exceptions import DecodeError
from base64 import b64decode
# A known random (i.e, not-too-compressible) payload generated with:
# "".join(random.choice(string.printable) for i in xrange(512))
# .enco... | |
# Copyright (c) 2007 Twisted Matrix Laboratories.
# See LICENSE for details
"""
This module tests twisted.conch.ssh.connection.
"""
import struct
from twisted.conch import error
from twisted.conch.ssh import channel, common, connection
from twisted.trial import unittest
from twisted.conch.test import test_userauth
... | |
import os
import re
from django import forms
from django.conf import settings
from django.forms import ModelForm
from django.forms.models import modelformset_factory
from django.template import Context, Template, TemplateSyntaxError
import happyforms
from piston.models import Consumer
from product_details import prod... | |
#------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... | |
#
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import shutil
import os
import hashlib
import psutil
import urllib.request
import tarfile
from getpass import getuser
from os import getenv, mkdir
from os.path import expanduser, dirname, isdir, isfile, islink, \
join, lexists, normpath, realpath, relpath
from subpro... | |
"""Python part of the warnings subsystem."""
import sys
__all__ = ["warn", "warn_explicit", "showwarning",
"formatwarning", "filterwarnings", "simplefilter",
"resetwarnings", "catch_warnings"]
def showwarning(message, category, filename, lineno, file=None, line=None):
"""Hook to write a wa... | |
# 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 -*-
# Copyright (c) 2013 Spotify AB
import logging
import pdb
import random
import sys
from graphwalker import codeloader
from graphwalker import halting
# some ghetto enums
COST, PATH = 0, 1
# approximation of infinity(tm)
inf = 2 ** 31
log = logging.getLogger(__name__)
class Planner(object):
... | |
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
"""An OrderedSet is a set that remembers its insertion order, and a FrozenOrderedSet is one that is
also immutable.
Based on the library `ordered-set` developed by Robyn Speer and release... | |
# Lint as: python3
# 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 requ... | |
#!/usr/bin/python
#
# Copyright (c) 2012, NORDUnet A/S
# 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
# no... | |
# Copyright 2022 Google LLC. 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 o... | |
"""Topology components for FAUCET Mininet unit tests."""
import os
import pty
import select
import socket
import string
import shutil
import subprocess
import time
import netifaces
# pylint: disable=import-error
from mininet.log import error, output
from mininet.topo import Topo
from mininet.node import Controller
f... | |
# -*- coding: utf-8 -*-
"""
This is part of HashBruteStation software
Docs EN: http://hack4sec.pro/wiki/index.php/Hash_Brute_Station_en
Docs RU: http://hack4sec.pro/wiki/index.php/Hash_Brute_Station
License: MIT
Copyright (c) Anton Kuzmin <http://anton-kuzmin.ru> (ru) <http://anton-kuzmin.pro> (en)
Class of unit tests... | |
"""Generates API documentation by introspection."""
from django.contrib.auth.models import AnonymousUser
import rest_framework
from rest_framework import viewsets
from rest_framework.serializers import BaseSerializer
from .introspectors import (
APIViewIntrospector,
BaseMethodIntrospector,
IntrospectorHelp... | |
import mock
import pytest
import requests
from collections import namedtuple
from awx.api.views import (
ApiVersionRootView,
JobTemplateLabelList,
JobTemplateSurveySpec,
InventoryInventorySourcesUpdate,
InventoryHostsList,
HostInsights,
)
from awx.main.models import (
Host,
)
from awx.ma... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware 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 cop... | |
#!/usr/bin/env python
#
# Copyright (c), 2016-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author Da... | |
import urllib2
import json
import hashlib
import hmac
import time
from django.conf import settings
# GET /api/v1/account/balance HTTP/1.1
# Accept: */*
# User-Agent: Python
# ACCESS_KEY: <YOUR-API-KEY>
# ACCESS_SIGNATURE: <YOUR-COMPUTED-SIGNATURE>
# ACCESS_NONCE: <YOUR-UPDATED-NONCE>
# Connection: close
# Host: coinb... | |
# Copyright 2014 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... | |
from collections.abc import Iterable, Mapping
from numbers import Real, Integral
from pathlib import Path
import subprocess
import sys
import warnings
from xml.etree import ElementTree as ET
import numpy as np
import openmc
import openmc.checkvalue as cv
from openmc._xml import clean_indentation
from openmc.mixin imp... | |
from __future__ import absolute_import
from PySide import QtCore, QtGui
from ..wave_file import WaveTable, WaveFileError, ExportAsmFormatter, ExportCFormatter
from .dialogs import AsmExportDialog
from .widgets import WaveScene
class WaveDocumentEditor(QtGui.QGraphicsView):
"""
Individual wave editor documen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.