repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/pytz/reference.py | 839 | 3649 | '''
Reference tzinfo implementations from the Python docs.
Used for testing against as they are only correct for the years
1987 to 2006. Do not use these for real code.
'''
from datetime import tzinfo, timedelta, datetime
from pytz import utc, UTC, HOUR, ZERO
# A class building tzinfo objects for fixed-offset time zo... | bsd-3-clause |
gronnbeck/udacity-deep-learning | embeddings/utils.py | 150 | 2194 | import re
from collections import Counter
def preprocess(text):
# Replace punctuation with tokens so we can use them in our model
text = text.lower()
text = text.replace('.', ' <PERIOD> ')
text = text.replace(',', ' <COMMA> ')
text = text.replace('"', ' <QUOTATION_MARK> ')
text = text.replace(... | mit |
ecell/libmoleculizer | python-src/bngparser/src/moleculizer/moleculeinterpreter.py | 1 | 6341 | ###############################################################################
# BNGMZRConverter - A utility program for converting bngl input files to mzr
# input files.
# Copyright (C) 2007, 2008, 2009 The Molecular Sciences Institute
#
# Moleculizer is free software; you can redistribute it and/or modify
# it ... | gpl-2.0 |
totallybradical/temp_servo2 | tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/test_stream.py | 446 | 6264 | from __future__ import absolute_import, division, unicode_literals
from . import support # flake8: noqa
import unittest
import codecs
from io import BytesIO
from six.moves import http_client
from html5lib.inputstream import (BufferedStream, HTMLInputStream,
HTMLUnicodeInputStream, ... | mpl-2.0 |
GunnerJnr/_CodeInstitute | Stream-2/Back-End-Development/3.Testing/3.Safe-Refactoring/challenge-solution/test_vending_machine.py | 1 | 1027 | # import the unit test module
import unittest
from vending_machine import give_change
from vending_machine import give_change_decimal
# define a class (inherits from unittest)
class TestVendingMachine(unittest.TestCase):
# define our method (must because with test_ otherwise the test will not run)
def test_re... | mit |
wvdd007/robomongo | tests/gtest-1.7.0/test/gtest_xml_outfiles_test.py | 2526 | 5340 | #!/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... | gpl-3.0 |
hj3938/or-tools | examples/python/data/nonogram_regular/nonogram_hard.py | 74 | 1104 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
Humanity4all/SpokenCode | test_common_interpreter.py | 2 | 2306 | # pylint: disable=missing-docstring,no-self-use
from nose.tools import assert_equals, assert_raises
from .common_interpreter import CommonInterpreter
class MockNode():
def __init__(self, value):
self.value = value
def make_list_of_mock_nodes(plain_list):
node_list = []
for item in plain_list:
... | gpl-3.0 |
daniel2101/fleosa | sale/report/sale_report.py | 6 | 5790 | # -*- 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... | gpl-3.0 |
Medium/phantomjs-1 | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py | 113 | 18377 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | bsd-3-clause |
marckuz/django | tests/migrations/test_autodetector.py | 100 | 112818 | # -*- coding: utf-8 -*-
import re
from django.apps import apps
from django.conf import settings
from django.contrib.auth.models import AbstractBaseUser
from django.core.validators import RegexValidator, validate_slug
from django.db import connection, models
from django.db.migrations.autodetector import MigrationAutode... | bsd-3-clause |
djo938/supershell | pyshell/system/manager/environment.py | 3 | 1148 | #!/usr/bin/env python -t
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Jonathan Delvaux <pyshell@djoproject.net>
# 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... | gpl-3.0 |
stackimpact/stackimpact-python | tests/message_queue_test.py | 1 | 1716 | import unittest
import sys
import json
import stackimpact
from stackimpact.utils import timestamp
from test_server import TestServer
class MessageQueueTest(unittest.TestCase):
def test_flush(self):
server = TestServer(5005)
server.start()
stackimpact._agent = None
agent = sta... | bsd-3-clause |
mia1rab/OpenColorado-Tools-and-Utilities | Scripts/Harvest/Drcog/bs4/__init__.py | 4 | 12867 | """Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup uses a pluggable XML or HTML parser to parse a
(possibly invalid) document into a tree representation. Beautiful Soup
provides provides methods and Pythonic idioms that make it easy to
navigate... | apache-2.0 |
Lekensteyn/buildbot | master/buildbot/steps/package/util.py | 11 | 1235 | # 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of ME... | gpl-2.0 |
mpi-sws-rse/antevents-python | examples/event_library_comparison/event.py | 1 | 8071 | """This version uses a traditional event-driven version,
using continuation passing style. Each method call is passed
a completion callback and an error callback
"""
from statistics import median
import json
import asyncio
import random
import time
import hbmqtt.client
from collections import deque
from antevents.base... | apache-2.0 |
esthermm/odoomrp-wip | stock_picking_wave_management/__openerp__.py | 9 | 1554 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c)
# 2015 Serv. Tec. Avanzados - Pedro M. Baeza (http://www.serviciosbaeza.com)
# 2015 AvanzOsc (http://www.avanzosc.es)
#
# This program is free software: you can redistribute it and/or modi... | agpl-3.0 |
Zhiqiang-He/kafka-0914-edit | tests/kafkatest/utils/remote_account.py | 42 | 1280 | # 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 ... | apache-2.0 |
imsut/commons | src/python/twitter/pants/tasks/binary_create.py | 2 | 4176 | # ==================================================================================================
# Copyright 2012 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | apache-2.0 |
harmslab/epistasis | docs/conf.py | 2 | 10687 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# epistasis documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 7 15:47:18 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# ... | unlicense |
a20012251/dd-agent | checks.d/gearmand.py | 34 | 2314 | # 3rd party
import gearman
# project
from checks import AgentCheck
class Gearman(AgentCheck):
SERVICE_CHECK_NAME = 'gearman.can_connect'
def get_library_versions(self):
return {"gearman": gearman.__version__}
def _get_client(self,host,port):
self.log.debug("Connecting to gearman at addre... | bsd-3-clause |
tchx84/debian-pkg-sugar | extensions/cpsection/aboutme/model.py | 9 | 4490 | # Copyright (C) 2008 One Laptop Per Child
# Copyright (C) 2010-14, Sugar Labs
# Copyright (C) 2010-14, Walter Bender
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Lic... | gpl-2.0 |
saikrishnar/vsm_preparer | scripts/quincontext.py | 1 | 1778 | #! /usr/bin/python
import os
def main(folder):
#vectors = []
#f = open('../dictionary/vectors.txt')
#for line in f:
# representation = line.strip('\n')
# vectors.append(representation)
#f.close()
for d, ds, fs in os.walk(folder):
for fname in fs:
if fname[-... | gpl-2.0 |
cjcjameson/gpdb | gpMgmt/bin/pythonSrc/PyGreSQL-4.0/pgdb.py | 57 | 17608 | #!/usr/bin/env python
#
# pgdb.py
#
# Written by D'Arcy J.M. Cain
#
# $Id: pgdb.py,v 1.54 2008/11/23 14:32:18 cito Exp $
#
"""pgdb - DB-API 2.0 compliant module for PygreSQL.
(c) 1999, Pascal Andre <andre@via.ecp.fr>.
See package documentation for further information on copyright.
Inline documentation is sparse.
See... | apache-2.0 |
DMLoy/ECommerceBasic | bin/bin/activate/lib/python2.7/site-packages/setuptools/command/bdist_wininst.py | 325 | 2283 | from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst
import os, sys
class bdist_wininst(_bdist_wininst):
_good_upload = _bad_upload = None
def create_exe(self, arcname, fullname, bitmap=None):
_bdist_wininst.create_exe(self, arcname, fullname, bitmap)
installer_name = se... | mit |
laslabs/odoo | openerp/addons/base/tests/test_user_has_group.py | 78 | 1567 | # -*- coding: utf-8 -*-
import openerp.tests
class TestHasGroup(openerp.tests.TransactionCase):
def setUp(self):
super(TestHasGroup, self).setUp()
group0 = self.env['ir.model.data']._update(
'res.groups', 'test_user_has_group',
{'name': 'group0'},
xml_id='group0... | agpl-3.0 |
Beyond-Imagination/BlubBlub | ChatbotServer/ChatbotEnv/Lib/site-packages/bs4/tests/test_builder_registry.py | 176 | 5582 | """Tests of the builder registry."""
import unittest
import warnings
from bs4 import BeautifulSoup
from bs4.builder import (
builder_registry as registry,
HTMLParserTreeBuilder,
TreeBuilderRegistry,
)
try:
from bs4.builder import HTML5TreeBuilder
HTML5LIB_PRESENT = True
except ImportError:
HT... | gpl-3.0 |
rversteegen/commandergenius | project/jni/python/src/Lib/test/test_mimetypes.py | 77 | 2581 | import mimetypes
import StringIO
import unittest
from test import test_support
# Tell it we don't know about external files:
mimetypes.knownfiles = []
mimetypes.inited = False
mimetypes._default_mime_types()
class MimeTypesTestCase(unittest.TestCase):
def setUp(self):
self.db = mimetypes.MimeTypes()
... | lgpl-2.1 |
tomato42/tlsfuzzer | scripts/test-openssl-3712.py | 1 | 9502 | # Author: Hubert Kario, (c) 2015
# Released under Gnu GPL v2.0, see LICENSE file for details
from __future__ import print_function
import traceback
import sys
import getopt
from itertools import chain
from random import sample
from tlsfuzzer.runner import Runner
from tlsfuzzer.messages import Connect, ClientHelloGene... | gpl-2.0 |
tdliu/hoop-picks | lib/requests/packages/chardet/big5freq.py | 3133 | 82594 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | apache-2.0 |
xin3liang/platform_external_chromium_org_third_party_libyuv | tools/valgrind-libyuv/memcheck/PRESUBMIT.py | 199 | 3908 | #!/usr/bin/env python
# Copyright (c) 2012 The LibYuv Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... | bsd-3-clause |
pathletboy/rt-thread | bsp/upd70f3454/rtconfig.py | 36 | 2949 | import os
# toolchains options
ARCH = 'v850'
CPU = '70f34'
CROSS_TOOL = 'iar'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
print '================ERROR============================'
print 'Not support gcc yet!'
print '=======================================... | gpl-2.0 |
Sorsly/subtle | google-cloud-sdk/platform/gsutil/third_party/boto/tests/integration/opsworks/test_layer1.py | 114 | 2121 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | mit |
sumeetsk/NEXT-1 | apps/DuelingBanditsPureExploration/tests/test_api.py | 1 | 5422 | import numpy
import numpy as np
import numpy.random
import random
import json
import time
from datetime import datetime
import requests
from scipy.linalg import norm
import time
from multiprocessing import Pool
import os
import sys
try:
import next.apps.test_utils as test_utils
except:
sys.path.append('../../..... | apache-2.0 |
xydinesh/youtube-dl | youtube_dl/extractor/tv4.py | 117 | 3631 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
parse_iso8601,
)
class TV4IE(InfoExtractor):
IE_DESC = 'tv4.se and tv4play.se'
_VALID_URL = r'''(?x)https?://(?:www\.)?
(?:
tv4\.se/(?:[^/]+)/klipp/(?:.*... | unlicense |
sigma-random/scrapy | scrapy/utils/console.py | 71 | 1444 |
def start_python_console(namespace=None, noipython=False, banner=''):
"""Start Python console binded to the given namespace. If IPython is
available, an IPython console will be started instead, unless `noipython`
is True. Also, tab completion will be used on Unix systems.
"""
if namespace is None:
... | bsd-3-clause |
Workday/OpenFrame | third_party/cython/src/Tools/cython-epydoc.py | 125 | 1436 | #! /usr/bin/env python
# --------------------------------------------------------------------
import re
from epydoc import docstringparser as dsp
CYTHON_SIGNATURE_RE = re.compile(
# Class name (for builtin methods)
r'^\s*((?P<class>\w+)\.)?' +
# The function name
r'(?P<func>\w+)' +
# The paramete... | bsd-3-clause |
Eksmo/calibre | src/calibre/gui2/viewer/position.py | 1 | 1815 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import json
c... | gpl-3.0 |
Xeralux/tensorflow | tensorflow/python/keras/applications/vgg19/__init__.py | 74 | 1127 | # 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 |
openego/oeplatform | modelview/migrations/0022_auto_20160303_2233.py | 1 | 1468 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-03 21:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("modelview", "0021_auto_20160303_2233")]
operations = [
migrations.AlterField(
m... | agpl-3.0 |
emetsger/osf.io | scripts/migrate_guid.py | 64 | 8584 | """
Create a GUID for all non-GUID database records. If record already has a GUID,
skip; if record has an ID but not a GUID, create a GUID matching the ID. Newly
created records will have optimistically generated GUIDs.
"""
import time
import collections
from framework.mongo import StoredObject
from website import m... | apache-2.0 |
ryfeus/lambda-packs | Tensorflow_LightGBM_Scipy_nightly/source/google/protobuf/internal/symbol_database_test.py | 70 | 5650 | #! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | mit |
iivic/BoiseStateX | lms/djangoapps/certificates/tests/tests.py | 87 | 4494 | """
Tests for the certificates models.
"""
from ddt import ddt, data, unpack
from mock import patch
from django.conf import settings
from nose.plugins.attrib import attr
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from student.te... | agpl-3.0 |
AjabWorld/ajabsacco | ajabsacco/core/facades/loans/transactions.py | 1 | 8484 | from ajabsacco.core.models import (
LoanTransactionEntry,
LoanProduct,
LoanAccount,
Message as SMSMessage,
)
from decimal import Decimal as D
from django.db.models import Q, Sum, F
from django.utils import timezone
from django.db import transaction as db_transaction
from ajabsacco.core import code... | apache-2.0 |
ArcherSys/ArcherSys | Lib/test/reperf.py | 1 | 1754 | <<<<<<< HEAD
<<<<<<< HEAD
import re
import time
def main():
s = "\13hello\14 \13world\14 " * 1000
p = re.compile(r"([\13\14])")
timefunc(10, p.sub, "", s)
timefunc(10, p.split, s)
timefunc(10, p.findall, s)
def timefunc(n, func, *args, **kw):
t0 = time.perf_counter()
try:
for i in ... | mit |
nopjmp/SickRage | lib/stevedore/dispatch.py | 21 | 9005 | import logging
from .enabled import EnabledExtensionManager
from .exception import NoMatches
LOG = logging.getLogger(__name__)
class DispatchExtensionManager(EnabledExtensionManager):
"""Loads all plugins and filters on execution.
This is useful for long-running processes that need to pass
different in... | gpl-3.0 |
Erotemic/ibeis | dev/_scripts/installers.py | 1 | 16608 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
r"""
On mac need to run with sudo
Testing:
python %HOME%/code/ibeis/_installers/ibeis_pyinstaller_data_helper.py --test-get_data_list
python ~/code/ibeis/_installers/ibeis_pyinstaller_data_helper.py --test-get_data_list
SeeAlso:
_installers/ibeis_pyinstalle... | apache-2.0 |
andykimpe/chromium-test-npapi | tools/valgrind/asan/asan_symbolize.py | 17 | 1357 | #!/usr/bin/env python
# Copyright (c) 2012 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 third_party import asan_symbolize
import os
import re
import sys
def fix_filename(file_name):
for path_to_cut in sys.argv... | bsd-3-clause |
janicduplessis/buck | third-party/py/unittest2/unittest2/test/test_discovery.py | 111 | 13372 | import os
import re
import sys
import unittest2
class TestDiscovery(unittest2.TestCase):
# Heavily mocked tests so I can avoid hitting the filesystem
def test_get_name_from_path(self):
loader = unittest2.TestLoader()
loader._top_level_dir = '/foo'
name = loader._get_name_from_path('... | apache-2.0 |
shanemcd/ansible | lib/ansible/galaxy/role.py | 33 | 14986 | ########################################################################
#
# (C) 2015, Brian Coca <bcoca@ansible.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... | gpl-3.0 |
shsingh/ansible | test/units/parsing/vault/test_vault.py | 44 | 40862 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.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 So... | gpl-3.0 |
iamkingmaker/zipline | zipline/utils/test_utils.py | 8 | 9150 | from contextlib import contextmanager
from itertools import (
product,
)
from logbook import FileHandler
from mock import patch
from numpy.testing import assert_array_equal
import operator
from zipline.finance.blotter import ORDER_STATUS
from zipline.utils import security_list
from six import (
itervalues,
)
fr... | apache-2.0 |
mastizada/pontoon | pontoon/base/migrations/0002_initial_data.py | 2 | 30009 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
def load_initial_data(apps, schema_editor):
Locale = apps.get_model('base', 'Locale')
for locale_kwargs in LOCALES:
Locale.objects.create(**locale_kwargs)
Project = a... | bsd-3-clause |
jonathonwalz/ansible | lib/ansible/modules/network/cumulus/_cl_ports.py | 70 | 7259 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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... | gpl-3.0 |
shaufi/odoo | addons/point_of_sale/wizard/pos_confirm.py | 343 | 2403 | # -*- 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... | agpl-3.0 |
Ziqi-Li/bknqgis | Shapely/tests/test_geos_err_handler.py | 2 | 2033 | import logging
import pytest
from shapely.geometry import LineString
from shapely.errors import ReadingError
from shapely.wkt import loads
def test_error_handler_exception(tmpdir):
"""Error logged in addition to exception"""
logger = logging.getLogger('shapely.geos')
logfile = str(tmpdir.join('test_erro... | gpl-2.0 |
0--key/lib | portfolio/Python/scrapy/lego/lego_pixmania.py | 2 | 1987 | import csv
import os
import copy
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse, FormRequest
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from scrapy.http.cookies import CookieJar
from product_... | apache-2.0 |
rr-/ida-images | rgb-ida.py | 1 | 3099 | import idaapi
import librgb
from librgb.qt_shims import QtGui # important for PySide legacy IDA
from librgb.qt_shims import QtWidgets
try:
MAJOR, MINOR = map(int, idaapi.get_kernel_version().split("."))
except AttributeError:
MAJOR, MINOR = 6, 6
USING_IDA7API = MAJOR > 6
USING_PYQT5 = USING_IDA7API or (MAJOR ... | mit |
dursk/django | tests/template_tests/test_nodelist.py | 173 | 3234 | from unittest import TestCase
from django.template import Context, Engine
from django.template.base import TextNode, VariableNode
from django.utils import six
class NodelistTest(TestCase):
@classmethod
def setUpClass(cls):
cls.engine = Engine()
super(NodelistTest, cls).setUpClass()
def ... | bsd-3-clause |
jeremyclover/airflow | airflow/hooks/base_hook.py | 20 | 1812 | from builtins import object
import logging
import os
import random
from airflow import settings
from airflow.models import Connection
from airflow.utils import AirflowException
CONN_ENV_PREFIX = 'AIRFLOW_CONN_'
class BaseHook(object):
"""
Abstract base class for hooks, hooks are meant as an interface to
... | apache-2.0 |
ryfeus/lambda-packs | Pyrestest_wrk/source/pip/_vendor/requests/packages/chardet/hebrewprober.py | 2929 | 13359 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... | mit |
PatrickOReilly/scikit-learn | examples/plot_johnson_lindenstrauss_bound.py | 67 | 7474 | r"""
=====================================================================
The Johnson-Lindenstrauss bound for embedding with random projections
=====================================================================
The `Johnson-Lindenstrauss lemma`_ states that any high dimensional
dataset can be randomly projected i... | bsd-3-clause |
sharhar/USB-Thing | UpdaterFiles/Lib/python-3.5.1.amd64/Lib/wsgiref/simple_server.py | 86 | 5153 | """BaseHTTPServer that implements the Python WSGI protocol (PEP 3333)
This is both an example of how WSGI can be implemented, and a basis for running
simple web applications on a local machine, such as might be done when testing
or debugging an application. It has not been reviewed for security issues,
however, and w... | apache-2.0 |
CTSRD-SOAAP/chromium-42.0.2311.135 | third_party/protobuf/python/google/protobuf/internal/message_cpp_test.py | 215 | 1929 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | bsd-3-clause |
louiskun/flaskGIT | venv/lib/python2.7/site-packages/alembic/util/messaging.py | 40 | 2442 | from .compat import py27, binary_type, string_types
import sys
from sqlalchemy.engine import url
import warnings
import textwrap
import collections
import logging
log = logging.getLogger(__name__)
if py27:
# disable "no handler found" errors
logging.getLogger('alembic').addHandler(logging.NullHandler())
try... | mit |
ftomassetti/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/main.py | 250 | 11605 | """
Main program for 2to3.
"""
from __future__ import with_statement
import sys
import os
import difflib
import logging
import shutil
import optparse
from . import refactor
def diff_texts(a, b, filename):
"""Return a unified diff of two strings."""
a = a.splitlines()
b = b.splitlines()
return diffl... | apache-2.0 |
AamerShareef/Spy-Bot | SpyBot_Workspace/Dependencies/hostapd-2.6/hostapd/wps-ap-nfc.py | 23 | 9966 | #!/usr/bin/python
#
# Example nfcpy to hostapd wrapper for WPS NFC operations
# Copyright (c) 2012-2013, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import os
import sys
import time
import argparse
import nfc
import nfc.ndef
import nf... | mit |
bzbarsky/servo | tests/wpt/web-platform-tests/tools/pytest/_pytest/_argcomplete.py | 179 | 3623 |
"""allow bash-completion for argparse with argcomplete if installed
needs argcomplete>=0.5.6 for python 3.2/3.3 (older versions fail
to find the magic string, so _ARGCOMPLETE env. var is never set, and
this does not need special code.
argcomplete does not support python 2.5 (although the changes for that
are minor).
... | mpl-2.0 |
guildenstern70/pyfab | src/reportlab/graphics/barcode/code39.py | 42 | 9830 | #
# Copyright (c) 1996-2000 Tyler C. Sarna <tsarna@sarna.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, thi... | mit |
chayapan/django-sentry | src/sentry/migrations/0030_auto__add_view__chg_field_event_group.py | 7 | 13667 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'View'
db.create_table('sentry_view', (
('id', self.gf('django.db.models.fields.AutoFie... | bsd-3-clause |
davidyezsetz/kuma | vendor/packages/ipython/IPython/kernel/core/tests/test_interpreter.py | 7 | 2119 | # encoding: utf-8
"""This file contains unittests for the interpreter.py module."""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2009 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is
# in the file COPYING, ... | mpl-2.0 |
kswiat/django | django/core/serializers/xml_serializer.py | 52 | 15026 | """
XML serializer.
"""
from __future__ import unicode_literals
from django.apps import apps
from django.conf import settings
from django.core.serializers import base
from django.db import models, DEFAULT_DB_ALIAS
from django.utils.xmlutils import SimplerXMLGenerator
from django.utils.encoding import smart_text
from ... | bsd-3-clause |
waelrash1/or-tools | data/nonogram_regular/nonogram_p199.py | 74 | 1527 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
michaelgallacher/intellij-community | python/helpers/python-skeletons/subprocess.py | 62 | 4287 | """Skeleton for 'subprocess' stdlib module."""
def call(args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=None,
preexec_fn=None, close_fds=False, shell=False, cwd=None, env=None,
universal_newlines=False, startupinfo=None, creationflags=0,
timeout=None, restore_signals=True,... | apache-2.0 |
bukun/pycsw | pycsw/server.py | 1 | 35618 | # -*- coding: utf-8 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
# Angelos Tzotsos <tzotsos@gmail.com>
#
# Copyright (c) 2016 Tom Kralidis
# Copyright (c) 2015 Angelos Tzotsos
# Copyright (c) 2016 James Dickens
# Copyright (c) 2016 Ri... | mit |
zencore-dobetter/zencore-utils | src/zencore/utils/redis.py | 1 | 3995 | import uuid
import math
import time
import logging
import redis as engine
from zencore.errors import WrongParameterTypeError
from .types import smart_force_to_string
logger = logging.getLogger(__name__)
class RedisLock(object):
def __init__(self, url, name=None, app_name=None, expire=None, prefix="zencore:lock... | mit |
samdoran/ansible | lib/ansible/module_utils/netscaler.py | 17 | 11949 | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of t... | gpl-3.0 |
kronicz/ecommerce-2 | lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/predicates.py | 103 | 1794 | """
This module houses the GEOS ctypes prototype functions for the
unary and binary predicate operations on geometries.
"""
from ctypes import c_char, c_char_p, c_double
from django.contrib.gis.geos.libgeos import GEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import check_predicate
from django.contrib.gi... | mit |
tommystendahl/cassandra | pylib/cqlshlib/helptopics.py | 91 | 4532 | # 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... | apache-2.0 |
big-pegasus/spark | python/pyspark/ml/__init__.py | 46 | 1105 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
p/webracer | tests/request_via_form_test.py | 1 | 1451 | import webracer
import nose.plugins.attrib
from . import utils
from .apps import form_app
utils.app_runner_setup(__name__, form_app.app, 8059)
@nose.plugins.attrib.attr('client')
@webracer.config(host='localhost', port=8059)
class RequestViaFormTest(webracer.WebTestCase):
def test_get_form_as_url(self):
s... | bsd-2-clause |
m11s/MissionPlanner | Lib/urllib2.py | 50 | 52574 | """An extensible library for opening URLs using a variety of protocols
The simplest way to use this module is to call the urlopen function,
which accepts a string containing a URL or a Request object (described
below). It opens the URL and returns the results as file-like
object; the returned object has some ext... | gpl-3.0 |
scs/uclinux | lib/boost/boost_1_38_0/tools/build/v2/example/customization/inline_file.py | 52 | 1097 | #!/usr/bin/python
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
import sys
from string import strip
def quote_line(line):
result = ""
for i in line:
if (i == '\\'):
... | gpl-2.0 |
n4hy/gnuradio | gr-digital/python/qa_ofdm_insert_preamble.py | 16 | 5662 | #!/usr/bin/env python
#
# Copyright 2007,2010,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at you... | gpl-3.0 |
Ichag/django-timelinejs3 | timeline/migrations/0009_auto_20150819_0648.py | 1 | 3020 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('timeline', '0008_auto_20150818_2241'),
]
operations = [
migrations.AlterField(
model_name='options',
... | bsd-3-clause |
std05048/Thesis | .waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Tools/errcheck.py | 331 | 5821 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
typos={'feature':'features','sources':'source','targets':'target','include':'includes','export_include':'export_includes','define':'defines','importpath':'includes','installpa... | gpl-2.0 |
jmorcar/ZenEventClassMapping | addTrapFromMIB/Deprecated/TrapToEventClassMapping.py | 2 | 2514 | #!/usr/bin/env python
import Globals, sys, ast, yaml, os, tempfile
from transaction import commit
from Products.ZenUtils.ZenScriptBase import ZenScriptBase
if len(sys.argv) < 3:
sys.exit('\nError faltan argumentos\n\nUsage: %s "fichero_MIBS" "cabecera_TRAPS"\n\n' % sys.argv[0])
file = sys.argv[1]
cabece... | gpl-2.0 |
EUDAT-B2SHARE/invenio-old | modules/bibformat/lib/elements/bfe_contact.py | 18 | 1522 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 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 |
nishnik/networkx | networkx/classes/tests/historical_tests.py | 8 | 17376 | #!/usr/bin/env python
"""Original NetworkX graph tests"""
from nose.tools import *
import networkx
import networkx as nx
from networkx import convert_node_labels_to_integers as cnlti
from networkx.testing import *
class HistoricalTests(object):
def setUp(self):
self.null=nx.null_graph()
self.P1=cn... | bsd-3-clause |
cjhak/b2share | invenio/modules/search/registry.py | 5 | 5130 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 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
# License, or (at your option) any... | gpl-2.0 |
SoSBallers/pogo-map | pogom/pgoapi/pgoapi.py | 28 | 6203 | """
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
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... | agpl-3.0 |
handroissuazo/tensorflow | tensorflow/python/client/session_test.py | 30 | 65566 | # 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... | apache-2.0 |
mccheung/kbengine | kbe/src/lib/python/Lib/test/test_importlib/import_/test_meta_path.py | 72 | 4414 | from .. import util
from . import util as import_util
import importlib._bootstrap
import sys
from types import MethodType
import unittest
import warnings
class CallingOrder:
"""Calls to the importers on sys.meta_path happen in order that they are
specified in the sequence, starting with the first importer
... | lgpl-3.0 |
YangSongzhou/django | tests/proxy_model_inheritance/tests.py | 278 | 1764 | from __future__ import absolute_import, unicode_literals
import os
from django.core.management import call_command
from django.test import TestCase, TransactionTestCase
from django.test.utils import extend_sys_path
from django.utils._os import upath
from .models import (
ConcreteModel, ConcreteModelSubclass, Con... | bsd-3-clause |
CryToCry96/android_kernel_ef51lsk | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
rochy2014/repo | main.py | 48 | 11992 | #!/bin/sh
#
# 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 app... | apache-2.0 |
do-mpc/do-mpc | testing/test_oscillating_masses_discrete_dae.py | 1 | 3206 | #
# This file is part of do-mpc
#
# do-mpc: An environment for the easy, modular and efficient implementation of
# robust nonlinear model predictive control
#
# Copyright (c) 2014-2019 Sergio Lucia, Alexandru Tatulea-Codrean
# TU Dortmund. All rights reserved
#
# do-mpc is free sof... | lgpl-3.0 |
honghaoz/UW-Info-Session-iOS | UW-Info-Session-1.0/GAE Support/uw-info2/libs/requests/packages/urllib3/connection.py | 187 | 5659 | # urllib3/connection.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import socket
from socket import timeout as SocketTimeout
try: # Python 3
from http.cli... | gpl-3.0 |
scottgigante/picopore | test/test.py | 1 | 2274 | from __future__ import print_function
import subprocess
import os
import errno
import shutil
import time
import signal
__test_files__ = ["sample_data/albacore_1d_original.fast5", "sample_data/metrichor_2d_original.fast5"]
__test_runs__ = ["lossless", "deep-lossless"]
__prefix__ = "picopore.test"
__raw_runs__ = [["--fa... | gpl-3.0 |
wuxianghou/phantomjs | src/qt/qtwebkit/Source/WebKit2/Scripts/webkit2/model.py | 118 | 2669 | # Copyright (C) 2010, 2011 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.