gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import typing as t
from functools import update_wrapper
from io import BytesIO
from itertools import chain
from typing import Union
from . import exceptions
from .datastructures import FileStorage
from .datastructures import Headers
from .datastructures import MultiDict
from .http import parse_options_header
from .san... | |
# 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 ... | |
'''
This file contains the library, for now.
'''
from datetime import datetime
import json
import os
import os.path
import requests
import shutil
import tempfile
from collections import namedtuple
# Sessions are stored in cookies. Each server can have its own cookie
# for this. We just set all the possible ones.
sess... | |
#
# 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 us... | |
# external control
import datetime
import time
import string
import urllib2
import math
import redis
import base64
import json
import eto
import py_cf
import os
#import sys # Need to have acces to sys.stdout
#fd = open('/media/mmc1/python/eto_debug.out.debug','a+') # open
#old_stdout = sys.stdout # store the defa... | |
# -*- coding: utf-8 -*-
import Gedi as gedi
import emcee
import sys
import numpy as np
import matplotlib.pylab as pl; pl.close("all")
import astropy.table as Table
import cPickle as pickle
import corner
### Spots dataset to analyse
ijk= 10
### Defining what's supose to run: 1 runs 0 doesn't
day_1, daydecay_1, daydeca... | |
#!/usr/bin/python
#Author: Michael Brothers
#Date: 10-22-2013
#Title: Vortex Ring Pair Interaction
#
#Note: must be run with four ranks
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import numpy as np
import numpy.ma as ma
from mpl_toolkits.mplot3d import Axes3D
from mpi4py import MPI
comm... | |
# Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
import unittest
import warnings
import numpy as np
import six.moves.cPickle as pickle
import chainer
from chainer import cuda
from chainer import links as L
from chainer import testing
from chainer.testing import attr
class SimpleLink(chainer.Link):
def __init__(self, shape):
super(SimpleLink, self).__... | |
'''''''''''''''''''''''''''''''''''''''''''''''''''''
// Authored by Christopher Iliffe Sprague //
// Christopher.Iliffe.Sprague@gmail.com //
// +1 703 851 6842 //
// https://github.com/CISprague/Spacecraft_Testbed //
''''''''''''''''''''''''''''''''''''''''''''''''''... | |
from __future__ import print_function
from __future__ import division
import os
import sys
import time
from collections import deque
from json import dumps
from platform import python_version
from pprint import pformat
from signal import signal, SIGTERM, SIGUSR1, SIGTSTP, SIGCONT
from subprocess import Popen
from thr... | |
#!/usr/bin/env python3
import time
import random
import socket
from flask import Flask, render_template, redirect, url_for, request, jsonify
import config
log = None
# classes
class Agent():
def __init__(self, ip, cw=True, node=None, state='initial'):
self.ip = ip
self.cw = cw
self.state... | |
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation 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 "... | |
from matplotlib.colors import LinearSegmentedColormap
from numpy import nan, inf
# Used to reconstruct the colormap in viscm
parameters = {'xp': [28.782590300914933, 59.705365170024862, -27.718282299434122, -58.259294515838988, -31.917671479189778, -2.9037098736051519],
'yp': [16.928446771378731, -47.20... | |
# Copyright 2012 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 agre... | |
"""The tests for the MQTT binary sensor platform."""
import copy
from datetime import datetime, timedelta
import json
import pytest
from homeassistant.components import binary_sensor, mqtt
from homeassistant.components.mqtt.discovery import async_start
from homeassistant.const import (
EVENT_STATE_CHANGED,
S... | |
#! /usr/bin/env python
import os
import sys
import math
import argparse
import warnings
from glob import glob
from functools import wraps
import numpy as np
from qtpy import QtWidgets, QtCore
from planetaryimage import PDS3Image
from ginga.BaseImage import BaseImage
from ginga.qtw.ImageViewCanvasQt import ImageViewCa... | |
# 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 applicable law or ag... | |
# 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... | |
"""Unit tests for the Travis CI integration."""
from __future__ import unicode_literals
import json
from django.core.urlresolvers import reverse
from django.utils.six.moves.urllib.error import HTTPError
from djblets.conditions import ConditionSet, Condition
from reviewboard.hostingsvcs.models import HostingServiceAc... | |
# -*- coding:utf-8 -*-
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
import re
import zlib
from random import random
from textwrap import dedent
from time import time
from django.core.cache.backends.base import (
DEFAULT_TIMEOUT, BaseCache, default_key_func
)
from djan... | |
"""
Extensions called during training to generate samples and diagnostic plots and printouts.
"""
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import numpy as np
import os
import theano.tensor as T
import theano
from blocks.extensions import SimpleExtension
import viz
import sampler
clas... | |
# Copyright 2020 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 applic... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""Wrapper for netCDF readers."""
from __future__ import unicode_literals, division, print_function
import os.path
from monty.dev import requires, deprecated
from monty.collections import AttrDict
from monty.f... | |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
requests_cache.backends.base
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Contains BaseCache class which can be used as in-memory cache backend or
extended to support persistence.
"""
from datetime import datetime
import hashlib
from copy import copy
from io import Byt... | |
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from __future__ import a... | |
"""
session stuff for jabber connections
"""
from twisted.internet import defer, reactor
from twisted.python import failure, log
from twisted.web import server
from twisted.names.srvconnect import SRVConnector
try:
from twisted.words.xish import domish, xmlstream
from twisted.words.protocols import jabber a... | |
from __future__ import with_statement
import textwrap
import os
import sys
from os.path import join, normpath
from tempfile import mkdtemp
from mock import patch
from tests.lib import assert_all_changes, pyversion
from tests.lib.local_repos import local_repo, local_checkout
from pip.util import rmtree
def test_simp... | |
# coding: utf-8
"""
Copyright 2015 SmartBear 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 applica... | |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | |
"""
This module lets the simulator communicate with external things like the
log viewer and NetVis.
"""
import comm
import socket
import json
import threading
import core
import api
class StreamingConnection (comm.NullInterface):
def __init__ (self, parent, sock):
self.sock = sock
self.parent = parent
... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
def ge... | |
# Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | |
import codecs
import datetime
import os
import shutil
import tempfile
import unittest
from io import StringIO
from unittest import mock
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.contrib.staticfiles import storage
from django.contrib.staticfiles.management.command... | |
'''
datetime.tzinfo timezone definitions generated from the
Olson timezone database:
ftp://elsie.nci.nih.gov/pub/tz*.tar.gz
See the datetime section of the Python Library Reference for information
on how to use these modules.
'''
# The Olson database is updated several times a year.
OLSON_VERSION = '2015d'
VERSI... | |
"""
A file full of bit twidling helpers
"""
import struct
MAX_WORD = 32 # usually no more than 8, 16 is for SIMD register support
# Masks to use for unsigned anding to size
u_maxes = [ (2 ** (8*i)) - 1 for i in range(MAX_WORD+1) ]
u_maxes[0] = 0 # powers of 0 are 1, but we need 0
bu_maxes = [ (2 ** (i)) - 1 for i in... | |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | |
# Jaikrishna Initial Date: June 24, 2013 Last Updated: June 24, 2013
#
# These files have been made available online through a Creative Commons Attribution-S$
# (http://creativecommons.org/licenses/by-sa/3.0/)
#
# http://www.dexterindustries.com/
# This code is for testing the BrickPi with a Lego Motor
from BrickPi i... | |
import logging
from django.apps import apps as django_apps
from django.conf import settings
from django.db import transaction
from orchestra.core.errors import WorkflowError
from orchestra.models import Certification
from orchestra.models import Step
from orchestra.models import TodoListTemplate
from orchestra.models... | |
"""
Support pre-0.12 series pickle compatibility.
"""
import sys
import pandas # noqa
import copy
import pickle as pkl
from pandas import compat, Index
from pandas.compat import u, string_types # noqa
def load_reduce(self):
stack = self.stack
args = stack.pop()
func = stack[-1]
if len(args) and ty... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Department'
db.create_table(u'tickets_department', (
... | |
"""
Tests for the gocookies code.
"""
import os
import shutil
import tempfile
import unittest
import urllib.request
import pyrfc3339
from juju.client.gocookies import GoCookieJar
# cookie_content holds the JSON contents of a Go-produced
# cookie file (reformatted so it's not all on one line but
# otherwise unchanged)... | |
"""
#;+
#; NAME:
#; abssys_utils
#; Version 1.0
#;
#; PURPOSE:
#; Module for Absorption Systems
#; 23-Oct-2014 by JXP
#;-
#;------------------------------------------------------------------------------
"""
from __future__ import print_function, absolute_import, division, unicode_literals
import numpy as np
... | |
#!/usr/bin/env python
#
# -----------------------------------------------------------------------------
# Copyright (c) 2017 The Regents of the University of California
#
# This file is part of kevlar (http://github.com/dib-lab/kevlar) and is
# licensed under the MIT license: see LICENSE.
# ----------------------------... | |
#
# tashiSSH.py - Implements the Tango VMMS interface.
#
# This implementation uses Tashi to manage the virtual machines and
# ssh and scp to access them. The following excecption are raised back
# to the caller:
#
# TashiException - Tashi raises this if it encounters any problem
# tashiCallError - raised by tashiC... | |
import datetime
from StringIO import StringIO
import django
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.encoding import force_unicode
from django.core.serializers import json as djangojson
from tastypie.bundle import Bundle
from tastypie.exceptions import ... | |
import tensorflow as tf
import numpy as np
import common
import matplotlib.pyplot as plt
from collections import OrderedDict
class ForwardModel(object):
def __init__(self, state_size, action_size, rho=0.05, beta=0.3, encoding_size=50, batch_size=50, multi_layered_encoder=True, num_steps=1,
separat... | |
# 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 2013 Cloudera 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 2014: 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 b... | |
# ----------------------------------------------------------------------
# Copyright (c) 2015 Rafael Gonzalez.
#
# 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... | |
# Modifying graphs: We will now extend basicgraphs.py. Copy the code
# in this module and call it e.g. mygraphs.py.
"""
This is a module for working with *undirected* graphs (simple graphs or multigraphs).
It contains three classes: Vertex, Edge and Graph.
The interface of these classes is extensive and allows progra... | |
""" Test how signals behave on classes.
"""
from pytest import raises
from flexx.util.testing import run_tests_if_main
from flexx.react import HasSignals, input, connect, lazy, Signal, InputSignal
def test_signals_on_classes_are_descriptors():
shown = []
class Test(HasSignals):
@i... | |
# Copyright 2012 IBM Corp.
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | |
"""
===============================================
Base code for running Kalman filter
===============================================
This module implements a Kalman filter that is slightly different fromt the
standard one, following West and Harrison (1999). This Kalman filter accepts
one-dimension discounting fa... | |
from __future__ import print_function
import os.path
import sys
import re
import warnings
from django.db import connection, models
from django.db.backends.util import truncate_name
from django.core.management.color import no_style
from django.db.models.fields import NOT_PROVIDED
from django.db.utils import DatabaseE... | |
from django.contrib.auth.models import User
from django.test import TestCase
from core import models
class ModelVariable(TestCase):
def setUp(self):
models.Variable.objects.create(
name='qwer',
value='asdf',
)
def test_str(self):
variable = models.Variable.ob... | |
from __future__ import unicode_literals
from django.contrib.auth.models import AnonymousUser
from django.contrib.contenttypes.models import ContentType
from django.db.models.query import QuerySet
from django.test import TestCase
from guardian.shortcuts import get_perms_for_model
from guardian.core import ObjectPermis... | |
# 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... | |
"""
Module for checking resource reservations by chutes.
One idea motivating this design is to reduce the amount of state
in memory for resource reservations. We have the chute list, which
contains information about what devices the chute is using. If we also
maintain a separate list of devices used by chutes, we ne... | |
#!/usr/bin/env python
from rdflib import Graph, Literal, RDF, RDFS, Namespace, URIRef
from rdflib.namespace import DCTERMS
from rdflib.plugins.stores import sparqlstore
from bunch import bunchify
import hashlib
import json
from uuid import uuid4
class LocalStore():
'''
This class is a wrapper for the Graph c... | |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Test the hunt_view interface."""
import os
import traceback
from absl import app
from grr_response_core.lib import rdfvalue
from grr_response_server import data_store
from grr_response_server import flow
from grr_response_server import hunt
from grr_response_server.... | |
import logging
from typing import Dict, Any, List, Optional, Tuple, Union
from ray._raylet import (
Sum as CythonCount,
Histogram as CythonHistogram,
Gauge as CythonGauge,
) # noqa: E402
# Sum is used for CythonCount because it allows incrementing by positive
# values that are different from one.
logger... | |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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... | |
import bs4
import re
import calendar
import datetime
import time
import json
import os.path
import parsedatetime
import bleach
import WebRequest
import common.util.urlFuncs
import WebMirror.OutputFilters.FilterBase
import WebMirror.OutputFilters.util.TitleParsers as titleParsers
import WebMirror.OutputFilters.... | |
from PyQt4 import QtCore, QtGui, uic
from wallet import wallet
from tablemodel import TableModel, ProxyModel
class AddAssetDialog(QtGui.QDialog):
def __init__(self, parent):
QtGui.QDialog.__init__(self, parent)
uic.loadUi(uic.getUiPath('addassetdialog.ui'), self)
for wname in ['edtMonike... | |
# 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 b... | |
# Copyright 2013 - Mirantis, Inc.
# Copyright 2015 - StackStorm, Inc.
# Copyright 2019 - NetCracker Technology 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:/... | |
import numpy
import chainer
from chainer import backend
from chainer import function_node
from chainer.utils import type_check
def _as_mat(x):
if x.ndim == 2:
return x
return x.reshape(len(x), -1)
def _ij_ik_il_to_jkl(a, b, c):
ab = chainer.functions.matmul(a[:, :, None], b[:, None, :]) # ijk
... | |
import atexit
import threading
from collections import defaultdict
from dataclasses import dataclass
from multiprocessing.pool import ThreadPool
import ray
from dask.core import istask, ishashable, _execute_task
from dask.system import CPU_COUNT
from dask.threaded import pack_exception, _thread_get_id
from .callback... | |
import os
import unittest
from functools import partial
from os.path import expanduser
from time import sleep
from kivy.app import App
from kivy.clock import Clock
from kivy.core.window import Window
from kivy.uix.gridlayout import GridLayout
from cobiv.modules.core.entity import Entity
from cobiv.modules.core.sessio... | |
#!/usr/bin/env python
"""
Sanders ik_comparison test python script
This script is written to be ran with the gazebo simulated Baxter
It will probably run on the robot live aswel, but is not tested on it
"""
#import various libraries
import argparse
import struct
import sys
import rospy
#import library to use time.sl... | |
import random
from tests.checks.common import AgentCheckTest, load_check
MOCK_CONFIG = {
'init_config': {},
'instances' : [{
'url': 'http://localhost:8500',
'catalog_checks': True,
}]
}
MOCK_CONFIG_SERVICE_WHITELIST = {
'init_config': {},
'instances' : [{
'url': 'http://lo... | |
from bolt.discord.models.base import Enum, Model, Field, ListField, Snowflake, Timestamp, SearchableList
from bolt.discord.models.channel import Channel
from bolt.discord.models.user import User
from bolt.discord.permissions import Permission
class MessageNotificationLevel(Enum):
ALL_MESSAGES = 0
ONLY_MENTION... | |
"""
ESQuery
=======
ESQuery is a library for building elasticsearch queries in a friendly,
more readable manner.
Basic usage
-----------
There should be a file and subclass of ESQuery for each index we have.
Each method returns a new object, so you can chain calls together like
SQLAlchemy. Here's an example usage:
... | |
#
# Copyright 2014 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 req... | |
"""The tests for sensor recorder platform."""
# pylint: disable=protected-access,invalid-name
from datetime import timedelta
import importlib
import json
import sys
from unittest.mock import patch, sentinel
import pytest
from pytest import approx
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
... | |
###############################################################################
##
## Copyright 2013 Tavendo GmbH
##
## 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... | |
# NOTE - It is a known issue that the keyboard-related functions don't work on Ubuntu VMs in Virtualbox.
import pyautogui
import sys
import os
from pyautogui import LEFT, MIDDLE, RIGHT
from Xlib.display import Display
from Xlib import X
from Xlib.ext.xtest import fake_input
import Xlib.XK
BUTTON_NAME_MAPPING = {LEFT... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: bigip_dns_nameserver
sh... | |
#!/usr/bin/python2.5
#
# Copyright 2008 the Melange 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... | |
import mock
import pytest
from rest_framework import exceptions
from django.utils import timezone
from api.base.settings.defaults import API_BASE
from api_tests import utils as test_utils
from framework.auth.core import Auth
from osf.models import PreprintService, NodeLicense
from osf.utils.workflows import DefaultSt... | |
# -*- coding: utf-8 -*-
from __future__ import print_function, division
"""
.. note::
These are the database functions for SPLAT
"""
# imports: internal
import os
import re
import requests
# imports: external
import numpy
# splat functions and codes
from splat.initialize import *
from splat.utilities impo... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# -*- coding: utf-8 -*-
# (The MIT License)
#
# Copyright (c) 2014 Kura
#
# 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... | |
# coding=utf-8
"""
The Collector class is a base class for all metric collectors.
"""
import os
import socket
import platform
import logging
import configobj
import traceback
import time
from diamond.metric import Metric
# Detect the architecture of the system and set the counters for MAX_VALUES
# appropriately. Ot... | |
# 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... | |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import textwrap
from typing import Iterable, Type
import pytest
from pants.backend.python import target_types_rules
from pants.backend.python.goals.setup_py import (
AmbiguousOwnerEr... | |
import timeit
from abc import abstractmethod, ABCMeta
from collections import namedtuple, OrderedDict
import inspect
from numba.core.compiler_lock import global_compiler_lock
from numba.core import errors, config, transforms, utils
from numba.core.tracing import event
from numba.core.postproc import PostProcessor
from ... | |
# Copyright 2011 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 python2.7
"""Adds a GTK status-bar icon allowing one-click control of the screensaver."""
LICENSE = """\
Copyright (c) 2012 Ian Good <ian.good@rackspace.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"... | |
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozilla.org/MPL/
#
# Softwa... | |
# Note that the dataset must be already downloaded for this script to work, do:
# $ cd data/
# $ python download_dataset.py
# quoc_trinh
import tensorflow as tf
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from sklearn import metrics
import os
import sys
import datetime
# get current... | |
# google_custom_search/models.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
# See also WeVoteServer/import_export_twitter/models.py for the code that interfaces with twitter (or other) servers
import wevote_functions.admin
from django.db import models
from config.base import get_environment_variabl... | |
import csv
import redis
from sqlalchemy.sql import exists, text
from collections import Counter
from .models import Grocery, List
from .app import db
from .decorators import timer
__CSV_FILE__ = '/Users/hannes/Downloads/groceries.csv'
def is_grocery(name):
''' Checks if grocery item exists '''
return db.ses... | |
# 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... | |
#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Enable 'with' statements in Python 2.5
from __future__ import with_statement
import os.path
import re
import subprocess
import ... | |
# -*- coding: UTF-8 -*-
import datetime
import os.path
from collections import defaultdict
from conference.models import Conference, AttendeeProfile
from django.conf import settings
from django.core.urlresolvers import reverse
from p3 import models as p3models
def conference_ticket_badge(tickets):
"""
vedi con... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.