gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from __future__ import unicode_literals
from rest_framework import status as http_status
import logging
from django.core.exceptions import ValidationError
from django.db import IntegrityError
from django.db import connection
from django.db import transaction
from flask import request
from framework.auth import Auth... | |
#!/usr/bin/env python3
"""Simple tool to work with protobuf in pyatv."""
import argparse
import binascii
from collections import namedtuple
import difflib
import glob
from io import BytesIO
import os
import re
import stat
import subprocess
import sys
import zipfile
import cryptography
from cryptography.hazmat.primiti... | |
"""Stops an Internal LB vm."""
from baseCmd import *
from baseResponse import *
class stopInternalLoadBalancerVMCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""the ID of the internal lb vm"""
"""Required"""
self.id = None
self.typeInfo['id'] =... | |
# 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... | |
"""Copy number detection using read counts, with cn.mops.
http://www.bioconductor.org/packages/release/bioc/html/cn.mops.html
"""
from contextlib import closing
import os
import re
import shutil
import subprocess
import pysam
import toolz as tz
from bcbio import bam, install, utils
from bcbio.distributed.multi impor... | |
# Copyright 2011 Andrew Bogott for the Wikimedia 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-... | |
#!/usr/bin/env python
# generate Python Manifest for the OpenEmbedded build system
# (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
# (C) 2007 Jeremy Laine
# licensed under MIT, see COPYING.MIT
#
# June 22, 2011 -- Mark Hatle <mark.hatle@windriver.com>
# * Updated to no longer generate special -dbg pa... | |
r"""
Uncertainty propagation class for arithmetic, log and exp.
Based on scalars or numpy vectors, this class allows you to store and
manipulate values+uncertainties, with propagation of gaussian error for
addition, subtraction, multiplication, division, power, exp and log.
Storage properties are determined by the n... | |
# 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 t... | |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 12 14:22:31 2016
@author: Tobias Jachowski
"""
import collections
import matplotlib.pyplot as plt
import numpy as np
from abc import ABCMeta, abstractmethod
from .. import gui
from .. import helpers as hp
from .. import traces as tc
from ..evaluate import signal as sn
fr... | |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: person.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflec... | |
"""Tests for the Google Assistant integration."""
DEMO_DEVICES = [{
'id':
'light.kitchen_lights',
'name': {
'name': 'Kitchen Lights'
},
'traits': [
'action.devices.traits.OnOff', 'action.devices.traits.Brightness',
'action.devices.traits.ColorSetting',
],
'type':
... | |
"""
Project Name: Twitter Tagcloud
Author: Alexandru Buliga
Email: bugaaa92@gmail.com
"""
import sys
import re
import logging
import json
from threading import currentThread, enumerate, Lock, Thread
from collections import Counter, OrderedDict
from datetime import datetime
import tweepy... | |
# -*- coding: utf-8 -*-
"""
DU task for BAR documents - see https://read02.uibk.ac.at/wiki/index.php/Document_Understanding_BAR
Here we convert the human annotation into 2 kinds of annotations:
- a semantic one: header, heading, page-number, resolution-marginalia, resolution-number, resolution-paragra... | |
import StringIO
import networkx as nx
# from networkx.readwrite import json_graph
import json
OPTLINE = '#'
CANVAS = '_canvas'
ATTRS = '_attributes'
DB = '_database'
ARCREL = 'relation'
LINECOLOR = 'linecolor'
FILL = 'fill'
BLACK = '0/0/0'
RED = '255/0/0'
GREEN = '0/255/0'
BLUE = '0/0/255'
PINK = '255/0/255'
LIGHTB... | |
#!/usr/bin/env python
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
# pylint: disable=bad-indentation,docstring-section-in... | |
#!/usr/bin/env python
# Copyright (c) 2011 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.
# based on an almost identical script by: jyrki@google.com (Jyrki Alakuijala)
"""Prints out include dependencies in chrome.
Since ... | |
#!/usr/bin/env python
# Copyright 2014-2019 The PySCF Developers. 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
#
# U... | |
# 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 unde... | |
# -*- coding: utf-8 -*-
'''
Module to provide MongoDB functionality to Salt
:configuration: This module uses PyMongo, and accepts configuration details as
parameters as well as configuration settings::
mongodb.host: 'localhost'
mongodb.port: 27017
mongodb.user: ''
mongodb.password:... | |
from .game_data import get_db_handle
from battleground.utils import bg_trueskill
import bson
def get_agents(owner=None,
game_type=None,
agent_id=None,
has_file=False,
fields=None,
db_handle=None):
"""
get agent data for conditions:
... | |
import pytz
import json
from unicodedata import normalize
from distutils.version import StrictVersion
from django.core.exceptions import ValidationError
from rest_framework import serializers as ser
from rest_framework import exceptions
from api.base.exceptions import Conflict, InvalidModelValueError, JSONAPIException... | |
# 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... | |
# Copyright (C) 2013-2016 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at
#
# http://www.a... | |
import asyncio
from base import Event
class TerminalEmulator(object):
def __init__(self):
super(TerminalEmulator, self).__init__()
self._logger = None
self.revision = 0
self._width = 0
self._height = 0
self.lines = []
self.cursorX = 0
self.cursorY ... | |
import hashlib
import re
import time
import socket
import exceptions
from twisted.internet import task, defer
from twisted.python import log
class Event(object):
"""Tensor Event object
All sources pass these to the queue, which form a proxy object
to create protobuf Event objects
:param state: Some ... | |
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
import json
import uuid
from django.conf import settings
from django.shortcuts import render_to_response
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.contrib.auth import authenticate, login, logout
from django.core.exceptions import Ob... | |
from collections import defaultdict
import threading
from .. import BaseResponder
from ..lib import MemoryCache, get_url, parse_command, catch_other
from ...message import Message
from ...signals import on_exception, message_out, config_changed
class APIError(Exception):
pass
class EventParser(object):
"""C... | |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-02-16 22:59:56
import sys
import six
import time
import logging
import traceback
logger = logging.getLogger("processor")
from six.moves import queue ... | |
import math
import unittest
import mock
import numpy
import six
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
@testing.parameterize(
{'shape': (8, 7), 'no... | |
"""The commutator: [A,B] = A*B - B*A."""
from __future__ import print_function, division
from sympy import S, Expr, Mul, Add
from sympy.core.compatibility import u
from sympy.printing.pretty.stringpict import prettyForm
from sympy.physics.quantum.dagger import Dagger
from sympy.physics.quantum.operator import Operat... | |
"""
A component which allows you to update your custom cards and components.
For more details about this component, please refer to the documentation at
https://github.com/custom-components/custom_updater
"""
import logging
import os.path
from datetime import timedelta
import voluptuous as vol
from aiohttp import web... | |
"""
Zoof, let's code!
Zoof, let us code!
Zoof, coding to the people!
Zoof, coding for everyone.
"""
import os
import time
from collections import OrderedDict
from PyQt4 import QtCore, QtGui
from zoof.lib.zson import Dict
Qt = QtCore.Qt
# Default values
PARAMS = Dict()
PARAMS.size = 32
PARAMS.gap = 0.05
PARAMS.ins... | |
import collections
import glob
import hashlib
import json
import logging
import os
import re
import shutil
import stat
import StringIO
import tempfile
import zipfile
from cStringIO import StringIO as cStringIO
from datetime import datetime
from itertools import groupby
from xml.dom import minidom
from zipfile import B... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 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.apach... | |
"""TcEx Framework"""
# standard library
import inspect
import logging
import os
import platform
import signal
import threading
from typing import TYPE_CHECKING, Dict, Optional, Union
# third-party
from requests import Session
# first-party
from tcex.api.tc.utils.threat_intel_utils import ThreatIntelUtils
from tcex.a... | |
#!/usr/bin/env python3
#
# 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
# ... | |
# Copyright 2015 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | |
# 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
# d... | |
# Copyright 2012 NEC 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 applicable law or ag... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""a converter from AI0 feature to AJ1 feature"""
# The implementation is very incomplete and very very ugly.
import sys, re
from collections import namedtuple
from enum import Enum
class GsubFragmentType(Enum):
UNKNOWN = 0
CID = 1
FROMBY = 2
OTHE... | |
"""The tests the for GPSLogger device tracker platform."""
from unittest.mock import patch
import pytest
from homeassistant import data_entry_flow
from homeassistant.components import gpslogger, zone
from homeassistant.components.device_tracker import DOMAIN as DEVICE_TRACKER_DOMAIN
from homeassistant.components.gpsl... | |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import dataclasses
import logging
from collections import defaultdict
from dataclasses import dataclass
from typing import Iterable
from packaging.util... | |
########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | |
from testfixtures import LogCapture
from twisted.internet import defer
from twisted.trial.unittest import TestCase
from scrapy import Request, Spider
from scrapy.utils.test import get_crawler
from tests.mockserver import MockServer
class LogExceptionMiddleware:
def process_spider_exception(self, response, excep... | |
#!/usr/bin/env python
# Copyright (C) 2006-2010, University of Maryland
#
# 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 us... | |
"""Support for monitoring the local system."""
from __future__ import annotations
import asyncio
from dataclasses import dataclass
import datetime
from functools import lru_cache
import logging
import os
import socket
import sys
from typing import Any, cast
import psutil
import voluptuous as vol
from homeassistant.c... | |
"""
english.py
Tools for NLG. Uses various sub-modules like nouns and verbs.
"""
import re
import copy
from utils import *
import ans
from ans import Pr, Vr, PVr, SbT
import nouns
import verbs
ANYTAG = re.compile(r"(\b[A-Z]#[a-z_/]+\b)")
TAGS = {
"noun": re.compile(r"\bN#([a-z_]+)/([a-z_]+)\b"),
"verb": re.c... | |
# -*- coding: utf-8 -*-
"""
@author: Chenglong Chen <c.chenglong@gmail.com>
@brief: utils for ngram
"""
def _unigrams(words):
"""
Input: a list of words, e.g., ["I", "am", "Denny"]
Output: a list of unigram
"""
assert type(words) == list
return words
def _bigrams(words, join_string,... | |
# extdiff.py - external diff program support for mercurial
#
# Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
#
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.
'''
The `extdiff' Mercurial extension allows you to use externa... | |
# -*- coding: UTF-8 -*-
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own lic... | |
# 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 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
"""
desispec.io.brick
=================
I/O routines for working with per-brick files.
See ``doc/DESI_SPECTRO_REDUX/PRODNAME/bricks/BRICKID/*-BRICKID.rst`` in desiDataModel
for a description of the relevant data models.
See :doc:`coadd` and `DESI-doc-1056 <https://desi.lbl.gov/DocDB/cgi-bin/private/ShowDocument?doci... | |
# Copyright 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
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, sof... | |
#!/tools/net/bin/python
# Copyright (c) 1994, 1996, Tony J. Ibbs All rights reserved.
# Copyright (c) 2004, Derek Chen-Becker All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | |
# -*- coding: utf-8 -*-
from django.shortcuts import get_object_or_404
from django_bootstrap3view.django_bootstrap3view_app.utils.render import render, render_string
from django_bootstrap3view.django_bootstrap3view_app.utils.python import convert_to_bool
class BaseService(object):
_repo = property(fget=lambda se... | |
#
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019 Intel 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... | |
# django imports
from django.db import IntegrityError
from django.db.models import Q
from django.db import connection
from django.contrib.auth.models import User
from django.contrib.auth.models import Group
from django.contrib.contenttypes.models import ContentType
from django.core.cache import cache
from django.core.e... | |
import collections
import numpy as np
import pandas as pd
import pandas.util.testing as tm
import pytest
import dask
import dask.dataframe as dd
from dask.dataframe.utils import assert_eq, assert_dask_graph, assert_max_deps
def groupby_internal_repr():
pdf = pd.DataFrame({'x': [1, 2, 3, 4, 6, 7, 8, 9, 10],
... | |
# Copyright 2011 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 requ... | |
#!/usr/bin/python
from datetime import date,datetime
import sqlalchemy
import json
import pprint
import uuid
import logging
import os
import utils
from config import ComicStreamerConfig
from comicstreamerlib.folders import AppFolders
from sqlalchemy.orm import scoped_session
from sqlalchemy.orm import sessionmaker... | |
import pickle
import datetime
import pytest
import six
from pyrsistent import (
PRecord, field, InvariantException, ny, pset, PSet, CheckedPVector,
PTypeError, pset_field, pvector_field, pmap_field, pmap, PMap,
pvector, PVector, v, m)
class ARecord(PRecord):
x = field(type=(int, float))
y = field(... | |
# Copyright (c) 2014 Alex Meade. All rights reserved.
# Copyright (c) 2014 Clinton Knight. All rights reserved.
# Copyright (c) 2016 Mike Rooney. 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 ob... | |
"""Metrics to assess performance on regression task
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Ma... | |
# import unittest
import unittest
from unittest.mock import Mock, MagicMock
import os
import sys
import asyncio
import xmlrunner
from test import common
from younit import set_test_hang_alarm
from younit import clear_test_hang_alarm
from younit import close_all_threads
from younit import asyncio_test, AsyncMock
imp... | |
#!/usr/bin/env python
"""Tests for host table in search view."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from absl import app
from grr_response_server.gui import gui_test_lib
from grr.test_lib import test_lib
class TestHostTable(gui_test_lib.Sea... | |
# Copyright 2010 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 requ... | |
#!/usr/bin/env python
# Copyright 2010-2015 by Peter Cock.
# All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
r"""Read and write BGZF compressed files (the GZIP variant used in BAM... | |
from eclcli.common import command
from eclcli.common import utils
from ..networkclient.common import utils as to_obj
class ListInterDCInterface(command.Lister):
def get_parser(self, prog_name):
parser = super(ListInterDCInterface, self).get_parser(prog_name)
parser.add_argument(
'--de... | |
# Copyright (c) 2016, MapR Technologies
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | |
"""
A simple logger.
Simple usage:
import logger
log = logger.Log('my_log.log', logger.Log.DEBUG)
log('A line in the log at the default level (DEBUG)') # simple
log('A log line at WARN level', logger.Log.WARN) # hard to use
log.info('log line issued at INFO level') # best if ... | |
# -*- coding: utf-8 -*-
# @Author: massimo
# @Date: 2016-03-10 20:16:59
# @Last Modified by: massimo
# @Last Modified time: 2016-03-10 23:29:56
import numpy as np
import theano
import theano.tensor as T
from theano.tensor.signal.downsample import max_pool_2d
from theano.tensor.nnet.conv import conv2d
from theano.sa... | |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
# 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 appl... | |
#!/usr/bin/env python
"""
Script which updates README.md with a list of all the available packs.
"""
import os
import copy
import glob
import json
import argparse
import yaml
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
PACKS_DIR = os.path.join(CURRENT_DIR, '../packs')
README_PATH = os.path.join(CURRENT... | |
# encoding: utf-8
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE.txt 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
# "Li... | |
#!/usr/bin/env python
import os
import sys
import time
import shlex
import struct
import platform
import subprocess
import pyglet
import cocos
from cocos.director import director
from cocos.audio.pygame.mixer import Sound
from cocos.audio.pygame import mixer
import colorama
colorama.init()
# support running from loca... | |
##########################################################################
#
# Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios),
# its affiliates and/or its licensors.
#
# Copyright (c) 2010-2015, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary ... | |
# Copyright (c) 2015-2016 Tigera, 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 applicabl... | |
from typing import Optional, Tuple
import gdsfactory as gf
from gdsfactory.add_padding import get_padding_points
from gdsfactory.cell import cell
from gdsfactory.component import Component
from gdsfactory.cross_section import strip
from gdsfactory.port import Port
from gdsfactory.types import CrossSectionFactory, Laye... | |
import datetime
import decimal
import json
import traceback
from django.conf import settings
from django.core.mail import EmailMessage
from django.db import models
from django.utils import timezone
from django.template.loader import render_to_string
from django.contrib.sites.models import Site
import stripe
from js... | |
from __future__ import print_function
from keras.models import Sequential
from keras.layers import LSTM, Dense, GRU, Dropout, SimpleRNN
from keras.models import load_model
from keras.callbacks import *
import numpy as np
import csv
import random as r
from util import elapsed
import logging
import json
import os
# Ref... | |
import MySQLdb
import config
import warnings
import os.path as op
import contextlib
ch_my_cnf = op.join(op.dirname(op.realpath(__file__)), 'ch.my.cnf')
wp_my_cnf = op.join(op.dirname(op.realpath(__file__)), 'wp.my.cnf')
class RetryingConnection(object):
'''
Wraps a MySQLdb connection, handling retries as nee... | |
<<<<<<< HEAD
<<<<<<< HEAD
# Copyright (C) 2003-2013 Python Software Foundation
import unittest
import plistlib
import os
import datetime
import codecs
import binascii
import collections
import struct
from test import support
from io import BytesIO
ALL_FORMATS=(plistlib.FMT_XML, plistlib.FMT_BINARY)
# The testdata is... | |
import time
from typing import Any, Dict, List, Optional
from django.db import models
from . import logging
from .autoupdate import AutoupdateElement, inform_changed_data, inform_elements
from .rest_api import model_serializer_classes
from .utils import convert_camel_case_to_pseudo_snake_case, get_element_id
logger... | |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, json
class User:
"""
A user object is created at the beginning of every request with details of the use.
The global user object is `frappe.user`
"""
def _... | |
#!/usr/local/bin/python
from __future__ import print_function
"""A Python version of the Perforce "p4" client.
This uses the Python type P4API.P4Adapter, which is a wrapper for the
Perforce ClientApi object.
$Id: //depot/r13.1/p4-python/P4.py#2 $
#***************************************... | |
#!/usr/bin/env python
# ==============================================================================
#
# FILE: runAWSCommand.py
#
# USAGE: runAWSCommand.py
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Gregg Jensen (), gjense... | |
#!/usr/bin/env python2.1
#
# A visual stimuli presentation script (showmovie.py)
# (written for fMRI study)
#
# requires: pygame
# pyOpenGL
# buffermovie.py
#
# 1-9-2009: sn
# HDD streaming movie presentation with some buffer
#
import sys
import time
import datetime
import pygame
from pygame.local... | |
"""Value inspectors that can be passed to :func:`fudge.Fake.with_args` for more
expressive argument matching.
As a mnemonic device,
an instance of the :class:`fudge.inspector.ValueInspector` is available as "arg" :
.. doctest::
>>> import fudge
>>> from fudge.inspector import arg
>>> image = fudge.Fake(... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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
# no... | |
# Copyright 2013 OpenStack Foundation
# Copyright 2013 IBM Corp
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICE... | |
from __future__ import absolute_import
import numpy as np
import unittest
import centrosome.lapjv as LAPJV
from centrosome.filter import permutations
from six.moves import range
from six.moves import zip
class TestLAPJVPYX(unittest.TestCase):
def test_01_01_reduction_transfer(self):
"""Test the reduction... | |
import os
import pytz
from datetime import tzinfo, timedelta, datetime
from django.conf import settings
from django.core.validators import MinValueValidator
from django.db import models
from django.db.models import F, Count, ExpressionWrapper, DateField, DateTimeField
from django.db.models.signals import pre_delete, p... | |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from textwrap import... | |
"""Module containing the base class for all pyleus components and a wrapper
class around Storm configurations.
"""
from __future__ import absolute_import
import argparse
from collections import deque
import logging
import logging.config
import os
import sys
import traceback
try:
import simplejson as json
_ = ... | |
# Lint as python3
# 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 r... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import six
import mock
import pytest
from datetime import datetime
from django.core.exceptions import SuspiciousOperation
from uuid import UUID
from sentry.coreapi import (
APIError,
APIUnauthorized,
Auth,
ClientApiHelper,
InvalidFin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.