gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
###############################################################################
#
# sage_interface.py
#
# description: interface between Boole and Sage
#
# Converts Boole expressions to Sage symbolic expressions and back.
#
# In the forward direction, the user specifies the symbolic ring, by
# default the_SymbolicRing(... | |
#
# 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... | |
#
# 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
# ... | |
# -*- coding: utf-8 -*-
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext as _
from rest_framework import serializers
from parler_rest.serializers import (
TranslatableModelSerializer,
TranslatedFieldsField,
)
from assessment.models import (
Survey,
Ques... | |
"""
Various data structures used in query construction.
Factored out from django.db.models.query to avoid making the main module very
large and/or so that they can be used by other modules without getting into
circular import difficulties.
"""
from __future__ import unicode_literals
import inspect
from collections im... | |
#!/usr/bin/python
import os
import json
import pcbmode.config as config
from . import messages as msg
# pcbmode modules
from . import utils
from .point import Point
def extract(extract, extract_refdefs):
"""
"""
svg_in = utils.openBoardSVG()
if extract == True:
msg.info("Extracting rout... | |
import pytest
import mock
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from osf_tests.factories import (
NodeFactory,
ProjectFactory,
OSFGroupFactory,
RegistrationFactory,
AuthUserFactory,
ForkFactory
)
from rest_framework import exceptions
from website i... | |
# =============================================================================
# Copyright (c) 2015, Cisco Systems, Inc
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of sour... | |
#compdef setup.py
# ------------------------------------------------------------------------------
# Copyright (C) 2015 by Hideo Hattori <hhatto.jp@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
... | |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Package Comments 0.1
# Copyright 2011 Mladen Mijatov <meaneye.rcf@gmail.com>
#
# 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; e... | |
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import bitcoin.base58
import bitcoin.core
import bitcoin.core.key
import bitcoin.wallet
import bitcoin.core.script as script
class StealthAddressError(ValueError):
pass
c... | |
# Copyright 2020 DeepMind Technologies 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 law or ag... | |
"""
Resolve .cube LUT Format Input / Output Utilities
=================================================
Defines the *Resolve* *.cube* *LUT* format related input / output utilities
objects:
- :func:`colour.io.read_LUT_ResolveCube`
- :func:`colour.io.write_LUT_ResolveCube`
References
----------
- :cite:`Chamberl... | |
###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2009, James McCoy
# 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 copyr... | |
#!/usr/bin/env python
"""API handlers for accessing and searching clients and managing labels."""
import ipaddress
import re
from typing import Optional
from urllib import parse as urlparse
from grr_response_core.lib import rdfvalue
from grr_response_core.lib.rdfvalues import client as rdf_client
from grr_response_co... | |
import os
import tempfile
import uuid
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.db.models.fields.files import Imag... | |
# Copyright (c) 2009-2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... | |
from .string_table import _StringTable
class _CsvHeaders:
HEADERS = [
# Common
_StringTable.Type,
_StringTable.Status,
_StringTable.Id,
_StringTable.ParentId,
_StringTable.SubType,
_StringTable.Campaign,
_StringTable.AdGroup,
_StringTable.Web... | |
from traceback import format_exc
from struct import unpack
from errno import EINTR
from time import time
import socket
import signal
from clusto.services.config import conf, get_logger
log = get_logger('clusto.dhcp', 'INFO')
import logging
runtime = logging.getLogger('scapy.runtime')
runtime.setLevel(logging.ERROR)
l... | |
from django.test import TestCase, Client
from ...models import Country, City, University, Faculty, Course, CourseProgram
from ...models import Program, ProgramCountry, ProgramCity, ProgramUniversity, ProgramFaculty
from ...management.commands import course_similarity
class ComparatorTestCase(TestCase):
def test_g... | |
from tcga_encoder.utils.helpers import *
from tcga_encoder.data.data import *
from tcga_encoder.definitions.tcga import *
#from tcga_encoder.definitions.nn import *
from tcga_encoder.definitions.locations import *
#from tcga_encoder.algorithms import *
import seaborn as sns
from sklearn.manifold import TSNE, locally_li... | |
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... | |
from django.db import connections
from django.db.models.query import QuerySet, ValuesQuerySet, ValuesListQuerySet
from django.contrib.gis import memoryview
from django.contrib.gis.db.models import aggregates
from django.contrib.gis.db.models.fields import get_srid_info, PointField, LineStringField
from django.contrib.... | |
"""A module containing a core representation of IATI Rulesets.
Todo:
Consider how we should handle lxml errors.
Remove references to `case`.
"""
# no-member errors are due to using `setattr()` # pylint: disable=no-member
import collections
import decimal
import json
import re
import sre_constants
from dateti... | |
# -*- coding: utf-8 -*-
"""
This module implements a number of Python exceptions you can raise from
within your views to trigger a standard non-200 response.
"""
import sys
from ._compat import integer_types, text_type
from .http import HTTP_STATUS_CODES, html_escape
class HTTPException(Exception):
"""
... | |
#!/usr/bin/python
#
# Copyright 2010 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 required by applicable law or... | |
from __future__ import absolute_import
import logging
import socket
from amqp.exceptions import ConnectionError
from kombu import Connection
from kombu.common import maybe_declare
from kombu.messaging import Consumer
from nameko.amqp import verify_amqp_uri
from nameko.constants import (
AMQP_URI_CONFIG_KEY, DEFA... | |
# 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... | |
#########################################################################
# Copyright (C) 2007, 2008, 2009
# Alex Clemesha <alex@clemesha.org> & Dorian Raymer <deldotdr@gmail.com>
#
# This module is part of codenode, and is distributed under the terms
# of the BSD License: http://www.opensource.org/licenses/bsd-li... | |
#################################################
## /Volumes/JCVI/home/sszpakow/DEVEL/YAP/scripts/Sources/FilterUnirefClusters.py
#################################################
import sys, argparse
from collections import defaultdict
_author="Sebastian Szpakowski"
_date="Jul 15, 2013"
_version="V1.00"
_descrip... | |
"""Repeating tasks and monitors for a Bus."""
import os
import re
import sys
import time
import threading
from magicbus.plugins import SimplePlugin
from magicbus.compat import get_thread_ident, TimerClass
# _module__file__base is used by Autoreload to make
# absolute any filenames retrieved from sys.modules which ar... | |
#
# 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... | |
# 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 use ... | |
from enum import IntEnum
from typing import (
Union,
TypeVar,
Any,
Tuple,
Dict,
Optional,
KeysView,
ItemsView,
ValuesView,
Iterator,
)
from ._bonsai import ldapentry
from .errors import InvalidDN
from .ldapdn import LDAPDN
from .ldapvaluelist import LDAPValueList
MYPY = False
... | |
"""
Illustrates an explicit way to persist an XML document expressed using
ElementTree.
Each DOM node is stored in an individual
table row, with attributes represented in a separate table. The
nodes are associated in a hierarchy using an adjacency list
structure. A query function is introduced which can search for... | |
# -*- coding: iso-8859-15 -*-
# =============================================================================
# Copyright (c) 2004, 2006 Sean C. Gillies
# Copyright (c) 2005 Nuxeo SARL <http://nuxeo.com>
#
# Authors : Sean Gillies <sgillies@frii.com>
# Julien Anguenot <ja@nuxeo.com>
#
# Contact email: sgillie... | |
"""Utilities for processing requests
:Authors: Sana Dev Team
:Version: 1.1
"""
from __future__ import with_statement
import os, sys, traceback
import cjson
import datetime
import logging
from collections import defaultdict
from django.conf import settings
from mds.core import models as v2
from mds.mrs.models import ... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
from django.apps import apps
from django.conf import settings
from django.core import checks
from django.core.checks import Error, Warning
from django.core.checks.compatibility.django_1_7_0 import \
check_1_7_compatibility
from django.core... | |
# Authors:
# Trevor Perrin
# Google - defining ClientCertificateType
# Google (adapted by Sam Rushing) - NPN support
# Dimitris Moraitis - Anon ciphersuites
#
# See the LICENSE file for legal information regarding use of this file.
"""Constants used in various places."""
class CertificateType:
x509 = 0
... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC
# Copyright 2012 Canonical 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/lice... | |
from typing import Dict, Tuple
import demistomock as demisto
from CommonServerPython import *
# IMPORTS
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
# CONSTANTS
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
API_VERSION = "v34.0"
HEADERS = ["Worker_ID", "User_ID", "Country", "Preferred_First_Name", "... | |
import struct
from test_parent_protocol import *
TEST1 = 10
TEST2 = 12
TEST3 = 1000
Embedded_message_g_tag = 100
Test_message_x_tag = 1
Test_message_embedded_message_oneof_tag = 2
class _Ostream:
def __init__(self):
self.buf = b''
def write(self, data):
self.buf += data
class _Istream:
def __init__(self, buf... | |
# Copyright 2017 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 agree... | |
"""Hierarchical Agglomerative Clustering
These routines perform some hierarchical agglomerative clustering of some
input data.
Authors : Vincent Michel, Bertrand Thirion, Alexandre Gramfort,
Gael Varoquaux
License: BSD 3 clause
"""
from heapq import heapify, heappop, heappush, heappushpop
import warnings
i... | |
#!/usr/bin/python
import argparse
import requests
import logging
import json
import sys
import os
from urlparse import urlparse, parse_qsl
from urllib import urlencode
class Api(object):
"""Api.
Permits to send http rest requests, to the api endpoint.
Paths in the url have to be initialized by another p... | |
import mock
import os
from bm_instance_agent.common import utils as bm_utils
from bm_instance_agent import exception
from bm_instance_agent import objects
from bm_instance_agent.systems.linux.distro import centos
from bm_instance_agent.tests import base
from bm_instance_agent.tests.unit import fake
class TestCentOSD... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.constants import MEMBER_USER
from sentry.models import Group, Project, TeamMember, Team, User
from sentry.testutils import TestCase, fixture, before
class EnvStatusTest(TestCase):
@fixture
... | |
"""Tests for the Home Assistant auth module."""
from datetime import timedelta
import jwt
import pytest
import voluptuous as vol
from homeassistant import auth, data_entry_flow
from homeassistant.auth import auth_store, const as auth_const, models as auth_models
from homeassistant.auth.const import MFA_SESSION_EXPIRA... | |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | |
"""
Compare the various algorithms on a synthetic dataset.
"""
import time
import cPickle
import os
import gzip
import pprint
import numpy as np
from scipy.misc import logsumexp
from scipy.special import gammaln
# Use the Agg backend in running on a server without the DISPLAY variable
if "DISPLAY" not in os.environ:
... | |
from pathlib import Path
from enum import Enum
from random import randint
from typing import List, Dict
from rlbot.matchconfig.loadout_config import LoadoutConfig
from rlbot.parsing.bot_config_bundle import get_bot_config_bundle
from rlbot.parsing.agent_config_parser import load_bot_appearance
from rlbot.parsing.match... | |
########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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 requir... | |
# 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... | |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, unicode_literals, division)
"""
=====================
Metabolic Null Models
=====================
:Authors:
Moritz Emanuel Beber
:Date:
2011-07-01
:Copyright:
Copyright(c) 2011 Jacobs University of Bremen. All rights reserved.
:File:
... | |
"""Client for cache server.
See cachesvr.py for protocol description.
"""
import argparse
import trollius as asyncio
from trollius import From, Return
from trollius import test_utils
import json
import logging
ARGS = argparse.ArgumentParser(description='Cache client example.')
ARGS.add_argument(
'--tls', action=... | |
#!/usr/bin/env python
try:
from lxml import etree
except ImportError:
try:
import xml.etree.cElementTree as etree
except ImportError:
try:
import xml.etree.ElementTree as etree
except ImportError:
print("Failed to import ElementTree from any known place")
imp... | |
""" Wang F. at all. "`Residual Attention Network for Image Classification
<https://arxiv.org/abs/1704.06904>`_"
"""
import tensorflow as tf
from .layers import conv_block
from . import TFModel
from .resnet import ResNet
class ResNetAttention(TFModel):
""" Residual Attention Network
**Configuration**
i... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | |
# Copyright (c) 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 required by applicable law... | |
#!/usr/bin/env python2
"""Load Questions, Run Prompts, and Run Probe Trials."""
# BasicPromptTools.py
# Created 1/30/15 by DJ based on VidLecTask.py - called PromptTools.py.
# Updated 3/16/15 by DJ - added ReadingTask_dict.py
# Updated 9/8/15 by DJ - added Likert option and RunQuestions_Move.
# Updated 10/29/15 by DJ -... | |
"""Runs Treadmill App tickets service.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import fnmatch
import logging
import os
import socket
import time
import tempfile
import click
import gssapi # p... | |
import numpy as np
from scipy.signal import hilbert
from sklearn import preprocessing
import scipy.stats
import pandas as pd
from data import to_np_array
# optional modules for trying out different transforms
try:
import pywt
except ImportError, e:
pass
try:
from scikits.talkbox.features import mfcc
exc... | |
# coding=utf8
# Based on yibo's R script and JianXiao's Python script
from scipy import sparse
from sklearn.feature_selection import SelectPercentile, f_classif, chi2
import pandas as pd
import numpy as np
from scipy import sparse as ssp
import pylab as plt
from sklearn.preprocessing import LabelEncoder,LabelBinarizer,... | |
# 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... | |
import logging
import boto3
import os
import pandas as pd
import argparse
from datetime import datetime
from dataactbroker.helpers.generic_helper import batch
from dataactvalidator.scripts.loader_utils import clean_data
from dataactvalidator.health_check import create_app
from dataactcore.models.domainModels import Hi... | |
#!/usr/bin/env python
# -*- coding:UTF-8 -*-
# Copyright (c) 2018 Nicolas Iooss
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
... | |
#! /usr/bin/env python
# --------------------------------------------------------------
# The asfgrid is a python module to compute asteroseismic
# parameters for a star with given stellar parameters and vice versa.
# Copyright (C) 2015 Sanjib Sharma, Dennis Stello
# This program is free sof... | |
#import getopt
import argparse
import emails
import sys
import re
import os
import subprocess
import time
import signal
from collections import defaultdict
from emails import EmailTemplate
from utils import Utils
from display import Display
from gather import Gather
from mydns import Dns
from webprofiler import profile... | |
from __future__ import absolute_import
from __future__ import print_function
import torch.nn as nn
import torch as T
# core: Dense, Dropout, Convolutional
# Dense (Linear)
def dense(in_size, out_size, bias=True):
return nn.Linear(in_size=in_size,
out_size=out_size,
bias=bia... | |
import json
import datetime
import time
import multiprocessing
import functools
import threading
from geolite2 import geolite2
import core.storage as storage
import core.util.extras as extras
import core.util.debug as debug
import core.content.models as models
from core.content.content import Content
import core.monit... | |
#!/usr/bin/env python
import sys, os, math
import queue
import PIL.Image as Image
from psd_tools import PSDImage, Layer, Group
def log2(n):
return math.log(n) / math.log(2)
def isTransp(pixel):
return pixel[3] == 0.0
def isBlue(pixel):
return pixel == (0.0, 0.0, 1.0)
def getBox(image):
pl = lis... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | |
#!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | |
#!/usr/bin/env python
"""
Copyright (c) 2007 Dustin Sallings <dustin@spy.net>
"""
import struct
# Command constants
CMD_GET = 0
CMD_SET = 1
CMD_SETQ = 0x11
CMD_ADD = 2
CMD_REPLACE = 3
CMD_DELETE = 4
CMD_DELETEQ = 0x14
CMD_INCR = 5
CMD_DECR = 6
CMD_QUIT = 7
CMD_FLUSH = 8
CMD_GETQ = 9
CMD_NOOP = 10
CMD_VERSION = 11
C... | |
"""
Module for testing the similarity measures
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import random
import numpy as np
import surprise.similarities as sims
n_x = 8
yr_global = {
0: [(0, 3), (1, 3), (2, 3), (5, 1), (6, 1.5)... | |
from google.cloud.security.iam.explain.service import GrpcExplainerFactory
from google.cloud.security.iam.playground.service import GrpcPlaygrounderFactory
from google.cloud.security.iam.dao import ModelManager
from tests.iam.api_tests.api_tester import ModelTestRunner, create_test_engine
from tests.unittest_utils im... | |
#!/usr/bin/env python
# coding:utf-8
__version__ = '3.1.5'
__password__ = ''
__hostsdeny__ = () # __hostsdeny__ = ('.youtube.com', '.youku.com')
__content_type__ = 'image/gif'
__mirror_userjs__ = () # __mirror_userjs__ = '//www.example.com/user.js'
import os
import re
import time
import struct
import zlib
import gz... | |
# Copyright (c) 2010-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 agree... | |
from __future__ import absolute_import,unicode_literals
import time
import binascii
import os
import tempfile
import time
import unittest
import synapse.common as s_common
import synapse.compat as s_compat
import synapse.cortex as s_cortex
import synapse.daemon as s_daemon
import synapse.link as s_link
import synapse... | |
from dsltools import ScopedDict
from .. import prims
from ..ndtypes import NoneT, NoneType, get_rank
from ..syntax import Var, Const, PrimCall, Tuple, Slice, TupleProj, Attribute, Shape
import numpy as np
from ..syntax.helpers import unwrap_constant
from syntax_visitor import SyntaxVisitor
class AbstractV... | |
# 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 required by applicable law or ... | |
import os
import sys
from collections import defaultdict
from functools import reduce
from itertools import product
from math import sqrt
import numpy
from PyQt4.QtCore import QPoint, Qt, QRectF
from PyQt4.QtGui import (QGraphicsRectItem, QGraphicsView, QColor,
QGraphicsScene, QPainter, QIcon,... | |
# -*- coding: utf-8 -*-
#
# 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
#... | |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | |
#!/usr/bin/env python
#
# Copyright under the latest Apache License 2.0
'''A class the inherits everything from python-twitter and allows oauth based access
Requires:
python-twitter
simplejson
oauth
'''
__author__ = "Hameedullah Khan <hameed@hameedkhan.net>"
__version__ = "0.2"
from jsb.contrib.twitter impo... | |
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Routines and a delegate for dealing with locally worked on packages."""
from __future__ import print_function
import collections
import glob
import o... | |
# Copyright (c) 2018-2019, NVIDIA CORPORATION. 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 a... | |
import os
import unicodecsv
from openelex.models import Contest, Candidate, Result
from openelex.us.md import jurisdiction
# Classes that describe election attributes
class MDElection(object):
"""
Base class for describing Maryland elections.
Subclasses, should, at the very least, define ``election_id`... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 NEC Corporation. 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.or... | |
# Copyright 2015-2017 Espressif Systems (Shanghai) PTE 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 ... | |
import sys
import os
from PySide.QtGui import (QWidget, QDialog, QListWidget, QListWidgetItem,
QVBoxLayout, QStackedWidget, QListView,
QHBoxLayout, QDialogButtonBox, QCheckBox,
QMessageBox, QLabel, QLineEdit, QSpinBox,
... | |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#!/usr/bin/env python3
"""A simple gui interface"""
import sys
import traceback
import webbrowser
import config
from pmca.commands.usb import *
from pmca.ui import *
from pmca.usb.usbshell import *
if getattr(sys, 'frozen', False):
from frozenversion import version
else:
version = None
class PrintRedirector(object... | |
#!/usr/bin/env python
"""
Validate that the titles in the rst files follow the proper capitalization convention.
Print the titles that do not follow the convention.
Usage::
./scripts/validate_rst_title_capitalization.py doc/source/development/contributing.rst
./scripts/validate_rst_title_capitalization.py doc/source/... | |
# Copyright 2017-2019 IBM Corp. 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... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is used to populate database for testing purposes.
"""
import os
import django
import pytz
from datetime import datetime
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'website.settings')
django.setup()
from django.contrib.auth.models import User
from mtg... | |
import os
from sys import float_info
from unittest import SkipTest
from functools import wraps
from flaky import flaky
from couchbase.exceptions import BucketDoesNotExistException, FeatureNotFoundException, InvalidArgumentException
from couchbase.management.users import DropUserOptions, GetUserOptions, Role, RoleAndO... | |
from collections import defaultdict
from itertools import chain
from jedi._compatibility import unicode, zip_longest
from jedi import debug
from jedi import common
from jedi.parser import tree as pr
from jedi.evaluate import iterable
from jedi.evaluate import analysis
from jedi.evaluate import precedence
from jedi.eva... | |
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.