gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# 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... | |
# Adapted from test_file.py by Daniel Stutzbach
from __future__ import unicode_literals
import sys
import os
import errno
import unittest
from array import array
from weakref import proxy
from functools import wraps
from UserList import UserList
from test.test_support import TESTFN, check_warnings, run_unittest, mak... | |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | |
# -*- coding: utf-8 -*-
"""
@author: Federico Cerchiari <federicocerchiari@gmail.com>
"""
import unittest
from copy import copy
from tempy.widgets import TempyTable, TempyList, TempyPage
from tempy.tags import (Table, Tr, Td, Dl, Dt, Dd, Ul, Ol,
Li, Html, Head, Body, Thead, Tfoot)
from tempy.ex... | |
# Authors: Manoj Kumar <manojkumarsivaraj334@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Joel Nothman <joel.nothman@gmail.com>
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
from scipy import sparse
from math import sqrt
from ..metrics impor... | |
# 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... | |
from __future__ import print_function
import sys, os
import re
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
import h2o.exceptions
from tests import pyunit_utils as pu
from h2o.automl import H2OAutoML
"""This test suite checks the AutoML parameters influencing the model selection pipeline"""
max_models... | |
import sys
import os
import gzip
import zipfile
from optparse import make_option
from django.conf import settings
from django.core import serializers
from django.core.management.base import BaseCommand
from django.core.management.color import no_style
from django.db import connections, router, transaction, DEFAULT_DB_... | |
# Copyright 2004-2017 Tom Rothamel <pytom@bishoujo.us>
#
# 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, m... | |
# Mechanics IO
import os
import sys
from math import cos, sin, asin, atan2
import numpy as np
import h5py
import pickle
import tempfile
from contextlib import contextmanager
# Siconos Mechanics imports
from siconos.mechanics.collision.tools import Volume
# Constants
joint_points_axes = {
'KneeJointR': (1, 0),
... | |
# -*- coding: utf-8 -*-
"""Methods for calculating what happens to the ice_column as external forcing is applied. That is, how does
weather affect an ice column. The inner workings of the ice column is part of the IceColumn class fount in ice.py."""
import math
import copy
import numpy as np
from icemodelling import p... | |
#!/usr/bin/python
import time
import sys
import logging
import signal
import getopt
from simulation import *
from statistics import *
from system import *
def usage(arg):
print arg, ": -h [--help] -l [--log] -m <mission_time> [--mission_time <mission_time>]"
print "-i <num_iterations> [--iterations <num_itera... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from platform import platform
# import requests
import urllib
from google.appengine.api import urlfetch
from .access_methods import AccessMethodsMixin
from .compat import json, string_type
from .decorators import objectify
from .exceptions import (
I... | |
# 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... | |
# ===============================================================================
# Copyright 2019 Jan Hendrickx and Gabriel Parrish
#
# 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:/... | |
from __future__ import unicode_literals
import boto.rds
import boto.vpc
from boto.exception import BotoServerError
import sure # noqa
from moto import mock_ec2_deprecated, mock_rds_deprecated
from tests.helpers import disable_on_py3
@disable_on_py3()
@mock_rds_deprecated
def test_create_database():
conn = boto... | |
#!/usr/bin/env python3
"""
Chord peer
==========
This module provides peer of a Chord distributed hash table.
"""
import random
import time
import socket
import socketserver
import threading
import logging
logging.basicConfig(format='%(asctime)s %(levelname)s:%(message)s',
level=logging.DEBUG)
CH... | |
import bs4
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
import time
from unidecode import unidecode
import pandas as pd
import datetime
from dateutil.parser import parse
from sklearn.cluster import DBSCAN
from sklearn.pre... | |
#!/usr/bin/env python
"""
Aerostat Registrar Unittests
"""
import os
import StringIO
import sys
import unittest
import mox
from aerostat import aerostat
from aerostat import registrar
class RegistrarTest(mox.MoxTestBase):
"""Test Class for Aerostat (client) module."""
def test_get_types_masterful(self):
... | |
# Copyright (c) 2011 Openstack, 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 requi... | |
##Built-In Libraries##
import time
import csv
import string
##Third-Party Libraries##
import numpy as np
from PIL import Image,ImageTk
import wolframalpha
##Other TP Files##
import mnist_training as mnist #See File for Citations
import unpackData as unpack #See File for Citations
class Network(object):
def __ini... | |
#
# Copyright (C) 2007, Mark Lee
#
#http://rl-glue-ext.googlecode.com/
#
# 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... | |
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
# -*- coding: utf-8 -*-
"""
pygments.lexers.php
~~~~~~~~~~~~~~~~~~~
Lexers for PHP and related languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, default, us... | |
import os,sys
import re
import utils as cu
import libDetection as ldet
import regionSelection as rs
import numpy as np
#Functions
def cumsum(a):
b = [0.0 for x in range(0,len(a))]
for i in range(0,len(a)):
b[i] = b[i-1]+a[i]
return b
intersect = lambda x,y: [max(x[0],y[0]),max(x[1],y[1]),min(x[2],y[2]),min(... | |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from cms.api import create_page, create_title
from cms.apphook_pool import apphook_pool
from cms.appresolver import (applications_page_check, clear_app_resolvers,
get_app_patterns)
from cms.test_utils.testcases import CMSTestCase, SettingsOverrideTestCas... | |
import logging
import numpy as np
import scipy.stats
import scipy
from unittest import TestCase
import gspn.distributions as distributions
logger=logging.getLogger("test_distributions")
def fractional_error(a, b):
return np.abs((a-b)/a)
def check_fractional_error(a, b, tolerance, message):
if fractional_err... | |
# Copyright 2022 The Magenta 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 ... | |
# 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... | |
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
This plotting function is for plotting when the surface-flagging method
is used.
The main difference is that the inner product ... | |
# Copyright 2012 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 ... | |
#!/usr/bin/env python
# Copyright 2017 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 os
import sys
import unittest
import checkxmlstyle
import helpers
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirn... | |
''' Contains the Tombot layer, which handles the messages. '''
import os
import sys
import logging
import time
import sqlite3
import threading
from apscheduler.schedulers import SchedulerNotRunningError
from yowsup.layers.interface \
import YowInterfaceLayer, ProtocolEntityCallback
from yowsup.layers \
... | |
# 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/env python
"""This file contains code to generate ZIP/TAR archives."""
import enum
import io
import os
from typing import Dict, Iterable, Iterator
import zipfile
from grr_response_core.lib import utils
from grr_response_core.lib.util import collection
from grr_response_core.lib.util.compat import yaml
from... | |
"""This package contains the "front end" classes and functions
for Beaker caching.
Included are the :class:`.Cache` and :class:`.CacheManager` classes,
as well as the function decorators :func:`.region_decorate`,
:func:`.region_invalidate`.
"""
import warnings
import beaker.container as container
import beaker.util... | |
# -*- coding: utf-8 -*-
# This coding header is significant for tests, as the debug view is parsing
# files to search for such a header to decode the source file content
from __future__ import unicode_literals
import importlib
import inspect
import os
import re
import sys
import tempfile
from unittest import skipIf
f... | |
"""Unit tests for reviewbot.tools.clang."""
from __future__ import unicode_literals
import os
try:
# Python 3.x
from plistlib import writePlist as dump_plist
except ImportError:
# Python 2.7
from plistlib import dump as dump_plist
import six
from reviewbot.tools.clang import ClangTool
from reviewbo... | |
import os, subprocess
import lxml
import json
import pysam
from django.contrib.auth.models import User
from django.http import HttpRequest
from django.test import TestCase
from django.test.client import Client
from tastypie.exceptions import NotRegistered, BadRequest
from core.models import BedEntry, QTLEntry, SNPEntr... | |
"""This module contains the general information for OsiStart ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class OsiStartConsts:
ADMIN_STATE_TRIGGER = "trigger"
ADMIN_STATE_TRIGGERED = "triggered"
ANSWER_FILE_SHAR... | |
import sys
import os
import glob
import argparse
from subprocess import call
from ..common.bounding_box import BoundingBox
import json
import itertools
from ..common import utils
from optimize_mesh import optimize_meshes
import math
import numpy as np
from scipy import spatial
import multiprocessing as mp
from rh_rende... | |
"""
OpenNSA JunOS backend.
Should work for EX and QXF switches.
"""
# configure snippet:
#
# ACTIVATION:
# configure
# set vlan opennsa-1234 vlan-id 1234
# set interfaces ge-0/0/1 unit 0 family ethernet-switching vlan members onsa-1234
# set interfaces ge-0/0/2 unit 0 family ethernet-switching vlan members onsa-1234
... | |
from ref import sopr
sopr_general_issue_codes = sopr.general_issue_codes.keys()
transformed_ld1_schema = {
"type": "object",
"properties": {
"document_id": {
"type": "string",
"format": "uuid_hex",
},
"affiliated_organizations_url": {
"type": ["null"... | |
from __future__ import absolute_import
from django import forms
from django.conf import settings
from django.contrib.auth.forms import SetPasswordForm, AuthenticationForm, \
PasswordResetForm
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.core.validators... | |
# 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 applicable ... | |
from airflow.models import DAG
from airflow.operators.dummy_operator import DummyOperator
from datetime import datetime, timedelta
from airflow.operators import PythonOperator
from airflow.hooks import RedisHook
from airflow.models import Variable
from subdags.format_utility import get_threshold
from subdags.format_uti... | |
# Copyright 2018 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 or ag... | |
from collections.abc import Iterable
import numpy as np
from robosuite.models.objects import CompositeObject
from robosuite.utils.mjcf_utils import BLUE, CYAN, GREEN, RED, CustomMaterial, add_to_dict
class HammerObject(CompositeObject):
"""
Generates a Hammer object with a cylindrical or box-shaped handle, ... | |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './examples/VideoTemplate.ui'
#
# Created: Mon Feb 17 20:39:30 2014
# by: pyside-uic 0.2.14 running on PySide 1.1.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_MainWindow(object):
... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys, os
import time
from pynfc import *
from threading import Thread
RED='\033[01;31m'
GREEN='\033[01;32m'
NC='\033[0m' # No Color
import os
import time
pwm_num = 2
pwm_dir = '/sys/class/pwm/pwmchip0/pwm' + str(pwm_num)
def beeper_setup():
if not os.path.... | |
"""
Manage groups on Linux, OpenBSD and NetBSD
.. important::
If you feel that Salt should be using this module to manage groups on a
minion, and it is using a different module (or gives an error similar to
*'group.info' is not available*), see :ref:`here
<module-provider-override>`.
"""
import functo... | |
# Copyright 2013 Intel.
#
# 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... | |
# -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
'''
Test properties attached to a widget
'''
import unittest
from kivy.event import EventDispatcher
from functools import partial
class TestProperty(EventDispatcher):
pass
wid = TestProperty()
class PropertiesTestCase(unittest.TestCase):
def test_base(self):
from kivy.properties import Property
... | |
#! /usr/bin/python
#
# Copyright (C) 2009-2012 Mikhail Sobolev
# Contact: Mikhail Sobolev <mss@mawhrin.net>
#
# 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.or... | |
from django.test.client import RequestFactory
from template_debug.tests.base import TemplateDebugTestCase
from template_debug.utils import (_flatten, get_variables, get_details,
is_valid_in_template, get_attributes)
try:
from django.utils.six import PY3
except ImportError:
range = xrange
PY3 = False
... | |
# 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... | |
#
# File: sites.py
# Author: Ivan Gonzalez
#
""" A module for single sites.
"""
import numpy as np
from dmrg_exceptions import DMRGException
from numpy import sqrt
class Site(object):
"""A general single site
You use this class to create a single site. The site comes empty (i.e.
with no operators i... | |
#!/usr/bin/env python
# normalDate.py - version 1.0 - 20000717
#hacked by Robin Becker 10/Apr/2001
#major changes include
# using Types instead of type(0) etc
# BusinessDate class
# __radd__, __rsub__ methods
# formatMS stuff
# derived from an original version created
# by Jeff Bauer of Rubicon Research and us... | |
# Copyright 2016 NEC 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 la... | |
# Copyright (c) 2012 Terence Honles <terence@honles.com> (maintainer)
# Copyright (c) 2008 Giorgos Verigakis <verigak@gmail.com> (author)
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permiss... | |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from azure... | |
# 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 ... | |
from elasticsearch import Elasticsearch
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
plt.ioff()
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib.dates import AutoDateLocator, AutoDateFormatter
import numpy as np
from scipy import stats
import datetime as dt
import math
imp... | |
#
# 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... | |
"""
Provides an APIView class that is the base of all views in REST framework.
"""
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.db import connections, models
from django.http import Http404
from django.http.response import HttpResponseBase
from django.utils.cache impo... | |
# 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 compliance with the License. You may obtain
# a ... | |
#!/usr/bin/env python
#
# 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
# "L... | |
#
# Copyright 2015 BMC Software, 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 ... | |
# Copyright 2020 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | |
import os
import shutil
import sys
import traceback
import six
import chainer
def _reduce(grad_list):
if not grad_list:
return None
if len(grad_list) >= 2:
grad_list[:] = [chainer.functions.add(*grad_list)]
return grad_list[0]
def _pure(grad):
return [] if grad is None else [grad]
... | |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from fairseq.utils import new_arange
# -------------- Helper Functions --------------------------------------------------- #
... | |
###############################################################################
#
# ptsvgconstraints.py - represent layout constraints for writing as Dunnart SVG
#
# File: ptsvgconstraints.py
# Author: Alex Stivala
# Created: February 2008
#
# $Id: ptsvgconstraints.py 3064 2009-12-18 03:15:57Z alexs $
#
# A PTVSVGC... | |
"""
Python implementation of the fast ICA algorithms.
Reference: Tables 8.3 and 8.4 page 196 in the book:
Independent Component Analysis, by Hyvarinen et al.
"""
# Authors: Pierre Lafaye de Micheaux, Stefan van der Walt, Gael Varoquaux,
# Bertrand Thirion, Alexandre Gramfort, Denis A. Engemann
# License: BS... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ------------------------------------------------
# Fachhochschule Bielefeld
# Ingenieurwissenschaften und Mathematik
# Ingenieurinformatik - Studienarbeit
# Michel Asmus, Marcel Bernauer
# ------------------------------------------------
# project: felix
# servo-class
# ... | |
# -*- coding: utf-8 -*-
"""
firebat.agr
~~~~~~~~~~~
Aggregate test results.
"""
import os
import string
import datetime
from BaseHTTPServer import BaseHTTPRequestHandler as rh
import pprint
pp = pprint.PrettyPrinter(indent=4)
import simplejson as json
from simplejson.decoder import JSONDecodeError
try:
import n... | |
# Copyright 2020 Google LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
from weakref import WeakKeyDictionary
from functools import partial
from itertools import count
import ctypes
import numpy as... | |
#!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin 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... | |
# ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | |
"""
mosaic.py
A simple python script that creates a mosaic from an input image.
Dependencies:
Python Imaging Library, available at http://www.pythonware.com/products/pil/
Summary of methods:
print_fn(s) prints s to the terminal only when the verbose option is selected
gcd(a,b) returns the greatest common divisor of a... | |
from __future__ import with_statement #NEW ADD from http://stackoverflow.com/questions/12681315/google-app-engine-base64-photo-save-from-ios-application
import mimetypes
import os
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.conf import settings
from djang... | |
import os
import errno
import json
import urllib
import urllib2
import socket
import csv
from urlparse import urlparse
from zipfile import ZipFile
from osgeo import ogr, osr
ogr.UseExceptions()
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('oa')
def mkdirsp(path):
try:
... | |
from __future__ import print_function
import sys
import sqlparse
from sqlparse.sql import Comparison, Identifier, Where
from .parseutils import last_word, extract_tables, find_prev_keyword
from .special import parse_special_command
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY3:
string_types... | |
""" Python script for local testing (compatible with both Python 2 and Python 3)
Disclaimer: this is a way to test your solutions, but it is NOT the real judging
system. The judging system behavior might be different.
"""
from __future__ import print_function
import random
import subprocess
import sys
USAGE_MSG = ""... | |
from sklearn.externals import joblib
__author__ = 'Aaron J. Masino'
import time, os
from sklearn import linear_model, svm, tree
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.ensemble import RandomForestClassifier
from sklearn.naive_bayes import Bernoull... | |
from __future__ import absolute_import, print_function
import random
import socket
import string
import sys
import time
import unittest2 as unittest
import warnings
import weakref
from nose import SkipTest
from kombu import Connection
from kombu import Exchange, Queue
from kombu.five import range
if sys.version_inf... | |
# -*- coding: utf-8 -*-
#FracFocus Scraper
import pprint
from datetime import datetime, date, timedelta
from urlparse import urlsplit, urljoin
from urlparse import parse_qs
from cStringIO import StringIO
from itertools import izip_longest
import re
from scrapy.spider import BaseSpider
from scrapy.selector import Html... | |
#! coding:utf-8
# python2 requires: pip install futures
import atexit
from concurrent.futures import (ProcessPoolExecutor, ThreadPoolExecutor,
as_completed)
from concurrent.futures._base import (CANCELLED, CANCELLED_AND_NOTIFIED,
FINISHED, PENDING, ... | |
"""
*****
Pajek
*****
Read graphs in Pajek format.
This implementation handles directed and undirected graphs including
those with self loops and parallel edges.
Format
------
See http://vlado.fmf.uni-lj.si/pub/networks/pajek/doc/draweps.htm
for format information.
"""
__author__ = """Aric Hagberg (hagberg@lanl.go... | |
# 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... | |
import fnmatch
import os
import shutil
import yaml
from chandra_suli.logging_system import get_logger
from chandra_suli.sanitize_filename import sanitize_filename
from chandra_suli.work_within_directory import work_within_directory
logger = get_logger("DataPackage")
_index_file = "index.yml"
def _check_directory(... | |
'''
Tests for fileinput module.
Nick Mathewson
'''
import os
import sys
import re
import fileinput
import collections
import builtins
import unittest
try:
import bz2
except ImportError:
bz2 = None
try:
import gzip
except ImportError:
gzip = None
from io import StringIO
from fileinput import FileInput,... | |
import xml.etree.cElementTree as ElementTree
import requests
NAMESILO_OPERATIONS = {
'add_account_funds': 'addAccountFunds',
'add_auto_renew': 'addAutoRenewal',
'add_contact': 'contactAdd',
'add_dns_record': 'dnsAddRecord',
'add_email_forward': 'configureEmailForward',
'add_portfolio': 'portf... | |
# Copyright (C) 2014-2016 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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.a... | |
#!/usr/bin/env python
"Representation of link standoff annotation and measures over it"
from collections import Sequence, defaultdict
import operator
try:
keys = dict.viewkeys
import itertools
filter = itertools.ifilter
except Exception:
# Py3k
keys = dict.keys
class Annotation(object):
__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... | |
########
# Copyright (c) 2014 Cloudify Platform Ltd. 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 requi... | |
import sys
import threading
import io
import csv
import itertools
import concurrent.futures
from collections import OrderedDict, namedtuple
from math import isnan
import numpy
from PyQt4 import QtCore
from PyQt4 import QtGui
from PyQt4.QtGui import (QIdentityProxyModel, QTableView, QItemSelectionModel,
... | |
"""SCons.Tool.javac
Tool-specific initialization for javac.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Per... | |
# Copyright 2020 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.