gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
"""Tests for artifacts."""
import os
import subprocess
import time
# pylint: disable=unused-import,g-bad-import-order
from grr.lib import server_plugins
# Pull in some extra artifacts used for testing.
from grr.lib import artifact_lib_test
# pylint: ena... | |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | |
#!/usr/bin/python
from logging import DEBUG, NOTSET
from cloud_utils.log_utils.eulogger import Eulogger
from cloud_utils.log_utils import markup, get_traceback
from cloud_utils.file_utils.eucarc import Eucarc
from nephoria import CleanTestResourcesException
from urlparse import urlparse
AWSRegionData = {
'us-eas... | |
from django.http import HttpResponse,Http404
from django.shortcuts import render,redirect
from django.views.decorators.csrf import csrf_exempt
import flockapplib.jwtauth as jwt
import flockapplib.actions as action
import flockapplib.exports as export
import json
from django.http import HttpResponseRedirect
#importing ... | |
# Copyright 2018 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
import requests
from bs4 import BeautifulSoup
from pymongo import Connection
"""
Author : Kshitij Burman <kburman6@gmail.com>
"""
class IMDBParser:
def __init__(self):
pass
def parseMovie(self,id):
item = {"_id":id}
persons = {}
url = 'http://www.imdb.com/title/'+id+'/'
r = requests.get(url)
if r.... | |
import os
import re
from pip.backwardcompat import urlparse
from pip.index import Link
from pip.util import rmtree, display_path, call_subprocess
from pip.log import logger
from pip.vcs import vcs, VersionControl
_svn_xml_url_re = re.compile('url="([^"]+)"')
_svn_rev_re = re.compile('committed-rev="(\d+)"')
_svn_url_r... | |
mHelpText = '''
# ----------------------------------------------
# Name: DoM
# Description: Expand and execute command from menu
## D20H-53 Expand and execute command
#
# Author: Philip S. Rist
# Date: 10/26/2010
# Copyright 2010 by St. Thomas Software
# ----------------------------------------------
# This program is ... | |
# Copyright (c) 2016-present, Facebook, 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... | |
# Copyright 2014 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 unittest
from telemetry.core.platform.power_monitor import cros_power_monitor
class CrosPowerMonitorMonitorTest(unittest.TestCase):
initial_power... | |
import json
import uuid
from datetime import datetime, timedelta
from django.conf import settings
from django.contrib import messages
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.db import connection
from django.db.models import Count, Q, Sum
from djang... | |
"""Tests for light platform."""
from datetime import timedelta
import logging
from typing import Callable, NamedTuple
from pyHS100 import SmartDeviceException
import pytest
from homeassistant.components import tplink
from homeassistant.components.homeassistant import (
DOMAIN as HA_DOMAIN,
SERVICE_UPDATE_ENTI... | |
# encoding: utf-8
from django import forms
from django.contrib import admin, messages
from django.utils.html import format_html
from endorsements.models import Category, Tag
from wikipedia.models import BulkImport, ImportedEndorsement, \
ImportedEndorser, ImportedNewspaper, \
... | |
import collections
import hashlib
import os
import re
import time
import uuid
from datetime import datetime
from django.conf import settings
from django.core.cache import cache
from django.db import connection, models, transaction
import caching.base as caching
import amo
import amo.models
import sharing.utils as sh... | |
"""Represent the AsusWrt router."""
from __future__ import annotations
from datetime import datetime, timedelta
import logging
from typing import Any
from aioasuswrt.asuswrt import AsusWrt
from homeassistant.components.device_tracker.const import (
CONF_CONSIDER_HOME,
DEFAULT_CONSIDER_HOME,
DOMAIN as TRA... | |
import unittest
from conans.test.utils.tools import TestClient, TestServer
from conans.test.utils.cpp_test_files import cpp_hello_conan_files
from conans.model.ref import ConanFileReference
from conans.util.files import save
import os
conanfile = """from conans import ConanFile
class MyPkg(ConanFile):
name = "Hel... | |
#
# Hubblemon - Yet another general purpose system monitor
#
# Copyright 2015 NAVER Corp.
#
# 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... | |
# (C) Copyright 2020 by Rocky Bernstein
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distr... | |
from __future__ import unicode_literals
from datetime import datetime, timedelta
import logging
import tweepy
import models
LOGGER = logging.getLogger(__name__)
SERVICES = [
'API', 'JS', 'DASH'
]
STATUSES = [
'', 'UP', 'DOWN', 'ISSUE'
]
class TwitterStatusProcessor(object):
SEPARATOR = ':'
def ... | |
"""
This is a subfile for IsyClass.py
These funtions are accessable via the Isy class opj
"""
# author : Peter Shipley <peter.shipley@gmail.com>
# copyrigh : Copyright (C) 2015 Peter Shipley
# license : BSD
from ISY.IsyExceptionClass import IsyInvalidCmdError, IsyResponseError
from ISY.IsyProgramClass import IsyPro... | |
# import os
# import re
import sys
# import pandas as pd
import numpy as np
# from tqdm import tqdm
from nlpia.loaders import get_data
if len(sys.argv) > 1:
lang = sys.argv[1][:3].lower()
else:
lang = 'spa'
source_lang = 'eng'
max_text_len = 32 # 32: 62,829 spa examples (2 min/epoch), 64: 100k spa examples ... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import re
from django.views.generic import View
from django.shortcuts import get_object_or_404
from django.core.files.base import ContentFile
from django.utils import timezone
from .settings import MAX_BYTES
from .models import ChunkedUpload
from .response import Response
from .constants import http_status, COMPLETE
... | |
# 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 use ... | |
# 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... | |
# 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... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (c) 2011 Christopher D. Lasher
#
# This software is released under the MIT License. Please see
# LICENSE.txt for details.
"""Markov chains for BPN."""
import math
import random
import recorders
import states
import logging
logger = logging.getLogger('bpn.... | |
"""A contents manager that uses the local file system for storage."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import io
import os
import shutil
import mimetypes
import nbformat
from tornado import web
from .filecheckpoints import FileCheckpoints
from .fi... | |
import socket
import struct
import threading
import sys
import time
import os
from lib import state
from lib.terminal_colors import Fore, Back, Style
class Client(threading.Thread):
def __init__(self, verbose, test, time, target):
threading.Thread.__init__(self)
self.test = test
self.verbo... | |
import ctypes
from ctypes import CFUNCTYPE, c_int
from ctypes.util import find_library
import gc
import locale
import os
import platform
import re
import subprocess
import sys
import unittest
from contextlib import contextmanager
from tempfile import mkstemp
from llvmlite import ir
from llvmlite import binding as llvm... | |
import json
from unittest.mock import patch
from django.dispatch import Signal
from django.test import TestCase
from django.test.client import Client
from django.urls import reverse
import stripe
from ..models import Event, EventProcessingException
from ..webhooks import (
AccountExternalAccountCreatedWebhook,
... | |
# requirements:
# pip install -e git://github.com/jekbradbury/chainer.git@raw-kernel
from chainer import cuda, Function, Variable, Chain
import chainer.links as L
import chainer.functions as F
import numpy as np
THREADS_PER_BLOCK = 32
class STRNNFunction(Function):
def forward_cpu(self, inputs):
f, z, h... | |
# Copyright 2017 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 The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import logging
import re
from c7n.filters import Filter, FilterValidationError, ValueFilter
from c7n.filters.related import RelatedResourceFilter
from c7n.query import sources
from c7n.resources import load_resources
from c7n.utils import ... | |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
from cloudify.state import ctx_parameters as inputs
import subprocess
import os
import re
import sys
import time
import threading
import platform
from StringIO import StringIO
from cloudify_rest_client import CloudifyClient
from cloudify impo... | |
"""Webhook handlers for mobile_app."""
import asyncio
from functools import wraps
import logging
import secrets
from aiohttp.web import HTTPBadRequest, Request, Response, json_response
from nacl.secret import SecretBox
import voluptuous as vol
from homeassistant.components import notify as hass_notify, tag
from homea... | |
# 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 or agreed to in writing, ... | |
import tempfile, shutil
import os
import re
import subprocess
import time
import datetime
import csv
import json, yaml
import string
from bson.objectid import ObjectId
from bson import json_util
from dateutil.parser import parse
from django.conf import settings
from hashlib import md5
from crits.core.class_mapper imp... | |
# Copyright 2011 OpenStack Foundation.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance w... | |
# encoding: utf-8
"""
environment.py
Created by Thomas Mangin on 2011-11-29.
Copyright (c) 2011-2015 Exa Networks. All rights reserved.
"""
# XXX: raised exception not caught
# XXX: reloading mid-program not possible
# XXX: validation for path, file, etc not correctly test (ie surely buggy)
import os
import sys
imp... | |
from sympy.core import Expr, S, C, Symbol, Equality, Interval, sympify, Wild
from sympy.solvers import solve
from sympy.utilities import flatten
class Sum(Expr):
"""Represents unevaluated summation."""
def __new__(cls, f, *symbols, **assumptions):
f = sympify(f)
if f.is_Number:
if... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import numpy as np
import argparse
import functools
from PIL import Image
import paddle.fluid as fluid
import reader
from pyramidbox import PyramidBox
from visualize import draw_bboxes
fr... | |
import argparse
import os
import sys
import numpy as np
from PIL import Image
import chainer
from chainer import cuda
import chainer.functions as F
from chainer.functions import caffe
from chainer import Variable, optimizers
import pickle
def subtract_mean(x0):
x = x0.copy()
x[0,0,:,:] -= 104
x[0,1,:,... | |
""" Finite Union of Intervals
Implements a class to handle finite (disjoint) unions of intervals.
* assumes that intervals are always closed and that the union is disjoint
* open intervals remaining at the end of any operations (eg. complement)
* are always made closed. e.g. [0,1]^C = [-np.inf,0] [1,np.inf]
* end in... | |
# 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 use ... | |
# 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... | |
# coding: utf-8
#
# Copyright 2018 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
import glob
import logging
import os
import sys
from urlparse import urljoin
import requests
from requests.exceptions import ConnectionError
from invoke import ctask as task, Collection
from invocations.testing import test
from tessera import app, db, config
from tessera_client.api.model import Section
from tessera.... | |
##
# @file PlaceDB.py
# @author Yibo Lin
# @date Apr 2018
# @brief placement database
#
import sys
import os
import re
import math
import time
import numpy as np
import torch
import logging
import Params
import dreamplace
import dreamplace.ops.place_io.place_io as place_io
import dreamplace.ops.fence_region.fence... | |
import os,sys
import numpy as np
from scipy.stats import norm
from rpy import r
from scipy.cluster.vq import kmeans2
#r.library(mvtnorm)
## a class represent a k component mixture of Gaussian models using a latent
# variable representation of the Gaussian function.
# the data matrix x is a numpy array (nxd)
class Gau... | |
#
# 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
# ... | |
# 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... | |
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... | |
#!/usr/bin/env python
# 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
# "L... | |
"""Dependency injector provided instance provider unit tests."""
import unittest
from dependency_injector import containers, providers
class Service:
def __init__(self, value):
self.value = value
self.values = [self.value]
def __call__(self):
return self.value
def __getitem__(s... | |
# coding=utf-8
# Copyright 2014 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)
import os
from textw... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Deployment model for distributed gasifiers
# Jose Daniel Lara
from __future__ import division
from pyomo.environ import *
from pyomo.opt import SolverFactory
import googlemaps
from sqlalchemy import create_engine
import numpy as np
import matplotlib.pyplot as plt
import ... | |
import operator
import collections
import pytest
import pandas as pd
import pandas.util.testing as tm
from pandas.compat import PY2, PY36
from pandas.tests.extension import base
from .array import JSONArray, JSONDtype, make_data
pytestmark = pytest.mark.skipif(PY2, reason="Py2 doesn't have a UserDict")
@pytest.fi... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import logging
import os
import sys
import pyotherside
import smartcard
import struct
import types
import time
import getpass
import urllib.parse
import ykman.logging_setup
from base64 import b32decode
from binascii import b2a_hex, a2b_hex
fro... | |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os,sys,sqlite3,traceback
largv = []
g_dbpath = None
k_vt_col_map = { '':'\x1b[0m', 'default':'\x1b[0m', 'black':'\x1b[30m', 'red':'\x1b[31m', 'green':'\x1b[32m', 'yellow':'\x1b[33m',
'blue':'\x1b[34m', 'magenta':'\x1b[35m', 'cyan':'\x1b[36m', 'white':'\x1b[37m',
... | |
import random
"""
Returns a "random" 4 word phrase from a list of words.
"""
nouns = [
'people',
'history',
'way',
'art',
'world',
'information',
'map',
'two',
'family',
'government',
'health',
'system',
'computer',
'meat',
'year',
'thanks',
'music... | |
# Debian packaging tools: Relationship parsing and evaluation.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: April 19, 2020
# URL: https://github.com/xolox/python-deb-pkg-tools
"""
Parsing and evaluation of Debian package relationship declarations.
The :mod:`deb_pkg_tools.deps` module provides funct... | |
# Copyright 2013 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 os
import unittest
from telemetry import story
from telemetry import page as page_module
from telemetry import value
from telemetry.value import list_... | |
"""
=============
pyFluidSynth
=============
Python bindings for FluidSynth
Author: Nathan Whitehead
Contact: nwhitehe@gmail.com
Version: 0.7
Date: 2015-02-24
Copyright 2008--2015, Nathan Whitehead <nwhitehe@gmail.com>
Released under the LGPL
This module contains python bindings for FluidSynth. FluidSynth is a
soft... | |
# Copyright 2014 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, ... | |
from .hub import Hub, HubListener
from .data import Data
from .link_manager import LinkManager
from .registry import Registry
from .visual import COLORS
from .message import (DataCollectionAddMessage,
DataCollectionDeleteMessage,
DataAddComponentMessage)
from .util import as_... | |
from __future__ import absolute_import, unicode_literals
TEST_RUNNER='django_nose.NoseTestSuiteRunner'
import os
import importlib
local_settings_module = os.environ.get('LOCAL_SETTINGS', 'hydroshare.local_settings')
######################
# MEZZANINE SETTINGS #
######################
# The following settings are al... | |
#----------------------------------------------------------------------
# Copyright (c) 2011-2015 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including ... | |
import unittest
from unittest import mock
from django.core.exceptions import ObjectDoesNotExist
import tethys_cli.app_settings_commands as cli_app_settings_command
class TestCliAppSettingsCommand(unittest.TestCase):
def setUp(self):
load_apps_patcher = mock.patch('tethys_cli.app_settings_commands.load_app... | |
# coding=utf-8
# Copyright 2014 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)
import sys
from coll... | |
# Copyright (c) 2010 Resolver Systems Ltd, PythonAnywhere LLP
# See LICENSE.md
#
try:
import unittest2 as unittest
except ImportError:
import unittest
from sheet.worksheet import Worksheet
from sheet.rewrite_formula_offset_cell_references import (
rewrite_formula, rewrite_source_sheet_formulae_for_cut,
)
... | |
import json
from flask import render_template, flash, redirect, session
#
from flask import url_for
# The g global is setup by Flask to store and share data
# during the life of a request.
from flask import request, g
from flask import jsonify
from flask.ext.login import login_user, logout_user, current_user, \
log... | |
#!/usr/bin/env python
"""Base module components."""
import numpy as np
import copy
from collections import OrderedDict
import itertools
import six
import inspect
__all__ = ["BaseTransformer", "Pipeline", "Union"]
class BaseTransformer(object):
"""The base class for all transformation objects.
This class imp... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import (assert_allclose, assert_array_almost_equal_nulp,
assert_equal)
from astropy.stats.biweight import (biweight_location, biweight_scale,
... | |
#!/usr/bin/env python
# The MIT License (MIT)
#
# Copyright (c) 2015 Richard Hull
#
# 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 righ... | |
#!/usr/bin/python
# pylint: disable=line-too-long
"""
module for TiemseriesArray Class
"""
import sys
import re
import logging
import base64
import json
import os
import gzip
# own modules
from Timeseries import Timeseries as Timeseries
from TimeseriesArrayStats import TimeseriesArrayStats as TimeseriesArrayStats
###... | |
#! /usr/bin/env python
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
import OpenGL
import sys
import getopt
import array
import random
from math import *
objectXform = [
[1.0, 0.0, 0.0, 0.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0]
]
#The global v... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
#!/usr/bin/python3
# lltapes.py - Uses BeautifulSoup and requests to parse and download episodes
# from lovelinetapes.
import re
import sys
import os
import logging
import argparse
# for multi-threading
from queue import Queue
from threading import Thread
import requests
from bs4 import BeautifulSoup
U... | |
'''
API for the laws app
'''
import logging
from django.core.urlresolvers import reverse
from tastypie.constants import ALL
import tastypie.fields as fields
from agendas.templatetags.agendas_tags import agendas_for
from apis.resources.base import BaseResource
from mks.models import Member, Party
from mks.api import Me... | |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
#!/usr/bin/env python
#
# Copyright (C) 2014
# Brian Caswell <bmc@lungetech.com>
# Narf Industries <info@narfindustries.com>
#
# 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 rest... | |
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
# Copyright 2013 Mirantis 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 ... | |
import os
import psycopg2
import time
# from filters_json import filter_list as FilterMap
psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
psycopg2.extensions.register_type(psycopg2.extensions.UNICODEARRAY)
QUERY_STRINGS = {}
DB_CONFIG = {}
ROOT_DIR = os.path.abspath(os.getcwd())
def read_in_bb_file(... | |
import logging
from typing import Dict, Optional, Union
import numpy as np
import pickle
from ray.tune import trial_runner
from ray.tune.result import DEFAULT_METRIC
from ray.tune.schedulers.trial_scheduler import FIFOScheduler, TrialScheduler
from ray.tune.trial import Trial
logger = logging.getLogger(__name__)
c... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from exam import fixture
from django.http import HttpRequest
from sentry import options
from sentry.models import Project
from sentry.testutils import TestCase
from sentry.utils.http import (
is_same_domain, is_valid_origin, get_origins,... | |
#! /usr/bin/env python
# Copyright 2014 Jason F Nicholls
#
# 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... | |
##################################################
# __ __ __ _ __
# / /_ ____/ / / /_ (_)___ _/ /_ ______________ ________
# / __ \/ __ / / __ \/ / __ `/ __ \/ ___/ ___/ __ \/ ___/ _ \
# / / / / /_/ / / / / / / /_/ / / / (__ ) /__/ /_/ / / / _... | |
# Copyright 2011 OpenStack Foundation
# 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/licenses/... | |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | |
"""
Copyright (c) 2016 Jet Propulsion Laboratory,
California Institute of Technology. All rights reserved
"""
import calendar
import logging
import traceback
from cStringIO import StringIO
from datetime import datetime
from multiprocessing.dummy import Pool, Manager
import matplotlib.dates as mdates
import matplotlib... | |
"""Mean shift clustering algorithm.
Mean shift clustering aims to discover *blobs* in a smooth density of
samples. It is a centroid based algorithm, which works by updating candidates
for centroids to be the mean of the points within a given region. These
candidates are then filtered in a post-processing stage to elim... | |
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2018 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... | |
import pyscf.pbc.tools.make_test_cell as make_test_cell
from pyscf.pbc.tools.pbc import super_cell
from pyscf.pbc import gto, scf, cc
from pyscf.pbc.cc.eom_kccsd_ghf import EOMIP, EOMEA, EOMEE
from pyscf.pbc.cc.eom_kccsd_ghf import EOMIP_Ta, EOMEA_Ta
from pyscf.cc import eom_gccsd
import unittest
cell = make_test_cell... | |
"""
records.assessment.orthographic_visualization.orthographic_records.py
"""
from dlkit.json_.osid.metadata import Metadata
from dlkit.primordium.id.primitives import Id
from dlkit.primordium.transport.objects import DataInputStream
from dlkit.primordium.type.primitives import Type
from dlkit.abstract_osid.osid.erro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.