gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# 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... | |
#
# Tool to add an OATH token to the yhsm-validation-server database.
#
# Copyright (c) 2011 Yubico AB
# See the file COPYING for licence statement.
#
import sys
import struct
import sqlite3
import argparse
import pyhsm
import pyhsm.oath_hotp
from hashlib import sha1
default_device = "/dev/ttyACM0"
default_db_file = ... | |
# Copyright 2002-2011 Nick Mathewson. See LICENSE for licensing information.
"""mixminion.MMTPClient
This module contains a single, synchronous implementation of the client
side of the Mixminion Transfer protocol. You can use this client to
upload packets to any conforming Mixminion server.
(We don't us... | |
import textwrap
import copy
from collections import OrderedDict
__all__ = ['get_header_from_yaml', 'get_yaml_from_header', 'get_yaml_from_table']
class ColumnOrderList(list):
"""
List of tuples that sorts in a specific order that makes sense for
astropy table column attributes.
"""
def sort(sel... | |
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | |
# -*- coding: utf-8 -*-
#
"""
Python library for the Withings API
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Withings Body metrics Services API
<https://developer.health.nokia.com/api>
Uses Oauth 1.0 to authentify. You need to obtain a consumer key
and consumer secret from Withings by creating an application
here: <https://... | |
#!/usr/bin/env python
#encoding:utf-8
#author:dbr/Ben
#project:tvdb_api
#repository:http://github.com/dbr/tvdb_api
#license:unlicense (http://unlicense.org/)
"""Simple-to-use Python interface to The TVDB's API (www.thetvdb.com)
Example usage:
>>> from tvdb_api import Tvdb
>>> t = Tvdb()
>>> t['Lost'][4][11]['episode... | |
# Built-in modules #
import os, platform, base64, shutil, gzip
from io import StringIO
# Internal modules #
from plumbing.common import camel_to_snake
from plumbing.cache import property_cached
from plumbing.databases.sqlite_database import SQLiteDatabase
# First party modules #
from autopaths.file_path import FilePa... | |
#!/usr/bin/env python3
# Copyright (c) 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.
"""Test compact blocks (BIP 152).
Version 1 compact blocks are pre-segwit (txids)
Version 2 compact blocks are... | |
"""
Support for Australian BOM (Bureau of Meteorology) weather service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.bom/
"""
import datetime
import ftplib
import gzip
import io
import json
import logging
import os
import re
import zipfile
impo... | |
# Lint as: python2, python3
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2016, Markus Hutzler
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# thi... | |
#
#
# Copyright (C) 2012, 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of condition... | |
"""Implementation of the musiccast media player."""
from __future__ import annotations
import logging
from aiomusiccast import MusicCastGroupException, MusicCastMediaContent
from aiomusiccast.features import ZoneFeature
import voluptuous as vol
from homeassistant.components.media_player import (
PLATFORM_SCHEMA,... | |
"""
Copyright 2020 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, software
distrib... | |
#!/usr/bin/env python3
import os
import sys
import subprocess
import struct
import optparse
import binascii
from io import BytesIO
import array
crctab = array.array('I', [
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2... | |
import unittest
from test import test_support
import operator
from sys import maxint
maxsize = test_support.MAX_Py_ssize_t
minsize = -maxsize-1
class oldstyle:
def __index__(self):
return self.ind
class newstyle(object):
def __index__(self):
return self.ind
class TrapInt(int):
def __index... | |
from __future__ import unicode_literals
from unittest import skipIf
from django.db import connection, connections
from django.db.migrations.exceptions import (
AmbiguityError, InconsistentMigrationHistory, NodeNotFoundError,
)
from django.db.migrations.loader import MigrationLoader
from django.db.migrations.recor... | |
# -*- coding: utf-8 -*-
import dedupe
import unittest
import numpy
import random
import itertools
import collections
from collections import OrderedDict
DATA = { 100 : {"name": "Bob", "age": "50"},
105 : {"name": "Charlie", "age": "75"},
110 : {"name": "Meredith", "age": "40"},
115 : {"... | |
# encoding: latin2
"""Max-P-regions
"""
__author__ = "Juan C. Duque"
__credits__ = "Copyright (c) 2009-11 Juan C. Duque"
__license__ = "New BSD License"
__version__ = "1.0.0"
__maintainer__ = "RiSE Group"
__email__ = "contacto@rise-group.org"
import copy
import numpy
import time as tm
from componentsAlg import AreaMan... | |
import clr
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import pickle
clr.AddReference('OSIsoft.AFSDK')
clr.AddReference('System.Net')
import OSIsoft.AF as AF
from PI import config
from System.Net import NetworkCredential
from tqdm import tqdm
__all__ = [
'AF',
'PIDataFrame',
'ge... | |
# ===============================================================================
# Copyright 2017 dgketchum
#
# 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... | |
"""
This module implements the main Evennia server process, the core of
the game engine.
This module should be started with the 'twistd' executable since it
sets up all the networking features. (this is done automatically
by game/evennia.py).
"""
import time
import sys
import os
if os.name == 'nt':
# For Windows... | |
# Copyright 2013-2017 DataStax, 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 writi... | |
#!/usr/bin/env python
#
#CustomScript extension
#
# Copyright 2014 Microsoft 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
#
#... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, print_function
from frappe.utils.minify import JavascriptMinify
import subprocess
import warnings
from six import iteritems, text_type
"""
Build the `public` folders and setup ... | |
import os
import time
import commands
from dircache import listdir
from glob import glob
from pUtil import tolog
from JobState import JobState
class Cleaner:
"""
This class is used to clean up lingering old/lost jobs.
The clean-up criteria is that for a found Panda job directory,
if the pilotlog.txt ha... | |
# -*- coding: utf-8 -*-
"""This is rule-based deduction system for SymPy
The whole thing is split into two parts
- rules compilation and preparation of tables
- runtime inference
For rule-based inference engines, the classical work is RETE algorithm [1],
[2] Although we are not implementing it in full (or even si... | |
from __future__ import unicode_literals
import requests
import time
from bs4 import BeautifulSoup
from datetime import datetime, timedelta
from decimal import Decimal
from .exceptions import (
PageError, DisambiguationError, RedirectError, HTTPTimeoutError,
WikipediaException, ODD_ERROR_MESSAGE)
from .util import... | |
# Copyright 2020 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,... | |
import gc
import sys
import time
import logging
from ctypes import *
import numpy as np
from numpy.ctypeslib import ndpointer
from .backend import Backend
log = logging.getLogger(__name__)
cudart = cdll.LoadLibrary("libcudart.so")
cusparse = cdll.LoadLibrary("libcusparse.so")
cufft = cdll.LoadLibrary("libcufft... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 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 m... | |
# -*- 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... | |
from __future__ import unicode_literals
from calendar import monthrange
import datetime
try:
from django.core.urlresolvers import reverse
except ImportError:
from django.urls import reverse
from django.utils.six.moves import xrange
from .event_factory import create_event, SetMeUp
class BiweeklyRepeatingChu... | |
import functools
from binascii import hexlify
from typing import List, Tuple, Sequence
import ledger.merkle_tree as merkle_tree
from ledger.hash_stores.hash_store import HashStore
from ledger.hash_stores.memory_hash_store import MemoryHashStore
from ledger.tree_hasher import TreeHasher
from ledger.util import Consiste... | |
#!/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... | |
# -*- coding: utf-8 -*-
#
import warnings
import numpy
from . import color as mycol
def draw_legend(data, obj):
'''Adds legend code.
'''
texts = []
children_alignment = []
for text in obj.texts:
texts.append('%s' % text.get_text())
children_alignment.append('%s' % text.get_horizo... | |
import warnings
from collections import namedtuple
from MySQLdb.constants import FIELD_TYPE
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.db.models.indexes import Index
from django.utils.datastructures import OrderedSet
from django.utils.depreca... | |
#!/usr/bin/env python
"""
Package for interfacing with the Dark Energy Survey (DES) wikis.
Currently supports Redmine access through the `DESRedmine` class.
"""
import os
import sys
import re
import requests
import getpass
import logging
from collections import OrderedDict as odict
# The python-redmine API changes ... | |
# 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 sys
import asyncio
import pulsar
from pulsar.utils.internet import nice_address, format_address
from .futures import multi_async, task, Future, ensure_future
from .events import EventHandler, AbortEvent
from .mixins import FlowControl, Timeout
__all__ = ['ProtocolConsumer',
'Protocol',
... | |
"""
Implement -f aka looponfailing for py.test.
NOTE that we try to avoid loading and depending on application modules
within the controlling process (the one that starts repeatedly test
processes) otherwise changes to source code can crash
the controlling process which should best never happen.
""... | |
#!/usr/bin/env python2.7
# Copyright 2015 gRPC 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 la... | |
#!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Run Regression Test Suite
This module calls down into individual test cases via subprocess. It will
forwa... | |
import collections
import functools
from itertools import chain, combinations, imap, count
import math
from operator import mul
from fractions import gcd
import random
import numpy as np
MILLION = 1000000
BILLION = 1000000000
PHI = 0.5 + 0.5 * np.sqrt(5)
def product(list):
return functools.reduce(mul, list, 1)
... | |
from .leaderboard import Leaderboard
from .leaderboard import grouper
from redis import StrictRedis, Redis, ConnectionPool
import math
class TieRankingLeaderboard(Leaderboard):
DEFAULT_TIES_NAMESPACE = 'ties'
def __init__(self, leaderboard_name, **options):
'''
Initialize a connection to a sp... | |
from typing import Dict
from CommonServerPython import * # noqa: E402 lgtm [py/polluting-import]
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
# CONSTANTS
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
class pXScoring:
"""
Class to handle all current and future scoring for PerimeterX object... | |
# 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... | |
'''
Linux file chooser
------------------
'''
from plyer.facades import FileChooser
from distutils.spawn import find_executable as which
import os
import subprocess as sp
import time
class SubprocessFileChooser(object):
'''A file chooser implementation that allows using
subprocess back-ends.
Normally you... | |
#!/usr/bin/env python3
#
# Copyright (c) 2016 Supreeth Herle
#
# 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... | |
"""The tests for the emulated Hue component."""
import json
import unittest
from aiohttp.hdrs import CONTENT_TYPE
import defusedxml.ElementTree as ET
import requests
from homeassistant import const, setup
from homeassistant.components import emulated_hue
from homeassistant.components.emulated_hue import upnp
from hom... | |
# 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... | |
#!/usr/bin/env vpython3
# Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import io
import os
import sys
import tempfile
import unittest
# Mutates sys.path.
import test_env
# third_party/
from d... | |
import struct
import time
import cherrypy
from cherrypy._cpcompat import basestring, BytesIO, ntob, set, unicodestr
from cherrypy.lib import file_generator
from cherrypy.lib import set_vary_header
def decode(encoding=None, default_encoding='utf-8'):
"""Replace or extend the list of charsets used to decode a requ... | |
# -*- coding: utf-8 -*-
import os
import urllib
import uuid
from pymongo import MongoClient
import requests
from framework.mongo.utils import to_mongo_key
from website.models import Node
from website.addons.wiki import settings as wiki_settings
from website.addons.wiki.exceptions import InvalidVersionError
def gen... | |
from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectio... | |
"""Test check_config script."""
import asyncio
import logging
import os
import unittest
import homeassistant.scripts.check_config as check_config
from tests.common import patch_yaml_files, get_test_config_dir
_LOGGER = logging.getLogger(__name__)
BASE_CONFIG = (
'homeassistant:\n'
' name: Home\n'
' lat... | |
# PLAN
# for each GNS placename shapefile
# for each year
# add relationship to gaul adm3 for that year
# add relationship to gaul adm2 for that year
# add relationship to gaul adm1 for that year
# add relationship to gaul country for that year
# for each gaul country relationship
# save as... | |
from datetime import date, datetime, timedelta
from itertools import permutations
import logging
"""
The str(f|p)time format for ISO datetime strings with minute-precision and the
expected length for such strings.
"""
ISO_FORMAT = '%Y-%m-%dT%H:%M'
ISO_FORMAT_LEN = 16
class Parser:
"""
Provides methods for conv... | |
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from datetime import timedelta, datetime
import json
import pytz
from django.test import TestCase, Client, override_settings
from django.contrib.auth.models import User
from django.core import mail
from django.core.management import call_command
from ... | |
"""A library of helper functions for the CherryPy test suite."""
import datetime
import logging
log = logging.getLogger(__name__)
import os
thisdir = os.path.abspath(os.path.dirname(__file__))
serverpem = os.path.join(os.getcwd(), thisdir, 'test.pem')
import unittest
import re
import sys
import time
import warnings
i... | |
# Copyright (c) 2015, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import (integer, boolean, s3_bucket_name, notification_type,
notification_event, json_checker, task_type,
... | |
# Copyright 2017, Major Hayden <major@mhtx.net>
#
# 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... | |
# -*- 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... | |
# -*- coding: utf-8 -*-
import operator
from copy import deepcopy
from operator import itemgetter
from typing import Callable, Iterable, List, Dict
from alamo_common.parser.exceptions import ParseResultError
class BaseOperator(object):
def __repr__(self):
return '{}({})'.format(self.__class__.__name__, ... | |
import re
import socket
import struct
from threading import Thread
import traceback
import time
from src.connection.connection import Connection
from src.connection.websocket import WebSocket
from src.helpers import websocket_helper
from src.logic.file_transfer import FileTransfer
from src.utility.exceptions import P... | |
import os
import re
import traceback
import requests
import zipfile
from xml.dom import minidom
from tempfile import NamedTemporaryFile
from urlparse import urljoin
from django.conf import settings
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.core.mail import mail_admins
from django.uti... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from tkinter import *
from tkinter.ttk import *
import suapp.jandw
import suapp.simple_json as simple_json
from suapp.logdecorator import *
# Extra widgets
class MultiListbox(Frame):
def __init__(self, master, lists):
Frame.__init__(self, master)
s... | |
import runStatus
import logSetup
import logging
import gc
import time
import os
import multiprocessing
import signal
import logging
import logSetup
import cProfile
import traceback
import threading
import sys
import queue
# from pympler.tracker import SummaryTracker, summary, muppy
# import tracemalloc
import sqlal... | |
from django.contrib.auth.models import AnonymousUser
from django.contrib.sessions.middleware import SessionMiddleware
from django.core.urlresolvers import reverse
from django.http import QueryDict
from django.test.client import Client, RequestFactory
from django_facebook import exceptions as facebook_exceptions, \
... | |
"""
Copyright 2020, CCL Forensics
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sub... | |
# 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 2015-2018 Capital One Services, LLC
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import sys
import types
from .azure_common import BaseTest, DEFAULT_SUBSCRIPTION_ID
from c7n_azure.tags import TagHelper
from c7n_azure.utils import (AppInsightsHelper, ManagedGroupHelper, Mat... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 17 16:59:50 2015
@author: moph8ia2
"""
import random
import numpy as np
import os
import sys
import time
def anyarg(listing,test):
for elem in listing:
if elem == test:
return True
return False
def naivesum(a):
b = np.float64(0.0)
fo... | |
"""
Images Pipeline
See documentation in topics/media-pipeline.rst
"""
import functools
import hashlib
import six
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
from PIL import Image
from scrapy.utils.misc import md5sum
from scrapy.utils.python import to_bytes
from... | |
#!/usr/bin/env python
# $Rev$
# $URL$
# Imported from //depot/prj/plan9topam/master/code/plan9topam.py#4 on
# 2009-06-15.
"""Command line tool to convert from Plan 9 image format to PNG format.
Plan 9 image format description:
http://plan9.bell-labs.com/magic/man2html/6/image
"""
# http://www.python.org/doc/2.3.5/l... | |
# -*- 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 'FileBlobIndex'
db.create_table(
'sentry_filebl... | |
#
# 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... | |
"""
ADDED CONSTRAINT: density > 10^4
(actually, density > dust-derived mean density, or 10^3, whichever is higher)
For each of the fitted spectra from individual_spectra.py, use the fitted ratio
(and appropriate ancillary data, e.g. h2 column) to derive the best fit
temperature, etc.
Store them in an output table and... | |
from django.contrib.auth import get_user_model
from django.core.exceptions import ImproperlyConfigured
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIRequestFactory
from oauth_api.models import get_application_model, AuthorizationCode, AccessToken
from oauth_api.t... | |
"""
Functions
---------
.. autosummary::
:toctree: generated/
line_search_armijo
line_search_wolfe1
line_search_wolfe2
scalar_search_wolfe1
scalar_search_wolfe2
"""
from __future__ import division, print_function, absolute_import
from scipy.optimize import minpack2
import numpy as np
from scip... | |
import pytest
from mock import Mock
import six
from thefuck.utils import default_settings, \
memoize, get_closest, get_all_executables, replace_argument, \
get_all_matched_commands, is_app, for_app, cache, compatibility_call
from tests.utils import Command
@pytest.mark.parametrize('override, old, new', [
... | |
#!/usr/bin/env python
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import os
import platform
import subprocess
import... | |
from collections import namedtuple
import numpy as np
from . import distributions
__all__ = ['_find_repeats', 'linregress', 'theilslopes']
LinregressResult = namedtuple('LinregressResult', ('slope', 'intercept',
'rvalue', 'pvalue',
... | |
# Copyright 2021 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, ... | |
# from binaryninja import *
import os
import webbrowser
import time
import sys
from pathlib import Path
from urllib.request import pathname2url
from binaryninja.interaction import get_save_filename_input, show_message_box, TextLineField, ChoiceField, SaveFileNameField, get_form_input
from binaryninja.settings import S... | |
#!/usr/bin/env python
# Copyright (c) 2012, AT&T Labs, Yun Mao <yunmao@gmail.com>
# 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... | |
##########################################################################
#
# Copyright (c) 2013-2015, Image Engine Design Inc. All rights reserved.
# Copyright (c) 2015, Nvizible Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided... | |
#!/usr/bin/env python
import unittest
from testtools import *
import sys
arg = None
def sa_call(method_name, params=[], user_name='alice'):
if arg in ['-v', '--verbose']:
verbose = True
else:
verbose = False
return api_call(method_name, 'sa/2', params=params, user_name=user_name, verbose=... | |
# Test packages (dotted-name import)
import sys
import os
import tempfile
import textwrap
import unittest
from test import test_support
# Helpers to create and destroy hierarchies.
def cleanout(root):
names = os.listdir(root)
for name in names:
fullname = os.path.join(root, name)
if os.path.... | |
from flask import *
from flask.json import JSONEncoder
from flask.ext.cors import CORS
from flask.ext.login import LoginManager, login_user , logout_user , current_user , login_required
from werkzeug.contrib.fixers import ProxyFix
import simplejson as json
import os, sys
import datetime
app = Flask(__name__, static_u... | |
from abc import ABCMeta, abstractmethod
from collections import namedtuple
import hashlib
from textwrap import dedent
import warnings
from logbook import Logger
import numpy
import pandas as pd
from pandas import read_csv
import pytz
import requests
from six import StringIO, iteritems, with_metaclass
from catalyst.er... | |
"""Tkinker gui for pylint"""
import os
import sys
import re
import Queue
from threading import Thread
from Tkinter import (Tk, Frame, Listbox, Entry, Label, Button, Scrollbar,
Checkbutton, Radiobutton, IntVar, StringVar)
from Tkinter import (TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH, SUNKEN, W,
... | |
from __future__ import unicode_literals, division, absolute_import
import logging
import urllib
import os
import posixpath
from datetime import datetime, timedelta
import random
import xml.etree.ElementTree as ElementTree
from sqlalchemy import Column, Integer, Float, String, Unicode, Boolean, DateTime, func
from sql... | |
##
# Copyright (c) 2011-2015 Apple 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 l... | |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_str,
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
determine_ext,
extract_attributes,
ExtractorError,
float_or_none,
int_or_none,
... | |
from __future__ import absolute_import, division, print_function
from operator import attrgetter
import os
import re
import subprocess
from itertools import chain
from collections import Iterator
from datetime import datetime, date
from distutils.spawn import find_executable
import pandas as pd
import sqlalchemy as ... | |
# 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 a... | |
#!/usr/bin/env python
# encoding: utf-8
################################################################################
#
# ChemPy - A chemistry toolkit for Python
#
# Copyright (c) 2012 by Joshua W. Allen (jwallen@mit.edu)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.