gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# 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 ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 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/l... | |
# RFC 2822 - style email validation for Python
# (c) 2012 Syrus Akbary <me@syrusakbary.com>
# Extended from (c) 2011 Noel Bush <noel@aitools.org>
# for support of mx and user check
# This code is made available to you under the GNU LGPL v3.
#
# This module provides a single method, valid_email_address(),
# which return... | |
# Copyright 2017, 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, ... | |
"""
The OffsetBox is a simple container artist. The child artist are meant
to be drawn at a relative position to its parent. The [VH]Packer,
DrawingArea and TextArea are derived from the OffsetBox.
The [VH]Packer automatically adjust the relative postisions of their
children, which should be instances of the OffsetBo... | |
from django.db.models import Count
from tastypie.resources import ModelResource, ALL_WITH_RELATIONS
from tastypie import http, fields
from tastypie.exceptions import ImmediateHttpResponse
from tastypie.bundle import Bundle
import json
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.... | |
# ===============================================================================
# Copyright 2011 Jake Ross
#
# 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... | |
"""
Created on 4 May 2021
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
example JSON:
{"serial_number": "27-000001", "type": "810-0023-02", "calibrated_on": "2016-11-01",
"sn1": {"serial_number": "212060308", "sensor_type": "NO2A43F"},
"sn2": {"serial_number": "132950202", "sensor_type": "CO A4"},
"sn3":... | |
# make the other metrics work
# generate the txt files, then work on the pdf otuput
__version__ = "0.1.0"
import numpy as np
import pandas as pd
# import matplotlib
# matplotlib.use('pdf')
import matplotlib.pyplot as plt
import sys
import os
import networkx as nx
import PHRG
import probabilistic_cfg as pcfg
import net_... | |
# Copyright 2020 The HuggingFace Team. 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... | |
# pylint: disable=invalid-name
# pylint: disable=g-long-ternary
# Copyright 2021 The Bazel 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.apac... | |
#!/usr/bin/env python
from __future__ import print_function, division, unicode_literals
import os
from tempfile import TemporaryDirectory
import pika
from rethinkdb import RethinkDB
import traceback
from collections import namedtuple
import inspect
from contextlib import ExitStack
from protocolbuffers.messages_pb2 im... | |
from troposphere import (
Parameter,
Ref,
Output,
Tags,
GetAtt,
Base64,
Join,
Equals,
cloudwatch as cw,
ec2,
elasticloadbalancing as elb,
autoscaling as asg
)
from utils.cfn import get_recent_ami
from utils.constants import (
ALLOW_ALL_CIDR,
EC2_INSTANCE_TYPES,
... | |
#!/usr/bin/python
#
# Copyright 2017 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible 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 License, or
# (at your option) any lat... | |
from app import db, app_log
from app.handler.error_handler import NotFound
from app.model.city import City
from app.model.region import Region
from app.model.country import Country
from app.model.status import Status
from app.model.units import Units
from app.model.label import Label
from app.model.categories import C... | |
# mako/runtime.py
# Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""provides runtime services for templates, including Context,
Namespace, and various helper funct... | |
# -*- coding: utf-8 -*-
#
# Copyright 2018 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... | |
#!/usr/bin/env python
import os, sys # system functions
import nipype.interfaces.io as nio # Data i/o
from nipype.interfaces.io import DataSink
import nipype.interfaces.fsl as fsl # fsl
import nipype.interfaces.ants as ants
import nipype.pipeline.engine as pe # pypeline engine
import nipype.interfaces.utility as u... | |
from datetime import date
from django.test import TestCase
#from unittest import TestCase
import words.dataretrieval
import words.requesthandler
import words.databaseinput
from words.emailsending import *
from words.models import Document_Data, Word_Data, Sentiment_Dict, Articles_Can
import csv
import decimal
from da... | |
# Copyright (c) 2010-2012 OpenStack, 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 ... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import cProfile
import pstats
import math
import string
import sys
import struct
import numpy as np
import cPickle
import asciitable
import scipy.ndimage
import scipy.stats as ss
import scipy.signal
import scipy as sp
import scipy.odr as odr
import glob
import os
import make_color_image
import make_fake_wht
import gzip... | |
# 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 ... | |
# -*- coding: utf-8 -*-
# pylint: disable=C0103
"""
k-nearest neighbors classification and regression.
"""
# Author: bertrand-l
# License: BSD
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from .classification import confusion
from .metrics import lp_norm
from .... | |
import datetime
import time
import uuid
from functools import wraps
from flask import render_template, abort, request, jsonify, redirect, url_for, flash
from flask_login import login_user, logout_user, current_user
from requests import HTTPError
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.orm import loa... | |
#
# Copyright 2014-2017 University of Southern California
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
#
from collections import namedtuple
import os
import numpy as np
import tifffile
from tifffile import lazyattr
from xml.dom import minidom
from functools import reduce
ImageMetadata = ... | |
# -*- 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... | |
#!/usr/bin/env python
# Copyright (c) 2010-2011 Stanford University
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS"... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2021 Richard Hull and contributors
# See LICENSE.rst for details.
"""
Tests for the :py:mod:`luma.core.cmdline` module.
"""
import pytest
import errno
from unittest.mock import patch, Mock
from luma.core import cmdline, error
from luma.core.interface... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import platform
import re
import unittest
import warnings
import random
import sys
from pymatgen import SETTINGS, __version__ as pmg_version
from pymatgen.ext.matproj import MPRester, MPRestError, TaskType
from ... | |
from .. import Availability, Class, Constant, Define, Method, Parameter, Type
gx_class = Class('FFT',
doc="""
This class allows for the application of predefined
filters to data in an OASIS database. The system uses
the Winograd algorithm to transform... | |
#!/eecs/research/asr/mingbin/python-workspace/hopeless/bin/python
import numpy, argparse, logging, time, cPickle, codecs, copy
from itertools import product, chain
# ================================================================================
if __name__ == '__main__':
logger = logging.getLogger()
logg... | |
from __future__ import print_function
import datetime
import hashlib
import os
import shutil
import sys
import shell_util
figure_str = r"""
\begin{figure}[h]
\centering
\includegraphics[width=0.5\linewidth]{@figname@}
\caption{\label{fig:@figlabel@} caption goes here}
\end{figure}
"""
class _TermColors(object):
... | |
# -*- coding: utf-8 -*-
from struct import pack, unpack
from ws4py.exc import FrameTooLargeException, ProtocolException
from ws4py.compat import py3k, ord
# Frame opcodes defined in the spec.
OPCODE_CONTINUATION = 0x0
OPCODE_TEXT = 0x1
OPCODE_BINARY = 0x2
OPCODE_CLOSE = 0x8
OPCODE_PING = 0x9
OPCODE_PONG = 0xa
__all_... | |
# ==========================================================================
#
# Copyright NumFOCUS
#
# 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/... | |
import sys
import json
import asyncio
import inspect
import logging
import argparse
import collections
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.cortex as s_cortex
import synapse.telepath as s_telepath
import synapse.lib.storm as s_storm
import synapse.lib.config as s_config
import ... | |
import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
merge_ordered,
)
import pandas._testing as tm
class TestMergeOrdered:
def setup_method(self):
self.left = DataFrame({"key": ["a", "c", "e"], "lvalue": [1, 2.0, 3]})
self.right = DataFrame({"key": ["b", "... | |
# 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... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.0.0.11832 on 2017-03-22.
# 2017, SMART Health IT.
import io
import json
import os
import unittest
from . import processrequest
from .fhirdate import FHIRDate
class ProcessRequestTests(unittest.TestCase):
def instantiate_from(self, filena... | |
# Copyright 2019 DeepMind Technologies Limited
#
# 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 agr... | |
from .bases import _StandardStemmer
from whoosh.compat import u
class FinnishStemmer(_StandardStemmer):
"""
The Finnish Snowball stemmer.
:cvar __vowels: The Finnish vowels.
:type __vowels: unicode
:cvar __restricted_vowels: A subset of the Finnish vowels.
:type __restricted_vowels: unicode
... | |
from __future__ import unicode_literals
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import no_oracle
from django.db import connection
from django.test import TestCase, skipUnlessDBFeature
from django.test.utils import override_settings
from django.utils import timezone
if HAS_GEOS... | |
# Copyright (c) 2010 ActiveState Software Inc. All rights reserved.
"""Textual UI: progress bar and colprint"""
import sys
from datetime import datetime, timedelta
from contextlib import contextmanager
import logging
import math
import six
LOG = logging.getLogger(__name__)
__all__ = ['colprint', 'find_console_widt... | |
from sympy import evalf, symbols, zeros, pi, sin, cos, sqrt, acos, Matrix
from sympy.physics.mechanics import (ReferenceFrame, dynamicsymbols, inertia,
KanesMethod, RigidBody, Point, dot)
from sympy.utilities.pytest import slow
@slow
def test_bicycle():
# Code to get equations ... | |
# 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... | |
# -*- coding: utf-8 -*-
"""
gspread.client
~~~~~~~~~~~~~~
This module contains Client class responsible for communicating with
Google Data API.
"""
import re
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
from xml.etree import ElementTree
from . import __version__... | |
# Copyright (c) 2019 Pieter Wuille
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test-only secp256k1 elliptic curve implementation
WARNING: This code is slow, uses bad randomness, does not properly protect
keys, and is trivia... | |
from flask_sqlalchemy import BaseQuery
from sqlalchemy.dialects.postgresql import INET, MACADDR
from sqlalchemy import distinct, desc
from sqlalchemy.sql import func
from . import db, id_column, get_db_binding
DB_BINDING = get_db_binding(__name__)
class Account(db.Model):
"""OpenStack Account"""
__bind_key_... | |
# -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
from JumpScale import j
from stat import *
import brotli
import hashlib
import functools
import subprocess
import pwd
import grp
import os
import sys
import re
class FListFactory(object):
def __init__(self):
self.__jslocation__ = "j.tools.flist"
def get_flist(self):
"""
Return a Flis... | |
from django.conf import settings
from collections import defaultdict
from django.db import models
from django.db.models.query import (QuerySet, ValuesQuerySet, DateQuerySet,
CHUNK_SIZE)
from django.db.models.query_utils import Q
from django.utils.translation import get_language
from nani.fieldtranslator import tra... | |
#!/usr/bin/env python
import argparse
import csv
import itertools
import math
import matplotlib
import os
import subprocess
import sys
class WorkingDirectory:
"Scoped context for changing working directory"
def __init__(self, working_dir):
self.original_dir = os.getcwd()
self.working_dir = w... | |
import asyncio
import binascii
import cgi
import collections
import datetime
import enum
import io
import json
import math
import re
import time
import warnings
from email.utils import parsedate
from types import MappingProxyType
from multidict import CIMultiDict, CIMultiDictProxy, MultiDict, MultiDictProxy
from yarl ... | |
from django.shortcuts import render, redirect
from django.urls import reverse
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.auth import authenticate, login as auth_login, logout as auth_logout
from .models import *
from django.conf import settings
from django.core.ex... | |
from collections import defaultdict
import os
import yaml
from flask import Markup, escape
from lxml.html import document_fromstring
class SearchSummary(object):
"""Provides a paragraph summarising the search performed and results"""
WRAP_PRE_TAG = '<p class="app-search-summary govuk-body-s">'
WRAP_POST... | |
# Copyright 2014 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 a... | |
# 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 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 agreed to in... | |
# -*- coding: utf-8 -*-
#
# Copyright 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... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 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
#... | |
"""
Views for creating, editing and viewing site-specific user profiles.
"""
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.http import Http404
from dja... | |
import os
from collections import namedtuple
from contextlib import contextmanager
from unittest import mock
from flask import g
from flask_testing import TestCase
from werkzeug.datastructures import Headers
from database import create_session
from mod_auth.models import Role, User
from mod_customized.models import C... | |
from __future__ import unicode_literals
from .abc import ABCIE
from .abc7news import Abc7NewsIE
from .academicearth import AcademicEarthCourseIE
from .addanime import AddAnimeIE
from .adobetv import (
AdobeTVIE,
AdobeTVVideoIE,
)
from .adultswim import AdultSwimIE
from .aftenposten import AftenpostenIE
from .a... | |
import os
import shutil
import textwrap
from collections import defaultdict
from multiprocessing import cpu_count
from subprocess import call, Popen, PIPE
import numpy as np
import pandas as pd
from scipy.stats import pearsonr
from rnaseq_lib.data import map_genes
from rnaseq_lib.docker import fix_permissions, get_ba... | |
# -*- coding: utf8
"""Random Projection transformers
Random Projections are a simple and computationally efficient way to
reduce the dimensionality of the data by trading a controlled amount
of accuracy (as additional variance) for faster processing times and
smaller model sizes.
The dimensions and distribution of Ra... | |
# stdlib
from collections import defaultdict, namedtuple
import time
import urlparse
# 3p
import requests
# project
from checks import AgentCheck
from config import _is_affirmative
from util import headers
class NodeNotFound(Exception):
pass
ESInstanceConfig = namedtuple(
'ESInstanceConfig', [
'ps... | |
#!/usr/bin/python
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | |
# Webhooks for external integrations.
import re
import string
from typing import Any, Callable, Dict, List, Optional
from django.db.models import Q
from django.http import HttpRequest, HttpResponse
from zerver.decorator import webhook_view
from zerver.lib.exceptions import AnomalousWebhookPayload, UnsupportedWebhookE... | |
import heapq
from random import random
from warnings import warn
# --- PRIORITY QUEUE ----------------------------------------------------------------------------------
# Currently not in use.
INFINITY = 1e20
class priorityqueue(dict):
def push(self, e, w):
self[e] = w
def pop(self):
p, w =... | |
# Copyright 2010-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.apache.org/licenses/LICENSE-2.0
#
# Unless... | |
import os
import uuid
import shutil
import sys
import time
import datetime
import traceback
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
from sideloader.worker import task_db
from twisted.mail.smtp import sendmail
from twisted.internet import defer, reactor, protocol
from twiste... | |
# 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... | |
#!/usr/bin/env python
from types import StringTypes
from lxml import etree
from StringIO import StringIO
# helper functions to help build xpaths
class XpathFilter:
@staticmethod
def filter_value(key, value):
xpath = ""
if isinstance(value, str):
if '*' in value:
val... | |
#!/usr/bin/python3
import gym
from gym import wrappers
import sys
import argparse
import numpy as np
import sklearn.pipeline
import sklearn.preprocessing
from sklearn.linear_model import SGDRegressor
from sklearn.kernel_approximation import RBFSampler
from matplotlib import pyplot as plt
plt.style.use("ggplot")
de... | |
#!/usr/bin/env python
#-Imports----------------------------------------------------------------------
#--Python Imports.
import os
import sys
#--wxPython Imports.
import wx
from wx.lib.embeddedimage import PyEmbeddedImage
#-Globals----------------------------------------------------------------------
paperairplane... | |
#!/usr/bin/env python
# coding: utf-8
# Copyright 2013 The Font Bakery 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/LIC... | |
from __future__ import print_function, division
from sympy.core import Add, S, sympify, oo, pi, Dummy
from sympy.core.function import Function, ArgumentIndexError
from sympy.core.numbers import Rational
from sympy.core.power import Pow
from sympy.core.compatibility import range
from .zeta_functions import zeta
from .e... | |
# 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... | |
from importlib import import_module
import itertools
import re
from django.apps import apps
from django.conf import settings
from django.contrib.sites.requests import RequestSite
from django.contrib.admin.models import LogEntry
from django.contrib.auth import SESSION_KEY, REDIRECT_FIELD_NAME
from django.contrib.auth.f... | |
# 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 2016 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 required by applicable law or agreed to in writing, ... | |
'''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
import unittest
import numpy as np
from numpy import nan
import array
import datetime as dt
from ..data_structures import image
from .. import S... | |
import unittest
import traceback
import gym
from gym.spaces import Box, Discrete, Tuple, Dict, MultiDiscrete
from gym.envs.registration import EnvSpec
import numpy as np
import sys
import ray
from ray.rllib.agents.registry import get_agent_class
from ray.rllib.models.tf.fcnet_v2 import FullyConnectedNetwork as FCNetV... | |
# Copyright (C) 2013 Lindley Graham
"""
This modules controls the management and creation of ``*.table`` files
"""
import glob, os, re
from polyadcirc.pyADCIRC.basic import pickleable
if __name__ == "__main__":
pass
def create_table_single_value(class_num, landuse_table, manningsn_value,
... | |
from __future__ import absolute_import, unicode_literals
from django import forms
from django.contrib.contenttypes.generic import generic_inlineformset_factory
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from .models import (TaggedItem, ValuableTaggedItem, Comparison, A... | |
# Copyright 2015. 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 la... | |
#!/usr/bin/env python2.6
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2011,2012,2013 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Y... | |
# -*- coding: utf-8 -*-
from __future__ import division
from werkzeug.security import generate_password_hash, check_password_hash
from sqlalchemy.ext.declarative import declared_attr
from . import db, lm
from app import db
# from app import app
from flask import current_app
import random
import datetime
from sqlalche... | |
# Copyright (C) 2015 Tom Barron <tpb@dyncloud.net>
# 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
#
# ... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from re import match
from json import dumps
from ..decorators import requires_auth
from .comment import IssueComment, issue_comment_params
from .event import IssueEvent
from .label import Label
from .milestone import Milestone
from ..models import GitHubC... | |
#
# 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... | |
#!/usr/bin/env python
#
# Appcelerator Titanium Module Packager
#
version = '3.5.1.GA'
sdk_path = r'/home/thor/.titanium/mobilesdk/linux/3.5.1.GA'
import os, sys, time, datetime, string, math, zipfile, codecs, re, shutil, subprocess, base64
from datetime import date
from xml.dom.minidom import parseString
sys.path.ap... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import json
from django.shortcuts import render, redirect
from django.contrib.auth import (REDIRECT_FIELD_NAME, get_user_model,
load_backend)
from django... | |
# 6.00.2x Problem Set 5
# Graph optimization
# Finding shortest paths through MIT buildings
#
import string
# This imports everything from `graph.py` as if it was defined in this file!
from graph import *
#
# Problem 2: Building up the Campus Map
#
# Before you write any code, write a couple of sentences here
# descr... | |
import json
from threading import Lock
from enum import Enum
from colorlog import error, warning as warn, info
from typing import List, Any, Dict, Callable, Optional, Tuple
from datetime import datetime
from yangson.datamodel import DataModel
from yangson.enumerations import ContentType, ValidationScope
from yangson.... | |
# Copyright 2017 The Meson development team
# 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 ... | |
"""The test for light device automation."""
import pytest
import homeassistant.components.automation as automation
from homeassistant.components.websocket_api.const import TYPE_RESULT
from homeassistant.const import CONF_PLATFORM, STATE_OFF, STATE_ON
from homeassistant.helpers import device_registry
from homeassistant... | |
#!/usr/bin/env python
# Copyright 2002 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 of c... | |
#!/usr/bin/env python
############################################################
# ConfigScanner - A buildbot config scanner and updater #
# Also does ReviewBoard (and at some point Bugzilla?) #
# Built for Python 3, works with 2.7 with a few tweaks #
#####################################################... | |
#!/usr/bin/env python2
# ENCODE_map 0.0.1
import os
import subprocess
import shlex
from multiprocessing import cpu_count
import logging
import sys
import json
logger = logging.getLogger(__name__)
logger.propagate = False
logger.setLevel(logging.INFO)
BWA_PATH = "bwa"
TRIMMOMATIC_PATH = "/".join([
os.getenv('TRIM... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.