repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
molobrakos/home-assistant | homeassistant/components/tts/__init__.py | 5 | 18394 | """Provide functionality to TTS."""
import asyncio
import ctypes
import functools as ft
import hashlib
import io
import logging
import mimetypes
import os
import re
from aiohttp import web
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.components.media_player.c... | apache-2.0 |
pattisdr/osf.io | api_tests/base/test_throttling.py | 12 | 4553 | import pytest
import mock
from nose.tools import * # noqa:
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from osf_tests.factories import AuthUserFactory, ProjectFactory
pytestmark = pytest.mark.skip(
'Unskip when throttling no longer fails on travis'
)
class TestDefaultTh... | apache-2.0 |
MER-GROUP/intellij-community | python/helpers/pydev/pydevd_attach_to_process/winappdbg/win32/shlwapi.py | 102 | 25807 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# 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... | apache-2.0 |
DiptoDas8/Biponi | lib/python2.7/site-packages/braintree/customer.py | 4 | 8252 | import warnings
from braintree.util.http import Http
from braintree.successful_result import SuccessfulResult
from braintree.error_result import ErrorResult
from braintree.resource import Resource
from braintree.apple_pay_card import ApplePayCard
from braintree.android_pay_card import AndroidPayCard
from braintree.cred... | mit |
ptthiem/nose2 | nose2/plugins/loader/discovery.py | 2 | 9459 | """
Discovery-based test loader.
This plugin implements nose2's automatic test module discovery. It
looks for test modules in packages and directories whose names start
with ``test``, then fires the :func:`loadTestsFromModule` hook for each
one to allow other plugins to load the actual tests.
It also fires :func:`han... | bsd-2-clause |
x303597316/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/xlwt/antlr.py | 57 | 84201 | ## This file is part of PyANTLR. See LICENSE.txt for license
## details..........Copyright (C) Wolfgang Haefelinger, 2004.
## This file was copied for use with xlwt from the 2.7.7 ANTLR distribution. Yes, it
## says 2.7.5 below. The 2.7.5 distribution version didn't have a
## version in it.
## Here is the contents of... | apache-2.0 |
watonyweng/nova | nova/tests/functional/v3/test_assisted_volume_snapshots.py | 3 | 2837 | # Copyright 2014 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
#
# Unless required by applicable law or agreed t... | apache-2.0 |
magnunor/hyperspy | hyperspy/drawing/_markers/vertical_line.py | 2 | 2501 | # -*- coding: utf-8 -*-
# Copyright 2007-2016 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | gpl-3.0 |
sagar30051991/ozsmart-erp | erpnext/accounts/doctype/sales_invoice/pos.py | 11 | 2008 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
@frappe.whitelist()
def get_items(price_list, sales_or_purchase, item=None):
condition = ""
order_by = ""
args = {"price_list": price_... | agpl-3.0 |
elkingtonmcb/pattern | pattern/text/en/__init__.py | 21 | 7122 | #### PATTERN | EN ##################################################################################
# -*- coding: utf-8 -*-
# Copyright (c) 2010 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
############... | bsd-3-clause |
DerekSelander/LLDB | lldb_commands/ddp.py | 1 | 5995 | # MIT License
# Copyright (c) 2020 Derik Ramirez
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, ... | gpl-2.0 |
bpsinc-native/src_third_party_scons-2.0.1 | engine/SCons/Script/Interactive.py | 61 | 14083 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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 li... | mit |
kvikshaug/pitcoin | pitcoin/script_opcodes.py | 1 | 1964 | # push value
OP_0 = 0x00
OP_FALSE = OP_0
OP_PUSHDATA1 = 0x4c
OP_PUSHDATA2 = 0x4d
OP_PUSHDATA4 = 0x4e
OP_1NEGATE = 0x4f
OP_RESERVED = 0x50
OP_1 = 0x51
OP_TRUE = OP_1
OP_2 = 0x52
OP_3 = 0x53
OP_4 = 0x54
OP_5 = 0x55
OP_6 = 0x56
OP_7 = 0x57
OP_8 = 0x58
OP_9 = 0x59
OP_10 = 0x5a
OP_11 = 0x5b
OP_12 = 0x5c
OP_13 = 0x5d
OP_14 =... | bsd-3-clause |
gojira/tensorflow | tensorflow/contrib/learn/python/learn/preprocessing/__init__.py | 42 | 1263 | # 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... | apache-2.0 |
ravello/ansible-modules-extras | system/filesystem.py | 38 | 3422 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Alexander Bulimov <lazywolf0@gmail.com>
#
# 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 t... | gpl-3.0 |
pycket/pycket | pycket/test/test_impersonators.py | 4 | 23872 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from pycket.test.testhelper import *
from pycket.values import *
from pycket.impersonators import *
from pycket.values_struct import *
import pytest
import sys
sys.setrecursionlimit(10000)
def test_impersonator_properties():
m = run_mod(
"""
#lang pycket
... | mit |
schryer/schryer_pelican_blog | add_links.py | 1 | 6919 | # -*- coding: utf-8 -*-
import os
import glob
import argparse
def make_argument_parser():
'''Returns argument parser for this script.
'''
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,
description='''
This script adds links to e... | cc0-1.0 |
kpi-petitions/project-y | kpiedemocracy/settings.py | 1 | 4892 | """
Django settings for kpiedemocracy project.
Generated by 'django-admin startproject' using Django 1.8.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Buil... | apache-2.0 |
dennybaa/st2 | st2actions/st2actions/runners/httprunner.py | 2 | 9655 | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... | apache-2.0 |
StuartLittlefair/astropy | astropy/coordinates/tests/test_solar_system.py | 1 | 19799 | import os
import pytest
import numpy as np
from urllib.error import HTTPError
from astropy.time import Time
from astropy import units as u
from astropy.constants import c
from astropy.coordinates.builtin_frames import GCRS, TETE
from astropy.coordinates.earth import EarthLocation
from astropy.coordinates.sky_coordina... | bsd-3-clause |
google/firmata.py | tests/test_io.py | 1 | 14001 | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
elmer/smart-gitosis | gitosis/serve.py | 2 | 8691 | """
Enforce git-shell to only serve allowed by access control policy.
directory. The client should refer to them without any extra directory
prefix. Repository names are forced to match ALLOW_RE.
"""
import logging
import sys, os, re
from gitosis import access
from gitosis import repository
from gitosis import gitwe... | gpl-2.0 |
jhoenicke/python-trezor | trezorlib/tests/device_tests/test_msg_verifymessage_segwit.py | 3 | 4567 | # This file is part of the Trezor project.
#
# Copyright (C) 2012-2018 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distrib... | lgpl-3.0 |
ankurankan/scikit-learn | sklearn/manifold/tests/test_locally_linear.py | 41 | 4827 | from itertools import product
from nose.tools import assert_true
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from scipy import linalg
from sklearn import neighbors, manifold
from sklearn.manifold.locally_linear import barycenter_kneighbors_graph
from sklearn.utils.testi... | bsd-3-clause |
finik/git-repo | pager.py | 86 | 2051 | #
# Copyright (C) 2008 The Android Open Source Project
#
# 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... | apache-2.0 |
40223119/2015cda | static/Brython3.1.1-20150328-091302/Lib/html/parser.py | 737 | 19605 | """A parser for HTML and XHTML."""
# This file is based on sgmllib.py, but the API is slightly different.
# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable character
# data -- only char and entity references and end tags are special)
# and CDAT... | gpl-3.0 |
schlueter/ansible | test/units/vars/test_variable_manager.py | 73 | 11541 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# 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) an... | gpl-3.0 |
wathsalav/xos | xos/importer/plclassic/site_importer.py | 1 | 1266 | from core.models import Site
class SiteImporter:
def __init__(self, api):
self.api = api
self.remote_sites = {}
self.local_sites = {}
def run(self):
db_sites = Site.objects.all()
for db_site in db_sites:
self.local_sites[db_site.login_base] = db_site
... | apache-2.0 |
bootandy/sqlalchemy | test/aaa_profiling/test_resultset.py | 23 | 4577 | from sqlalchemy import MetaData, Table, Column, String, Unicode, Integer, \
create_engine
from sqlalchemy.testing import fixtures, AssertsExecutionResults, profiling
from sqlalchemy import testing
from sqlalchemy.testing import eq_
from sqlalchemy.util import u
from sqlalchemy.engine.result import RowProxy
import s... | mit |
dannyperry571/theapprentice | script.module.liveresolver/lib/liveresolver/resolvers/castamp.py | 10 | 1405 | # -*- coding: utf-8 -*-
import re,urllib,urlparse,base64
from liveresolver.modules import client,constants
from liveresolver.modules.log_utils import log
def resolve(url):
try:
id = urlparse.parse_qs(urlparse.urlparse(url).query)['c'][0]
try:
referer = urlparse.parse_qs(urlparse.urlp... | gpl-2.0 |
craffel/mir_eval | tests/mpl_ic.py | 3 | 12171 | # CREATED:2015-02-17 14:41:28 by Brian McFee <brian.mcfee@nyu.edu>
# this function is lifted wholesale from matploblib v1.4.2,
# and modified so that images are stored explicitly under the tests path
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import si... | mit |
zheguang/voltdb | src/catgen/catalog_utils/__init__.py | 2 | 1341 | #!/usr/bin/env python
# This file is part of VoltDB.
# Copyright (C) 2008-2014 VoltDB Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at you... | agpl-3.0 |
rupace10/mysql-connector-python | tests/test_setup.py | 12 | 5048 | # MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... | gpl-2.0 |
mattcongy/itshop | docker-images/taigav2/taiga-back/taiga/projects/custom_attributes/migrations/0003_triggers_on_delete_customattribute.py | 28 | 4785 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('custom_attributes', '0002_issuecustomattributesvalues_taskcustomattributesvalues_userstorycustomattributesvalues'),
]
operations = [... | mit |
danakj/chromium | third_party/closure_compiler/compiler_test.py | 6 | 11550 | #!/usr/bin/env python
# Copyright 2014 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 ast import literal_eval
import os
import tempfile
import unittest
from compile import Checker
from processor import FileCache, Pr... | bsd-3-clause |
gfneto/bitcoin-abe | build/lib.linux-x86_64-2.7/Abe/Chain/Bitcoin.py | 29 | 1035 | # Copyright(C) 2014 by Abe developers.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is dist... | agpl-3.0 |
ccastell/Transfer-System | Website/env/lib/python3.5/site-packages/django/contrib/sessions/middleware.py | 129 | 3423 | import time
from importlib import import_module
from django.conf import settings
from django.contrib.sessions.backends.base import UpdateError
from django.core.exceptions import SuspiciousOperation
from django.utils.cache import patch_vary_headers
from django.utils.deprecation import MiddlewareMixin
from django.utils.... | apache-2.0 |
pk400/catering | myvenv/lib/python3.4/site-packages/django/utils/timesince.py | 409 | 2671 | from __future__ import unicode_literals
import calendar
import datetime
from django.utils.html import avoid_wrapping
from django.utils.timezone import is_aware, utc
from django.utils.translation import ugettext, ungettext_lazy
TIMESINCE_CHUNKS = (
(60 * 60 * 24 * 365, ungettext_lazy('%d year', '%d years')),
... | mit |
happycube/ld-decode | lddecode/utils.py | 1 | 29033 | # A collection of helper functions used in dev notebooks and lddecode_core.py
import atexit
from base64 import b64encode
from collections import namedtuple
import copy
import getopt
import io
from io import BytesIO
import json
import math
import os
import sys
import subprocess
from multiprocessing import Process, Poo... | gpl-3.0 |
lcy-seso/models | fluid/icnet/icnet.py | 1 | 9220 | import paddle.fluid as fluid
import numpy as np
import sys
def conv(input,
k_h,
k_w,
c_o,
s_h,
s_w,
relu=False,
padding="VALID",
biased=False,
name=None):
act = None
tmp = input
if relu:
act = "relu"
if padding ==... | apache-2.0 |
simpeg/discretize | tests/base/test_tensor.py | 1 | 7915 | import numpy as np
import unittest
import discretize
from pymatsolver import Solver
TOL = 1e-10
class BasicTensorMeshTests(unittest.TestCase):
def setUp(self):
a = np.array([1, 1, 1])
b = np.array([1, 2])
c = np.array([1, 4])
self.mesh2 = discretize.TensorMesh([a, b], [3, 5])
... | mit |
abhaysac/cuda-convnet2 | python_util/util.py | 181 | 2825 | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
gitromand/phantomjs | src/breakpad/src/tools/gyp/pylib/gyp/generator/gypd.py | 151 | 3320 | #!/usr/bin/python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""gypd output module
This module produces gyp input as its output. Output files are given the
.gypd extension to avoid overwriting the .gyp f... | bsd-3-clause |
austindlawless/cudas | lambda/signup/passlib/tests/test_context.py | 6 | 64739 | """tests for passlib.context"""
#=============================================================================
# imports
#=============================================================================
# core
from __future__ import with_statement
from passlib.utils.compat import PY3
if PY3:
from configparser import N... | mit |
ikreymer/pywb | pywb/warcserver/index/query.py | 1 | 3663 | from six.moves.urllib.parse import urlencode
from pywb.warcserver.index.cdxobject import CDXException
from pywb.utils.canonicalize import calc_search_range
from pywb.utils.format import to_bool
#=================================================================
class CDXQuery(object):
def __init__(self, params):
... | gpl-3.0 |
daineseh/kodi-plugin.video.ted-talks-chinese | youtube_dl/extractor/extremetube.py | 31 | 3146 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
sanitized_Request,
str_to_int,
)
class ExtremeTubeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?extremetube\.com/(?:[^/]+/)?video/(?P<id>[^/#?&]+)'
_TESTS = [{
'u... | gpl-2.0 |
kotnik/nikola | nikola/plugins/task_copy_files.py | 3 | 2203 | # -*- coding: utf-8 -*-
# Copyright © 2012-2013 Roberto Alsina and others.
# 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 t... | mit |
yashdsaraf/scancode-toolkit | tests/extractcode/test_patch.py | 1 | 72541 | #
# Copyright (c) 2017 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... | apache-2.0 |
hairmare/php-buildpack | lib/yaml/emitter.py | 387 | 43298 |
# Emitter expects events obeying the following grammar:
# stream ::= STREAM-START document* STREAM-END
# document ::= DOCUMENT-START node DOCUMENT-END
# node ::= SCALAR | sequence | mapping
# sequence ::= SEQUENCE-START node* SEQUENCE-END
# mapping ::= MAPPING-START (node node)* MAPPING-END
__all__ = ['Emitter', 'Emi... | apache-2.0 |
ononeor12/python-social-auth | social/tests/backends/test_nationbuilder.py | 77 | 8489 | import json
from social.tests.backends.oauth import OAuth2Test
class NationBuilderOAuth2Test(OAuth2Test):
backend_path = 'social.backends.nationbuilder.NationBuilderOAuth2'
user_data_url = 'https://foobar.nationbuilder.com/api/v1/people/me'
expected_username = 'foobar'
access_token_body = json.dumps(... | bsd-3-clause |
xl7dev/WebShell | reGeorg-master/reGeorgSocksProxy.py | 1 | 16189 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import argparse
import signal
import sys
import atexit
import httplib
import urllib3
from threading import Thread
from urlparse import urlparse
from socket import *
from threading import Thread
from time import sleep
#import struct
# Constants
SOCKTIMEOUT =... | gpl-2.0 |
NocFlame/MifareClassicTool | tools/dump-file-converter/mct2eml.py | 7 | 1685 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
########################################################################
#
# Copyright 2015 Gerhard Klostermeier
#
# 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 Sof... | gpl-3.0 |
Edraak/edraak-platform | common/lib/xmodule/xmodule/tests/test_randomize_module.py | 13 | 3955 | """
Test cases covering workflows and behaviors for the Randomize XModule
"""
import unittest
from datetime import datetime, timedelta
from pytz import UTC
from opaque_keys.edx.locator import BlockUsageLocator
from xblock.fields import ScopeIds
from xmodule.randomize_module import RandomizeModule
from .test_course_mo... | agpl-3.0 |
sesuncedu/sdhash | sdhash-ui/cherrypy/wsgiserver/wsgiserver3.py | 82 | 78074 | """A high-speed, production ready, thread pooled, generic HTTP server.
Simplest example on how to use this module directly
(without using CherryPy's application machinery)::
from cherrypy import wsgiserver
def my_crazy_app(environ, start_response):
status = '200 OK'
response_headers = [('... | apache-2.0 |
allenp/odoo | addons/website_forum/tests/common.py | 13 | 3559 | # -*- coding: utf-8 -*-
from openerp.tests import common
KARMA = {
'ask': 5, 'ans': 10,
'com_own': 5, 'com_all': 10,
'com_conv_all': 50,
'upv': 5, 'dwv': 10,
'edit_own': 10, 'edit_all': 20,
'close_own': 10, 'close_all': 20,
'unlink_own': 10, 'unlink_all': 20,
'post': 100, 'flag': 500, ... | gpl-3.0 |
labordoc/labordoc-next | modules/miscutil/lib/web_api_key.py | 2 | 4341 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2010, 2011, 2013 CERN.
##
## Invenio 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
## ... | gpl-2.0 |
a-nai/django-wiki | wiki/plugins/images/wiki_plugin.py | 2 | 3205 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
from django.conf.urls import patterns, url
from django.utils.translation import ugettext as _
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from wiki.plugins.images import views... | gpl-3.0 |
xorstream/unicorn | bindings/python/sample_network_auditing.py | 7 | 12371 | #!/usr/bin/env python
# Unicorn sample for auditing network connection and file handling in shellcode.
# Nguyen Tan Cong <shenlongbk@gmail.com>
from __future__ import print_function
from unicorn import *
from unicorn.x86_const import *
import struct
import uuid
SIZE_REG = 4
SOCKETCALL_MAX_ARGS = 3
SOCKET_TYPES = {
... | gpl-2.0 |
andyh616/mne-python | mne/io/egi/egi.py | 5 | 13219 | # Authors: Denis A. Engemann <denis.engemann@gmail.com>
# Teon Brooks <teon.brooks@gmail.com>
#
# simplified BSD-3 license
import datetime
import time
import warnings
import numpy as np
from ..base import _BaseRaw, _check_update_montage
from ..meas_info import _empty_info
from ..constants import F... | bsd-3-clause |
asgard-lab/neutron | neutron/common/exceptions.py | 12 | 15936 | # Copyright 2011 VMware, 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 a... | apache-2.0 |
axbaretto/beam | sdks/python/.tox/py27gcp/lib/python2.7/site-packages/google/api/httpbody_pb2.py | 17 | 2535 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/api/httpbody.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflecti... | apache-2.0 |
illicitonion/givabit | lib/sdks/google_appengine_1.7.1/google_appengine/lib/jinja2/jinja2/compiler.py | 121 | 61899 | # -*- coding: utf-8 -*-
"""
jinja2.compiler
~~~~~~~~~~~~~~~
Compiles nodes into python code.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from cStringIO import StringIO
from itertools import chain
from copy import deepcopy
from jinja2 import nodes
from j... | apache-2.0 |
Tigerwhit4/taiga-back | taiga/projects/custom_attributes/migrations/0005_auto_20150505_1639.py | 23 | 1088 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_pgjson.fields
class Migration(migrations.Migration):
dependencies = [
('custom_attributes', '0004_create_empty_customattributesvalues_for_existen_object'),
]
operations = [
... | agpl-3.0 |
Metronote/metronotesd-alpha | lib/burn.py | 1 | 3750 | #! /usr/bin/python3
import struct
import decimal
D = decimal.Decimal
from fractions import Fraction
from . import (util, config, exceptions, bitcoin, util)
"""Burn {} to earn {} during a special period of time.""".format(config.BTC, config.XMN)
ID = 60
def validate (db, source, destination, quantity, block_index,... | mit |
ufosky-server/zulip | analytics/management/commands/client_activity.py | 114 | 2830 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.db.models import Count
from zerver.models import UserActivity, UserProfile, Realm, \
get_realm, get_user_profile_by_email
import datetime
class Command(BaseCommand):
help = """Report rough client activity ... | apache-2.0 |
moreati/uwsgi | tests/websockets.py | 13 | 2254 | #!./uwsgi --https :8443,foobar.crt,foobar.key --http-websockets --gevent 100 --module tests.websocket
import uwsgi
import gevent
from gevent.queue import JoinableQueue
from gevent.socket import wait_read
queue = JoinableQueue()
def application(env, sr):
ws_scheme = 'ws'
if 'HTTPS' in env or env['wsgi.url_sc... | gpl-2.0 |
franosincic/edx-platform | lms/djangoapps/discussion_api/tests/test_permissions.py | 34 | 4986 | """
Tests for discussion API permission logic
"""
import itertools
import ddt
from discussion_api.permissions import (
can_delete,
get_editable_fields,
get_initializable_comment_fields,
get_initializable_thread_fields,
)
from lms.lib.comment_client.comment import Comment
from lms.lib.comment_client.th... | agpl-3.0 |
norayr/unisubs | libs/bulkops.py | 6 | 3083 | # TODO: Remove this once the new data model lands.
# This is from http://www.caktusgroup.com/blog/2011/09/20/bulk-inserts-django/
# Bulk insert/update DB operations for the Django ORM. Useful when
# inserting/updating lots of objects where the bottleneck is overhead
# in talking to the database. Instead of doing this
... | agpl-3.0 |
onyxfish/stovetop | gdata/webmastertools/data.py | 126 | 5504 | #!/usr/bin/python
#
# Copyright (C) 2009 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 ... | mit |
benjaminsoellner/2015_Data_Analyst_Project_3 | Lesson_5_Analyzing_Data/16-Same_Operator/population.py | 3 | 2354 | #!/usr/bin/env python
"""
In an earlier exercise we looked at the cities dataset and asked which region in India contains
the most cities. In this exercise, we'd like you to answer a related question regarding regions in
India. What is the average city population for a region in India? Calculate your answer by first ... | agpl-3.0 |
askeing/servo | tests/wpt/web-platform-tests/webdriver/tests/actions/mouse.py | 3 | 4720 | import pytest
from tests.actions.support.mouse import get_center
from tests.actions.support.refine import get_events, filter_dict
from tests.support.asserts import assert_move_to_coordinates
from tests.support.inline import inline
from tests.support.wait import wait
def link_doc(dest):
content = "<a href=\"{}\" ... | mpl-2.0 |
piMoll/SEILAPLAN | tool/peakdetect.py | 1 | 27677 | # -*- coding: utf-8 -*-
import numpy as np
from math import pi, log
try:
from scipy import fft, ifft
from scipy.optimize import curve_fit
except ModuleNotFoundError:
# Import error is handled in seilaplanPlugin.py run() function
pass
i = 10000
x = np.linspace(0, 3.5 * pi, i)
y = (0.3*np.sin(x) + np.s... | gpl-2.0 |
caisq/tensorflow | tensorflow/python/ops/distributions/dirichlet_multinomial.py | 17 | 13343 | # 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... | apache-2.0 |
josrolgil/exjobbCalvin | calvin/utilities/confsort.py | 3 | 3435 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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... | apache-2.0 |
salaria/odoo | addons/payment_authorize/controllers/main.py | 247 | 1261 | # -*- coding: utf-8 -*-
import pprint
import logging
import urlparse
from openerp import http
from openerp.http import request
_logger = logging.getLogger(__name__)
class AuthorizeController(http.Controller):
_return_url = '/payment/authorize/return/'
_cancel_url = '/payment/authorize/cancel/'
@http.ro... | agpl-3.0 |
CEG-FYP-OpenStack/scheduler | nova/servicegroup/drivers/mc.py | 7 | 3516 | # Service heartbeat driver using Memcached
# Copyright (c) 2013 Akira Yoshiyama <akirayoshiyama at gmail dot com>
#
# This is derived from nova/servicegroup/drivers/db.py.
# Copyright 2012 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... | apache-2.0 |
jkburges/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/model/warninglog.py | 122 | 2147 | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
pyqt/python-qt5 | PyQt5/uic/port_v2/as_string.py | 2 | 1435 | #############################################################################
##
## Copyright (c) 2016 Riverbank Computing Limited <info@riverbankcomputing.com>
##
## This file is part of PyQt5.
##
## This file may be used under the terms of the GNU General Public License
## version 3.0 as published by the Free Softw... | gpl-3.0 |
rabipanda/tensorflow | tensorflow/contrib/timeseries/python/timeseries/state_space_models/filtering_postprocessor_test.py | 67 | 3176 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
miniconfig/home-assistant | homeassistant/components/homematic.py | 5 | 28822 | """
Support for Homematic devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/homematic/
"""
import os
import time
import logging
from datetime import timedelta
from functools import partial
import voluptuous as vol
import homeassistant.helpers.co... | mit |
DrMeers/django | tests/one_to_one/models.py | 26 | 1605 | """
10. One-to-one relationships
To define a one-to-one relationship, use ``OneToOneField()``.
In this example, a ``Place`` optionally can be a ``Restaurant``.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_co... | bsd-3-clause |
justinlulejian/fah-gae | lib/flask/globals.py | 783 | 1137 | # -*- coding: utf-8 -*-
"""
flask.globals
~~~~~~~~~~~~~
Defines all the global objects that are proxies to the current
active context.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from functools import partial
from werkzeug.local import LocalStack, ... | mit |
Nitrate/Nitrate | src/tcms/testruns/migrations/0006_set_assignee_and_tested_by_to_null_if_user_is_deleted.py | 2 | 1101 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-11-18 14:51
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("testruns", "0005_set_run_default_tester_to_null_if_user_is_deleted... | gpl-2.0 |
Clinical-Genomics/scout | tests/server/blueprints/login/test_views.py | 1 | 2083 | # -*- coding: utf-8 -*-
from flask import url_for
from flask_ldap3_login.forms import LDAPLoginForm
from flask_login import current_user
from scout.server.extensions import store
def test_unathorized_login(app, institute_obj, case_obj):
"""Test failed authentication against scout database"""
# GIVEN an init... | bsd-3-clause |
ol-loginov/intellij-community | python/helpers/docutils/parsers/rst/languages/eo.py | 57 | 3722 | # $Id: eo.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: Marcelo Huerta San Martin <richieadler@users.sourceforge.net>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two... | apache-2.0 |
qedsoftware/commcare-hq | corehq/apps/smsbillables/migrations/0005_update_http_backend_criteria.py | 1 | 1081 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from corehq.apps.smsbillables.models import SmsGatewayFeeCriteria
from corehq.messaging.smsbackends.sislog.models import SQLSislogBackend
from corehq.messaging.smsbackends.yo.models import SQLYoBackend
from corehq.sql_db.o... | bsd-3-clause |
indashnet/InDashNet.Open.UN2000 | android/external/chromium-trace/trace-viewer/third_party/pywebsocket/src/test/mux_client_for_testing.py | 29 | 27698 | #!/usr/bin/env python
#
# Copyright 2012, 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... | apache-2.0 |
Javiercerna/MissionPlanner | Lib/site-packages/scipy/optimize/tests/test_minpack.py | 55 | 9863 | """
Unit tests for optimization routines from minpack.py.
"""
from numpy.testing import assert_, assert_almost_equal, assert_array_equal, \
assert_array_almost_equal, TestCase, run_module_suite, assert_raises
import numpy as np
from numpy import array, float64
from scipy import optimize
from scipy.optimize.mi... | gpl-3.0 |
NationalSecurityAgency/ghidra | Ghidra/Features/Python/ghidra_scripts/AskScriptPy.py | 1 | 4185 | ## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | apache-2.0 |
derekjchow/models | research/cvt_text/task_specific/task_definitions.py | 5 | 2961 | # 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 applicab... | apache-2.0 |
openstack/blazar | blazar/tests/__init__.py | 3 | 2729 | # Copyright (c) 2013 Bull.
#
# 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, sof... | apache-2.0 |
playm2mboy/edx-platform | openedx/core/djangoapps/user_api/preferences/api.py | 3 | 16995 | """
API for managing user preferences.
"""
import logging
import analytics
from eventtracking import tracker
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db import IntegrityError
from django.utils.translation import ugettext as _
from django.utils.translation impor... | agpl-3.0 |
perlygatekeeper/glowing-robot | Little_Alchemy_2/Scraper_python/env/lib/python3.7/site-packages/pip/_vendor/requests/adapters.py | 54 | 21548 | # -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import os.path
import socket
from pip._vendor.urllib3.poolmanager import PoolManager, proxy_from_url
from pip._vendor.urllib3.response import HTTPRes... | artistic-2.0 |
pniedzielski/fb-hackathon-2013-11-21 | src/repl.it/jsrepl/extern/python/unclosured/lib/python2.7/cgitb.py | 113 | 12073 | """More comprehensive traceback formatting for Python scripts.
To enable this module, do:
import cgitb; cgitb.enable()
at the top of your script. The optional arguments to enable() are:
display - if true, tracebacks are displayed in the web browser
logdir - if set, tracebacks are written to fi... | agpl-3.0 |
harshilasu/LinkurApp | y/google-cloud-sdk/platform/gcutil/lib/google_compute_engine/gcutil_lib/http_health_check_cmds.py | 4 | 13283 | # Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | gpl-3.0 |
Inspq/ansible | lib/ansible/modules/network/eos/eos_user.py | 1 | 11534 | #!/usr/bin/python
#
# 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.
#
# Ansible is distribut... | gpl-3.0 |
swiftstack/swift | test/probe/test_object_conditional_requests.py | 3 | 2859 | # Copyright (c) 2017 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 ... | apache-2.0 |
yask123/scikit-learn | sklearn/cross_decomposition/pls_.py | 187 | 28507 | """
The :mod:`sklearn.pls` module implements Partial Least Squares (PLS).
"""
# Author: Edouard Duchesnay <edouard.duchesnay@cea.fr>
# License: BSD 3 clause
from ..base import BaseEstimator, RegressorMixin, TransformerMixin
from ..utils import check_array, check_consistent_length
from ..externals import six
import w... | bsd-3-clause |
hurricanerix/swift | test/unit/common/test_constraints.py | 2 | 25596 | # 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... | apache-2.0 |
kbiElude/Emerald | Emerald/gtest-1.6.0/test/gtest_output_test.py | 1733 | 12005 | #!/usr/bin/env python
#
# Copyright 2008, 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... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.