gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import base64
import os
import shutil
import string
import tempfile
import unittest
from datetime import timedelta
from django.conf import settings
from django.contrib.sessions.backends.cache import SessionStore as CacheSession
from django.contrib.sessions.backends.cached_db import \
SessionStore as CacheDBSession... | |
import pytest
import json
from mock import patch, Mock
from name.models import (
Name,
Note,
Variant,
BaseTicketing,
Location,
Identifier_Type,
Identifier)
class TestIdentifier_Type:
def test_has_unicode_method(self):
label = "Test Label"
identifer = Identifier_Type(lab... | |
from __future__ import unicode_literals
import os
import pickle
import time
from datetime import datetime
from django.test import RequestFactory, TestCase
from django.conf import settings
from django.template import Template, Context
from django.template.response import (TemplateResponse, SimpleTemplateResponse,
... | |
#
# 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... | |
# 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... | |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... | |
# Author: Travis Oliphant 2001
# Author: Nathan Woods 2013 (nquad &c)
from __future__ import division, print_function, absolute_import
import sys
import warnings
from functools import partial
from . import _quadpack
import numpy
from numpy import Inf
__all__ = ['quad', 'dblquad', 'tplquad', 'nquad', 'quad_explain',
... | |
# -*- coding: utf-8 -*-
import pytest
from flask import Flask, url_for
from werkzeug.routing import BuildError
from werkzeug.wrappers import BaseResponse
from flask_marshmallow import Marshmallow
from flask_marshmallow.fields import _tpl
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow.sqla import Hyper... | |
import datetime
from datetime import date
#All term schedulled polls are computed based on these dates
#these dates are necessary for the system to work properly and
#should be entered every beginning of year. See _next_term_question_date()
FIRST_TERM_BEGINS = datetime.datetime(2014, 2, 3)
SECOND_TERM_BEGINS = datet... | |
"""
Various data structures used in query construction.
Factored out from django.db.models.query to avoid making the main module very
large and/or so that they can be used by other modules without getting into
circular import difficulties.
"""
from __future__ import unicode_literals
import inspect
from collections im... | |
from decimal import Decimal
from django.contrib.auth import get_user_model
from django.db import transaction
from openslides.core.config import config
from openslides.poll.views import BaseOptionViewSet, BasePollViewSet, BaseVoteViewSet
from openslides.utils.auth import has_perm
from openslides.utils.autoupdate impor... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | |
import re
import os
import sys
import json
import bpy
import rman
import threading
import time
from collections import OrderedDict
import rman_utils.stats_config.core as stcore
from . import rman_render
from .rfb_utils import prefs_utils
from .rfb_logger import rfb_log
__oneK2__ = 1024.0*1024.0
__RFB_STATS_MANAGER__ ... | |
# -*- coding: utf-8 -*-
# Copyright 2015, 2016 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... | |
"""Provides 'raw', which loads and parses raw KITTI data."""
import datetime as dt
import glob
import os
from collections import namedtuple
import numpy as np
import pykitti.utils as utils
__author__ = "Lee Clement"
__email__ = "lee.clement@robotics.utias.utoronto.ca"
class raw:
"""Load and parse raw data int... | |
import functools
import inspect
import traceback
import weakref
from zope.interface import implementer
from pyramid.exceptions import (
ConfigurationError,
CyclicDependencyError,
)
from pyramid.compat import (
iteritems_,
is_nonstr_iter,
integer_types,
string_types,
text_,
PY3,
... | |
"""
Settings for Oscar's demo site.
Notes:
* The demo site uses the stores extension which requires a spatial database.
Only the postgis and spatialite backends are tested, but all backends
supported by GeoDjango should work.
"""
import os
# Django settings for oscar project.
PROJECT_DIR = os.path.dirname(__fi... | |
import sys
from xml.parsers import expat
import copy
from pyang import syntax
from pyang import grammar
from pyang import error
from pyang import statements
from pyang import util
yin_namespace = "urn:ietf:params:xml:ns:yang:yin:1"
# We're using expat to parse to our own primitive dom-like
# structure, because we ne... | |
"""
RecycleGridLayout
=================
.. versionadded:: 1.10.0
.. warning::
This module is highly experimental, its API may change in the future and
the documentation is not complete at this time.
The RecycleGridLayout is designed to provide a
:class:`~kivy.uix.gridlayout.GridLayout` type layout when used ... | |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Unit tests for groio library
"""
from __future__ import division, print_function
import unittest
import os
import sys
import contextlib
import groio
__author__ = "Hubert Santuz & Jonathan Barnoud"
# Path to the directory containing the material for tests
REFDIR = os... | |
# BEGIN_COPYRIGHT
#
# Copyright 2009-2015 CRS4.
#
# 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 ... | |
#!/usr/bin/env python
import subprocess
import os
import errno
import collections
import glob
import argparse
class Platform(object):
pass
class simulator_platform(Platform):
directory = 'darwin_ios'
sdk = 'iphonesimulator'
arch = 'i386'
triple = 'i386-apple-darwin11'
version_min = '-miphoneos... | |
# 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... | |
# encoding: utf-8
# Copyright 2013 maker
# License
"""
Infrastructure module views
"""
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from maker.core.rendering import render_to_response
from maker.infrastructure.models import Item, ItemField, ItemType, ItemStatus, ItemSer... | |
import re
from decimal import Decimal
from mock import patch, mock
from transient.test.unit import BaseTestCase
from transient.services.payments import *
class TestPaymentsService(BaseTestCase):
uuid_pattern = re.compile("(\w{8}(-\w{4}){3}-\w{12}?)")
@patch("transient.services.payments.Payment")
def tes... | |
#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
import os
import shutil
import tempfile
import unittest
import mock
try:
from itertools import izip as zip
except ImportError:
# In Py3 use builtin zip function
pass
from mkdocs import nav, config
from mkdocs.commands import b... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import pytest
import responses
from mock import patch
from requests.exceptions import RequestException
from sentry.interfaces.stacktrace import Stacktrace
from sentry.lang.javascript.processor import (
BadSource, discover_sourcemap, fetch_sourcemap,... | |
#
# Unix SMB/CIFS implementation.
# backend code for provisioning a Samba4 server
#
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2008
# Copyright (C) Andrew Bartlett <abartlet@samba.org> 2008-2009
# Copyright (C) Oliver Liebel <oliver@itc.li> 2008-2009
#
# This program is free software; you can redistribute ... | |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import itertools
import os
import pytest
from cryptography.exceptions i... | |
from sklearn.base import BaseEstimator
from sklearn.exceptions import NotFittedError
import warnings
from sklearn.feature_selection import SelectorMixin
from sklearn.utils import check_random_state
from sklearn.utils.validation import check_is_fitted
from fri.compute import RelevanceBoundsIntervals
from fri.model.b... | |
# Copyright 2016-2017 Capital One Services, 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 ... | |
# Copyright 2015 The Switch Authors. All rights reserved.
# Licensed under the Apache License, Version 2, which is in the LICENSE file.
"""
This module describes fuel use with considerations of unit commitment
and incremental heat rates using piecewise linear expressions. If you
want to use this module directly in a ... | |
import os
from mock import patch
import pytest
from cloudify import constants
from cloudify_agent.api import exceptions
from cloudify_agent.api import utils
from cloudify_agent.api.plugins import installer
from cloudify_agent.tests.daemon import (
assert_daemon_alive,
wait_for_daemon_alive,
wait_for_daem... | |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django_auth_ldap.backend import _LDAPUser
from django.test.client import RequestFactory
from typing import Any, Callable, Dict, Optional, Text
from builtins import objec... | |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 3 of the Lic... | |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.models import User
from sqp import models as sqp_models
from django.conf import settings
class Migration(DataMigratio... | |
from imc.auth import Auth
import config
from asyncdb import AsyncDB
class TOJAuth(Auth):
ACCESS_READ = 0x1
ACCESS_WRITE = 0x2
ACCESS_CREATE = 0x4
ACCESS_DELETE = 0x8
ACCESS_SETPER = 0x10
ACCESS_EXECUTE = 0x20
ACCESS_ALL = -1
ROLETYPE_USER = 1
ROLETYPE_3RD =... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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/LICEN... | |
"""
Tests for the permuted_ols function.
"""
# Author: Virgile Fritsch, <virgile.fritsch@inria.fr>, Feb. 2014
import nose
import numpy as np
from scipy import stats
from sklearn.utils import check_random_state
from numpy.testing import (assert_almost_equal, assert_array_almost_equal,
assert... | |
#!/usr/bin/env python
#
# Copyright 2014 Docalytics Inc, Copyright 2010 Google 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 r... | |
#
# vacutils.py - reusable functions and classes for Vac and Vcycle
#
## THE DEFINITIVE SOURCE OF THIS FILE IS THE Vac GIT REPOSITORY ##
## UNMODIFIED VERSIONS ARE COPIED TO THE Vcycle REPO AS NEEDED ##
#
# Andrew McNab, University of Manchester.
# Copyright (c) 2013-9. All rights reserved.
#
# Redistribution and ... | |
from __future__ import absolute_import # Python 2 only
import re
import types
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.urlresolvers import reverse
from django.utils import timezone
from django.forms.widgets import CheckboxInput
from django.core.cache import cache
from djang... | |
#! /usr/env/python
"""Component that models 2D diffusion using an explicit finite-volume method.
Created July 2013 GT Last updated March 2016 DEJH with LL v1.0 component
style
"""
import numpy as np
from landlab import Component, FieldError, LinkStatus, NodeStatus, RasterModelGrid
_ALPHA = 0.15 # time-step stabil... | |
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
"""
Keep track of buffer change history.
**Plugin Type: Global**
``ChangeHistory`` is a global plugin. Only one instance can be opened.
This plugin is used to log any changes to data buffer. For example,
a ch... | |
# 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... | |
import copy
import functools as ft
import sys
import numpy as np
import chemex.containers.helper as cch
import chemex.containers.noise as ccn
import chemex.containers.plot as ccp
CPMG_SCHEMA = {
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
... | |
#!/usr/bin/env python2.7
import json
import os
import re
import socket
import sys
import time
try:
import pyxhook
import Xlib, Xlib.protocol, Xlib.display, Xlib.X
xlib_support = True
except Exception as e:
pyxhook = Xlib = None
xlib_support = False
print "Warning:"
print e
print "No X... | |
from mock import MagicMock
import os
import six
import unittest
import dbt.clients.system
import dbt.compilation
import dbt.exceptions
import dbt.flags
import dbt.linker
import dbt.model
import dbt.project
import dbt.templates
import dbt.utils
import networkx as nx
from dbt.logger import GLOBAL_LOGGER as logger # no... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import framework
import importlib
import itertools
import json
import os
import sys
import thread
from collections import OrderedDict
import django
import modularodm
import website.models
from api.caching import listeners # noqa
from django.apps import a... | |
# Copyright 2019 The Cirq Developers
#
# 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 to in ... | |
# 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... | |
# Copyright (c) 2015 Red Hat, 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 require... | |
#!/usr/bin/env 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... | |
"""
RDB metadata.
This file is part of the telex project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
Created on Jul 31, 2014.
"""
from sqlalchemy import Column
from sqlalchemy import DateTime
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import Meta... | |
##########################################################################
#
# Copyright (c) 2011, John Haddon. All rights reserved.
# Copyright (c) 2011-2015, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... | |
import pytest
import numpy as np
# Dependencies from cobra
from cobra.io.json import load_json_model
from cobra.manipulation.modify import convert_to_irreversible
# Other dependencies
import csv,json,sys
# Dependencies from thermodynamics
from thermodynamics.thermodynamics_simulatedData import thermodynamics_simulat... | |
# -*- coding: utf-8 -*-
"""
Sessions module for the Tornado framework.
Milan Cermak <milan.cermak@gmail.com>
USAGE:
======
Every session object can be handled as a dictionary:
self.session[key] = value
var = self.session[key]
The session data is saved automatically for you when the request
handler finishes... | |
from tornado.testing import gen_test
from .. server import AuthServer
from .. import options as _opts
from anthill.common.testing import AcceptanceTestCase
from anthill.common.access import AccessToken
from anthill.common.sign import HMACAccessTokenSignature, RSAAccessTokenSignature
from anthill.common.access import... | |
from __future__ import division
import warnings
import numpy as np
from functools import wraps
from menpo.feature.base import rebuild_feature_image
try:
# try importing pyfftw
from pyfftw.interfaces.numpy_fft import fft2, ifft2, fftshift, ifftshift
try:
# try calling fft2 on a 4-dimensional array... | |
"""Support KNX devices."""
import logging
import voluptuous as vol
from homeassistant.const import (
CONF_ENTITY_ID,
CONF_HOST,
CONF_PORT,
EVENT_HOMEASSISTANT_STOP,
)
from homeassistant.core import callback
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as c... | |
# 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... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
svg2rlg is a tool to convert from SVG to reportlab graphics.
License : BSD
version 0.3
"""
import sys
import os
import time
import glob
import tempfile
import wx
from svg2rlg import svg2rlg
#import svglib
USESVGLIB = False
class Log(wx.PyLog):
"""
Class to se... | |
# engine/row.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Define row constructs including :class:`.Row`."""
import operator
from .. import... | |
#!/usr/bin/env python
import httplib
from datetime import datetime, timedelta
from mock import MagicMock, Mock
from tests.unit import unittest
from tests.unit import AWSMockServiceTestCase
import boto.ec2
from boto.regioninfo import RegionInfo
from boto.ec2.blockdevicemapping import BlockDeviceType, BlockDeviceMappi... | |
from io import StringIO
from luther.collections import Stack, State
from luther.nfa import NFA
class RegularExpression():
"""
TODO:
- refactor
- properties? (self.nfa, self.postfix)
"""
def __init__(self, expression):
self.expression = expression
def to_nfa(self):
... | |
import pygame
import menu
import Dice2
import time
import random
import Vragen
import psycopg2
import winscreen
class Vector2(tuple):
def __new__(typ, x=0.0, y=0.0):
n = tuple.__new__(typ, (int(x), int(y)))
n.x = x
n.y = y
return n
def __mul__(self, other):
return self... | |
#
# Copyright Ericsson AB 2013. All rights reserved
#
# Authors: Ildiko Vancsa <ildiko.vancsa@ericsson.com>
# Balazs Gibizer <balazs.gibizer@ericsson.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 co... | |
import pysal
import os.path
import numpy as np
from struct import pack, unpack
import pysal.core.FileIO as FileIO
from pysal.weights import W
from pysal.weights.util import remap_ids
from warnings import warn
__author__ = "Myunghwa Hwang <mhwang4@gmail.com>"
__all__ = ["ArcGISSwmIO"]
class ArcGISSwmIO(FileIO.FileIO)... | |
from __future__ import print_function
import os
import sys
sys.setrecursionlimit(10000)
import time
import json
import argparse
#from densenet169 import densenet169_model
import densenet
import numpy as np
import pandas as pd
import cv2
from tqdm import tqdm
import scipy
from sklearn.metrics import fbeta_score
from... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Yahoo! 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... | |
"""Module containing the datastore mode and associated functions."""
import os
import random
from mimic.__mimic import common
import datetime
from . import secret
from . import settings
from . import shared
from google.appengine.api import memcache
from google.appengine.api import taskqueue
from google.appengine.ap... | |
"""
picasso/gaussmle
~~~~~~~~~~~~~~~~
Maximum likelihood fits for single particle localization
:authors: Joerg Schnitzbauer, Maximilian Thomas Strauss, 2016-2018
:copyright: Copyright (c) 2016-2018 Jungmann Lab, MPI of Biochemistry
"""
import numpy as _np
import numba as _numba
import math as _ma... | |
#!/usr/bin/env python3
from splinter import Browser
from bs4 import BeautifulSoup
import json
import re
import sys
import os
import datetime
import hashlib
import http.client
import hmac
import base64
import urllib.parse
from multiprocessing import Pool, Lock
import argparse
import requests
import collections
import s... | |
#!/usr/bin/env python
from flask import current_app
import json
import os
from ooiservices.app.m2m.help_data import get_help_data
from ooiservices.app.m2m.exceptions import InvalidPortException, InvalidPathException, \
InvalidMethodException, InvalidScopeException
def get_m2m_ports():
try:
uframe_hos... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
# Natural Language Toolkit: TIMIT Corpus Reader
#
# Copyright (C) 2001-2007 NLTK Project
# Author: Haejoong Lee <haejoong@ldc.upenn.edu>
# Steven Bird <stevenbird1@gmail.com>
# Jacob Perkins <japerk@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
# [xx] this docstring is... | |
# -*- coding: utf-8 -*-
import __main__
import numpy
import pylab
import os.path
import os
import copy
import pdb
import param
import topo.pattern
import topo.command.analysis
from math import pi, sqrt, exp, pow
from numpy.oldnumeric import zeros, Float, sum
from topo.projection import CFProjection, SharedWeightCFPro... | |
#!/usr/bin/env python
import atexit
import glob
import os
import re
import shutil
import sys
import tempfile
import textwrap
from fabric.api import env, local, hide
from fabric.context_managers import lcd, settings, shell_env
from fabric.contrib.console import confirm
from fabric.contrib.files import exists
from fabr... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018 Huawei
# 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
#################################################################... | |
import inspect
import os
import re
# FIXME: remove textwrap dependency and code from scratch
import textwrap
def remove_indent(text, include_firstline=False):
"""Removes leading whitespace from the provided text.
Removes largest amount of leading whitespaces that is shared amongst all of the selected lines.
... | |
"""
Tests for DatetimeIndex timezone-related methods
"""
from datetime import date, datetime, time, timedelta, tzinfo
from distutils.version import LooseVersion
import dateutil
from dateutil.tz import gettz, tzlocal
import numpy as np
import pytest
import pytz
from pandas._libs.tslibs import conversion, timezones
imp... | |
"""
Functions related to file storage and serving.
The following functions return different types and configurations of
Django `Storage` classes depending on the use and the deployment context.
See https://docs.djangoproject.com/en/3.0/ref/files/storage/
For security reasons, even public files should be served raw
fr... | |
import pygame
import sys
import math
import pytmx
from utils import vector2
from utils import sprite2
from pytmx.util_pygame import load_pygame
from pygame import Rect
from player_movement import player_movement
from tree import tree
from wraith import wraith
import random
# setup goes here
pygame.init()
tile_width =... | |
"""HTTP server classes.
Note: BaseHTTPRequestHandler doesn't implement any HTTP request; see
SimpleHTTPRequestHandler for simple implementations of GET, HEAD and POST,
and CGIHTTPRequestHandler for CGI scripts.
It does, however, optionally implement HTTP/1.1 persistent connections,
as of version 0.3.
Notes on CGIHTT... | |
#
# 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 ... | |
# 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 ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Cisco Systems, 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-... | |
#!/usr/bin/env python
###################################################################################
#
# Copyright (c) 2010-2016 Motsai
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softwa... | |
"""
Class for reading data from from Tucker Davis TTank format.
Terminology:
TDT hold data with tanks (actually a directory). And tanks hold sub block
(sub directories).
Tanks correspond to neo.Block and tdt block correspond to neo.Segment.
Note the name Block is ambiguous because it does not refer to same thing in TD... | |
# 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... | |
# Copyright (C) 2014,2015 VA Linux Systems Japan K.K.
# Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp>
# 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 t... | |
# -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import t
import functools
import os
import sys
from gunicorn import config
from gunicorn.app.base import Application
from gunicorn.workers.sync import SyncWorker
dirname = os.path.dirname(_... | |
import numpy as np
import os
import cv2
import time
import config
import scipy.ndimage
import pygame, random
import scipy.stats
from pygame.locals import *
import pygame.gfxdraw
import skeleton
from blob_tracker import BlobTracker
import freenect
from kinect_capture import capture_images, threshold_depth_image
from con... | |
# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | |
"""
If you know what an abstract syntax tree (AST) is, you'll see that this module
is pretty much that. The classes represent syntax elements like functions and
imports.
This is the "business logic" part of the parser. There's a lot of logic here
that makes it easier for Jedi (and other libraries to deal with a Python... | |
EMITTER_BYTECODE = (
"60606040526104ae806100126000396000f3606060405236156100615760e060020a60003504630b"
"b563d6811461006357806317c0c1801461013657806320f0256e1461017057806390b41d8b146101"
"ca5780639c37705314610215578063aa6fd82214610267578063e17bf956146102a9575b005b6020"
"6004803580820135601f810184900490... | |
########################################################################
import operator
import math
class vec2d(object):
"""2d vector class, supports vector and scalar operators,
and also provides a bunch of high level functions
"""
__slots__ = ['x', 'y']
def __init__(self, x_or_pair, y =... | |
#!/usr/bin/env python
# Copyright (c) 2013 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 ... | |
# 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... | |
# Copyright 2014 Cisco Systems, 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.