gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright (c) 2001-2007 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An epoll() based implementation of the twisted main loop.
To install the event loop (and you should do this before any connections,
listeners or connectors are added)::
from twisted.internet import epollreactor
epollreactor... | |
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
## console.py
import cmd
import helper
import helpernmap
import os
import readline
from helper import *
banner ='\033[0;36m'+'''
================================================
_ _ _____ _____ _
| \ | |/ ___|| ___| | |
| \| |\ `--. | |__ __ _ _ __ ___ |... | |
# Meme: a fast mind-mapping tool
# (c) 2010 Jamie Webb - MIT license
import math, sys, pygtk, gtk, pango, cairo, random, time
class Renderer(object):
def __init__(self, style, canvas, window, w, h):
self._style = style
self._canvas = canvas
self._window = window
self._zoom = 1
self._pixmap = self._make_pix... | |
from __future__ import print_function
import os
import subprocess,os.path
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Circle
from matplotlib.collections import LineCollection
from shapely import geometry
from . import field
from ..utils import point_in_polygon
def plot_geo(ge... | |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
import pandas as pd
from functools import partial
from math import sqrt
from multiprocessing import Pool
from typing import Callable, Optional
AVAILABLE_METRICS = ['mse', 'rmse', 'mape', 'smape', 'mase', 'rmsse',
'mini_owa', 'pinball_loss'... | |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | |
# -*- coding: utf-8 -*-
# Copyright 2009-2013, Peter A. Bigot
#
# 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... | |
from __future__ import absolute_import, unicode_literals
import math
import re
import django
from django import forms
from django.core.exceptions import ImproperlyConfigured
from django.db.models.fields import FieldDoesNotExist
from django.forms.models import fields_for_model
from django.template.loader import render... | |
#
# The Offline workflow manager (WFM)
#
# Dependencies: pip install json2xml dicttoxml termcolor
#
# Formal usage: ./workflow_manager.py <username> <password/token> <upr_url> <spm_url> <psar_url>
# Example usage: ./workflow_manager.py adrian badpassword http://195.235.93.146:8081 130.192.225.109 http://195.235.93.146... | |
from os import kill, system, path, chdir
from signal import alarm, signal, SIGALRM, SIGKILL
import time
import subprocess
from re import sub, compile, search
from sys import argv
import datetime
import urllib
REAVER = 'reaver'
PIXIEWPS = 'pixiewps'
AIRMON = 'airmon-ng'
GIT = 'git'
INFO = '\033[32m[+] \033[0m' # gree... | |
##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... | |
from snovault import (
abstract_collection,
calculated_property,
collection,
load_schema,
)
from snovault.util import Path
from pyramid.security import Authenticated
from .base import (
Item,
paths_filtered_by_status,
)
@abstract_collection(
name='donors',
unique_key='accession',
p... | |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2016, Silvio Peroni <essepuntato@gmail.com>
#
# Permission to use, copy, modify, and/or distribute this software for any purpose
# with or without fee is hereby granted, provided that the above copyright notice
# and this permission notice appear in all copies.
... | |
#!/usr/bin/python
#
# offwaketime Summarize blocked time by kernel off-CPU stack + waker stack
# For Linux, uses BCC, eBPF.
#
# USAGE: offwaketime [-h] [-u] [-p PID] [-T] [duration]
#
# The current implementation uses an unrolled loop for x86_64, and was written
# as a proof of concept. This implementat... | |
"""Bridges between the `asyncio` module and Tornado IOLoop.
.. versionadded:: 3.2
This module integrates Tornado with the ``asyncio`` module introduced
in Python 3.4. This makes it possible to combine the two libraries on
the same event loop.
.. deprecated:: 5.0
While the code in this module is still used, it is... | |
#!/usr/bin/env python3
#
# Tests the basic methods of the Nelder-Mead optimiser.
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
import numpy as np
import unittest
imp... | |
#!/usr/bin/env python
# -- coding: utf-8 --
from fnmatch import fnmatch
# make units optional when importing jsonextended
try:
import numpy as np
except ImportError:
pass
from jsonextended.edict import flatten, flatten2d, unflatten, merge
def get_in_units(value, units):
"""get a value in the required u... | |
import logging
import os
import re
import sh
from sys import stdout, stderr
from math import log10
from collections import defaultdict
from colorama import Style as Colo_Style, Fore as Colo_Fore
import six
# This codecs change fixes a bug with log output, but crashes under python3
if not six.PY3:
import codecs
... | |
import json
import math
try:
from urllib.parse import urlencode, urlunsplit
except ImportError:
from urlparse import urlunsplit
from urllib import urlencode
from bottle import Response, error, route, run, template, install, redirect, hook, \
request, response, abort, static_file, JSONPlugin, url
from m... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | |
# -*- coding: utf-8 -*-
#
# SelfTest/Protocol/test_KDF.py: Self-test for key derivation functions
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | |
from PyQt5 import QtCore, QtGui, QtWidgets
from ctxt.client.ui_connect import Ui_ConnectDialog
from ctxt.client.ui_main import Ui_MainWindow
import ctxt.protocol as cp
import ctxt.util as cu
import logging
class ConnectDialog(QtWidgets.QDialog):
"""
Connection dialog.
"""
def __init__(self, parent, address, port,... | |
# 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 (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Provides basic functionality for all pyamf.amf?.[De|E]ncoder classes.
"""
import types
import datetime
import pyamf
from pyamf import util, python, xml
__all__ = [
'IndexedCollection',
'Context',
'Decoder',
'Encoder'
]
try:
u... | |
# -*- coding: utf-8 -*-
import datetime
import furl
import httplib as http
import markupsafe
from flask import request
from modularodm import Q
from modularodm.exceptions import NoResultsFound
from modularodm.exceptions import ValidationValueError
from framework import forms, status
from framework import auth as fra... | |
# postgresql/json.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from __future__ import absolute_import
import json
import collections
from .base... | |
"""
Manage IAM roles
================
.. versionadded:: 2014.7.0
This module uses ``boto``, which can be installed via package, or pip.
This module accepts explicit IAM credentials but can also utilize
IAM roles assigned to the instance through Instance Profiles. Dynamic
credentials are then automatically obtained f... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
from django.db import (
DEFAULT_DB_ALIAS, DatabaseError, Error, ProgrammingError, connections,
)
from django.utils.decorators import ContextDecorator
class TransactionManagementError(ProgrammingError):
"""
This exception is thrown when transaction management is used improperly.
"""
pass
def get_... | |
# Copyright 2011 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 requ... | |
# 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... | |
# Copyright (c) 2021 PaddlePaddle 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 appli... | |
# Copyright 2011 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 requ... | |
#
# Copyright (C) 2005, Giovanni Bajo
# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
#
# 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 Lic... | |
#!/usr/bin/env python
# AWSBucketDump is a tool to quickly enumerate AWS S3 buckets to look for loot.
# It's similar to a subdomain bruteforcer but is made specifically to S3
# buckets and also has some extra features that allow you to grep for
# delicous files as well as download interesting files if you're not
# afr... | |
import json
import os
from multiprocessing import Process
from unittest import TestCase
import requests
import sys
import time
from app import generator
# ec = configs.EnjoliverConfig(importer=__file__)
class IOErrorToWarning(object):
def __enter__(self):
generator.GenerateCommon._raise_enof = Warning... | |
'''
Toolset to analyse measurement-induced Dephasing of qubits
Hacked together by Rene Vollmer
'''
import pycqed
from pycqed.analysis_v2.quantum_efficiency_analysis import DephasingAnalysisSweep
import pycqed.analysis_v2.base_analysis as ba
import numpy as np
from collections import OrderedDict
import copy
import dat... | |
#
# 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
# ... | |
"""Test the validation module"""
from __future__ import division
import sys
import warnings
import tempfile
import os
from time import sleep
import numpy as np
from scipy.sparse import coo_matrix, csr_matrix
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.uti... | |
# Copyright 2013, Big Switch 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 required by applic... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] ta... | |
from direct.directnotify import DirectNotifyGlobal
from direct.interval.IntervalGlobal import *
from direct.showbase import PythonUtil
from pandac.PandaModules import *
import random
import types
import Toon, ToonDNA
from otp.avatar import Emote
from otp.otpbase import OTPLocalizer
from toontown.chat.ChatGlobals impor... | |
from __future__ import division, print_function, absolute_import
import sys
import math
import numpy as np
from numpy import sqrt, cos, sin, arctan, exp, log, pi, Inf
from numpy.testing import (assert_, TestCase, run_module_suite, dec,
assert_allclose, assert_array_less, assert_almost_equal, assert_raises)
fro... | |
# -*- coding: utf-8 -*-
# Usage of this is governed by a license that can be found in doc/license.rst.
import logging
import os
import pickle
import yaml
import StringIO
import collections
from ast import literal_eval
logger = logging.getLogger(__name__)
__virtualname__ = 'qa'
def __virtual__():
return __virtu... | |
# -*- coding: utf-8 -*-
'''
SoftLayer HW Cloud Module
=========================
The SoftLayer HW cloud module is used to control access to the SoftLayer
hardware cloud system
Use of this module only requires the ``apikey`` parameter. Set up the cloud
configuration at:
``/etc/salt/cloud.providers`` or ``/etc/salt/clo... | |
'''----------------------------- Imports -----------------------------'''
# Built ins
import math
# Hack computer
from ._x__components import *
'''----------------------------- Helpers -----------------------------'''
def zeroN_( N ):
return ( 0, ) * N
def oneN_( N ):
return ( 0, ) * ( N - 1 ) + ( 1, )
def ... | |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | |
from . import utils
from .path import *
from .pathFinder import *
import copy
class ConnectivityMatrix:
def __init__(self, graph):
self._graph = graph
self._paths = []
self._nodes = []
self._initialMatrix = []
self._matrix = []
self._rowLabels = []
self._... | |
"""
Collection management and migration helpers
See also: documents/notes/schema-evolution-notes:
"""
from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2016, G. Klyne"
__license__ = "... | |
from base import *
from globs import *
from types_builtin import app_map, subst
# Sure could use graphs here!
VatContents = DT('VatContents', ('copiedExtrinsics', ['*Extrinsic']),
('replacements', {'a': 'a'}),
('transmute', {'a': 'a'}))
VAT = new_env('V... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
import re
from collections import defaultdict, Counter
from functools import partial
from itertools import chain
from six import text_type
from sacremoses.corpus import Perluniprops
from sacremoses.corpus import NonbreakingPrefixes
from sacremoses.util i... | |
from __future__ import unicode_literals
from djblets.db.fields import Base64DecodedValue
from reviewboard.diffviewer.models import (DiffSet, FileDiff,
LegacyFileDiffData,
RawFileDiffData)
from reviewboard.testing import TestCase
c... | |
# -*- coding: utf-8 -*-
import unittest
from copy import deepcopy
from openprocurement.api.tests.base import (
snitch
)
from openprocurement.tender.belowthreshold.tests.award import (
TenderAwardComplaintResourceTestMixin,
TenderAwardComplaintDocumentResourceTestMixin,
TenderAwardDocumentResourceTestM... | |
"""
Alternation module
Copyright (c) 2009 John Markus Bjoerndalen <jmb@cs.uit.no>,
Brian Vinter <vinter@nbi.dk>, Rune M. Friborg <rune.m.friborg@gmail.com>.
See LICENSE.txt for licensing details (MIT License).
"""
# Imports
import inspect
import types
import collections
import pickle
from pycsp.parallel.guard... | |
import bz2, sys, os, time
import xmlprocessing
from pycontainers import compressedfile, hashtable
#UK dump size nodes=33017987 ways=4040979 relations=80851
def StoreFactoryCreate(fina, maskBits = 26, maxCachedPages = 50):
try:
os.unlink(fina)
except:
pass
compfile = compressedfile.CompressedFile(fina, create... | |
# 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 itertools
import functools
import numpy as np
try:
import bottleneck as bn
_USE_BOTTLENECK = True
except ImportError: # pragma: no cover
_USE_BOTTLENECK = False
import pandas.core.common as com
import pandas.hashtable as _hash
from pandas import compat, lib, algos, tslib
from pandas.co... | |
##
# Copyright (c) 2011-2014 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 datetime import datetime, timedelta
from django.test import TestCase
from django.test.client import Client
from django.test.utils import override_settings
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.http import HttpRequest,... | |
import os
import cv2
import numpy as np
import threading
import random
from multiprocessing.dummy import Pool
from multiprocessing import cpu_count
class Net:
def __init__(self, subset_name='train', options = None):
""" Module for loading CelebA data
:param subset_name: "train", "validation", "te... | |
from functools import partial
from os.path import join, expanduser
from unittest.mock import MagicMock
import uuid
from genty import genty, genty_dataset, genty_args
from app.subcommands.deploy_subcommand import DeploySubcommand
from app.util.network import Network
from test.framework.base_unit_test_case import BaseU... | |
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import print_function, unicode_literals
import hashlib
import json
import jsonschema
import os
import re
from pipes import q... | |
#
# Jasy - Web Tooling Framework
# Copyright 2010-2012 Zynga Inc.
#
import os, json, re, xml.etree.ElementTree
import jasy.core.Console as Console
from jasy import datadir, __version__
import jasy.core.File
__all__ = ["LocaleParser"]
# Here we load our CLDR data from
CLDR_DIR = os.path.join(datadir, "cldr")
# Re... | |
from __future__ import unicode_literals
import datetime
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, override_settings, skipUnlessDBFeature
from django.test.utils import requires_tz_support
from django.utils import timezone
from .models import Book, BookSigning
def _mak... | |
__all__ = ('Coord', 'TileMap')
from collections import defaultdict, namedtuple
from filters import is_tile
class TileMapStorage(object):
def __init__(self, width, height):
self.width = width
self.height = height
self.tiles = []
for y in range(self.height):
self.tiles.ap... | |
"""
This module is home to the ExtendedRuntime class
"""
from pyecobee.ecobee_object import EcobeeObject
class ExtendedRuntime(EcobeeObject):
"""
This class has been auto generated by scraping
https://www.ecobee.com/home/developer/api/documentation/v1/objects/ExtendedRuntime.shtml
Attribute names hav... | |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base... | |
#
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2021 PyMeasure Developers
#
# 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 limit... | |
# coding=utf-8
# Copyright 2012 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2012 NTT DOCOMO, 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 a... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011, 2012 Ian Daniher
# Copyright (c) 2012 Tony Forster, Walter Bender, Alan Aguiar
# Copyright (c) 2013 Alan Aguiar
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | |
# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Author: Kiall Mac Innes <kiall@hp.com>
#
# 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/L... | |
# 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... | |
__all__ = ["Mofa"]
import numpy as np
import matplotlib.pyplot as pl
from scipy.cluster.vq import kmeans
from scipy.linalg import inv
from matplotlib.patches import Ellipse
from . import _algorithms
class Mofa(object):
"""
Mixture of Factor Analyzers
calling arguments:
[ROSS DOCUMENT HERE]
in... | |
# Copyright (c) 2019-2021 Manfred Moitzi
# License: MIT License
from typing import TYPE_CHECKING, Iterable, Optional
import copy
from ezdxf.math import Vec3, Matrix44
from ezdxf.lldxf.tags import Tags
from ezdxf.lldxf.attributes import (
DXFAttr,
DXFAttributes,
DefSubclass,
XType,
group_code_mapping... | |
from browser import document, html, alert, local_storage
import json
import ui
storage = local_storage.storage
current_cell = None
current_cell_info = None
def entry_keydown(ev):
global current_cell
_input = ev.target
cell = _input.parent
is_arrow = ev.keyCode in [9, #tab
37, # left
... | |
import logging
import synapse.common as s_common
import synapse.lib.tufo as s_tufo
import synapse.lib.module as s_module
logger = logging.getLogger(__name__)
class SynMod(s_module.CoreModule):
@staticmethod
def getBaseModels():
modl = {
'types': (
('syn:splice', {'subof':... | |
# Copyright (c) 2011 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 ... | |
#
# 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... | |
#
# Copyright (c) 2017 Linaro
# Copyright (c) 2017 Bobby Noelte
#
# SPDX-License-Identifier: Apache-2.0
#
from collections import defaultdict
from copy import deepcopy
# globals
phandles = {}
aliases = defaultdict(list)
chosen = {}
reduced = {}
defs = {}
structs = {}
bindings = {}
bus_bindings = {}
bindings_compat = ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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.apac... | |
# -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
import asyncio
import json
from unittest.mock import MagicMock, patch, call
from datetime import timedelta, datetime
import uuid
import pytest
from aiohttp import web
from foglamp.services.core import routes
from foglamp.ser... | |
# Python stubs generated by omniidl from /usr/local/share/idl/omniORB/COS/CosExternalization.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):
ret... | |
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
# -*- coding: utf-8 -*-
from cms.models.placeholderpluginmodel import PlaceholderReference
from cms.utils.urlutils import admin_reverse
from django.contrib.admin.helpers import AdminForm
from django.utils.decorators import method_decorator
import json
from django.views.decorators.clickjacking import xframe_options_sam... | |
##########################################################################
#
# Copyright (c) 2011-2013, John Haddon. All rights reserved.
# Copyright (c) 2011-2012, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The Foundry Nuke - CSV File to ColorLookup Node
===============================================
Defines *The Foundry Nuke* *ColorLookup* node creation objects from *.csv*
files.
"""
# from __future__ import unicode_literals
import csv
try:
import nuke
except Im... | |
from datetime import datetime
import pytest
from app.domain.entities import Admin, Host, Service
from app.domain.errors import NoAdministratorFound
from app.repository.sqlalchemy import (SqlalchemyAdminRepo, SqlalchemyHostRepo,
SqlalchemyServiceRepo)
from app.repository.sqlalche... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
#******************************************************************************
# Copyright (C) 2013 Kenneth L. Ho
# 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... | |
#!/bin/env python
import getpass
import os
import sys
import traceback
from lxml import etree
from crypt import crypt
import cheshire3
from cheshire3.baseObjects import Session
from cheshire3.server import SimpleServer
from cheshire3.internal import cheshire3Root
from cheshire3.document import StringDocument
from ... | |
from __future__ import unicode_literals, absolute_import, print_function
import click
import hashlib, os, sys, compileall
import frappe
from frappe import _
from frappe.commands import pass_context, get_site
from frappe.commands.scheduler import _is_scheduler_enabled
from frappe.limits import update_limits, get_limits
... | |
import glob
import os
import sys
import click
from wcategory.conf import DOMAINS_FILE, INPUT_DIR, OUTPUT_DIR, CONF_DIR, CONF_EXTENSION
def write_file(path, string, mode):
file = open(path, mode)
file.write(string)
file.close()
def write_lines(path, lines):
file = open(path, "w")
for line in li... | |
"""UFO for GlifLib"""
from robofab import RoboFabError, RoboFabWarning
from robofab.objects.objectsBase import BaseFont, BaseKerning, BaseGroups, BaseInfo, BaseFeatures, BaseLib,\
BaseGlyph, BaseContour, BaseSegment, BasePoint, BaseBPoint, BaseAnchor, BaseGuide, BaseComponent, \
relativeBCPIn, relativeBCPOut, abso... | |
# Copyright 2022 The Flax 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 or agreed to in wri... | |
# 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 applica... | |
# This module is part of Hypatia and is released under the
# MIT license: http://opensource.org/licenses/MIT
"""py.test unit testing for hypatia/constants.py
"""
import os
import pygame
import pytest
from hypatia import physics
from hypatia import constants
try:
os.chdir('demo')
except OSError:
pass
cla... | |
# encoding: utf-8
"""
Initializes oxml sub-package, including registering custom element classes
corresponding to Open XML elements.
"""
from __future__ import absolute_import
from lxml import etree
from .ns import NamespacePrefixedTag, nsmap
# configure XML parser
element_class_lookup = etree.ElementNamespaceCla... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.