gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from unittest import mock
import re
import os
import uuid
import json
from datetime import date
import pytest
import requests
import responses
from fiobank import FioBank
@pytest.fixture(scope='function')
def token():
return uuid.uuid4()
@pytest.fixture(scope='function')
def transactions_json():
with open... | |
# 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 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... | |
# -*- coding: utf-8 -*-
#!/usr/bin/python
"""
Created on Sat Sep 26 11:22:57 2015
@author: William Herrera
Python 2.7 code to analyze sound and use as interface with ASUS G20 lighting
Tk widgets GUI version
IMPORTANT: run as administrator
"""
import os
import ctypes
import threading
import Tkinter as tki
import t... | |
import errno
import os
import os.path
import shutil
import subprocess
import tarfile
from distutils import log
from distutils.command.build_clib import build_clib as _build_clib
from distutils.command.build_ext import build_ext as _build_ext
from distutils.errors import DistutilsError
from io import BytesIO
import sys
... | |
#!/usr/bin/env python
#Copyright (c) 2016 Ramnatthan Alagappan
#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, modif... | |
from __future__ import unicode_literals
from django.contrib.auth.models import AnonymousUser, User
from django.core.files.storage import get_storage_class
from django.core.files.uploadedfile import SimpleUploadedFile
from django.template import RequestContext, Template
from django.test.client import RequestFactory
fro... | |
# -*- coding: utf-8 -*-
# opts.py
"""sub_coord_0.py
Template for Damon-analyzing data with multiple subspaces.
Copyright (c) 2009 - 2011, [Developer Name] for [Company Name].
Purpose:
Damon Version:
Python Version:
Numpy Version:
License
-------
Licensed under the Apache License, Version 2.0 (the "License");
you ma... | |
#!/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... | |
# 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... | |
"""Support for Dutch Smart Meter (also known as Smartmeter or P1 port)."""
import asyncio
from datetime import timedelta
from functools import partial
import logging
from dsmr_parser import obis_references as obis_ref
from dsmr_parser.clients.protocol import create_dsmr_reader, create_tcp_dsmr_reader
import serial
imp... | |
#!/usr/bin/env python
"""Application controller for rdp_classifier-2.0
"""
__author__ = "Kyle Bittinger"
__copyright__ = "Copyright 2007-2012, The Cogent Project"
__credits__ = ["Kyle Bittinger","Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.5.3"
__maintainer__ = "Kyle Bittinger"
__email__ = "kylebittinger@gmai... | |
import sys
import os
import gc
import threading
import numpy as np
from numpy.testing import assert_equal, assert_, assert_allclose
from scipy.sparse import (_sparsetools, coo_matrix, csr_matrix, csc_matrix,
bsr_matrix, dia_matrix)
from scipy.sparse._sputils import supported_dtypes
from scipy... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Contains the worker classes/functions executed on the server side.
"""
import logging
import os
import tempfile
import jedi
from pyqode.core.share import Definition
from pyflakes import messages
def _logger():
"""
Returns the module's logger
"""
retur... | |
from django.db import migrations, models
from django.db.migrations import operations
from django.db.migrations.optimizer import MigrationOptimizer
from django.db.migrations.serializer import serializer_factory
from django.test import SimpleTestCase
from .models import EmptyManager, UnicodeModel
class OptimizerTests(... | |
from __future__ import absolute_import
import re
import csv as csvapi
import json as jsonapi
import sqlite3 as sqlite3api
import future.builtins as builtins
import six
from functional.pipeline import Sequence
from functional.util import is_primitive, ReusableFile
def seq(*args):
"""
Primary entrypoint for ... | |
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.utils import six
from djblets.webapi.errors import PERMISSION_DENIED
from reviewboard.reviews.models import ScreenshotComment
from reviewboard.webapi.resources import resources
from reviewboard.webapi.tests.base import Bas... | |
import datetime
import random
import re
import sha
from django.conf import settings
from django.core.mail import EmailMessage
from django.db import models
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from django.... | |
import json
import pytest
from datetime import datetime, timedelta
from urllib.parse import urlencode
import vcr
from rest_framework.test import APITestCase
from elections.tests.factories import (
ElectionWithStatusFactory,
ModerationHistoryFactory,
ModerationStatusFactory,
related_status,
)
from orga... | |
#!/usr/bin/env python
#
# Created by: Pearu Peterson, March 2002
#
""" Test functions for scipy.linalg.matfuncs module
"""
from __future__ import division, print_function, absolute_import
import math
import warnings
import numpy as np
import scipy.sparse
import scipy.sparse.linalg
from numpy import array, eye, exp, ... | |
# Copyright (C) 2016-2018, Raffaele Salmaso <raffaele@salmaso.org>
# Copyright (C) 2013, byteweaver
# 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 re... | |
# Copyright 2013 Nebula Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | |
# 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... | |
from __future__ import unicode_literals
import logging
from .storage import StorageAdapter
from .logic import LogicAdapter, MultiLogicAdapter
from .input import InputAdapter
from .output import OutputAdapter
from .queues import ResponseQueue
from .utils import import_module
class ChatBot(object):
def __init__(se... | |
import os
import unittest
import random
from test import test_support
thread = test_support.import_module('thread')
import time
import sys
import weakref
from test import lock_tests
NUMTASKS = 10
NUMTRIPS = 3
_print_mutex = thread.allocate_lock()
def verbose_print(arg):
"""Helper function for printing out debu... | |
# coding: utf-8
"""
MINDBODY Public API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
impor... | |
from collections import OrderedDict
from django import forms
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.forms.models import ModelForm, BaseModelFormSet, BaseInlineFormSet, modelform_factory, modelformset_factory, inlin... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script processes the Categories for discussion working page.
It parses out the actions that need to be taken as a result of CFD discussions
(as posted to the working page by an administrator) and performs them.
Syntax:
python pwb.py cfd
"""
#
# (C) Ben McIlwain... | |
#!/usr/bin/python
# 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
# di... | |
#! /usr/bin/env python
#
# example2_qt.py -- Simple, configurable FITS viewer.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from __future__ import print_function
import sys, os
import logging
from ginga.qtw.QtHelp import QtGui, QtCore
from ginga import... | |
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | |
from io import StringIO
from unittest import mock, skipIf
from django.conf import settings
from django.contrib.gis.geos import LineString
from django.core.management import call_command
from django.core.management.base import CommandError
from django.test import TestCase, override_settings
from django.db import Integr... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from pathlib import Path
import astropy.units as u
import h5py
import numpy as np
from astropy import log
from astropy.io.misc.hdf5 import read_table_hdf5, write_table_hdf5
from astropy.table import Table
from .plot import find_ML
try:
imp... | |
# Copyright 2018 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 ag... | |
from gosubl import gs
from gosubl import gsq
from gosubl import mg9
import os
import re
import sublime
import sublime_plugin
DOMAIN = 'GsDoc'
GOOS_PAT = re.compile(r'_(%s)' % '|'.join(gs.GOOSES))
GOARCH_PAT = re.compile(r'_(%s)' % '|'.join(gs.GOARCHES))
EXT_EXCLUDE = [
'out', 'exe', 'o', 'dll', 'so', 'a', 'dynlib', ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Safe
a commandline password manager using AES encryption, written in python.
:: author Erick Daniszewski
:: date 05 December 2015
"""
import json
import getpass
import argparse
import struct
from os import mkdir, remove
from os.path import join as join_path
fr... | |
from django.conf import settings
from jinja2 import nodes
from jinja2.ext import Extension
from jinja2.exceptions import TemplateSyntaxError
from jinja2 import Markup
from django_cofingo.library import Library
class LoadExtension(Extension):
"""The load-tag is a no-op in Coffin. Instead, all template libraries
... | |
# Copyright 2013 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 (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | |
# -*- coding: utf-8 -*-
import re
import os
import codecs
from modules import constants
from modules.part2_structures.marshal import tpm2_partx_type_mapping
# Generates string containing a calculated number of spaces, used for indentation
# Parameters:
# string
# extra
# Returns:
# indented string
def indent(string... | |
"""
Dataset module for managing text datasets.
"""
__author__ = 'victor'
from collections import OrderedDict
import random
import numpy as np
class InvalidFieldsException(Exception):
pass
class Dataset(object):
"""
Generic Dataset object that encapsulates a list of instances.
The dataset stores the... | |
import re
from numpy import save as npsave
from numpy import log as numpy_log
from nltk.probability import FreqDist
from scipy.sparse import lil_matrix
'''
Here is long, sort of obtuse script I wrote. If you define these paths at the beginning, you'll end up with
1. A matrix of PPMI values (word-context co-occurrences... | |
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2014, Ocean Systems Laboratory, Heriot-Watt University, UK.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follow... | |
from collections import namedtuple
import sqlparse
from MySQLdb.constants import FIELD_TYPE
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo as BaseFieldInfo, TableInfo,
)
from django.db.models import Index
from django.utils.datastructures import OrderedSet
FieldInfo = nam... | |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from openapi_server.models.base_model_ import Model
from openapi_server.models.cause_action import CauseAction
from openapi_server.models.empty_change_log_set import Em... | |
# Copyright 2019 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 agree... | |
#
# Copyright (c) 2016 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... | |
import numpy as np
import scipy as sp
import matplotlib.pylab as plt
'''
objects for storing pest related control file
'''
class controldata(object):
'''
object containing paramaters in the control data section of the pestcontrol file
Attributes:
RSTFLE : "restart or norestart" Instructs PEST whether to w... | |
#!/usr/bin/python
# Howto, Code license, Credits, etc: http://code.google.com/B/BCI-Project-Triathlon/
noGL = False # Set noGL to True for disabling the use of OpenGL (to gain speed, or to avoid python-wx-opengl problems)
import pyfann
from pyfann import libfann
import string
import os
import sys
import random
im... | |
from importlib import import_module
import abc
import os
import logging
import threading
import signal
import sys
import time
import inspect
from pydispatch import dispatcher
import schedule
from .notebooks import Notebook
logger = logging.getLogger('navi')
class Navi(object):
"""The navi object is used to ini... | |
#!/bin/env python
#
# AutoPyfactory batch plugin for Condor
#
import commands
import datetime
import logging
import os
import re
import string
import time
import traceback
from autopyfactory import condor
from autopyfactory.condor import mynewsubmit, killids
from autopyfactory import jsd
from autopyfactory.interfa... | |
'''
Parser
======
Class used for the parsing of .kv files into rules.
'''
import os
import re
import sys
import traceback
from re import sub, findall
from types import CodeType
from functools import partial
from collections import OrderedDict, defaultdict
import kivy.lang.builder # imported as absolute to avoid cir... | |
import hashlib
import warnings
import logging
import unittest
import ssl
from itertools import chain
from mock import patch, Mock
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers
from urllib3.util.timeout import Timeout
from urllib3.util.url import (
get_host,
... | |
# 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 (t... | |
"""
GateKeeper finder / loader implementations imported from here.
Things change quite a lot in python3.5 where imp is deprecated.
Useful environment variables (Used for debug, may change)
VEXT_DISABLED=1 Disable vext by not adding it to sys.path
VEXT_LOG_BLOCKS=1 Store... | |
#!/usr/bin/env python
"""html2text: Turn HTML into equivalent Markdown-structured text."""
__version__ = "2.35"
__author__ = "Aaron Swartz (me@aaronsw.com)"
__copyright__ = "(C) 2004-2008 Aaron Swartz. GNU GPL 3."
__contributors__ = ["Martin 'Joey' Schulze", "Ricardo Reyes"]
# TODO:
# Support decoded entities with u... | |
#-*- coding: utf-8 -*-
from loris.loris_exception import ResolverException
from loris.resolver import SimpleHTTPResolver, TemplateHTTPResolver
from loris.resolver import SourceImageCachingResolver
from os.path import dirname
from os.path import isfile
from os.path import join
from os.path import realpath
from urllib im... | |
import numpy as np
import Op
import ISCV
from GCore import Calibrate
try:
import ncam
class NCamCamera(Op.Op): # Feel free to change the name when we figure out style guidelines
def __init__(self, name='/NCAM_Camera', locations='/root', ipAddress='127.0.0.1', port=38860):
fields = [
('name', 'name', 'name',... | |
# coding: utf-8
#
# Copyright 2017 The Oppia 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 requi... | |
'''
This module provides the class Searcher
which interacts with a Handle Search
Servlet.
Author: Merret Buurman (DKRZ), 2015-2016
'''
import logging
import re
import requests
import json
import b2handle
from past.builtins import xrange
from b2handle.handleexceptions import ReverseLookupException
LOGGER = logging.g... | |
# 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 ... | |
from django.views.generic import View
from django.contrib import messages
from django.shortcuts import render
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from students.models import Child_detail, School_child_count
from teachers.models import Teacher_detail, block_wise_abst... | |
from django.forms.fields import BooleanField
from django.utils.translation import ugettext_lazy as _
import mock
from nose.tools import eq_, ok_
from test_utils import RequestFactory
import amo
import amo.tests
from devhub.models import AppLog
from editors.models import RereviewQueue
from files.models import FileUplo... | |
# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This program 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 2 of the License, o... | |
# Copyright 2014 Mellanox Technologies, 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 applicable law or agreed t... | |
from __future__ import division, absolute_import, print_function
# Code common to build tools
import sys
import warnings
import copy
import binascii
from numpy.distutils.misc_util import mingw32
#-------------------
# Versioning support
#-------------------
# How to change C_API_VERSION ?
# - increase C_API_VERSI... | |
"""Spectral Embedding."""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Wei LI <kuantkid@gmail.com>
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse
from scipy.linalg import eigh
from scipy.sparse.linalg import eigsh
from scipy.sparse.csgraph import connected_... | |
# Copyright 2014 Netflix, 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... | |
import numpy as np
from scipy import io
import math
from operator import itemgetter
from random import choice
import time
class werner:
"""Contains methods for running the Werner (1995) model of sand dune evolution"""
x_len = 0
y_len = 0
slab_ratio = 0.1
num_iterations = 0
jump_length = 0... | |
# pacman.py
# ---------
# Licensing Information: Please do not distribute or publish solutions to this
# project. You are free to use and extend these projects for educational
# purposes. The Pacman AI projects were developed at UC Berkeley, primarily by
# John DeNero (denero@cs.berkeley.edu) and Dan Klein (klein@cs.be... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# Copyright 2012 Justin Santa Barbara
#
# 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
#
# h... | |
"""Support to serve the Home Assistant API as WSGI application."""
from ipaddress import ip_network
import logging
import os
import ssl
from typing import Optional, cast
from aiohttp import web
from aiohttp.web_exceptions import HTTPMovedPermanently
import voluptuous as vol
from homeassistant.const import (
EVENT... | |
from __future__ import annotations
import warnings
import numpy as np
import pandas._libs.parsers as parsers
from pandas._typing import (
ArrayLike,
FilePathOrBuffer,
)
from pandas.errors import DtypeWarning
from pandas.core.dtypes.common import (
is_categorical_dtype,
pandas_dtype,
)
from pandas.co... | |
# -*- coding: utf-8 -*-
"""
Tests for scalar Timedelta arithmetic ops
"""
from datetime import datetime, timedelta
import operator
import numpy as np
import pytest
import pandas as pd
import pandas.util.testing as tm
from pandas.core import ops
from pandas import Timedelta, Timestamp, NaT
class TestTimedeltaAdditio... | |
# Copyright (c) 2013 NTT DOCOMO, 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 requ... | |
#!/usr/bin/env python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
"""Base Contrail Provisioning module."""
import os
import re
import stat
import shutil
import socket
import tempfile
import platform
import logging
import argparse
from distutils.version import LooseVersion
from contrail_vrout... | |
#!/usr/bin/env python3
# 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 argparse
import logging
import os
from pathlib import Path
import shutil
from itertools import groupby
from temp... | |
# Copyright 2016 MongoDB, 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 writing, so... | |
"""
atlas logconfig
"""
import datetime
from logging.handlers import TimedRotatingFileHandler
from .local import LOG_ROOT
LOG_SIZE = 1000000000
import logging, socket
class ContextFilter(logging.Filter):
hostname = socket.gethostname()
def filter(self, record):
record.hostname = ContextFilter.hos... | |
#!/usr/local/bin/python
''' Joins together the main files of the MAUDE dataset and produces a single
JSON file.
'''
import csv
import logging
import os
from os.path import dirname, join
import simplejson as json
import arrow
RUN_DIR = dirname(dirname(os.path.abspath(__file__)))
ENUM_FILE = join(RUN_DIR, 'maude/d... | |
"""setuptools.command.egg_info
Create a distribution's .egg-info directory and contents"""
# This module should be kept compatible with Python 2.3
import os, re, sys
from setuptools import Command
from distutils.errors import *
from distutils import log
from setuptools.command.sdist import sdist
from setuptools.compa... | |
"""
Classes allowing "generic" relations through ContentType and object-id fields.
"""
from django import oldforms
from django.core.exceptions import ObjectDoesNotExist
from django.db import backend
from django.db.models import signals
from django.db.models.fields.related import RelatedField, Field, ManyToManyRel
from... | |
#!/usr/bin/env python
"""
Copyright 2010-2019 University Of Southern California
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 appli... | |
import unittest
from pyramid.tests.test_scripts import dummy
class DummyIntrospector(object):
def __init__(self):
self.relations = {}
self.introspectables = {}
def get(self, name, discrim):
pass
class TestPRoutesCommand(unittest.TestCase):
def _getTargetClass(self):
from... | |
#!python
"""Bootstrap distribute installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from distribute_setup import use_setuptools
use_setuptools()
If you want to require a specific version of se... | |
# Copyright 2019 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... | |
# coding: utf-8
import datetime
from sqlalchemy import bindparam
from sqlalchemy import Column
from sqlalchemy import DateTime
from sqlalchemy import exc
from sqlalchemy import func
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import Table
from sqlalchemy import testing
from sqlalche... | |
# Provided under the CC-BY-SA license. Please cite the accompanying paper when using TOP dataset -
# @ARTICLE {
# author = "Sonal Gupta and Rushin Shah and Mrinal Mohit and Anuj Kumar and Michael Lewis",
# title = "Semantic Parsing for Task Oriented Dialog using Hierarchical Representations",
# journal =... | |
import sys
import os
import subprocess
import shutil
import zipfile
import platform
import json
from time import sleep
try:
from os.path import curdir
import ctypes
import win32api
import win32ui
except:
pass
try:
from urllib.request import urlopen
except:
try:
from urllib2 import u... | |
"""LerpInterval module: contains the LerpInterval class"""
__all__ = [
'LerpNodePathInterval', 'LerpPosInterval', 'LerpHprInterval',
'LerpQuatInterval', 'LerpScaleInterval', 'LerpShearInterval',
'LerpPosHprInterval', 'LerpPosQuatInterval',
'LerpHprScaleInterval', 'LerpQuatScaleInterval',
'LerpPosHp... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | |
"""Classes to help gather user submissions."""
import logging
from typing import Any, Callable, Dict, List, Optional, cast
import uuid
import voluptuous as vol
from .core import HomeAssistant, callback
from .exceptions import HomeAssistantError
_LOGGER = logging.getLogger(__name__)
RESULT_TYPE_FORM = "form"
RESULT_... | |
#!/usr/bin/env python
"""
Small script which combines images given on the command line into a single
PDF file.
Basic Usage:
./compile_images -o output.pdf input1.eps input2.eps
Run `./compile_images --help` for more details.
@copyright: David Zwicker <dzwicker@seas.harvard.edu>
@date: 2014-07-10
"""
from _... | |
# Copyright 2011-2016 Rackspace US, 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 i... | |
import matplotlib.pyplot as plt
import numpy as np
import cv2
from time import time
import skimage
import skimage.transform
from skimage import measure
from skimage import morphology
#from skimage.filters import threshold_otsu
import os
import cPickle
OUT_SHAPE = (64, 64)
imshow = lambda im: plt.imshow(im, cmap='gray'... | |
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# ... | |
# -*- coding: utf-8 -*-
import pytest
from plexapi.exceptions import BadRequest, NotFound
from . import conftest as utils
def test_myplex_accounts(account, plex):
assert account, "Must specify username, password & resource to run this test."
print("MyPlexAccount:")
print("username: %s" % account.username... | |
# seppo.py
"""simple embarrassingly parallel python"""
## Copyright (c) 2005, Andrew Straw. 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 ... | |
#!/usr/bin/env python
# test_ctxman.py - unit test for connection and cursor used as context manager
#
# Copyright (C) 2012 Daniele Varrazzo <daniele.varrazzo@gmail.com>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.