gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# coding: utf-8
"""Wrappers for forwarding stdout/stderr over zmq"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import atexit
from binascii import b2a_hex
from collections import deque
try:
from importlib import lock_h... | |
# coding=utf-8
"""
Implements PowerManagement functions using /sys/class/power_supply/*
See doc/linux for platform-specific details.
"""
import os
import warnings
from power import common
POWER_SUPPLY_PATH = '/sys/class/power_supply'
if not os.access(POWER_SUPPLY_PATH, os.R_OK):
raise RuntimeError("Unable to re... | |
# -*- test-case-name: vumi.persist.tests.test_riak_manager -*-
"""A manager implementation on top of the riak Python package."""
import json
from riak import RiakClient, RiakObject, RiakMapReduce, RiakError
from vumi.persist.model import Manager, VumiRiakError
from vumi.utils import flatten_generator
def to_unico... | |
# -*- coding: utf-8 -*-
import mock
import unittest
from nose.tools import * # noqa
from github3 import GitHubError
from github3.repos import Repository
from tests.base import OsfTestCase
from tests.factories import UserFactory, ProjectFactory
from framework.auth import Auth
from website.addons.github.exceptions ... | |
import re
import sys
from re import sub
for path in sys.path:
if path and 'anaconda' in path:
sys.path.remove(path)
import numpy as np
from pybedtools import *
from pyfaidx import Fasta
import subprocess, os, shutil
from collections import *
import time
import dill as pickle
#from multiprocessing import Po... | |
from unittest import TestCase
from iota import Address, Fragment, ProposedBundle, ProposedTransaction, Tag, \
TryteString
from iota.crypto.signing import KeyGenerator
from iota.crypto.types import Seed
from iota.transaction.types import BundleHash
class ProposedBundleTestCase(TestCase):
def setUp(self):
supe... | |
from __future__ import unicode_literals
import datetime
import uuid
from django.conf import settings
from django.core.exceptions import FieldError
from django.db import utils
from django.db.backends import utils as backend_utils
from django.db.backends.base.operations import BaseDatabaseOperations
from django.db.mode... | |
import traceback
from binascii import hexlify
#from cancat.j1939 import *
# we can move things into here if we decide this replaces the exiting j1939 modules
import cancat
import struct
from cancat.J1939db import *
from cancat import *
from cancat.vstruct.bitfield import *
import queue
import threading
'''
This is a... | |
# -*- coding: utf-8
"""The connections.py module allows for the creation of an app
which will contain required information for the API. It also
allows for the storage of login information for authentication.
"""
from __future__ import absolute_import, print_function
try:
import xml.etree.cElementTree as ET
except... | |
# Python stubs generated by omniidl from /usr/local/share/idl/omniORB/compression.idl
# DO NOT EDIT THIS FILE!
import omniORB, _omnipy
from omniORB import CORBA, PortableServer
_0_CORBA = CORBA
_omnipy.checkVersion(4,2, __file__, 1)
try:
property
except NameError:
def property(*args):
return None
... | |
# Copyright 2015 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | |
# -*- coding: utf-8 -*-
"""
pyvisa.ctwrapper.highlevel
~~~~~~~~~~~~~~~~~~~~~~~~~~
Highlevel wrapper of the VISA Library.
This file is part of PyVISA.
:copyright: 2014 by PyVISA Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
from __future__ import divi... | |
<<<<<<< HEAD
<<<<<<< HEAD
#
# Emulation of has_key() function for platforms that don't use ncurses
#
import _curses
# Table mapping curses keys to the terminfo capability name
_capability_names = {
_curses.KEY_A1: 'ka1',
_curses.KEY_A3: 'ka3',
_curses.KEY_B2: 'kb2',
_curses.KEY_BACKSPACE: 'kbs',
... | |
"""
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, University of California, Berkeley
# All rights reserved.
# Authors: Cameron Lee (cameronlee@berkeley.edu) and Dmitry Berenson (
berenson@eecs.berkeley.edu)
#
# Redistribution and use in source and binary forms, with or without
# modification, are p... | |
"""Alexa configuration for Home Assistant Cloud."""
import asyncio
from contextlib import suppress
from datetime import timedelta
import logging
import aiohttp
import async_timeout
from hass_nabucasa import Cloud, cloud_api
from homeassistant.components.alexa import (
DOMAIN as ALEXA_DOMAIN,
config as alexa_c... | |
from .constants import MILLI_MICROS,SECOND_MICROS,MINUTE_MICROS,HOUR_MICROS,MEAN_DAY_MICROS,MEAN_WEEK_MICROS,MEAN_MONTH_MICROS,MEAN_YEAR_MICROS,HALF_MILLI_MICROS,HALF_SECOND_MICROS,HALF_MINUTE_MICROS,HALF_HOUR_MICROS,HALF_MEAN_DAY_MICROS,HALF_MEAN_WEEK_MICROS,HALF_MEAN_MONTH_MICROS,HALF_MEAN_YEAR_MICROS
import time
TR... | |
#
# Copyright (c) SAS Institute 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 w... | |
"""
This collection of functions scrapes Box Office Returns at the
weekly, weekend, and daily levels from a film's page on Box Office Mojo.
Last Edit: March, 2017
"""
import requests
from bs4 import BeautifulSoup
import re
import dateutil.parser
from string import ascii_uppercase
import pandas as pd
# import pickle
i... | |
import random
import string
import sys
from typing import (
Callable,
Iterable,
List,
Set,
)
from unittest import skip
from darglint.token import (
TokenType,
Token,
)
from darglint.config import (
get_config,
Configuration,
)
REFACTORING_COMPLETE = True
def require_python(major=3, ... | |
# -*- coding: utf-8 -*-
"""DataFrame client for InfluxDB."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import math
from collections import defaultdict
import pandas as pd
import numpy as np
from .client import... | |
import pytest
from awx.api.versioning import reverse
from awx.main.models.mixins import WebhookTemplateMixin
from awx.main.models.credential import Credential, CredentialType
@pytest.mark.django_db
@pytest.mark.parametrize(
"user_role, expect", [
('superuser', 200),
('org admin', 200),
('... | |
from datetime import datetime
from functools import partial
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.utils.timezone import get_current_timezone
from django.utils.timezone import make_aware
from elasticutils import F
from freezegun import freeze_time
from demo_esutils... | |
import os
import ply.lex as lex
import ply.yacc as yacc
from .lexer import *
from .nodes import *
from . import report
start = "spec_file"
def push_parent(p, node):
parents = getattr(p.parser, "parents")
parents.append(node)
def pop_parent(p):
parents = getattr(p.parser, "parents")
top = parents[-1]... | |
#!/usr/bin/python
# Copyright (c) 2006-2013, 2015 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.
# Usage:
#
# $ ./make_new_branch.py --help
#
# Also:
#
# $ ./make_new_branch.py |& tee 2012.08.03.make_new_branch.txt
#
'''
# 2012.08.08: Making leafy branch is finally pretty qui... | |
# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2014 Sippy Software, Inc. All rights reserved.
#
# 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. Redistrib... | |
# Copyright 2019, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
from PySide import QtGui, QtCore
from cdat.Base import BaseOkWindow
from cdat import axis_preview
from cdat.DictEdit import DictEditor
import vcs
class AxisEditorWidget(BaseOkWindow.BaseOkWindowWidget):
def __init__(self, axis, parent=None):
super(AxisEditorWidget, self).__init__()
self.axis = axi... | |
#!/usr/bin/env python3
#
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Download or build previous releases.
# Needs curl and tar to download a release, or the build depend... | |
# Copyright(c) 2014, The scLVM developers (Forian Buettner, Paolo Francesco Casale, Oliver Stegle)
#
#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... | |
"""
Views for financialaid
"""
import json
from functools import reduce
from django.conf import settings
from django.contrib.auth.mixins import UserPassesTestMixin
from django.contrib.auth.models import User
from django.db.models import F, Q
from django.views.generic import ListView
from rest_framework.authentication ... | |
from __future__ import print_function, division
from sympy.core.singleton import S
from sympy.core.function import Function
from sympy.core import Add
from sympy.core.evalf import get_integer_part, PrecisionExhausted
from sympy.core.numbers import Integer
from sympy.core.relational import Gt, Lt, Ge, Le
from sympy.cor... | |
# pylint: disable=C0302,R0204
'''
RESTful API for MyTardis models and data.
Implemented with Tastypie.
.. moduleauthor:: Grischa Meyer <grischa@gmail.com>
'''
import json
from django.conf import settings
from django.conf.urls import url
from django.contrib.auth.models import AnonymousUser
from django.contrib.auth.mod... | |
'''
python-mtdev - Python binding to the mtdev library (MIT license)
The mtdev library transforms all variants of kernel MT events to the
slotted type B protocol. The events put into mtdev may be from any MT
device, specifically type A without contact tracking, type A with
contact tracking, or type B with contact trac... | |
# coding=utf-8
# Copyright 2022 The Tensor2Tensor 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... | |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.2'
# jupytext_version: 1.2.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %%
# %matplotlib in... | |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import numpy as np
from .axes_divider import make_axes_locatable, Size, locatable_axes_factory
import sys
from .mpl_axes import Axes
def make_rgb_axes(ax, pad=0.01, axes_class=None, add_all=True):... | |
#!/usr/bin/env
"""
GOA_Winds_NARR_model_prep.py
Retrieve NARR winds for two locations:
GorePoint - 58deg 58min N, 150deg 56min W
and Globec3 59.273701N, 148.9653W
Filter NARR winds with a triangular filter (1/4, 1/2, 1/4) and output every 3hrs
Provide U, V
Save in EPIC NetCDF standard
"""
#System St... | |
import abc
import os
from hashlib import md5, sha1
import hkdf
from Crypto.Cipher import AES, ARC4, ChaCha20, ChaCha20_Poly1305, Salsa20
class BaseCipher:
def __init__(self, password: str):
self.master_key = self._get_key(password.encode("ascii", "ignore"))
def _get_key(self, password: bytes, salt: ... | |
# Copyright 2014 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 ... | |
from __future__ import unicode_literals
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import NoReverseMatch
from django.template.defaultfilters import date
from django.utils import six
from django.utils.html import (conditional_escape, escape, format_html,
... | |
# coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import re
import os
import ast
import _ast
import textwrap
import CommonMark
from collections import OrderedDict
cur_dir = os.path.dirname(__file__)
project_dir = os.path.abspath(os.path.join(cur_dir, '..'))
docs_dir ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/server/pylibc.py
#
# 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, th... | |
# Copyright (c) 2012 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | |
# -*- coding: utf-8 -*-
import datetime
import sys
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
#from ietf.person.models import Person
Person = orm['person.Person']
# can not use custom ma... | |
# -*- coding: utf-8 -*-
# Copyright 2014 Mirantis, 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 requi... | |
'''
create pwmCss, pwmAuth
define fitness
initPopulation as randomized
scoring
'''
import random
import threading
import time
from libgenetic.libgenetic import EvolutionBasic, Selections, Crossovers, Mutations, Generation, GABase
from libgenetic.pwm import PWM
import numpy as np
BASES_MAP = {0:'A', 1:'C', 2:'G', 3:'... | |
#
# ppo.py, doom-net
#
# Created by Andrey Kolishchak on 01/21/17.
#
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from device import device
from collections import namedtuple
from ppo_base import PPOBase
import random
class Cells:
def __init__(self, cell... | |
# -*- coding: utf-8 -*-
"""
Test aspects to allow fine grained control over what tests are executed.
Several parts of the test infrastructure are implemented as mixins,
such as API result caching and excessive test durations. An unused
mixin to show cache usage is included.
"""
#
# (C) Pywikibot team, 2014-2015
#
# ... | |
# -*- coding: utf-8 -*-
""" Sahana Eden Procurement Model
@copyright: 2009-2013 (c) Sahana Software Foundation
@license: MIT
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 w... | |
"""The tests for the Owntracks device tracker."""
import asyncio
import json
import unittest
from unittest.mock import patch
from tests.common import (
assert_setup_component, fire_mqtt_message, mock_coro, mock_component,
get_test_home_assistant, mock_mqtt_component)
import homeassistant.components.device_trac... | |
# -*- coding: utf-8 -*-
"""
"""
import unittest
from datetime import datetime
from decimal import Decimal
from unittest.mock import patch
from vulyk.app import TASKS_TYPES
from vulyk.blueprints.gamification import listeners
from vulyk.blueprints.gamification.core.rules import Rule
from vulyk.blueprints.gamification.co... | |
import sqlalchemy as sa
from sqlalchemy.ext import compiler as sa_compiler
from sqlalchemy.schema import DDLElement
from .compat import string_types
def _check_if_key_exists(key):
return isinstance(key, sa.Column) or key
def get_table_attributes(preparer,
diststyle=None,
... | |
# Open mode AP tests
# Copyright (c) 2014, Qualcomm Atheros, Inc.
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import logging
logger = logging.getLogger()
import struct
import subprocess
import time
import os
import hostapd
import hwsim_utils
from tshark impo... | |
import time
import sys
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException, NoAlertPresentException, UnexpectedAlertPresentException
from selenium.common.exceptions import ElementClickInterceptedException
from knitter.configure im... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# (c) Copyright 2013-2015 Hewlett Packard Enterprise Development LP
# 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 ... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Blog.block_other_4'
db.delete_column('blogs_blog', 'block_other_4')
# Deleting fi... | |
# Copyright 2015, 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 applicable law or agreed to in ... | |
# Copyright 2020, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
"""
sphinx.ext.imgmath
~~~~~~~~~~~~~~~~~~
Render math in HTML via dvipng or dvisvgm.
:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import posixpath
import re
import shutil
import subprocess
import sys
import tempfile
from os import pa... | |
"""
TODO
"""
import abc, os
import tensorflow as tf
import numpy as np
from .misc_utils import get_logger
logger = get_logger(__name__)
class Model(metaclass=abc.ABCMeta):
"""
TODO
"""
def __init__(self):
self.is_trained = False
@abc.abstractmethod
def train(self, feature_tensor, corr... | |
import unittest
import numpy as np
import numpy.testing as np_test
from pgmpy.inference import VariableElimination
from pgmpy.inference import BeliefPropagation
from pgmpy.models import BayesianModel
from pgmpy.models import JunctionTree
from pgmpy.factors import TabularCPD
from pgmpy.factors import Factor
class Test... | |
#!/usr/bin/env python
import math
import random
import pygame
import pygame.color as color
import boid
import mapparser as mp
from prm import PRMGenerator
class Configuration:
"""
Static class that holds important global variables
"""
## Dimensions of the screen
dim = xSize, ySize = 1000, 600
... | |
import contextlib
import datetime
import uuid
import sqlalchemy as sa
from sqlalchemy import Date
from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import orm
from sqlalchemy import select
from sqlalchemy import String
from sqlalc... | |
# Copyright 2014 Treode, 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 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... | |
from pandas.compat import range
import re
import operator
import warnings
from numpy import nan
import numpy as np
from pandas import _np_version_under1p8
from pandas.sparse.api import SparseArray
from pandas._sparse import IntIndex
from pandas.util.testing import assert_almost_equal, assertRaisesRegexp
import pandas... | |
#!/usr/bin/env python
#
# TODO:
# - Task colors:
# - User-defined using config file.
# - Automagically chosen from color space.
# - Advanced algorithm (contact Hannes Pretorius).
# - Koos' specs:
# - Resources and tasks sorted in read-in order (default)
# or alphabetically (flag).
# - Have pro... | |
# 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 writin... | |
# 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 a... | |
# 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, ... | |
#
# io_rgb.py -- RGB image file handling.
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from __future__ import print_function
import sys, time
import os
import numpy
... | |
# -*- coding: utf-8 -*-
import os
import numpy as np
import logging
from PyMca5.PyMcaIO import ConfigDict
from ..io import localfs
from ..io import spe
from ..utils import subprocess
logger = logging.getLogger(__name__)
def proc_result(args, out, err, returncode):
success = returncode == 0
if not success:
... | |
import sqlite3
import os
try:
import json
except ImportError:
import simplejson as json
import sys
import xml.sax
import binascii
from vincenty import vincenty
from struct import pack, unpack
from rtree import Rtree
def cons(ary):
for i in range(len(ary)-1):
yield (ary[i], ary[i+1])
def pack_coord... | |
import os
import re
import subprocess
import sys
from dcr.scenario_utils.distro import get_distro
BASE_CGROUP = '/sys/fs/cgroup'
AGENT_CGROUP_NAME = 'WALinuxAgent'
AGENT_SERVICE_NAME = "walinuxagent.service"
CONTROLLERS = ['cpu'] # Only verify the CPU controller since memory accounting is not enabled yet.
DAEMON_CM... | |
# Copyright 1996-2015 PSERC. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
from warnings import warn
from numpy import array, ones, zeros, Inf, r_, c_, concatenate, shape
from numpy import flatnonzero as find
from scipy.sparse import spdiag... | |
# Copyright 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | |
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
"""Add audit permissions.
Revision ID: 904377398db
Revises: 4838619603a
Create... | |
"""
Arithmetic operations for PandasObjects
This is not a public API.
"""
# necessary to enforce truediv in Python 2.X
from __future__ import division
import operator
import warnings
import numpy as np
import pandas as pd
import datetime
from pandas import compat, lib, tslib
import pandas.index as _index
from pandas.u... | |
#
# The Python Imaging Library.
# $Id$
#
# EPS file handling
#
# History:
# 1995-09-01 fl Created (0.1)
# 1996-05-18 fl Don't choke on "atend" fields, Ghostscript interface (0.2)
# 1996-08-22 fl Don't choke on floating point BoundingBox values
# 1996-08-23 fl Handle files from Macintosh (0.3)
# 2001-02-17 fl ... | |
#
# 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
# ... | |
#!/usr/bin/env python
from __future__ import print_function
import logging
import os
import subprocess
import textwrap
import warnings
from datetime import datetime
import argparse
from builtins import input
from collections import namedtuple
from dateutil.parser import parse as parsedate
import json
import daemon
fr... | |
#
# Copyright 2012 eNovance <licensing@enovance.com>
# Copyright 2012 Red Hat, Inc
# Copyright 2014 Cisco 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.apac... | |
#! /usr/bin/env python2
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicabl... | |
import pexpect
import argparse
s_imports="""
import os
import signal
import datetime
import SocketServer
import socket
import threading
import Queue
import sys
import time
import subprocess
import re
"""
exec s_imports
# -tp targetPort -sh sshHost -lp listenPort [-su sshUser] [-sp sshPort] [-sw sshPassword] [--force]... | |
# Copyright (C) 2010-2013 Claudio Guarnieri.
# Copyright (C) 2014-2016 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
# Originally contributed by Check Point Software Technologies, Ltd.
import logging
import os
import subpro... | |
from office365.runtime.client_result import ClientResult
from office365.runtime.client_value_collection import ClientValueCollection
from office365.runtime.queries.service_operation_query import ServiceOperationQuery
from office365.runtime.paths.resource_path import ResourcePath
from office365.runtime.paths.service_ope... | |
#
# 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... | |
import datetime
import re
from firebase import firebase
import ENV_VAR as ENV
import timezone_handler as tz
# fb = firebase.FirebaseApplication("https://burning-heat-7654.firebaseio.com/", None)
fb = firebase.FirebaseApplication(ENV.FIREBASE_LINK, None)
# _YES = ["yes", "Yes", "YES", "Y", "y"]
# _NO = ["no", "No", "... | |
import mdp
# import numeric module (scipy, Numeric or numarray)
numx, numx_rand, numx_linalg = mdp.numx, mdp.numx_rand, mdp.numx_linalg
numx_description = mdp.numx_description
import random
import itertools
def timediff(data):
"""Returns the array of the time differences of data."""
# this is the fastest way... | |
# -*- coding: utf-8 -*-
import datetime
import math
from flask import current_app
from models import (
Achievement,
Coupon,
GlobalStatistics,
Level,
LevelInstanceUser,
LevelStatistics,
Organization,
OrganizationAchievement,
OrganizationCoupon,
OrganizationLevel,
Organizati... | |
"""
Key bindings which are also known by GNU Readline by the given names.
See: http://www.delorie.com/gnu/docs/readline/rlman_13.html
"""
from __future__ import unicode_literals
from six.moves import range
import six
from .completion import generate_completions, display_completions_like_readline
from prompt_toolkit.d... | |
"""The tests for the Unifi WAP device tracker platform."""
from unittest import mock
from datetime import datetime, timedelta
import pytest
import voluptuous as vol
import homeassistant.util.dt as dt_util
from homeassistant.components.device_tracker import DOMAIN
import homeassistant.components.unifi.device_tracker a... | |
from collections import defaultdict
from json import JSONEncoder
import logging
import hashlib
class Node(object):
APPENDIX = u'appendix'
INTERP = u'interp'
REGTEXT = u'regtext'
SUBPART = u'subpart'
EMPTYPART = u'emptypart'
INTERP_MARK = 'Interp'
def __init__(self, text='', children=[],... | |
from unittest import TestCase
import simplejson as json
from qrl.core import config
from qrl.core.Indexer import Indexer
from qrl.core.State import State
from qrl.core.StateContainer import StateContainer
from qrl.core.misc import logger
from qrl.core.OptimizedAddressState import OptimizedAddressState
from qrl.core.M... | |
# Copyright (c) 2012 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.
"""Generic utils."""
import codecs
import cStringIO
import datetime
import logging
import os
import pipes
import platform
import Queue
import re
import ... | |
from __future__ import annotations
from typing import cast
import warnings
import numpy as np
from pandas._libs.lib import (
NoDefault,
no_default,
)
from pandas._libs.missing import is_matching_na
import pandas._libs.testing as _testing
from pandas.core.dtypes.common import (
is_bool,
is_categorica... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Openstack, LLC
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 ... | |
from __future__ import print_function
import os
import sys
from six.moves import range
md = os.path.abspath(os.path.split(__file__)[0])
sys.path = [os.path.join(md, '..', '..', 'util')] + sys.path
dataFile = "../../atlas/CochlearNucleus/images/cochlear_nucleus.ma"
labelFile = "../../atlas/CochlearNucleus/images/coch... | |
import requests
import logging
from concurrent.futures import ThreadPoolExecutor
from pybitx import __version__
import pandas as pd
import json
log = logging.getLogger(__name__)
# --------------------------- constants -----------------------
class BitXAPIError(ValueError):
def __init__(self, response):
... | |
"""Manifest validation."""
from __future__ import annotations
from pathlib import Path
from urllib.parse import urlparse
from awesomeversion import (
AwesomeVersion,
AwesomeVersionException,
AwesomeVersionStrategy,
)
import voluptuous as vol
from voluptuous.humanize import humanize_error
from homeassista... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.