code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unified_strdate,
compat_str,
)
class NocoIE(InfoExtractor):
_VALID_URL = r'http://(?:(?:www\.)?noco\.tv/emission/|player\.noco\.tv/\?idvideo=)(?P<id>\d+)'
... | huangciyin/youtube-dl | youtube_dl/extractor/noco.py | Python | unlicense | 3,451 |
# 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"); y... | lukecwik/incubator-beam | learning/katas/python/test_helper.py | Python | apache-2.0 | 6,995 |
#
# Copyright (C) 2015 Greg Landrum
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
import unittest, os, csv
from rdkit import Chem, RDConfig
class TestCase(unittest.Test... | bp-kelley/rdkit | Data/Pains/test_data/run_tests.py | Python | bsd-3-clause | 1,219 |
# $Id$
#
# Copyright (C) 2003-2008 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
"""unit testing code ... | bp-kelley/rdkit | rdkit/ML/UnitTestBuildComposite.py | Python | bsd-3-clause | 7,293 |
# -*- coding: utf-8 -*-
"""
pygments.lexers.asm
~~~~~~~~~~~~~~~~~~~
Lexers for assembly languages.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, using, DelegatingL... | sysbot/pastedown | vendor/pygments/pygments/lexers/asm.py | Python | mit | 12,130 |
'''tzinfo timezone information for Asia/Rangoon.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Rangoon(DstTzInfo):
'''Asia/Rangoon timezone definition. See datetime.tzinfo for details'''
zone = 'Asia/Rangoon'
_utc_... | newvem/pytz | pytz/zoneinfo/Asia/Rangoon.py | Python | mit | 564 |
"""
Train low-data Tox21 models with random forests. Test last fold only.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import tempfile
import numpy as np
import deepchem as dc
from datasets import load_tox21_ecfp
from sklearn.ensemble import RandomFo... | Agent007/deepchem | examples/low_data/tox_rf_one_fold.py | Python | mit | 2,037 |
# Copyright (C) 2015-2016 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This progr... | ccilab/binutils | gdb/testsuite/gdb.python/py-mi-objfile-gdb.py | Python | gpl-3.0 | 1,077 |
# Copyright (C) 2013 Ian W. Harry
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in t... | ligo-cbc/pycbc | pycbc/tmpltbank/option_utils.py | Python | gpl-3.0 | 57,143 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | crmccreary/openerp_server | openerp/addons/import_google/wizard/import_google_data.py | Python | agpl-3.0 | 8,149 |
from django.db import models
from django.conf import settings
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _, pgettext_lazy
from django.core.urlresolvers import reverse
from django.contrib.contenttypes.models import ContentType
from django.contrib.c... | manevant/django-oscar | src/oscar/apps/promotions/models.py | Python | bsd-3-clause | 11,554 |
"""Transformers for missing value imputation"""
import typing
from ._base import MissingIndicator, SimpleImputer
from ._knn import KNNImputer
if typing.TYPE_CHECKING:
# Avoid errors in type checkers (e.g. mypy) for experimental estimators.
# TODO: remove this check once the estimator is no longer experimental... | manhhomienbienthuy/scikit-learn | sklearn/impute/__init__.py | Python | bsd-3-clause | 438 |
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.utils.six.moves.urllib.parse import urlparse
from wagtail.wagtailcore.models import Page
class BadRequestError(Exception):
pass
def get_base_url(request=None):
base_url = getattr(settings, 'WAGTAILAPI_BAS... | chrxr/wagtail | wagtail/contrib/wagtailapi/utils.py | Python | bsd-3-clause | 807 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.ap... | zestrada/nova-cs498cc | nova/virt/hyperv/snapshotops.py | Python | apache-2.0 | 4,875 |
#!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | BladeSmithJohn/nixysa | nixysa/cpp_utils_unittest.py | Python | apache-2.0 | 1,879 |
def __str__(self):
return self.getStringValue()
def __hash__(self):
raise AttributeError, "ConfigVariables are not immutable."
def ls(self):
from pandac.Notify import Notify
self.write(Notify.out())
def __int__(self):
return int(self.getValue())
def __lon... | jjkoletar/panda3d | direct/src/extensions/ConfigVariable-extensions.py | Python | bsd-3-clause | 1,164 |
import sys
import os
import shutil
from zope.interface.verify import verifyObject
from twisted.trial import unittest
# ugly hack to avoid cyclic imports of scrapy.spider when running this test
# alone
from scrapy.interfaces import ISpiderManager
from scrapy.spidermanager import SpiderManager
from scrapy.http import ... | devGregA/code | scrapy/tests/test_spidermanager/__init__.py | Python | bsd-3-clause | 2,747 |
from __future__ import absolute_import
import sys
from kombu.transport import amqplib
from kombu.connection import BrokerConnection
from kombu.tests.utils import TestCase
from kombu.tests.utils import mask_modules, Mock
class MockConnection(dict):
def __setattr__(self, key, value):
self[key] = value
... | glogiotatidis/mozillians-new | vendor-local/lib/python/kombu/tests/transport/test_amqplib.py | Python | bsd-3-clause | 4,458 |
import os
import urlparse
import boto
import boto.connection
import boto.jsonresponse
import boto.exception
import awsqueryrequest
class NoCredentialsError(boto.exception.BotoClientError):
def __init__(self):
s = 'Unable to find credentials'
boto.exception.BotoClientError.__init__(self, s)
class ... | apavlo/h-store | third_party/python/boto/roboto/awsqueryservice.py | Python | gpl-3.0 | 4,196 |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.gui2.actions import InterfaceAction
from calibre.gui2.dialogs.template_dialog import TemplateDialog
from cal... | ashang/calibre | src/calibre/gui2/actions/show_template_tester.py | Python | gpl-3.0 | 1,940 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 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.apach... | zestrada/nova-cs498cc | nova/tests/api/openstack/compute/test_api.py | Python | apache-2.0 | 7,206 |
from __future__ import unicode_literals
"""Migrating IPython < 4.0 to Jupyter
This *copies* configuration and resources to their new locations in Jupyter
Migrations:
- .ipython/
- nbextensions -> JUPYTER_DATA_DIR/nbextensions
- kernels -> JUPYTER_DATA_DIR/kernels
- .ipython/profile_default/
- static/custom -... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/jupyter_core/migrate.py | Python | bsd-2-clause | 8,222 |
# 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 telemetry.page import page_measurement
class NoOp(page_measurement.PageMeasurement):
def __init__(self):
super(NoOp, self).__init__('RunNoOp')
... | TeamEOS/external_chromium_org | tools/perf/measurements/no_op.py | Python | bsd-3-clause | 373 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings_core")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| cbxcube/bezrealitky.py | tests/manage_core.py | Python | bsd-3-clause | 247 |
'''This module contains utilities for following up search triggers'''
# JavaScript for searching the aLOG
redirect_javascript = """<script type="text/javascript">
function redirect(form,way)
{
// Set location to form and submit.
if(form != '')
{
document.forms[form].action=way;
... | ligo-cbc/pycbc | pycbc/results/dq.py | Python | gpl-3.0 | 2,187 |
"""
Test the course_info xblock
"""
import mock
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from .helpers import LoginEnrollmentTestCase
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from courseware.tests.modulestore_config import TEST_DATA_MIXE... | dsajkl/reqiop | lms/djangoapps/courseware/tests/test_course_info.py | Python | agpl-3.0 | 2,849 |
import fcntl
import logging
import os
log = logging.getLogger(__name__)
def read_file_line(filename):
with open(filename, 'r') as f:
return f.read().strip()
class Directory:
def __init__(self, path):
self.path = path
def __enter__(self):
log.info('Opening {}'.format(self.path))... | movicha/dcos | packages/bootstrap/extra/dcos_internal_utils/utils/__init__.py | Python | apache-2.0 | 1,151 |
"""The tests for the IMAP email content sensor platform."""
from collections import deque
import datetime
import email
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from homeassistant.components.imap_email_content import sensor as imap_email_content
from homeassistant.helpers.even... | jawilson/home-assistant | tests/components/imap_email_content/test_sensor.py | Python | apache-2.0 | 6,952 |
from __future__ import unicode_literals
import re
import sure # noqa
import moto.server as server
'''
Test the different server responses
'''
def test_ec2_server_get():
backend = server.create_backend_app("ec2")
test_client = backend.test_client()
res = test_client.get(
'/?Action=RunInstances&... | Brett55/moto | tests/test_ec2/test_server.py | Python | apache-2.0 | 662 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from .....testing import assert_equal
from ..histogrammatching import HistogramMatching
def test_HistogramMatching_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(noha... | FCP-INDI/nipype | nipype/interfaces/slicer/filtering/tests/test_auto_HistogramMatching.py | Python | bsd-3-clause | 1,372 |
# 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... | dims/heat | heat/db/sqlalchemy/migrate_repo/versions/043_migrate_template_versions.py | Python | apache-2.0 | 2,285 |
# 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... | HKUST-SING/tensorflow | tensorflow/python/debug/wrappers/local_cli_wrapper.py | Python | apache-2.0 | 20,594 |
"""
Tests for programs celery tasks.
"""
import json
import unittest
from celery.exceptions import MaxRetriesExceededError
import ddt
from django.conf import settings
from django.core.cache import cache
from django.test import override_settings, TestCase
from edx_rest_api_client.client import EdxRestApiClient
from edx... | TheMOOCAgency/edx-platform | openedx/core/djangoapps/programs/tasks/v1/tests/test_tasks.py | Python | agpl-3.0 | 14,729 |
# /usr/bin/env python
"""
This module has utility functions for gathering up the static content
that is defined by XModules and XModuleDescriptors (javascript and css)
"""
import logging
import hashlib
import os
import errno
import sys
from collections import defaultdict
from docopt import docopt
from path import path... | EduPepperPD/pepper2013 | common/lib/xmodule/xmodule/static_content.py | Python | agpl-3.0 | 6,505 |
from ..libmp.backend import xrange
from .functions import defun, defun_wrapped
def _check_need_perturb(ctx, terms, prec, discard_known_zeros):
perturb = recompute = False
extraprec = 0
discard = []
for term_index, term in enumerate(terms):
w_s, c_s, alpha_s, beta_s, a_s, b_s, z = term
h... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/sympy/mpmath/functions/hypergeometric.py | Python | agpl-3.0 | 51,556 |
from __future__ import unicode_literals
import pytest
from prompt_toolkit.completion import Completion
from prompt_toolkit.document import Document
@pytest.fixture
def completer():
import mycli.sqlcompleter as sqlcompleter
return sqlcompleter.SQLCompleter(smart_completion=False)
@pytest.fixture
def complete_e... | danieljwest/mycli | tests/test_naive_completion.py | Python | bsd-3-clause | 1,653 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class PaymentWizard(models.TransientModel):
_inherit = 'payment.acquirer.onboarding.wizard'
_name = 'website.sale.payment.acquirer.onboarding.wizard'
_description = 'Website Payment ... | ddico/odoo | addons/website_sale/wizard/payment_acquirer_onboarding_wizard.py | Python | agpl-3.0 | 539 |
"""Supporting definitions for the Python regression tests."""
if __name__ != 'test.test_support':
raise ImportError, 'test_support must be imported from the test package'
import sys
class Error(Exception):
"""Base class for regression test exceptions."""
class TestFailed(Error):
"""Test failed."""
clas... | certik/pyjamas | pgen/test_support.py | Python | apache-2.0 | 18,242 |
# Copyright 2013 Hewlett-Packard Development Company, 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 requir... | ankur-gupta91/horizon-net-ip | openstack_dashboard/dashboards/identity/domains/panel.py | Python | apache-2.0 | 1,340 |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) 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 re... | matthewoliver/swift | test/unit/test_locale/test_locale.py | Python | apache-2.0 | 2,743 |
#!/usr/bin/env python
'''
these tables are generated from the STM32 datasheets for the
STM32F40x
'''
# additional build information for ChibiOS
build = {
"CHIBIOS_STARTUP_MK" : "os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk",
"CHIBIOS_PLATFORM_MK" : "os/hal/ports/STM32/STM32F4xx/platform.mk"
... | squilter/ardupilot | libraries/AP_HAL_ChibiOS/hwdef/scripts/STM32F407xx.py | Python | gpl-3.0 | 20,891 |
# Copyright 2014 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 ... | cernops/neutron | neutron/db/migration/alembic_migrations/versions/5ac1c354a051_n1kv_segment_alloc.py | Python | apache-2.0 | 2,068 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from reportlab.pdfbase import ttfonts
from odoo import api, fields, models
from odoo.report.render.rml2pdf import customfonts
"""This module allows the mapping of some system-available TTF fonts to
the r... | chienlieu2017/it_management | odoo/odoo/addons/base/res/res_font.py | Python | gpl-3.0 | 6,052 |
from __future__ import absolute_import
from time import time
from itertools import count
from celery import states
from celery.events import Event
from celery.events.state import State, Worker, Task, HEARTBEAT_EXPIRE
from celery.utils import uuid
from celery.tests.utils import unittest
class replay(object):
d... | mzdaniel/oh-mainline | vendor/packages/celery/celery/tests/test_events/test_events_state.py | Python | agpl-3.0 | 10,779 |
# -*- coding: utf-8 -*-
"""
celery.events.dumper
~~~~~~~~~~~~~~~~~~~~
THis is a simple program that dumps events to the console
as they happen. Think of it like a `tcpdump` for Celery events.
:copyright: (c) 2009 - 2011 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
from __fu... | mzdaniel/oh-mainline | vendor/packages/celery/celery/events/dumper.py | Python | agpl-3.0 | 2,533 |
import xdrlib
xdrlib._test()
| zephyrplugins/zephyr | zephyr.plugin.jython/jython2.5.2rc3/Lib/test/test_xdrlib.py | Python | epl-1.0 | 30 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Serial Port Protocol
"""
# system imports
import os, errno
# dependent on pyserial ( http://pyserial.sf.net/ )
# only tested w/ 1.18 (5 Dec 2002)
import serial
from serial import PARITY_NONE, PARITY_EVEN, PARITY_ODD
from serial im... | mclois/iteexe | twisted/internet/_posixserialport.py | Python | gpl-2.0 | 2,116 |
#!/usr/bin/env python
'''
OWASP ZSC | ZCR Shellcoder
ZeroDay Cyber Research
Z3r0D4y.Com
Ali Razmjoo
'''
def run(dirname):
return 'N'
| Yas3r/OWASP-ZSC | lib/generator/windows_x86/dir_create.py | Python | gpl-3.0 | 135 |
import hashlib
import hmac
def hmac_sha256_digest(key, msg):
"""
Return the HMAC-SHA256 message authentication code of the message
'msg' with key 'key'.
"""
return hmac.new(key, msg, hashlib.sha256).digest()
| masterkorp/obfsproxy | obfsproxy/common/hmac_sha256.py | Python | bsd-3-clause | 230 |
# test tools for the pyxpcom bindings
from xpcom import _xpcom
import unittest
# export a "getmemusage()" function that returns a useful "bytes used" count
# for the current process. Growth in this when doing the same thing over and
# over implies a leak.
try:
import win32api
import win32pdh
import win32... | yuyuyu101/VirtualBox-NetBSD | src/libs/xpcom18a4/python/test/pyxpcom_test_tools.py | Python | gpl-2.0 | 4,286 |
# Copyright 2013 Mellanox Technologies, Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | samsu/neutron | plugins/mlnx/common/constants.py | Python | apache-2.0 | 784 |
def migrate_ip(self):
"""
Migrate to the latest schema version.
"""
migrate_1_to_2(self)
migrate_2_to_3(self)
def migrate_2_to_3(self):
"""
Migrate from schema 2 to 3.
"""
if self.schema_version < 2:
migrate_1_to_2(self)
if self.schema_version == 2:
self.schem... | Lambdanaut/crits | crits/ips/migrate.py | Python | mit | 869 |
#!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module 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 late... | bjolivot/ansible | lib/ansible/modules/cloud/openstack/os_nova_flavor.py | Python | gpl-3.0 | 8,477 |
# Copyright (c) 2014 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... | gkotton/vmware-nsx | vmware-nsx/neutron/tests/unit/vmware/extensions/test_portsecurity.py | Python | apache-2.0 | 1,831 |
#!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 16.3.8
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | bjolivot/ansible | lib/ansible/modules/network/avi/avi_analyticsprofile.py | Python | gpl-3.0 | 25,965 |
# ==================================================================================================
# Copyright 2013 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | Yasumoto/commons | src/python/twitter/common/__init__.py | Python | apache-2.0 | 957 |
from typing import Callable
def f() -> Callable[[int, str], int]:
pass
c = f()
print(c(<arg1>))
| paplorinc/intellij-community | python/testData/paramInfo/TypingCallableWithKnownParameters.py | Python | apache-2.0 | 104 |
NOERROR = 0
NOCONTEXT = -1
NODISPLAY = -2
NOWINDOW = -3
NOGRAPHICS = -4
NOTTOP = -5
NOVISUAL = -6
BUFSIZE = -7
BADWINDOW = -8
ALREADYBOUND = -100
BINDFAILED = -101
SETFAILED = -102
| xbmc/atv2 | xbmc/lib/libPython/Python/Lib/plat-irix6/GLWS.py | Python | gpl-2.0 | 181 |
# 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... | xuleiboy1234/autoTitle | tensorflow/tensorflow/python/kernel_tests/init_ops_test.py | Python | mit | 22,981 |
#!/usr/bin/env python
""" genpyx.py - parse c declarations
(c) 2002, 2003, 2004, 2005 Simon Burton <simon@arrowtheory.com>
Released under GNU LGPL license.
version 0.xx
This is a module of mixin classes for ir.py .
Towards the end of ir.py our global class definitions
are remapped to point to the class definitions ... | omco/mpir | yasm/tools/python-yasm/pyxelator/genpyx.py | Python | lgpl-3.0 | 18,513 |
# Copyright (c) 2015 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 ... | paninetworks/neutron | neutron/tests/functional/agent/linux/test_interface.py | Python | apache-2.0 | 2,526 |
# $Id$
import inc_sip as sip
import inc_sdp as sdp
# When SRTP is enabled in pjsua, it should prefer to use
# RTP/SAVP media line if there are multiple m=audio lines
sdp = \
"""
v=0
o=- 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=audio 4000 RTP/AVP 0
a=rtpmap:0 pcmu/8000
m=audio 4000 RTP/SAVP 0
a=crypto:1 aes_... | xiejianying/pjsip | tests/pjsua/scripts-sendto/330_srtp_prefer_rtp_savp.py | Python | gpl-2.0 | 805 |
import collections
import inspect
import mock
import pytest
import yaml
from ansible.module_utils.six import string_types
from ansible.modules.cloud.openstack import os_server
class AnsibleFail(Exception):
pass
class AnsibleExit(Exception):
pass
def params_from_doc(func):
'''This function extracts th... | mheap/ansible | test/units/modules/cloud/openstack/test_os_server.py | Python | gpl-3.0 | 6,539 |
"""
Public views
"""
from django_future.csrf import ensure_csrf_cookie
from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from django.conf import settings
from edxmako.shortcuts import render_to_response
from external_auth.views import (s... | huchoi/edx-platform | cms/djangoapps/contentstore/views/public.py | Python | agpl-3.0 | 2,264 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para depositfiles
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core ... | dknlght/dkodi | src/plugin.video.animehere/servers/depositfiles.py | Python | gpl-2.0 | 2,041 |
"""
.. todo::
WRITEME
"""
import numpy as np
from pylearn2.datasets import dense_design_matrix
from pylearn2.utils.serial import load
from pylearn2.utils.rng import make_np_rng
from pylearn2.utils import contains_nan
class TFD(dense_design_matrix.DenseDesignMatrix):
"""
Pylearn2 wrapper for the Toronto ... | JazzeYoung/VeryDeepAutoEncoder | pylearn2/pylearn2/datasets/tfd.py | Python | bsd-3-clause | 4,912 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
pass
| glaudsonml/kurgan-ai | tools/sqlmap/waf/__init__.py | Python | apache-2.0 | 150 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import osv
import fields
| vileopratama/vitech | src/openerp/osv/__init__.py | Python | mit | 125 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class PaymentEntryReference(Document):
pass
| hassanibi/erpnext | erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.py | Python | gpl-3.0 | 287 |
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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:... | halexan/Headquarters | src/headquarters/packet/stream_parser.py | Python | mit | 2,384 |
"""Results of coverage measurement."""
import os
from coverage.backward import set, sorted # pylint: disable=W0622
from coverage.misc import format_lines, join_regex, NoSource
from coverage.parser import CodeParser
class Analysis(object):
"""The results of analyzing a code unit."""
def __init__(s... | youtube/cobalt | third_party/blink/Tools/Scripts/webkitpy/thirdparty/coverage/results.py | Python | bsd-3-clause | 8,758 |
"""Python part of the warnings subsystem."""
# Note: function level imports should *not* be used
# in this module as it may cause import lock deadlock.
# See bug 683658.
import linecache
import sys
import types
__all__ = ["warn", "warn_explicit", "showwarning",
"formatwarning", "filterwarnings", "simplefil... | gusai-francelabs/datafari | windows/python/Lib/warnings.py | Python | apache-2.0 | 14,748 |
# -*- coding: utf-8 -*-
"""
pygments.lexers.actionscript
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for ActionScript and MXML.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, using,... | prashanthr/wakatime | wakatime/packages/pygments_py3/pygments/lexers/actionscript.py | Python | bsd-3-clause | 11,179 |
# sybase/__init__.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from sqlalchemy.dialects.sybase import base, pysybase, pyodbc
# default dialect
ba... | jessekl/flixr | venv/lib/python2.7/site-packages/sqlalchemy/dialects/sybase/__init__.py | Python | mit | 957 |
def foo3(x, y):
assert isinstance(y, object)
i = x + y
return i
| asedunov/intellij-community | python/testData/intentions/typeAssertion4_after.py | Python | apache-2.0 | 70 |
def func1():
var = 1
def func2():
nonlocal var
var = 2
print(var)
func2()
print(var)
func1()
| clumsy/intellij-community | python/testData/inspections/PyUnusedLocalVariableInspection3K/test.py | Python | apache-2.0 | 132 |
# encoding.py - character transcoding support for Mercurial
#
# Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import error
import unicodedata, locale, os
def _getpr... | iaddict/mercurial.rb | vendor/mercurial/mercurial/encoding.py | Python | mit | 9,581 |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i:s'
DATE... | edisonlz/fruit | web_project/base/site-packages/django/conf/locale/mk/formats.py | Python | apache-2.0 | 1,758 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Goose:
@property
def name(self):
return "Mr Stabby"
class Hamster:
@property
def name(self):
return "Phil"
class _SecretSquirrel:
@property
def name(self):
return "Mr Anonymous" | Krakn/learning | src/python/python_koans/python3/another_local_module.py | Python | isc | 280 |
############################################################################
# Copyright (C) 2005 by Reithinger GmbH
# mreithinger@web.de
#
# This file is part of faces.
#
# faces is free software; you can redistribute it and/or modify
# ... | diogocs1/comps | web/addons/resource/faces/plocale.py | Python | apache-2.0 | 1,910 |
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General... | minhphung171093/OpenERP_V8 | openerp/addons/google_spreadsheet/google_spreadsheet.py | Python | agpl-3.0 | 5,617 |
#!/usr/bin/env python3
import os
import unittest
import xml.etree.ElementTree as ET
from ietf.sql.base import Base
from ietf.sql.fyi import Fyi
from ietf.xml.fyi import add_all
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
class TestXmlRfc(unittest.TestCase):
data_file = os.path.jo... | lafrenierejm/ietf-cli | ietf/test/xml-fyi.py | Python | isc | 1,273 |
# coding=utf-8
"""
Testing CoAP requests
"""
import json
import os
import tempfile
import unittest
import pycolo as coap
from pycolo.request import request
from pycolo.endpoint import Endpoint
from pycolo.exceptions import InvalidURL, COAPError
from tests.examples.TestCoAPbin import coapbin
class CarelessTest(unitt... | sieben/pycolo | tests/core/TestRequest.py | Python | isc | 25,728 |
from markdown import markdown
from django.db import models
from django.core.urlresolvers import reverse
class Tag(models.Model):
"""
A subject-matter tag for blog posts
"""
slug = models.CharField(max_length=200, unique=True)
name = models.SlugField(max_length=200, unique=True)
def __str__(s... | blcook223/bencook.info | blog/models.py | Python | isc | 1,100 |
import feedparser
from multiprocessing.pool import ThreadPool
def fetch_and_parse_feed(args):
name, feed = args
return (name, feedparser.parse(feed))
class Reader:
"""Get updates on the feeds supplied"""
def __init__(self, feeds, silent=False, njobs=4):
self.feeds = []
self.silent = s... | sulami/feed2maildir | feed2maildir/reader.py | Python | isc | 778 |
"""Unit tests for wx.Gauge.
Methods yet to test:
__init__, Create, Pulse"""
import unittest
import wx
import wxtest
import testControl
class GaugeTest(testControl.ControlTest):
def setUp(self):
self.app = wx.PySimpleApp()
self.frame = wx.Frame(parent=None)
self.testControl = wx.Gauge(par... | ifwe/wxpy | src/tests/wxPythonTests/testGauge.py | Python | mit | 2,410 |
from abc import ABCMeta, abstractmethod
class AbstractConsumer(metaclass=ABCMeta):
"""
This class provides facilities to create and manage queue consumers. To
create a consumer, subclass this class and override the :meth:`run`
method. Then, instantiate the class with the desired parameters and call
... | gst/amqpy | amqpy/consumer.py | Python | mit | 2,846 |
# -*- coding: utf-8 -*-
# author: Alfred
import os
import re
DB_MODULE_PATTERN = re.compile(r'db2charts_models\.(?P<module>.*)_models')
class DB2ChartsRouter(object):
def db_for_module(self, module):
match = DB_MODULE_PATTERN.match(module)
if match:
return match.groupdict()['module']
... | Alfredx/django-db2charts | db2charts/router.py | Python | mit | 619 |
'''
Created by auto_sdk on 2015.06.23
'''
from aliyun.api.base import RestApi
class Rds20130528SwitchDBInstanceNetTypeRequest(RestApi):
def __init__(self,domain='rds.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
self.ConnectionStringPrefix = None
self.DBInstanceId = None
def getapiname(self):
r... | francisar/rds_manager | aliyun/api/rest/Rds20130528SwitchDBInstanceNetTypeRequest.py | Python | mit | 380 |
import pytest
from ..sqlademo import demo_config | elbow-jason/SQLALchemy_demo | sqlademo/test/test_demo_config.py | Python | mit | 52 |
"""
Molecule class.
"""
import numpy as np
from .water_models import SPC_E_atoms, TIP3P_atoms, TIP4P_atoms, TIP5P_atoms
from .gas_models import EPM2_atoms
from .structure_data import MolecularGraph
import networkx as nx
class Molecule(MolecularGraph):
#TODO(pboyd):add bonding calculations for the atoms in each mo... | peteboyd/lammps_interface | lammps_interface/Molecules.py | Python | mit | 18,379 |
# -*- coding: utf-8 -*-
__version__ = '0.15.0'
| jules185/IoT_Hackathon | .homeassistant/deps/fuzzywuzzy/__init__.py | Python | mit | 47 |
import random
import telegram
MENU = [[('handler', 'Venues ☕', 'foursquare-location-choice'),
('handler', 'Weather 🌤', 'weather-show'),
('handler', 'News 📰', 'news-get-entry')],
[('handler', 'Vinci 🌇', 'vinci-upload-image'),
('handler', 'Get Uber 🚘', 'uber-choose-location'),
... | sevazhidkov/leonard | modules/menu.py | Python | mit | 2,095 |
#takes in an eQTL file and outputs allele freq and deviation from HWE
#0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
#scaf pac locus freq fold effect dom d_over_a f p hom1 het hom2 Rsquared f(hom1/het/hom2)
#scaf8 20911662 9414108 0.80... | emjosephs/eQTL | calc_HW_deviations.py | Python | mit | 1,527 |
# import time
# import unittest
import doctest
from django.test import LiveServerTestCase #, TestCase
from selenium import webdriver
import pug.nlp.util
# from pug.dj import db as djdb
# from traceback import print_exc
class HomeTest(LiveServerTestCase):
def setUp(self):
self.browser = webdriver.Firefox... | hobson/pug-dj | pug/dj/miner/tests.py | Python | mit | 3,596 |
"""Resource manage module."""
import os
from .utils import RequestUtil
class ResourceAPI(object):
"""Resource wechat api."""
ADD_TEMP_URI = ('https://api.weixin.qq.com/cgi-bin/media/'
'upload?access_token={}&type={}')
@classmethod
def upload(cls, path, token, rtype, upload_type=... | istommao/wechatkit | wechatkit/resource.py | Python | mit | 1,185 |
# Wrapper for ApiGen All (PHP)
import sys
import platform
import os
import glob
from subprocess import call
def invokeApiGen(dir, out_dir):
cmd = ['apigen', '--quiet', '--source', dir]
if platform.system() == 'Windows': cmd[0] = 'apigen.cmd'
os.chdir(dir)
for php in glob.glob('*.php'):
print('ApiGen ~ Documentin... | stpettersens/sublimetext-buildtools | ApiGen/apigen_all.py | Python | mit | 451 |
from __future__ import absolute_import
import theano
import theano.tensor as T
import numpy as np
class Constraint(object):
def __call__(self, p):
return p
def get_config(self):
return {"name":self.__class__.__name__}
class MaxNorm(Constraint):
def __init__(self, m=2):
self.m = m
... | ypkang/keras | keras/constraints.py | Python | mit | 1,069 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/contrib/lite/toco/toco_flags.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from goog... | ryfeus/lambda-packs | Keras_tensorflow_nightly/source2.7/tensorflow/contrib/lite/toco/toco_flags_pb2.py | Python | mit | 8,125 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from bs4 import BeautifulSoup
from urllib.request import urlopen
def getSoupAQHI():
html = urlopen("http://www.aqhi.gov.hk/en/aqhi/past-24-hours-aqhi45fd.html?stationid=80")
soup = BeautifulSoup(html, "lxml")
return soup
def getLatestAQHI(dataTable):
aqhiTable = data... | elvian/alfred | scripts/pollutionController.py | Python | mit | 1,497 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.