gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import os
import shutil
import platform
# Handle packages
try:
from pynput.keyboard import Key, Listener, Controller
except ImportError:
print("-- Warning: pynput is not installed on this machine, auto completion will not be supported --")
print("-- You can type 'pip install pynput' to get pynput and then... | |
# Copyright 2014 MongoDB, 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, so... | |
'''
Created on 05/06/2014
@author: nikolay
'''
from __builtin__ import map
import sys
import time
import collections
import logging
from os.path import os
from sys import maxint
from autoscale.FANNWrapper import FANNWrapper
from autoscale.VMType import VMType
from workload.Workload import Workload
from workload.Clien... | |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
# -*- coding: UTF-8 -*-
from pandasticsearch.client import RestClient
from pandasticsearch.queries import Agg, ScrollSelect
from pandasticsearch.operators import *
from pandasticsearch.types import Column, Row
from pandasticsearch.errors import DataFrameException
import json
import six
import sys
import copy
_unboun... | |
# 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... | |
from __future__ import unicode_literals
import json
try:
from urllib import unquote
except ImportError:
from urllib.parse import unquote
from moto.core.utils import amz_crc32, amzn_request_id
from moto.core.responses import BaseResponse
from .models import lambda_backends
class LambdaResponse(BaseResponse)... | |
#!/usr/bin/env python
#
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
'''
Greenplum logging facilities.
This Module contains some helper functions for setting up the
python builtin logging module. Tools and libraries are expected
to centralize configuration of logging through these functions.
Typical ... | |
# Copyright 2016 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at:
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | |
# -*- coding: utf-8 -*-
from __future__ import with_statement, print_function, absolute_import
import json
import requests
from requests_oauthlib import OAuth1
from trello.board import Board
from trello.card import Card
from trello.trellolist import List
from trello.organization import Organization
from trello.member i... | |
"""Compatibility for older pythons."""
# OrderedDict from http://code.activestate.com/recipes/576693/
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6,
# 2.7 and pypy. Passes Python2.7's test suite and incorporates all
# the latest updates.
try:
from thread import get_ident as _get_ident
exce... | |
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | |
from __future__ import absolute_import
import sys
import time
from django.conf import settings
from django.db import transaction, connection
from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError
from django.test import (TransactionTestCase, skipIfDBFeature,
skipUnlessDBFeature)
from djang... | |
"""Provide methods to bootstrap a Home Assistant instance."""
import asyncio
import logging
import logging.handlers
import os
import sys
from time import time
from collections import OrderedDict
from typing import Any, Optional, Dict, Set
import voluptuous as vol
from homeassistant import core, config as conf_util, c... | |
from pyticketswitch.trolley import Trolley
from pyticketswitch.bundle import Bundle
from pyticketswitch.event import Event
from pyticketswitch.order import Order
class TestTrolley:
def test_from_api_data_with_trolley_data(self):
data = {
'discarded_orders': [
{'item_number': 3... | |
"""
Support for HydroQuebec.
Get data from 'My Consumption Profile' page:
https://www.hydroquebec.com/portail/en/group/clientele/portrait-de-consommation
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.hydroquebec/
"""
import logging
from datetime... | |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from core import perf_benchmark
from benchmarks import silk_flags
from measurements import smoothness
import page_sets
import page_sets.key_silk_cases
from ... | |
import time
from electrum.i18n import _
from electrum.plugin import hook
from electrum.wallet import Standard_Wallet
from electrum.gui.qt.util import *
from .coldcard import ColdcardPlugin
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
class Plugin(ColdcardPlugin, QtPluginBase):
icon_unpaired = ":icons/... | |
import json
import logging
import logging.handlers
import ethereum.slogging as slogging
class TestHandler(logging.handlers.BufferingHandler):
def __init__(self):
logging.Handler.__init__(self)
self.capacity = 10000
self.buffer = []
@property
def logged(self):
# returns ju... | |
import os
import sys
from unittest import mock
import pytest
from _pytest.main import ExitCode
from _pytest.mark import EMPTY_PARAMETERSET_OPTION
from _pytest.mark import MarkGenerator as Mark
from _pytest.nodes import Collector
from _pytest.nodes import Node
class TestMark:
@pytest.mark.parametrize("attr", ["ma... | |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"""Make sure associations in the old model are in the new model."""
for criterion in orm.JudgingCriterion.objects.all()... | |
""" This module is generated by transpiling Haxe into Python and cleaning
the resulting code by hand, e.g. removing unused Haxe classes. To try it
yourself, clone https://github.com/hsluv/hsluv and run:
haxe -cp haxe/src hsluv.Hsluv -python hsluv.py
"""
from functools import wraps as _wraps, partial as _partial ... | |
#
# Copyright (C) 2011-2018 Red Hat, Inc. (https://github.com/Commonjava/indy)
#
# 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
#
# Unles... | |
"""
File: psoc_4m_base_class.py
This file is the base class that all modbus 5lp modules use
Variables which can be read as modbus type 3 measages
#define MOD_UNIT_ID 0
#define MOD_UNIT_TEMP 1
#define MOD_RTU_WATCH_DOG_FLAG 2
#define MOD_CONTROLLER_WATCH_DOG_FLA... | |
# encoding: 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):
# Adding model 'Relation'
db.create_table('portal_relation', (
('id', self.gf('django.db.model... | |
"""Support for Netatmo Smart thermostats."""
from datetime import timedelta
import logging
from typing import Optional, List
import pyatmo
import requests
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.climate import ClimateDevice, PLATFORM_SCHEMA
from home... | |
# 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... | |
"""Mode Grueneisen parameter band structure calculation."""
# Copyright (C) 2012 Atsushi Togo
# All rights reserved.
#
# This file is part of phonopy.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | |
# -*- coding: utf-8; -*-
#
# Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License"... | |
"""
Unit tests for reverse URL lookups.
"""
from __future__ import unicode_literals
import unittest
from django.contrib.auth.models import User
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
from django.core.urlresolvers import (reverse, reverse_lazy, resolv... | |
from __future__ import absolute_import
from __future__ import unicode_literals
from builtins import str
from xml.dom.minidom import *
from isisdata.templatetags.app_filters import *
from .mods_helper import *
def initial_response(citation_id):
doc = xml.dom.minidom.Document()
# <formats id="http://unapi.info/n... | |
"""
Keras implementation of CapsNet in Hinton's paper Dynamic Routing Between Capsules.
The current version maybe only works for TensorFlow backend. Actually it will be straightforward to re-write to TF code.
Adopting to other backends should be easy, but I have not tested this.
Usage:
python capsulenet.py
... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.hashers import make_password
from django.contrib.sites.models import Site
from django.core.urlresolvers import clear_url_caches
from django.d... | |
# 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... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrigh... | |
######################################################################
#
# Copyright (C) 2013
# Associated Universities, Inc. Washington DC, USA,
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published by
# the Free Software Fo... | |
"""
Wrapper methods for easy access to common operations, making them both less
complex and less verbose for one off or simple use cases.
"""
from rabbitpy import amqp_queue
from rabbitpy import connection
from rabbitpy import exchange
from rabbitpy import message
class SimpleChannel(object):
"""The rabbitpy.sim... | |
"""
Custom formats used to return data in different formats.
These are used from the query itself when calling the fetch_as_format()
method.
For example, returning a LogQuery as a table::
query = LogQuery(fetch_size=200)
for log in query.fetch_batch(): # Default is TableFormat
print(log)
As CS... | |
"""
Compute Engine definitions for the Pipeline API.
"""
from abc import (
ABCMeta,
abstractmethod,
)
from uuid import uuid4
from six import (
iteritems,
with_metaclass,
)
from numpy import array
from pandas import DataFrame, MultiIndex
from toolz import groupby, juxt
from toolz.curried.operator import... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2008 Artifacts - Fine Software Development
# http://www.artifacts.de
# Author: Martin Borho (martin@borho.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... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from django.db.models import Q
import HTMLParser
html_parser = HTMLParser.HTMLParser()
class Migration(DataMigration):
def forwards(self, orm):
wrong = orm['website.Jurisdiction'... | |
import re
from literal import *
from cscreator import *
from sanatize import *
#try to match the line with the implication pattern
def implies(line):
#######################################################
# ~A -> ~B
m = re.match('NOT (\w+) implies NOT (\w+)$', line, re.I)
if m:
clause = ... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
#!/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.
... | |
# Copyright 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | |
# coding: utf-8
from sqlalchemy import Column
from sqlalchemy import exc
from sqlalchemy import Integer
from sqlalchemy import schema
from sqlalchemy import sql
from sqlalchemy import String
from sqlalchemy import Table
from sqlalchemy import testing
from sqlalchemy import types as sqltypes
from sqlalchemy.dialects.po... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | |
#!/usr/bin/python
#-*- coding: utf-8 -*-
# (c) 2013, Yeukhon Wong <yeukhon@acm.org>
# (c) 2014, Nate Coraor <nate@bx.psu.edu>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_M... | |
# Copyright 2022 The MT3 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 writ... | |
# 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 requ... | |
#!/usr/bin/python
import argparse
import boto
import json
import datetime
import time
from boto.sqs.message import RawMessage
from boto.dynamodb2.table import Table
from boto.dynamodb2.fields import HashKey
from boto.dynamodb2.fields import RangeKey
import pprint
import sys
import os
import jinja2
import jinja2_time
M... | |
#!/usr/bin/env python
#a Imports
from OpenGL.GLUT import *
from OpenGL.GLU import *
from OpenGL.GL import *
from OpenGL.GL import shaders
import sys
import math
from gjslib.math import quaternion, matrix, vectors
import OpenGL.arrays.vbo as vbo
import numpy
#a Default shaders
shader_code={}
shader_code["standard_vert... | |
# -*- coding: utf8 -*-
import os
import bitcoin
from secp256k1 import PrivateKey
import pytest
import serpent
from rlp.utils import decode_hex
from ethereum import tester, utils, abi
from ethereum.utils import safe_ord, big_endian_to_int
# Test EVM contracts
serpent_code = '''
def main(a,b):
return(a ^ b)
'''
... | |
# Copyright 2014 Cloudbase Solutions Srl
#
# 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... | |
#!/usr/bin/env python
# Copyright 2017 F5 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 applicable la... | |
import sys
import traceback
import datetime
import unittest
from tcmessages import TeamcityServiceMessages
from tcunittest import strclass
from tcunittest import TeamcityTestResult
try:
from nose.util import isclass # backwards compat
from nose.config import Config
from nose.result import TextTestResult
from... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# snakemakelib documentation build configuration file, created by
# sphinx-quickstart on Fri May 29 14:05:01 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this... | |
# =============================================================================
# HEPHAESTUS VALIDATION 4 - MESHER AND CROSS-SECTIONAL ANALYSIS
# =============================================================================
# IMPORTS:
import sys
import os
sys.path.append(os.path.abspath('..\..'))
from AeroComBAT.St... | |
##########################################################################
#
# 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
"""
arast-client -- commandline client for Assembly RAST
"""
import argparse
import errno
import json
import logging
import os
import sys
import time
from ConfigParser import SafeConfigParser
from assembly import asmtypes
from assembly import auth
from assembly import client
from assembly impo... | |
# -*- 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 'PyConTalkProposal.extreme'
db.delete_column(u'pycon_pycontalkproposal', 'extreme')
... | |
# -*- coding: utf-8 -*-
from __future__ import division
import copy
import functools
import logging
import math
import re
import unicodedata
from framework import sentry
import six
from django.apps import apps
from django.core.paginator import Paginator
from django.db.models import Q
from elasticsearch import (Con... | |
ROOOT_Domain_List = { ".aaa" : "[.]aaa",
".aarp" : "[.]aarp",
".abb" : "[.]abb",
".abbott" : "[.]abbott",
".abbvie" : "[.]abbvie",
".able" : "[.]able",
".abogado" : "[.]abogado",
".abudhabi" : "[.]abudhabi",
".ac" : "[.]ac",
".academy" : "[.]academy",
".accenture" : "[.]accenture",
".accountant" : "[.]accoun... | |
from django.db.models import Exists
from django.db.models import OuterRef
from django.db.models import Q
from django.db import transaction
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.permissions import IsAuthenticated
from rest_framework.serializers import PrimaryKeyRelatedField
fr... | |
#! /usr/bin/env python
import unittest
import numpy as np
from pymt.grids import UniformRectilinear, UniformRectilinearPoints
class TestRasterGrid(unittest.TestCase):
def assert_point_count(self, grid, point_count):
self.assertEqual(point_count, grid.get_point_count())
def assert_cell_count(self, ... | |
#!/usr/bin/env python
"""Upload and download support for apitools."""
from __future__ import print_function
import email.generator as email_generator
import email.mime.multipart as mime_multipart
import email.mime.nonmultipart as mime_nonmultipart
import io
import json
import mimetypes
import os
import threading
impo... | |
"""Mean shift clustering algorithm.
Mean shift clustering aims to discover *blobs* in a smooth density of
samples. It is a centroid based algorithm, which works by updating candidates
for centroids to be the mean of the points within a given region. These
candidates are then filtered in a post-processing stage to elim... | |
"""
## Hyptotheis Testing Stuff
### Standard Stuff
#### Standard Headers
"""
from __future__ import division
import sys, random, math
from pdb import set_trace
sys.dont_write_bytecode = True
"""
#### Standard Utils
"""
class o():
"Anonymous container"
def __init__(i, **fields):
i.override(fiel... | |
# 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 requ... | |
"""
Porter Stemmer
This is the Porter stemming algorithm. It follows the algorithm
presented in
Porter, M. "An algorithm for suffix stripping." Program 14.3 (1980): 130-137.
with some optional deviations that can be turned on or off with the
`mode` argument to the constructor.
Martin Porter, the algorithm's invento... | |
import os
import pandas as pd
from sqlalchemy.sql import column
from igf_data.igfdb.baseadaptor import BaseAdaptor
from igf_data.igfdb.igfTables import File, File_attribute
class FileAdaptor(BaseAdaptor):
'''
An adaptor class for File tables
'''
def store_file_and_attribute_data(self,data,autosave=True):
'... | |
# -*- coding: utf-8 -*-
# Django settings for social pinax project.
import os.path
import posixpath
import pinax
PINAX_ROOT = os.path.abspath(os.path.dirname(pinax.__file__))
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
# tells Pinax to use the default theme
PINAX_THEME = "default"
DEBUG = True
TEMPLAT... | |
"""
Manage vms running on the OpenBSD VMM hypervisor using vmctl(8).
.. versionadded:: 2019.2.0
:codeauthor: ``Jasper Lievisse Adriaanse <jasper@openbsd.org>``
.. note::
This module requires the `vmd` service to be running on the OpenBSD
target machine.
"""
import logging
import re
import salt.utils.path... | |
# -*- coding: utf-8 -*-
"""
lantz.feat
~~~~~~~~~~
Implements Feat and DictFeat property-like classes with data handling,
logging, timing, cache and notification.
:copyright: 2015 by Lantz Authors, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import time
impor... | |
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | |
# Rationale for this module comes from the dependency flow:
# main -> bunch of stuff -> core -> space, continuations
#from rpython.rlib.objectmodel import we_are_translated, keepalive_until_here
from rpython.rtyper.lltypesystem import rffi, lltype, llmemory
from rpython.rlib.rthread import ThreadLocalReference
from rp... | |
# Copyright 2015 Bloomberg Finance L.P.
#
# 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 i... | |
#!/usr/bin/env python
"""Unit tests run as PYTHONPATH=../../.. python3 ./test_valve.py."""
# Copyright (C) 2015 Research and Innovation Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2019 The Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except i... | |
# -*- coding: utf-8 -*-
"""
tablib.core
~~~~~~~~~~~
This module implements the central Tablib objects.
:copyright: (c) 2016 by Kenneth Reitz. 2019 Jazzband.
:license: MIT, see LICENSE for more details.
"""
from collections import OrderedDict
from copy import copy
from operator import itemgetter
... | |
import unittest
import sys
verbose = False
have_unicode=False
# Adapted from Python 2.7.x test_format.py
# testformat(formatstr, *args, **kwargs)
class FormatTest(unittest.TestCase):
def doboth(self, formatstr, *args, **kwargs):
if verbose:
print "Testing ", formatstr, " on ", args[1]
... | |
"""
mbed CMSIS-DAP debugger
Copyright (c) 2006-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 applicable ... | |
# 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 th... | |
# -*- 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... | |
from pykechain.utils import __dict__inherited__
class Enum:
"""Custom enumeration class to support class attributes as options.
Example
-------
>>> class Toppings(Enum):
... CHEESE = "Cheese"
... SALAMI = "Salami"
>>> topping_choice = Toppings.CHEESE
"""
@classmethod
d... | |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Provider tests."""
from __future__ import absolute_import, print_function
import... | |
# 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... | |
import functools
from datetime import datetime
from functools import partial
from django import http
from django.conf import settings
from django.contrib import auth
from django.contrib.auth.forms import PasswordResetForm
from django.contrib.auth.tokens import default_token_generator
from django.db import IntegrityErr... | |
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
# Due to the PEX_ properties, disable checkstyle.
# checkstyle: noqa
import os
import sys
from contextlib import contextmanager
from .common import die
__all__ = ('ENV', 'Variables')
... | |
# Copyright 2011-2015 ZackZK
#
# 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, so... | |
# -*- coding: utf-8 -*-
"""Maximum flow algorithms test suite.
"""
from nose.tools import *
import networkx as nx
from networkx.algorithms.flow import build_flow_dict, build_residual_network
from networkx.algorithms.flow import boykov_kolmogorov
from networkx.algorithms.flow import edmonds_karp
from networkx.algorithm... | |
#!/usr/bin/env python3
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the foll... | |
# -*- 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... | |
#! /usr/bin/env python3
'''SMTP/ESMTP client class.
This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP
Authentication) and RFC 2487 (Secure SMTP over TLS).
Notes:
Please remember, when doing ESMTP, that the names of the SMTP service
extensions are NOT the same thing as the option keywords for the R... | |
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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... | |
'''
Box Layout
==========
.. only:: html
.. image:: images/boxlayout.gif
:align: right
.. only:: latex
.. image:: images/boxlayout.png
:align: right
:class:`BoxLayout` arranges children in a vertical or horizontal box.
To position widgets above/below each other, use a vertical BoxLayout::
... | |
from guardian.shortcuts import get_perms
from rest_framework import serializers as ser
from rest_framework.exceptions import ValidationError
from api.actions.serializers import ReviewableCountsRelationshipField
from api.base.utils import absolute_reverse, get_user_auth
from api.base.serializers import JSONAPISerialize... | |
# 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 ... | |
"""User input parameter validation.
This module handles user input parameter validation
against a provided input model.
Note that the objects in this module do *not* mutate any
arguments. No type version happens here. It is up to another
layer to properly convert arguments to any required types.
Validation Errors
... | |
# -:- encoding: utf-8 -:-
# This file is part of the GBI project.
# Copyright (C) 2012 Omniscale GmbH & Co. KG <http://omniscale.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
#
# ht... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.