gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains the classes and utility functions for distance and
cartesian coordinates.
"""
import warnings
import numpy as np
from astropy import units as u
from astropy.utils.exceptions import AstropyWarning
from .angles import Angle
__al... | |
#!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
#
# This module is used to run benchmark queries. It runs the set queries specified in the
# given workload(s) under <workload name>/queries. This script will first try to warm the
# buffer cache before running the query. There is also a pa... | |
import random
class Sorting:
#=======================================================================
# Author: Isai Damier
# Title: Bubblesort
# Project: geekviewpoint
# Package: algorithms
#
# Statement:
# Given a disordered list of integers (or any other items),
# rearrange... | |
from __future__ import absolute_import
from datetime import time, date, timedelta
from django.test import TestCase
from django.utils.timezone import now, localtime
from farnsworth import pre_fill
from workshift.models import *
from workshift.forms import *
from workshift.cron import CollectBlownCronJob, UpdateWeekl... | |
# 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... | |
from django.contrib.messages import constants, get_level, set_level, utils
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.constants import DEFAULT_LEVELS
from django.contrib.messages.storage import base, default_storage
from django.contrib.messages.storage.base import Message
from d... | |
from __future__ import absolute_import
from django.utils.translation import ugettext as _
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.views.decorators.csrf import csrf_exempt
from django.http import QueryDict, HttpResponseNotAllowed, HttpRe... | |
# -*- encoding: utf-8 -*-
#
# Copyright 2015-2016 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 applic... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from OpenGL.GL import *
from OpenGL.GLU import *
import GestureAgentsPygame.Screen as Screen
import pygame
import atexit
width, height = Screen.size
CALIBRATION_FILE = 'calibration.json'
#default calibration
calibration = {}
calibration['x'] = 0
calibration... | |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are ... | |
"""Contains the adsorbate class."""
from pygaps import logger
from pygaps.data import ADSORBATE_LIST
from pygaps.units.converter_unit import _PRESSURE_UNITS
from pygaps.units.converter_unit import c_unit
from pygaps.utilities.coolprop_utilities import CP
from pygaps.utilities.coolprop_utilities import thermodynamic_ba... | |
# python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... | |
# 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 (c) 2015, Novartis Institutes for BioMedical Research Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyrigh... | |
#!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | |
from datetime import datetime, timedelta
import uuid
from flask.ext.login import UserMixin
from werkzeug import generate_password_hash, check_password_hash
from octopus.core import app
from octopus.modules.account.authorise import Authorise
from octopus.modules.account import dao
from octopus.lib import dataobj
clas... | |
'''
Settings
========
.. versionadded:: 1.0.7
This module provides a complete and extensible framework for adding a
Settings interface to your application. By default, the interface uses
a :class:`SettingsWithSpinner`, which consists of a
:class:`~kivy.uix.spinner.Spinner` (top) to switch between individual
settings ... | |
"""
@name: Modules/Core/Config/config_tools.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com>
@copyright: (c) 2014-2020 by D. Brian Kimmel
@license: MIT License
@note: Created on Jul 15, 2014
@Summary: This handles config files.
mypy Modules/Core/Config/config_tools.py
"""
__updated_... | |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2017-present MagicStack Inc. and the EdgeDB 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... | |
"""Authentication for HTTP component."""
from __future__ import annotations
from collections.abc import Awaitable, Callable
from datetime import timedelta
from ipaddress import ip_address
import logging
import secrets
from typing import Final
from urllib.parse import unquote
from aiohttp import hdrs
from aiohttp.web ... | |
#! /usr/bin/env python
"""
LLSG (Gomez Gonzalez et al. 2016)
"""
__author__ = 'Carlos Alberto Gomez Gonzalez'
__all__ = ['llsg']
import numpy as np
from scipy.linalg import qr
from multiprocessing import cpu_count
from astropy.stats import median_absolute_deviation
from ..conf import time_ini, timing
from ..preproc... | |
from datetime import datetime
from nbgrader import api
from nbgrader.api import InvalidEntry, MissingEntry
from nose.tools import assert_equal, assert_not_equal, assert_raises
class TestGradebook(object):
def setup(self):
self.gb = api.Gradebook("sqlite:///:memory:")
def teardown(self):
self.... | |
from __future__ import print_function
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: Simplified BSD
import warnings
from math import sqrt, ceil
import numpy as np
from scipy import linalg
from .mxne_debiasing import compute_bias
from ..utils import logger, verbose, sum_squared
fro... | |
#! /usr/bin/python
import sys
import os
import json
import re
##############################
#
# Functinality plan:
# ------------------
#
# wrtr I am entering some text | wrtr -w | --write I am entering some text ~ this text after wrtr appends in the last paragraph, or the current paragraph set in the confi... | |
import mxnet as mx
import random
import sys
import copy
from mxnet.io import DataBatch, DataIter
import numpy as np
from mxnet.image import *
def add_data_args(parser):
data = parser.add_argument_group('Data', 'the input images')
data.add_argument('--data-dir', type=str, default='./data',
... | |
#!/usr/bin/env python
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generates an Android Studio project from a GN target."""
import argparse
import codecs
import logging
import os
import shutil
impor... | |
# orm/interfaces.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
Contains various base classes used throughout the ORM.
Defines some key bas... | |
# Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp.
# 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/LIC... | |
import requests
import json
import time
from collections import OrderedDict
from test_framework.test_framework import OpenBazaarTestFramework, TestFailure
class CompleteDisputedTest(OpenBazaarTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 3
def run_test(self):
... | |
#!/usr/bin/env python
import os
import rlp
import utils
import copy
bin_to_nibbles_cache = {}
hti = {}
for i, c in enumerate('0123456789abcdef'):
hti[c] = i
def bin_to_nibbles(s):
"""convert string s to nibbles (half-bytes)
>>> bin_to_nibbles("")
[]
>>> bin_to_nibbles("h")
[6, 8]
>>> ... | |
""" discover and run doctests in modules and test files."""
import bdb
import inspect
import platform
import sys
import traceback
import types
import warnings
from contextlib import contextmanager
from typing import Any
from typing import Callable
from typing import Dict
from typing import Generator
from typing import ... | |
"""
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
tests.unit.config.schemas.test_ssh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import salt.utils.stringutils
from salt.config.schemas import ssh as ssh_schemas
from salt.config.schemas.minion import MinionConfiguration
from salt.utils.versions import LooseVer... | |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Textfont(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scattercarpet"
_path_str = "scattercarpet.textfont"
_valid_props = {"color", "colorsrc", "... | |
from builtins import zip
import pytest
from threeML import *
from threeML.plugins.OGIPLike import OGIPLike
from threeML.utils.fitted_objects.fitted_point_sources import InvalidUnitError
from threeML.io.calculate_flux import _calculate_point_source_flux
import astropy.units as u
import matplotlib.pyplot as plt
from thr... | |
import json
import re
from random import choice
from discord import ChannelType, Embed
from discord.utils import find
from musicbot.bookmarks import bookmark
from musicbot.entry import Entry
from musicbot.logger import OnlineLogger
from musicbot.settings import Settings
from musicbot.utils import (Response, block_use... | |
# -*- coding: utf-8 -*-
"""Useful module for commandline input parameters handling
.. module:: lib.console.commandlinetool
:platform: Unix
:synopsis: Useful module for commandline input parameters handling
.. moduleauthor:: Petr Czaderna <pc@hydratk.org>
"""
import sys
from hydratk.lib.number.conversion import... | |
'''
Created on 15.10.2012
@author: mhoefli
'''
from __future__ import division
from openopt import GLP # , NLP
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy
setBackend = "TkAgg"
if mpl.rcParams["backend"] != setBackend:
print "Switching matplotlib backend from", mpl.rcParams["backend... | |
import json
import requests
LEG_WITH_SOCKET = [
132369, 132410, 137044, 132444, 132449, 132452, 132460, 133973, 133974, 137037, 137038, 137039, 137040,
137041, 137042, 137043, 132378, 137045, 137046, 137047, 137048, 137049, 137050, 137051, 137052, 137054, 137055,
137220, 137223, 137276, 137382, 138854
]
... | |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | |
# -*- mode: python; tab-width: 2; coding: utf8 -*-
#
# Copyright (C) 2015 Niklas Rosenstein
#
# 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 IPython Controller Hub with 0MQ
This is the master object that handles connections from engines and clients,
and monitors traffic through the various queues.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import j... | |
import itertools
from wtforms.validators import ValidationError
from wtforms.fields import FieldList, FormField, SelectFieldBase
try:
from wtforms.fields import _unset_value as unset_value
except ImportError:
from wtforms.utils import unset_value
from flask_admin._compat import iteritems
from .widgets import... | |
from collections import Iterable
import json
import django
from django import forms
from django.core.exceptions import ValidationError
from django.core.serializers.json import DjangoJSONEncoder
from django.core import validators
from django.db import models
from django.utils import six
from django.utils.encoding imp... | |
from nose.tools import assert_equal, assert_true
from datetime import datetime as dt
from test_util import make_path
from letter_parser import get_action, fst, get_year, \
get_author, get_recipient, parse_file, get_year_month_day, \
process_content_line
def test_get_action():
wrapper = lambda l: get_acti... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# res/ rep cycle
from app import app
from app import r
from app import g
from app import logging
from app import salt
from app import red
from app import RqlError
import urllib2
from flask import (render_template)
from flask import redirect, make_response
from flask imp... | |
# Copyright 2014 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... | |
# Lint as: python3
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | |
from __future__ import unicode_literals
import boto
import boto.ec2.autoscale
from boto.ec2.autoscale.launchconfig import LaunchConfiguration
from boto.ec2.autoscale.group import AutoScalingGroup
from boto.ec2.autoscale import Tag
import boto.ec2.elb
import sure # noqa
from moto import mock_autoscaling, mock_ec2, moc... | |
#!/usr/bin/env python
# Copyright 2015 Coursera
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
"""This module implements a binary search tree."""
from queue_ds import Queue
from stack import Stack
class Node(object):
"""Node object for use in a binary search tree."""
def __init__(self, value, right=None, left=None, parent=None):
"""Initialize a node for a binary search tree object."""
... | |
#!/usr/bin/python3
from __future__ import print_function
import os
import datetime
import configparser
import time
#import pytz
from enum import Enum
import paho.mqtt.client as mqtt
from threading import Thread
from queue import Queue
heatMgrQueue = 0
ECS_COMMAND_OFF = b'1'
ECS_COMMAND_ON = b'2'
lastTemp... | |
##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provi... | |
import os
import time
import socket
import logging
import selectors
import threading
import collections
import synapse.glob as s_glob
import synapse.common as s_common
import synapse.eventbus as s_eventbus
import synapse.lib.queue as s_queue
import synapse.lib.config as s_config
import synapse.lib.msgpack as s_msgpac... | |
import json
import logging
import mimetypes
import os
from typing import Dict, List, Optional
from urllib.parse import quote
from uuid import uuid4
import requests
# noinspection PyPackageRequirements
from slugify import slugify
from federation.entities.base import Post, Profile
from federation.entities.matrix.enums ... | |
"""
Unittests for gj2ascii.core
"""
from collections import OrderedDict
import itertools
import os
import unittest
import emoji
import fiona as fio
import pytest
import gj2ascii
import gj2ascii.core
import numpy as np
@pytest.fixture(scope='function')
def geo_interface_feature():
class GIFeature(object):
... | |
"""
Tests for django test runner
"""
from __future__ import absolute_import
from optparse import make_option
from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command
from django import db
from django.test import simple, TransactionTestCase, skipUnlessDBFeature
from djang... | |
"""
- /*
- * Copyright 2008 Google Inc.
- * Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
- * Copyright (C) 2010 Rich Newpol <rich.newpol@gmail.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 obtai... | |
import unittest
import weakref
import copy
from pyorm.column import Column
from pyorm.expression import Expression, Equation
from pyorm.token import *
class MockOwner(object):
def __hash__(self):
return 1
class ColumnTestCase(unittest.TestCase):
def test_path(self):
"""
Test to ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Nachi Ueno, NTT MCL, 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... | |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2018-2020 The Ion Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Functionality to build scripts, as well as SignatureH... | |
"""
Unit test for treadmill.appmgr.run
"""
# Disable C0302: Too many lines in module.
# pylint: disable=C0302
import os
import pwd
import shutil
import socket
import stat
import tempfile
import unittest
from collections import namedtuple
# Disable W0611: Unused import
import tests.treadmill_test_deps # pylint: dis... | |
from collections import defaultdict
import logging
import networkx
from .pathprioritizer import PathPrioritizer
from .errors import AngrAnnotatedCFGError, AngrExitError
from .analyses.cfg.cfg_node import CFGNode
l = logging.getLogger("angr.annocfg")
class AnnotatedCFG(object):
"""
AnnotatedCFG is a control ... | |
import os
import pytest
from django.core.cache import caches
from django.db.models import Q
from django.db.models.functions import Upper
from django.test import SimpleTestCase, TestCase, override_settings
from django_perf_rec import TestCaseMixin, get_perf_path, get_record_name, record
from tests.testapp.models impor... | |
###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | |
# Point-and-shoot camera for Raspberry Pi w/camera and Adafruit PiTFT.
# This must run as root (sudo python cam.py) due to framebuffer, etc.
#
# Adafruit invests time and resources providing this open source code,
# please support Adafruit and open-source development by purchasing
# products from Adafruit, thanks!
#
... | |
# Copyright (c) 2013 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 ... | |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | |
# Copyright 2020 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
import sublime
import sublime_plugin
import fnmatch
import os
import shutil
import sys
import threading
import time
try:
from . import tools
except ValueError:
from package_sync_helpers import tools
class Queue(object):
current = None
pool = []
def __init__(self):
pass
def start(s... | |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 -*-
import unittest
import os # noqa: F401
import time
import hashlib
import inspect
import requests
import shutil
import zipfile
import glob
from datetime import datetime
from string import Template
from os import environ
try:
from ConfigParser import ConfigParser # py2
except BaseException:... | |
#!/usr/bin/python
#Created : Fri 24 Jul 2015 09:18:22 AM UTC
#Last Modified : Tue 11 Aug 2015 10:38:22 AM MYT
#qpy:console
import site
import os
import sys
import time
import sqlite3
from peewee import *
import datetime
import io
db = SqliteDatabase('lessonplan2010.db', **{})
#db = SqliteDatabase('/storage/extSdCar... | |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | |
import matplotlib
matplotlib.use("GTK")
import scipy, numpy, pylab, time, matplotlib.mlab, matplotlib.pyplot, matplotlib.cm
import os, gtk, gobject, bisect, psyco
import FemIo, FilenameComposer
class FemResultsViewer:
RootFilename = "Kolbka2"
ExperimentNumber = "2"
XSaptialDelta = 0.002
YSaptialDe... | |
#!/usr/bin/env python
import logging
import re
import sys
import cssselect
from collections import defaultdict
from collections import deque
from lxml.etree import tostring
from lxml.etree import tounicode
from lxml.html import document_fromstring
from lxml.html import fragment_fromstring
from .cleaners import clean_... | |
'''
This is a extended unittest module for Kivy, to make unittest based on
graphics with OpenGL context.
The idea is to let user render a Widget tree, and after 1, 2 or x frame, a
screenshot will be done, and be compared to the original one.
If no screenshot exist for the current test, the very first one will be used.... | |
# 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... | |
from __future__ import division
import numpy as np
import chainer
from chainercv.links.model.ssd import MultiboxCoder
from chainercv import transforms
class SSD(chainer.Chain):
"""Base class of Single Shot Multibox Detector.
This is a base class of Single Shot Multibox Detector [#]_.
.. [#] Wei Liu, ... | |
import astropy.time
import astropy.units as u
from astropy.coordinates import get_sun
# don't think the following is needed
# import sunpy.map
# don't think the following is needed
# from sunpy import sun
import numpy as np
def _get_sun_pos(met):
"""
Convenience wrapper module for getting the solar position
... | |
#
# 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
# distributed under the ... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
import os
import re
import urllib
from django.conf import settings
from django.contrib.auth import SESSION_KEY, REDIRECT_FIELD_NAME
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.sites.models import Site, RequestSite
from django.contrib.auth.models import User
from django.test import Test... | |
#!/usr/bin/python
#
# Copyright: Ansible Team
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | |
from __future__ import unicode_literals
import os
import re
from django.utils import six
from django.utils.six.moves import range
from reviewboard.diffviewer.processors import (filter_interdiff_opcodes,
post_process_filtered_equals)
class MoveRange(object):
"""Sto... | |
# -*- coding: utf-8 -*-
"""
Test parsing of units
"""
import sys
import time
import datetime
import unittest
import parsedatetime as pdt
from parsedatetime.context import pdtContext
from . import utils
class test(unittest.TestCase):
@utils.assertEqualWithComparator
def assertExpectedResult(self, result, chec... | |
# 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.
import unittest
import test_expectations
from telemetry import story
from telemetry.internal.platform import system_info
from telemetry.page import page as ... | |
#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Herald HTTP transport discovery, based on a homemade multicast protocol
:author: Thomas Calmant
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 0.0.3
:status: Alpha
..
Copyright 2014 isandlaTech
Licensed under the Apache Li... | |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------
# drawElements Quality Program utilities
# --------------------------------------
#
# Copyright 2015 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... | |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
impor... | |
#!/usr/bin/env python
"""Convert pyx12 configuration files from XML to Python.
The Python X12 module contains a number of XML files which
define X12 message structures. They need to be converted into the syntax for the
:mod:`X12.parse` parser.
Note that the pyx12 module defines Loops, Segments, Composites and indivi... | |
from itertools import chain
from contextlib import contextmanager
from plumbum.machines.local import CommandsProvider
from plumbum.commands.base import BaseCommand
from plumbum.commands.processes import run_proc, CommandNotFound, ProcessExecutionError
class EmptyCluster(Exception):
"""Raised by :class:`Cluster <... | |
"""Run GATK GenomicsDBImport tool."""
import os
import shutil
from pathlib import Path
from plumbum import TEE
from resolwe.process import (
BooleanField,
Cmd,
DataField,
FileField,
GroupField,
IntegerField,
ListField,
Process,
SchedulingClass,
StringField,
)
from resolwe.proce... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016-2018, Eric Jacob <erjac77@gmail.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/LICENS... | |
import sys
import os
import csv
from statsd import StatsClient
from sklearn.cross_validation import train_test_split
from sklearn.preprocessing import LabelBinarizer
from sklearn.metrics import classification_report, confusion_matrix, accuracy_score
from itertools import chain
import pycrfsuite
statsd = StatsClient(... | |
from __future__ import absolute_import
from collections import Counter, defaultdict
import six
from django.utils import timezone
from sentry.tsdb.base import BaseTSDB
from sentry.utils.dates import to_datetime, to_timestamp
from sentry.utils.compat import map
class InMemoryTSDB(BaseTSDB):
"""
An in-memory ... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011 - 2012 -- Lars Heuer <heuer[at]semagia.com>
# 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 th... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 Canonical Corp.
# 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.or... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Page.published_languages'
db.delete_column(u'cms_page',... | |
from DBUtil import *
##### junction - 202666904
def createjunction3Data(junction_id):
connection = MongoClient()
db = connection.c3stem_database
db.junction.insert({
"_id": junction_id,
"west_lane_out":"-19501516#11",
"west_lane_out_values":["-19501516#11_0", "-19501516#11_1"],
"west_lane_... | |
# Copyright (c) 2015 Mirantis, 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 requir... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.