gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from .helper import format_bytes, calc_speed, calc_eta, calc_percent
import io
import os
import time
import sys
import logging
log = logging.getLogger(__name__)
from .commandline import get_log_line
try: input = raw_input
except NameError: pass
# the printing and processing of finished downloads is initiaded from the ... | |
#!/usr/bin/env python
# Copyright 2017 Battelle Energy Alliance, 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 appl... | |
#
#
# Copyright (C) 2006, 2007, 2010, 2011, 2012, 2014 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
... | |
"""Config flow for Apple TV integration."""
from ipaddress import ip_address
import logging
from random import randrange
from pyatv import exceptions, pair, scan
from pyatv.const import Protocol
from pyatv.convert import protocol_str
import voluptuous as vol
from homeassistant import config_entries
from homeassistant... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
# Copyright 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 copy of t... | |
# 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.
import collections
import itertools
import os
import posixpath
from devil.android import device_errors
from devil.android import device_temp_file
from devil... | |
# utility for color output for Mercurial commands
#
# Copyright (C) 2007 Kevin Christen <kevin.christen@gmail.com> and other
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import re
from .... | |
from flask import request
import logging
from werkzeug.exceptions import BadRequest, NotFound
from sqlalchemy.orm.exc import NoResultFound
from rdr_service.api.base_api import UpdatableApi, log_api_request
from rdr_service.api_util import BIOBANK
from rdr_service.app_util import auth_required
from rdr_service.dao.biob... | |
import uuid, subprocess, os, shutil, json, requests, time
from datetime import datetime
import portality.models as models
from portality.core import app
from xml.etree import ElementTree as ET
from lxml import etree
class callers(object):
def __init__(self,scraperdir=False,storagedir=False,speciesdi... | |
# -*- coding: utf-8 -*-
# Copyright 2018 Objectif Libre
#
# 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 ... | |
# encoding: utf-8
from __future__ import unicode_literals
from web.dispatch.core import nodefault
from web.dispatch.object import ObjectDispatch
from sample import path, function, Simple, ClassDynamicAttribute, FunctionDynamicAttribute, CallableShallow, \
CallableDeep, CallableMixed, AnonymousDynamicAttribute
# ... | |
# -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, 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 requi... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Factory functions producing ABINIT Works.
Works are packed together in a flow. A flow can be ran using abirun (abipy)
Entry points for client code (high-level interface)
"""
from __future__ import unicode_li... | |
from __future__ import absolute_import, division
from collections import defaultdict
import numpy as np
import pandas as pd
from six import iteritems
from bokeh.charts import DEFAULT_PALETTE
from bokeh.core.enums import DashPattern
from bokeh.models.glyphs import Rect, Segment, Line, Patches, Arc
from bokeh.models.r... | |
# Copyright 2016 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 ... | |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publi... | |
# Copyright (c) 2014 Mirantis 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 ... | |
# Licensed under a 3-clause BSD style license - see PYFITS.rst
import sys
import numpy as np
from .base import DTYPE2BITPIX, DELAYED
from .image import PrimaryHDU
from .table import _TableLikeHDU
from astropy.io.fits.column import Column, ColDefs, FITS2NUMPY
from astropy.io.fits.fitsrec import FITS_rec, FITS_record
f... | |
"""selector - WSGI handler delegation. (AKA routing.)"""
# This is a local copy of selector to get it working properly with
# Python 3. See: https://github.com/lukearno/selector/pull/22
import re
from itertools import starmap
from wsgiref.util import shift_path_info
import resolver
class MappingFileError(Exceptio... | |
'''
Module for plotting patches, built for the COSMO project
Quim Ballabrera, August 2020
Changes:
- 07/2020: QB:
Initial version
'''
import tkinter as tk
from tkinter import ttk
#try:
# from tkcolorpicker import askcolor
#except:
# from tkColorChooser import askcolor
from tkinter.colorchoose... | |
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from flexmock import flexmock
import os
import os.path
import pytest
import datetime
import sys
from time import tzset
from osbs.utils import... | |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
import unittest
from flypy import jit, sjit
from flypy.types import int32, void, Pointer
from flypy.runtime import ffi
#===------------------------------------------------------------------===
# Test code
#===-------------------... | |
# Copyright 2011 James McCauley
# Copyright 2012 James McCauley
#
# This file is part of POX.
#
# POX is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | |
# Copyright (c) 2014 OpenStack Foundation
# Copyright (c) 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.apac... | |
# -*- coding: 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 'BatchLocationStatus'
db.create_table(u'survey_batchlocationstatus', (
(u'id', se... | |
# 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 ... | |
# 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... | |
"""
General Character commands usually availabe to all characters
"""
from django.conf import settings
from src.utils import utils, prettytable
from src.commands.default.muxcommand import MuxCommand
# limit symbol import for API
__all__ = ("CmdHome", "CmdLook", "CmdNick",
"CmdInventory", "CmdGet", "CmdDrop... | |
#!/usr/bin/env python
# Copyright 2013 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.
"""This is a python sync server used for testing Chrome Sync.
By default, it listens on an ephemeral port and xmpp_port and sends the ... | |
import argparse
import hashlib
import io
import os
import re
import subprocess
import sys
import requests
import json
def create_args(params):
parser = argparse.ArgumentParser('coveralls')
parser.add_argument('--gcov-options', metavar='GCOV_OPTS', default='',
help='set the options give... | |
from __future__ import absolute_import
import myhdl
from myhdl import (Signal, intbv, enum, always_seq, always_comb,
ConcatSignal)
from rhea.system import MemoryMapped, Barebone, FIFOBus
from . import controller_basic
@myhdl.block
def command_bridge(glbl, fifobus, mmbus):
""" Convert a comma... | |
# -*- coding: utf-8 -*-
__all__ = ['Distribution']
import io
import sys
import re
import os
import warnings
import numbers
import distutils.log
import distutils.core
import distutils.cmd
import distutils.dist
from distutils.util import strtobool
from distutils.debug import DEBUG
from distutils.fancy_getopt import tran... | |
import logging
from unittest import TestCase
from testfixtures import LogCapture
from twisted.trial.unittest import TestCase as TrialTestCase
from twisted.internet import defer
from scrapy.utils.test import get_crawler
from tests.mockserver import MockServer
from scrapy.http import Response, Request
from scrapy.spide... | |
# Copyright 2015 Tesora 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 a... | |
#!/usr/bin/python
__author__ = 'Jervis Muindi'
__date__ = 'November 2013'
import httplib2
import time
from apiclient.discovery import build
from apiclient.http import MediaFileUpload
from oauth2client.client import OAuth2WebServerFlow
from oauth2client.client import Credentials
class GFile(object):
"""Encapsula... | |
"""
Filename: plot_lat_vs_depth.py
Author: Damien Irving, irving.damien@gmail.com
Description: Plot latitude versus depth data
"""
# Import general Python modules
import sys
import os
import pdb
import re
import argparse
import numpy
import matplotlib.pyplot as plt
from matplotlib import gridspec
from ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Blueprint
from flask import current_app
from flask import jsonify
from flask import redirect
from flask import render_template
from flask import request
from flask import url_for
from flask.ext.login import current_user
from flask.ext.login import login_r... | |
"""prov-analysis.py: Some basic prov-o benchmarking
Usage: prov-analysis.py
"""
import os, os.path
import sys
import re
import unittest
import logging
import httplib
import urllib
import time
import StringIO
import codecs
import csv
try:
# Running Python 2.5 with simplejson?
import simplejson as... | |
'''
Created on February 11, 2021
This file is subject to the terms and conditions defined in the
file 'LICENSE.txt', which is part of this source code package.
@author: David Moss
'''
from devices.device import Device
import signals.vayyar as vayyar
import utilities.utilities as utilities
# We had established 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.
... | |
# 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... | |
"""
Test for the SmartThings sensors platform.
The only mocking required is of the underlying SmartThings API object so
real HTTP calls are not initiated during testing.
"""
from pysmartthings import ATTRIBUTES, CAPABILITIES, Attribute, Capability
from homeassistant.components.sensor import (
DEVICE_CLASSES,
... | |
# Copyright 2011 OpenStack Foundation
# Copyright 2011 Ilya Alekseyev
#
# 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
#
#... | |
"""
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal... | |
from datetime import datetime, timedelta
from os import path
from django.core.urlresolvers import reverse
import jingo
from mock import Mock
from pyquery import PyQuery as pq
from olympia import amo
from olympia.amo.tests import TestCase
from olympia.addons.models import Addon, AddonUser
from olympia.bandwagon.model... | |
from abc import ABCMeta, abstractmethod
from collections import Iterable
from math import pi
from numbers import Real
import sys
from xml.etree import ElementTree as ET
from six import add_metaclass
import numpy as np
import openmc.checkvalue as cv
from openmc.stats.univariate import Univariate, Uniform
@add_metacl... | |
import sys
sys.path.append("..")
import gat.dm.utils as utils
from gat.dm.Move import Move
from gat.dm.Pole import *
from gat.dm.State import State
from gat.dm.risk_calculation import generate_resource_vocab
from gat.dm.MST import MST
from gat.dm import IO
from gat.dm import risk_calculation
from gat.dm.Event import E... | |
# 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... | |
""" BenchmarkExecution Controller tests """
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.auth.models import AnonymousUser
from django.utils import timezone
from app.logic.benchmark.controllers.BenchmarkExecutionController import BenchmarkExecutionController
from app.... | |
"""Special archetypes provided as necessary to the Rickshaw input file.
Used for fuel cycle niches that have more than just one incommodity and outcommodity.
"""
import random
def generate_throwsink(commod, name):
"""Generic sink for outcommodities that do not become the
incommodity of the following archetyp... | |
# ----------------------------------------------------------------------------
# Name: integrateable_multimeter_logger_with_temperature.py
# Modified from: multi_meterlog.py
# Author: Jeff Horsburgh
# Creation Date: 7/25/2016
# Modified by: Joshua Tracy
# Modified: 8/14/18
# Modified again by: Daniel Henshaw (to add au... | |
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and
# distribution is subject to the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
from declarations import *
try:
# try to use internal elementtree
from xml.etree... | |
# -*- coding: utf-8 -*-
import time
from datetime import datetime
import random
import urllib
from urlparse import urlparse, urlunparse, parse_qs, urlsplit, urlunsplit
from auth import Token, Consumer
from auth import to_utf8, escape
from auth import SignatureMethod_HMAC_SHA1
class CustomSignatureMethod_HMAC_SHA1(Si... | |
from flask import Blueprint
from flask import render_template, request, redirect, g, jsonify, session
from cloudmesh.config.cm_config import cm_config
# from cloudmesh.cm_mesh import cm_mesh
from cloudmesh_common.tables import table_printer
from cloudmesh.cm_mongo import cm_mongo
from cloudmesh.user.cm_user import cm_... | |
"""Test the Kuler Sky lights."""
from unittest.mock import MagicMock, patch
import pykulersky
import pytest
from homeassistant import setup
from homeassistant.components.kulersky.light import DOMAIN
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_HS_COLOR,
ATTR_RGB_COLOR,
ATTR_WHITE... | |
#!/usr/bin/env python
import os
import commands
import sys
import json
import logging
import urllib2
import stat
import shutil
import fnmatch
import subprocess
import time
import re
from bs4 import BeautifulSoup
from optparse import OptionParser
script_path = os.path.realpath(__file__)
const_path = os.path.dirname(scri... | |
"""This file tests internal details of AndroidPlatform. These are not part of the public API,
and should not be accessed or relied upon by user code.
"""
import calendar
from contextlib import contextmanager
import imp
from importlib import import_module, metadata, reload, resources
import importlib.util
from importli... | |
"""
Abstract conv interface
"""
import numpy as np
import logging
from six import reraise, integer_types
import sys
import theano
from theano.tensor import as_tensor_variable, patternbroadcast
from theano.tensor import get_scalar_constant_value, NotScalarConstantError
from theano.gof import Apply, Op
from six.moves... | |
import re
import time
import sys
# use this as a mapping for fonts
_FONT = {
'.' : [0, 0, 0x01, 0, 0], # dot
' ' : [0, 0, 0, 0, 0], # space!
'a' : [0x3f, 0x48, 0x48, 0x48, 0x3f], # A
'b' : [0x7f, 0x49, 0x49, 0x49, 0x36],
'c' : [0x3e, 0x41, 0x41, 0x41, 0x22],
'd' : [0x7f, 0x41, 0x41, 0x22, 0x1c],
'e' : [0... | |
#
# Insight compatible API module
#
import os, urlparse, cgi, json
from string import hexdigits
from struct import pack, unpack
from datetime import datetime
from hashlib import sha256
from bitcoinrpc.authproxy import AuthServiceProxy
from gevent import sleep
from sqlchain.version import version, MAX_TX_BLK, MAX_IO_... | |
# Copyright (c) 2015 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
#
# Unless required by applicable l... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""This file contains the class GPSContent (for everything that is saved on the GPS device)."""
import os
import glob
import webbrowser
import subprocess
import time
import xml.etree.ElementTree as ElementTree
from geocache import TYPE_LIST, SIZE_LIST
from geocache import Ge... | |
# Added Fortran compiler support to config. Currently useful only for
# try_compile call. try_run works but is untested for most of Fortran
# compilers (they must define linker_exe first).
# Pearu Peterson
from __future__ import division, absolute_import, print_function
import os, signal
import warnings
import sys
fr... | |
import apsw
class _NoDefault(object):
pass
class _RowBase(object):
pass
class Row(_RowBase):
""" Encapsulates a value tuple and column dictionary from APSW.
Provides very fast access to values/column names via attribute and item
lookup.
It is recommended to use the query and get methods in ... | |
"""
Copyright (c) 2013, Jurriaan Bremer
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the followi... | |
import os
import re
from robot import utils
from robot.utils.asserts import assert_equals
from robot.result.resultbuilder import ExecutionResultBuilder
from robot.result.executionresult import Result
from robot.result.testsuite import TestSuite
from robot.result.testcase import TestCase
from robot.result.keyword impor... | |
from datetime import datetime
from functools import reduce
from django.core.exceptions import ImproperlyConfigured
from django.contrib.auth.decorators import login_required
from django.db.models import Model, QuerySet, Q, F, Min, Max, Avg, Count, Sum, Value, CharField, Case, When
from django.db.models.functions import... | |
#!/usr/bin/env python
"""
Usage:
tig init
tig commit <msg>
tig checkout <start-point> [-b <branch-name>]
tig diff
tig log
tig branch
tig merge <branch>
Options:
-b <branch-name> Branch name to checkout.
"""
import sys
import docopt
import os
import shutil
import difflib
import hashlib
import json
... | |
from __future__ import absolute_import
import argparse
import multiprocessing
import os
import sys
import time
import traceback
import numpy as np
from progressbar import ProgressBar
import h5py
from src.data import VideoGenerator
def extract_features(videos_dir, output_dir, batch_size, num_threads,
... | |
# -*- coding: utf-8 -*-
import re
from django.core.urlresolvers import reverse, NoReverseMatch
from django.utils.safestring import mark_safe
from crispy_forms.compatibility import string_types
from crispy_forms.layout import Layout
from crispy_forms.layout_slice import LayoutSlice
from crispy_forms.utils import rende... | |
from conans.errors import ConanException, ConanConnectionError
from conans.util.log import logger
import traceback
from conans.util.files import save, sha1sum, exception_message_safe, to_file_bytes, mkdir
import os
import time
from conans.util.tracer import log_download
import conans.tools
class Uploader(object):
... | |
#
# Copyright 2016 Quantopian, 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 wr... | |
# Copyright 2013 Lars Butler & individual contributors
#
# 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... | |
#!/usr/bin/env python
"""
One of the most controversial issues in the US educational system is the efficacy of standardized
tests, and whether they are unfair to certain groups. Given our prior knowledge about this topic,
investigating the correlations between SAT scores and demographic factors might be an interesting
... | |
# This file contains all code handling the resolution and modification of i
# mappings. This includes group handle indirection and VSL validation, so the
# file is somewhat hairy.
# NOTE: an ihandle is the hash of a principal's itable, which holds that
# principal's mapping from inumbers (the second part of an i) to in... | |
"""
Tools for constructing patterns.
-----
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License. See http://scipy.org.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
Author: Pearu Peterson <pearu@cens.ioc.ee>
Created: Oct 2006
-----
"""
dollar_ok = True
... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
__author__="Scott Hendrickson, Josh Montague"
import sys
import requests
import json
import codecs
import datetime
import time
import os
import re
import unicodedata
from acscsv.twitter_acs import TwacsCSV
reload(sys)
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
s... | |
# -*- coding: utf-8 -*-
import nltk
import csv
import random
import codecs
import re
from nltk.corpus import stopwords
import sys
stopset = list(set(stopwords.words('spanish')))
hil_tweets = []
trump_tweets = []
bernie_tweets = []
cruz_tweets = []
classes = {}
def transform(temp):
if temp == "imo":
retur... | |
#
# IIS_DataListener.py -- IIS (XImtool protocol) server
#
# Eric Jeschke (eric@naoj.org)
#
# This file contains code by "fpierfed" (email addr unknown) downloaded from:
# http://pyimtool.cvs.sourceforge.net/viewvc/pyimtool/pyimtool/src/
# and modified.
#
# Modifications Copyright (c) Eric R. Jeschke. All rights re... | |
from models.dummy_tensorflow_model import DummyTensorflowModel
from models.relation_prediction_oracle import RelationPredictionOracle
from models.tensorflow_components.aux_components.sentence_to_entity_mapper import SentenceToEntityMapper
from models.tensorflow_components.gcn.gcn_factory import GcnFactory
from models.t... | |
# -*- coding: utf-8 -*-
from __future__ import (
absolute_import, division, print_function, unicode_literals)
import errno
import os
import pdb.fetch_ss_dis as ss
import shutil
import stat
import unittest
from io import open
from tempfile import mkdtemp
from pdb.lib.datetime_info import now_utc
class TestSsDis... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nicira Networks, 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.apach... | |
"""Tests for distutils.sysconfig."""
import contextlib
import os
import shutil
import subprocess
import sys
import textwrap
import unittest
from distutils import sysconfig
from distutils.ccompiler import get_default_compiler
from distutils.unixccompiler import UnixCCompiler
from distutils.tests import support
from tes... | |
#!/usr/bin/env python3
import sys, time, random, struct, io, binascii
# Scan regions of memory for changes, and display those changes in real-time.
# It's like My First Temporal Hex Dump. Great for kids!
__all__ = ['watch_scanner', 'watch_tabulator']
def break_up_addresses(device, addrs, block_wordcount):
"""Br... | |
# coding=utf-8
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2012, Intel Performance Learning Solutions Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | |
""" Factory methods to build Data objects from files
Implementation notes:
Each factory method conforms to the folowing structure, which
helps the GUI Frontend easily load data:
1) The first argument is a file name to open
2) The return value is a Data object
3) The function should be decorated with data_factory a... | |
import json
import logging
import posixpath
from typing import TYPE_CHECKING, Dict, Optional, Tuple
from funcy import cached_property
from .errors import ObjectFormatError
from .file import HashFile
from .stage import get_file_hash
if TYPE_CHECKING:
from dvc.hash_info import HashInfo
from .meta import Meta
... | |
from rpython.rlib import jit, longlong2float
from rpython.rlib.objectmodel import specialize
from rpython.rlib.rarithmetic import intmask
from rpython.rlib.unroll import unrolling_iterable
from rpython.rtyper.lltypesystem import rffi, lltype
NUM_DIGITS = 4
NUM_DIGITS_POW2 = 1 << NUM_DIGITS
class MapTransitionCache(... | |
# 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 2014 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
"""
Represents diffraction results.
self._intensities = numpy.array((number_energies,number_angles,index_polarization))
self._phases = numpy.array((number_energies,number_angles,index_polarization))
index_polarization:
INDEX_POLARIZATION_S = 0
INDEX_POLARIZATION_P = 1
INDEX_DIFFE... | |
#!/usr/bin/env python
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''
Usage: callstats.py [-h] <command> ...
Optional arguments:
-h, --help show this help message and exit
Commands:
run ... | |
# Copyright (c) 2021 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.
"""Pseudolocale translations for chrome."""
from __future__ import print_function
import re
import string
from collections import namedtuple
from grit ... | |
"""Pkgpanda HTTP API"""
import http.client
import logging
import os
import sys
from flask import current_app, Flask, jsonify, make_response, request
from pkgpanda import actions, Install, Repository
from pkgpanda.exceptions import (PackageConflict, PackageError,
PackageNotFound, Vali... | |
import datetime
import hashlib
import random
import re
from django.conf import settings
from django.db import models
from django.db import transaction
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from django import VERSION as DJANGO_VERSION
from authentic... | |
from __future__ import print_function
import argparse
import random
import torch
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
from warpctc_pytorch import CTCLoss
import os
import utils
import dataset... | |
#!/usr/bin/env python3
#
# Copyright (c) 2019, Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
'''Tool for parsing a list of projects to determine if they are Zephyr
projects. If no projects are given then the output from `west list` will be
used as project list.
Include file is generated for Kconfig... | |
# 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... | |
import tensorflow as tf
from ImageAugmenter import ImageAugmenter
import cv2
from tqdm import tqdm
import glob
import os
import numpy as np
from random import shuffle
from joblib import Parallel, delayed
import multiprocessing
num_cores = multiprocessing.cpu_count()
print("CPU count:" + str(num_cores))
NUM_EXAMPLES_P... | |
import os
import numpy as np
import pytest
import warnings
import matplotlib.pyplot as plt
import scipy.special
from astropy.io import fits
from stingray import Lightcurve
from stingray import Crossspectrum, AveragedCrossspectrum
from stingray.crossspectrum import cospectra_pvalue
from stingray.crossspectrum import (
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.