gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 30 19:07:37 2017
@author: AmatVictoriaCuramIII
"""
import numpy as np
import random as rand
import pandas as pd
import time as t
from DatabaseGrabber import DatabaseGrabber
from YahooGrabber import YahooGrabber
Empty = []
Dataset = pd.DataFrame()
Portfolio = pd.DataFrame(... | |
# -*- coding: utf-8 -*-
import pytest
from pandas import compat
from pandas.compat import PY3
import numpy as np
from pandas import (Series, Index, Float64Index, Int64Index, UInt64Index,
RangeIndex, MultiIndex, CategoricalIndex, DatetimeIndex,
TimedeltaIndex, PeriodIndex, Int... | |
# The _mango_open_core module is a shared-object library
# which exports python functions and classes.
import mango.mpi
import sys
if sys.platform.startswith('linux'):
import DLFCN as dl
_flags = sys.getdlopenflags()
sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)
from . import _mango_open_ndarray_conver... | |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | |
"""
Copyright (c) 2014 Brian Muller
Copyright (c) 2015 OpenBazaar
"""
import time
import sqlite3 as lite
from collections import OrderedDict, MutableMapping
from zope.interface import implements, Interface
from protos.objects import Value
from threading import RLock
class IStorage(Interface):
"""
Local stora... | |
import types
import time
from direct.distributed.ClockDelta import *
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import ivalMgr
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedSmoothNode
from direct.distributed.PyD... | |
r'''
A set of cooperating classes which allow command implementations to
specify and parse the various options which Gerrit supports.
In addition, every option can be assigned a semantic-version compatible
specification which identifies the Gerrit versions on which the option
is supported. Thus, a command implementati... | |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: ElementTree.py
__all__ = [
'Comment',
'dump',
'Element', 'ElementTree',
'fromstring', 'fromstringlist',
'iselement', 'iterparse',
'parse', 'Par... | |
# Copyright 2011 VMware, 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 ... | |
#!/usr/bin/env python
# tile-generator
#
# Copyright (c) 2015-Present Pivotal Software, 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... | |
#!/usr/bin/env python
# Copyright 2015 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 argparse
import collections
import logging
import os
import re
import subprocess
import sys
import time
SCRIPT_DIR = os.path.d... | |
# -*- coding: utf-8 -*-
"""
Django settings for {{ project_name }} project.
Generated by 'django-admin startproject' using Django {{ django_version }}.
For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
For the full list of settings and their values, see
http... | |
# Copyright 2020-2022 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 writ... | |
from unittest.mock import Mock
from flask import g
import pytest
from dataactbroker import permissions
from dataactcore.models.lookups import ALL_PERMISSION_TYPES_DICT, PERMISSION_TYPE_DICT
from dataactcore.models.userModel import UserAffiliation
from dataactcore.utils.responseException import ResponseException
from ... | |
import json
from datetime import datetime, timedelta
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.urls import reverse
from django.db.models import Count
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404, redirect, ... | |
# Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from arcanelab.ouroboros.executors import Workflow
from arcanelab.ouroboros.models import NodeSpec, TransitionSpec
from arcane... | |
# -*- coding: utf-8 -*-
#
# Copyright 2014 - Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | |
#!/usr/bin/env python
#
# Copyright 2001 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 require... | |
from __future__ import nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals
# ----------------------------------------------default-------------------------------------------- #
foreground = (90, 43, 69) # foreground, -1
# ---------------------------------------------... | |
# -*- coding: utf-8 -*-
from datetime import *
from django import forms
from django.db import models
from django.contrib import admin
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext as _
from django.utils.html import format_html
from django.contrib.admin import helpers
from d... | |
"""
This module defines export functions for decision trees.
"""
# Authors: Gilles Louppe <g.louppe@gmail.com>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Brian Holt <bdholt1@gmail.com>
# Noel Dawe <noel@dawe.me>
# Satrajit Gosh <satrajit.ghosh@gmail.com>
# Trevor... | |
'''
***
Modified generic daemon class
***
Author: http://www.jejik.com/articles/2007/02/
a_simple_unix_linux_daemon_in_python/www.boxedice.com
License: http://creativecommons.org/licenses/by-sa/3.0/
Changes: 23rd Jan 2009 (David Mytton <david@boxedice.com>)
... | |
import imp
import marshal
import os
import py_compile
import random
import stat
import sys
import unittest
from test.test_support import (unlink, TESTFN, unload, run_unittest, rmtree,
is_jython, check_warnings, EnvironmentVarGuard)
import textwrap
from test import script_helper
def remov... | |
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.gui.DirectGui import *
from direct.showbase import PythonUtil
from direct.task import Task
from panda3d.core import *
import DisplaySettingsDialog
import ShtikerPage
from otp.speedchat import SCColorScheme
from otp.speedchat import SCStaticTex... | |
# 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 agreed to in... | |
from os.path import abspath, dirname, join, split
from glob import glob
from functools import partial
from subprocess import Popen, PIPE
import gzip
from click import echo
from psycopg2 import (connect, OperationalError)
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
from natsort import natsorted
from amg... | |
import unittest
from random import choice
"""
THIRD UPDATE
-----------
Lovely. Shit just works: http://www.codeskulptor.org/#user38_DjCBcO6l1q_6.py
same score and report as above.
SECOND UPDATE
------------
New URL: http://www.codeskulptor.org/#user38_DjCBcO6l1q_5.py
Score: 70.0/100
Everything seems to be working th... | |
# Copyright (c) 2012-2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... | |
##
# Copyright Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" file accompany... | |
"""Harmony data object which contains the Harmony Client."""
from __future__ import annotations
from collections.abc import Iterable
import logging
from aioharmony.const import ClientCallbackType, SendCommandDevice
import aioharmony.exceptions as aioexc
from aioharmony.harmonyapi import HarmonyAPI as HarmonyClient
f... | |
"""
Assertion helpers and base class for offsets tests
"""
from datetime import datetime
from typing import (
Optional,
Type,
)
from dateutil.tz.tz import tzlocal
import pytest
from pandas._libs.tslibs import (
OutOfBoundsDatetime,
Timestamp,
)
from pandas._libs.tslibs.offsets import (
FY5253,
... | |
import re
from django import forms
from django.db.models import Q
from django.template.loader import get_template
from django.urls import reverse
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy, ugettext_noop
from crispy_forms import layout as crispy
from crispy_fo... | |
import os
import json
from pokemongo_bot.base_task import BaseTask
from pokemongo_bot.human_behaviour import sleep
from pokemongo_bot.inventory import pokemons, Pokemon, Attack
DEFAULT_IGNORE_FAVORITES = False
DEFAULT_GOOD_ATTACK_THRESHOLD = 0.7
DEFAULT_TEMPLATE = '{name}'
MAXIMUM_NICKNAME_LENGTH = 12
class Nickna... | |
#!/usr/bin/env python
import MySQLdb as mysqlconnector
from MySQLdb.constants import CLIENT
import os
import socket
import decimal
import struct
from time import sleep
import multiprocessing
import ConfigParser
from MKFlowMessage import FBconvertLong # converter for long numbers to float and percent
#cvd-client->rbBm... | |
"""
Implements the Component class; the core class that has properties,
actions that mutate the properties, and reactions that react to the
events and changes in properties.
"""
import sys
from ._dict import Dict
from ._attribute import Attribute
from ._action import ActionDescriptor, Action
from ._reaction import Re... | |
# 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 2013 Huawei Technologies Co.,LTD.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | |
import datetime
from pprint import pprint
from dateutil.relativedelta import relativedelta
from django.db.models import Q
from django.core.management.base import BaseCommand, CommandError
from django.utils.formats import dateformat, date_format
from giveaway_winners import (
get_birthday,
get_other_giveaways,
... | |
#!/usr/bin/python
# interpolate scalar gradient onto nedelec space
import petsc4py
import sys
petsc4py.init(sys.argv)
from petsc4py import PETSc
from dolfin import *
# from MatrixOperations import *
import numpy as np
import PETScIO as IO
import common
import scipy
import scipy.io
import time
import scipy.sparse as... | |
try:
import dask
import dask.array
from dask.highlevelgraph import HighLevelGraph
from .dask_array_compat import meta_from_array
except ImportError:
pass
import itertools
import operator
from typing import (
Any,
Callable,
Dict,
Hashable,
Mapping,
Sequence,
Tuple,
T... | |
# -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import
from functools import partial
import re
import warnings
from ._compat import range_type, text_type, PY2
from . import err
#: Regular expression for :meth:`Cursor.executemany`.
#: executemany only suports simple bulk insert.
#: You can us... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Module Project Create Script
#
import os, sys, shutil, string, uuid, re, zipfile, glob, optparse
from string import capitalize
from StringIO import StringIO
from datetime import date
this_dir = os.path.dirname(__file__)
scripts_common_dir = os.path.join(os.path.dirna... | |
"""Tests for letsencrypt.plugins.standalone."""
import argparse
import socket
import unittest
import mock
import six
from acme import challenges
from acme import jose
from acme import standalone as acme_standalone
from letsencrypt import achallenges
from letsencrypt import errors
from letsencrypt import interfaces
... | |
#!python
"""Bootstrap setuptools 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 ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools... | |
from __future__ import unicode_literals
import re
import datetime
from django.utils import six
from django.db import models
from django.conf import settings
from django.db.migrations import operations
from django.db.migrations.migration import Migration
from django.db.migrations.questioner import MigrationQuestioner
... | |
# 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.
#
# Copyright 2010 Anso Labs, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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 t... | |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import io
import os
from distutils.version import LooseVersion as V
import numpy as np
from numpy.testing import assert_array_almost_equal
from nose.tools import assert_raises
from matplotlib.im... | |
# This Python file uses the following encoding: utf-8
# Copyright 2015 Tin Arm Engineering AB
# 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
... | |
# 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... | |
# -*- coding: utf-8 -*-
"""CCXT: CryptoCurrency eXchange Trading Library"""
# MIT License
# Copyright (c) 2017 Igor Kroitor
# 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 restricti... | |
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
from mock import patch
import os
import unittest
import shard_util
DEBUG_APP_OTOOL_OUTPUT = '\n'.join([
'Meta Class', 'name 0x1064b8... | |
from test import support
import enum
import locale
import platform
import sys
import sysconfig
import time
import unittest
try:
import threading
except ImportError:
threading = None
try:
import _testcapi
except ImportError:
_testcapi = None
# Max year is only limited by the size of C int.
SIZEOF_INT =... | |
import logging
import multiprocessing
import os
import unittest.loader
from argparse import ArgumentParser
from contextlib import contextmanager
from importlib import import_module
from unittest import TestSuite, TextTestRunner, defaultTestLoader, mock
from django.db import connections
from django.test import SimpleTe... | |
# cli commands
from twisted.python import log
from twisted.internet import defer
from opennsa import constants as cnt, nsa, error
def _createSTP(stp_arg):
# no generic label stuff for now
if '#' in stp_arg:
stp_desc, vlan = stp_arg.split('#')
network, port = stp_desc.rsplit(':',1)
... | |
from csv import DictReader, DictWriter
import sys
from copy import copy
import os.path
import arrow
from xlsxwriter.workbook import Workbook
from utils import MEDS, PROVINCES, DISTRICTS
HEADINGS_WHITE = ['Date', 'Province', 'District', 'Clinic Name', 'Clinic Contact', 'Latitute', 'Longitude', 'Monitor Name', 'Medicin... | |
# 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... | |
# 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... | |
"""Support for RESTful API sensors."""
import json
import logging
from xml.parsers.expat import ExpatError
from jsonpath import jsonpath
import requests
from requests import Session
from requests.auth import HTTPBasicAuth, HTTPDigestAuth
import voluptuous as vol
import xmltodict
from homeassistant.components.sensor i... | |
# Copyright 2012 Red Hat, Inc.
# 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/LICENSE-2.... | |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from .common import BaseTest
import time
import json
class TestCFN(BaseTest):
def test_delete(self):
factory = self.replay_flight_data("test_cfn_delete")
p = self.load_policy(
{
"name": "cfn... | |
# -*- coding: utf-8 -*-
# This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt)
# Maximilian Christ (maximilianchrist.com), Blue Yonder Gmbh, 2016
from functools import partial
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin
from tsfresh i... | |
# coding=utf-8
# Copyright 2020 The Google Research Team 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 app... | |
# -*- coding: utf-8 -*-
#########################################################################
## This scaffolding model makes your app work on Google App Engine too
#########################################################################
if request.env.web2py_runtime_gae: # if running on Google App E... | |
# -*- coding: UTF-8 -*-
#Copyright (c) 2008, Media Modifications Ltd.
#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,... | |
"""
Test functions used to create k8s objects
"""
from kubespawner.objects import make_pod_spec, make_pvc_spec
def test_make_simplest_pod():
"""
Test specification of the simplest possible pod specification
"""
assert make_pod_spec(
name='test',
image_spec='jupyter/singleuser:latest',
... | |
import select
import socket
import unittest
from pyrad.packet import PacketError
from pyrad.server import RemoteHost
from pyrad.server import Server
from pyrad.server import ServerPacketError
from pyrad.tests.mock import MockFinished
from pyrad.tests.mock import MockFd
from pyrad.tests.mock import MockPoll
from pyrad.t... | |
from som.interpreter.bc.bytecodes import Bytecodes as BC
from som.vm.globals import nilObject, trueObject, falseObject
from som.vm.symbols import sym_nil, sym_true, sym_false
def emit_inc(mgenc):
emit1(mgenc, BC.inc, 0)
def emit_dec(mgenc):
emit1(mgenc, BC.dec, 0)
def emit_inc_field_push(mgenc, field_idx,... | |
import _minpack
from numpy import atleast_1d, dot, take, triu, shape, eye, \
transpose, zeros, product, greater, array, \
all, where, isscalar, asarray, inf
error = _minpack.error
__all__ = ['fsolve', 'leastsq', 'newton', 'fixed_point','bisection', 'curve_fit']
def check_func(the... | |
'''
@author: rtermondt
'''
from decimal import Decimal
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.db.models import Avg
from django.http import HttpResponseRedirect
from django.shortcuts im... | |
import sys
import logging
import subprocess
from os.path import dirname
import fabric.api as fab
NEW_CERTS_TMP_DIR_PATH = '/tmp/new_cloudify_certs/'
REMOTE_SCRIPT_PATH = NEW_CERTS_TMP_DIR_PATH + 'replace_certificates.py'
REMOTE_REQUIREMENTS_PATH = NEW_CERTS_TMP_DIR_PATH + 'instance_requirements.txt'
class ReplaceCe... | |
# Copyright (c) 2012 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.
# pylint: disable=W0212
import fcntl
import logging
import os
import psutil
from devil import base_error
from devil import devil_env
from devil.android... | |
"""
sentry.interfaces.exception
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
__all__ = ('Exception', )
import re
import six
from django.conf import settings
from sentr... | |
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
"""
import gyp.common
import os.p... | |
import re
import os
from cumulusci.tasks.release_notes.github_api import GithubApiMixin
class BaseChangeNotesParser(object):
def __init__(self, title):
self.title = title
self.content = []
def parse(self):
raise NotImplementedError()
def render(self):
return '# {}\r\n\r... | |
# Copyright (c) 2019 PaddlePaddle 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 appli... | |
# Copyright 2013 Netease Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
"""This module defines classes for working with GenBank records."""
import re
import datetime
import textwrap
import sys
import location
class GenBankRecordParser():
"""Parses a GenBank record from a string or file."""
ATTRIBUTE_REGEXP = re.compile(r'^[A-Z]+')
SUBATTRIBUTE_REGEXP = re.compile(r'^\s{2,}[A... | |
import os
import itertools
import random
import click
import gevent
from populus.observers import (
DirWatcher,
)
from populus.compilation import (
compile_and_write_contracts,
)
from .deploy import (
deploy_contract,
)
from .accounts import (
is_account_locked,
)
def select_chain(project):
"""... | |
import os
import errno
import shutil
import time
import fnmatch
from glob import has_magic
def makedirs(path, mode=0o777, exist_ok=False):
"""Create a directory, and ancestors if necessary.
If exists_ok is True, no exception is raised when path exists.
Mimics behaviour of os.makedirs in python 3.2.
... | |
# 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 abc
import six
from cryptography import utils
@six.add_metacla... | |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | |
# Author: Mainak Jas <mainak@neuro.hut.fi>
# Romain Trachel <trachelr@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
import pytest
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_allclose, assert_equal)
from mne impor... | |
import warnings
from functools import partial
from typing import Any, Callable, List, Optional, Sequence
import torch
from torch import nn, Tensor
# from .._internally_replaced_utils import load_state_dict_from_url
from .misc_torch import ConvNormActivation, SqueezeExcitation as SElayer
from ._utils import _make_divi... | |
from direct.distributed.DistributedNodeAI import DistributedNodeAI
from direct.distributed.ClockDelta import *
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from direct.fsm import StateData
from toontown.safezone import DistributedChineseCheckersAI
from toontown.safezone import DistributedChecke... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('api', '0002_auto_20170214_1526'),
]
operations = [
migrations.CreateMo... | |
# !/usr/bin/env python2.7
# -*- coding: utf_8 -*-
# import resource_packs # not the right place, moving it a bit further
#-# Modified by D.C.-G. for translation purpose
#.# Marks the layout modifications. -- D.C.-G.
from __future__ import unicode_literals
"""
mcedit.py
Startup, main menu, keyboard configuration, auto... | |
"""Functions to plot on circle as for connectivity."""
from __future__ import print_function
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: Simplified BSD
from itertools ... | |
# 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... | |
# 6.00x Problem Set 4A Template
#
# The 6.00 Word Game
# Created by: Kevin Luu <luuk> and Jenna Wiens <jwiens>
# Modified by: Sarina Canelake <sarina>
#
import random
import string
VOWELS = 'aeiou'
CONSONANTS = 'bcdfghjklmnpqrstvwxyz'
HAND_SIZE = 7
SCRABBLE_LETTER_VALUES = {
'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': ... | |
# KillerBee Device Support for:
# Sewio Open-Sniffer Radio Client
# (product previously known as Wislab Sniffer)
# This sniffer is a remote IPv4 host.
#
# (C) 2013 Ryan Speers <ryan at riverloopsecurity.com>
#
# For documentation from the vendor, visit:
# http://www.sniffer.wislab.cz/sniffer-configuration/
#
import... | |
from __future__ import absolute_import
import json
import mock
import re
import responses
from datetime import datetime, timedelta
from flask import current_app
from mock import patch
from changes.config import db
from changes.constants import Result, ResultSource, Status
from changes.db.types.filestorage import Fil... | |
#!/usr/bin/env python
#encoding:utf-8
# Author: Robin Wen
# Date: 11/25/2014 10:51:54
# Desc: Auto deploy core-platform and auth to remote server.
# Import necessary packages.
import os
import sys, getopt
import socket
import string
import shutil
import getopt
import errno
import logging
import tempfile
import datetim... | |
"""
Test lldb data formatter subsystem.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class LibcxxMultiMapDataFormatterTestCase(TestBase):
mydir = Tes... | |
# manifest.py - manifest revision class for mercurial
#
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.
from node import bin, hex, nullid
from revlog import revlog, RevlogErr... | |
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from time import gmtime, strftime
from google.appengine.api import mail
from models import *
from google.appengine.ext import blobstore
from google.appengine.ext.webapp import blobstore_handlers
from gaesessions import get... | |
if __package__ is None:
__package__ ='modules'
import cPickle
import math
import h5py
import scipy as sp
from .classes.segmentgraph import Segmentgraph
from .classes.counts import Counts
from reads import *
from hdf5 import appendToHDF5
import rproc as rp
def count_graph_coverage(genes, fn_bam=None, CFG=None, fn... | |
# 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... | |
import os
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
def make_conv_bn_relu(in_channels, out_channels, kernel_size=3, stride=1, padding=1, groups=1):
return [
nn.Conv2d(in_channels, out_channels, kernel_size=kernel_size, stride=stride,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.