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 |
|---|---|---|---|---|---|
lukeolson/clean-latex-to-arxiv | parxiv.py | 1 | 12460 | #! /usr/bin/env python
from __future__ import print_function
import glob
import re
import os
import io
import time
import shutil
import tempfile
import subprocess
import ply.lex
# Python2 FileNotFoundError support
try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError
"""
usage:
python parx... | mit |
sameenjalal/mavenize-beta | mavenize/apps/item/models.py | 1 | 2128 | from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.core.exceptions import ObjectDoesNotExist
class Item(models.Model):
item_type = models.CharField(max_length=30, default="")
four_star = models.IntegerField(default=0)
three_star = mo... | mit |
davenovak/mtasa-blue | vendor/google-breakpad/src/testing/scripts/generator/cpp/gmock_class_test.py | 78 | 7135 | #!/usr/bin/env python
#
# Copyright 2009 Neal Norwitz All Rights Reserved.
# Portions Copyright 2009 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
#
# ... | gpl-3.0 |
dgu123/yaml-cpp | test/gmock-1.7.0/gtest/test/gtest_xml_output_unittest.py | 1815 | 14580 | #!/usr/bin/env python
#
# Copyright 2006, 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 |
dkarakats/edx-platform | cms/lib/xblock/test/test_runtime.py | 25 | 2194 | """
Tests of edX Studio runtime functionality
"""
from urlparse import urlparse
from mock import Mock
from unittest import TestCase
from cms.lib.xblock.runtime import handler_url
class TestHandlerUrl(TestCase):
"""Test the LMS handler_url"""
def setUp(self):
self.block = Mock()
def test_trailin... | agpl-3.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/sympy/polys/groebnertools.py | 78 | 23399 | """Groebner bases algorithms. """
from __future__ import print_function, division
from sympy.polys.monomials import monomial_mul, monomial_lcm, monomial_divides, term_div
from sympy.polys.orderings import lex
from sympy.polys.polyerrors import DomainError
from sympy.polys.polyconfig import query
from sympy.core.symbo... | mit |
skosukhin/spack | lib/spack/spack/schema/__init__.py | 1 | 1512 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
tchellomello/home-assistant | homeassistant/components/ecovacs/vacuum.py | 16 | 5879 | """Support for Ecovacs Ecovacs Vaccums."""
import logging
import sucks
from homeassistant.components.vacuum import (
SUPPORT_BATTERY,
SUPPORT_CLEAN_SPOT,
SUPPORT_FAN_SPEED,
SUPPORT_LOCATE,
SUPPORT_RETURN_HOME,
SUPPORT_SEND_COMMAND,
SUPPORT_STATUS,
SUPPORT_STOP,
SUPPORT_TURN_OFF,
... | apache-2.0 |
solashirai/edx-platform | lms/djangoapps/commerce/tests/test_views.py | 9 | 4246 | """ Tests for commerce views. """
import json
from uuid import uuid4
from nose.plugins.attrib import attr
import ddt
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
import mock
from student.tests.factories import UserFactory
from openedx.core.djangoapps.t... | agpl-3.0 |
shifvb/hash_photos | _gui/main_gui.py | 1 | 9930 | import os
import time
import tkinter as tk
from tkinter import filedialog
from tkinter import messagebox
from tkinter.font import Font
from _gui.get_geometry import get_center_geometry
from _tools.get_hash import get_hash
from _tools.is_valid_file import is_vaild_file
from _tools.move_file import move_file
__version_... | apache-2.0 |
amohanta/thug | src/ActiveX/modules/RealPlayer.py | 8 | 1600 | # RealMedia RealPlayer Ierpplug.DLL ActiveX Control
# CVE-2007-5601
import logging
log = logging.getLogger("Thug")
def DoAutoUpdateRequest(self, arg0, arg1, arg2):
if len(arg0) > 1000 or len(arg1) > 1000:
log.ThugLogging.log_exploit_event(self._window.url,
"RealMe... | gpl-2.0 |
betoesquivel/CIE | flask/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/vcs/bazaar.py | 393 | 4943 | import os
import tempfile
import re
from pip.backwardcompat import urlparse
from pip.log import logger
from pip.util import rmtree, display_path, call_subprocess
from pip.vcs import vcs, VersionControl
from pip.download import path_to_url
class Bazaar(VersionControl):
name = 'bzr'
dirname = '.bzr'
repo_na... | mit |
princespn/codeigniter | user_guide_src/cilexer/cilexer/cilexer.py | 241 | 2214 | # CodeIgniter
# http://codeigniter.com
#
# An open source application development framework for PHP
#
# This content is released under the MIT License (MIT)
#
# Copyright (c) 2014 - 2015, British Columbia Institute of Technology
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of thi... | mit |
AlanCoding/tower-cli | tower_cli/resources/job_event.py | 2 | 1664 | # Copyright 2018, Red Hat, Inc.
# Alan Rominger <arominge@redhat.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... | apache-2.0 |
ericspod/Eidolon | tests/meshtests/billboardtest.py | 1 | 1140 | # Eidolon Biomedical Framework
# Copyright (C) 2016-8 Eric Kerfoot, King's College London, all rights reserved
#
# This file is part of Eidolon.
#
# Eidolon 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 Foundati... | gpl-3.0 |
synergeticsedx/deployment-wipro | common/djangoapps/track/views/tests/test_segmentio.py | 19 | 22011 | """Ensure we can parse events sent to us from the Segment webhook integration"""
from datetime import datetime
import json
from ddt import ddt, data, unpack
from mock import sentinel
from nose.plugins.attrib import attr
from django.contrib.auth.models import User
from django.test.client import RequestFactory
from dj... | agpl-3.0 |
mancoast/CPythonPyc_test | fail/314_test_normalization.py | 1 | 3162 | from test.support import run_unittest, open_urlresource
import unittest
import sys
import os
from unicodedata import normalize, unidata_version
TESTDATAFILE = "NormalizationTest.txt"
TESTDATAURL = "http://www.unicode.org/Public/" + unidata_version + "/ucd/" + TESTDATAFILE
if os.path.exists(TESTDATAFILE):
f = ope... | gpl-3.0 |
myerpengine/odoo | addons/account/account_bank_statement.py | 20 | 29774 | # -*- 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 |
kaltura/server | alpha/scripts/utils/apiGrep.py | 1 | 4097 | #!/usr/bin/python
from optparse import OptionParser
import sys
import os
def isLineLogStart(curLine):
if len(curLine) < 20:
return False
if (curLine[4] == '-' and curLine[7] == '-' and curLine[10] == ' ' and
curLine[13] == ':' and curLine[16] == ':'):
return True
return False
d... | agpl-3.0 |
dulaccc/django-accounting | accounting/apps/books/migrations/0004_auto_20141104_1026.py | 3 | 1288 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import accounting.apps.books.utils
def next_invoice_number():
return 100
class Migration(migrations.Migration):
dependencies = [
('books', '0003_auto_20141029_1606'),
]
operations = [
... | mit |
clearcare/twilio-python | tests/test_members.py | 3 | 1452 | from mock import patch
from tools import create_mock_json
from twilio.rest.resources import Members
QUEUE_SID = "QU1b9faddec3d54ec18488f86c83019bf0"
ACCOUNT_SID = "AC123"
AUTH = (ACCOUNT_SID, "token")
CALL_SID = "CAaaf2e9ded94aba3e57c42a3d55be6ff2"
BASE_URI = "https://api.twilio.com/2010-04-01/Accounts/AC123/Queues/%s... | mit |
flgiordano/netcash | +/google-cloud-sdk/lib/surface/sql/instances/patch.py | 1 | 13800 | # 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 ag... | bsd-3-clause |
eric-stanley/freeciv-android | lib/freeciv/gamescreen.py | 2 | 16986 | # Copyright (C) 2011 Michal Zielinski (michal@zielinscy.org.pl)
#
# 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, or (at your option)
# any later version.
#
# This program is d... | gpl-2.0 |
tensorflow/estimator | tensorflow_estimator/python/estimator/canned/dnn_test_fc_v2.py | 1 | 19054 | # 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 |
leotrubach/sourceforge-allura | Allura/allura/config/middleware.py | 3 | 7033 | # -*- coding: utf-8 -*-
"""WSGI middleware initialization for the allura application."""
import mimetypes
import pylons
import pylons.middleware
import tg
import tg.error
pylons.c = pylons.tmpl_context
pylons.g = pylons.app_globals
import pkg_resources
from tg import config
from paste.deploy.converters import asbool
f... | apache-2.0 |
nitzmahone/ansible | lib/ansible/utils/module_docs_fragments/openswitch.py | 58 | 3815 | #
# (c) 2015, Peter Sprygada <psprygada@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, either version 3 of the License, or
# (at your option) any late... | gpl-3.0 |
SDSG-Invenio/invenio | invenio/legacy/refextract/xml.py | 15 | 35234 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2005, 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
# Li... | gpl-2.0 |
rouault/pycsw | etc/mappings.py | 6 | 4218 | # -*- coding: ISO-8859-15 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files... | mit |
txemi/ansible | lib/ansible/modules/cloud/amazon/lightsail.py | 68 | 16237 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | gpl-3.0 |
rogerwang/chromium | third_party/tlslite/tlslite/utils/compat.py | 361 | 4060 | """Miscellaneous functions to mask Python version differences."""
import sys
import os
if sys.version_info < (2,2):
raise AssertionError("Python 2.2 or later required")
if sys.version_info < (2,3):
def enumerate(collection):
return zip(range(len(collection)), collection)
class Set:
def ... | bsd-3-clause |
CVL-dev/cvl-fabric-launcher | pyinstaller-2.1/PyInstaller/lib/unittest2/test/test_loader.py | 11 | 49503 | import sys
import types
import unittest2
if sys.version_info[:2] == (2,3):
from sets import Set as set
from sets import ImmutableSet as frozenset
class Test_TestLoader(unittest2.TestCase):
### Tests for TestLoader.loadTestsFromTestCase
################################################################... | gpl-3.0 |
altairpearl/scikit-learn | sklearn/ensemble/base.py | 40 | 3621 | """
Base class for ensemble-based estimators.
"""
# Authors: Gilles Louppe
# License: BSD 3 clause
import numpy as np
from ..base import clone
from ..base import BaseEstimator
from ..base import MetaEstimatorMixin
from ..utils import _get_n_jobs
class BaseEnsemble(BaseEstimator, MetaEstimatorMixin):
"""Base cl... | bsd-3-clause |
delete/estofadora | estofadora/bills/views.py | 1 | 1602 | from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.core.urlresolvers import reverse
from .forms import BillForm
from .models import Bill
@login_required
def new(request):
context = {}
if r... | mit |
infoxchange/lettuce | tests/integration/lib/Django-1.3/django/core/management/commands/shell.py | 230 | 3263 | import os
from django.core.management.base import NoArgsCommand
from optparse import make_option
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list + (
make_option('--plain', action='store_true', dest='plain',
help='Tells Django to use plain Python, not IPython.'),
)
... | gpl-3.0 |
Keeperv85/Blade_G_kernel | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
grlee77/scipy | scipy/stats/mstats_extras.py | 12 | 14809 | """
Additional statistics functions with support for masked arrays.
"""
# Original author (2007): Pierre GF Gerard-Marchant
__all__ = ['compare_medians_ms',
'hdquantiles', 'hdmedian', 'hdquantiles_sd',
'idealfourths',
'median_cihs','mjci','mquantiles_cimj',
'rsh',
... | bsd-3-clause |
kaldonis/ft-event-manager | src/lib/jinja2/testsuite/tests.py | 7 | 3474 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.tests
~~~~~~~~~~~~~~~~~~~~~~
Who tests the tests?
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Markup, Environment
env = Environm... | gpl-2.0 |
geekboxzone/mmallow_external_deqp | scripts/build/config.py | 2 | 5833 | # -*- coding: utf-8 -*-
#-------------------------------------------------------------------------
# drawElements Quality Program utilities
# --------------------------------------
#
# Copyright 2015 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... | apache-2.0 |
Fsero/security_monkey | security_monkey/views/revision.py | 7 | 8458 | # Copyright 2014 Netflix, 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... | apache-2.0 |
apocalypsebg/odoo | addons/survey_crm/__openerp__.py | 312 | 1593 | # -*- 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 |
theepicsnail/SuperBot2 | Core.py | 1 | 5362 | from PluginManager import PluginManager
from PluginDispatcher import PluginDispatcher
from Configuration import ConfigFile
from Util import call
from re import match
from sys import path
from os import getcwd
from Util import dictJoin
from Logging import LogFile
path.append(getcwd())
log = LogFile("Core")
class Cor... | mit |
calebthompson/googletest | test/gtest_uninitialized_test.py | 2901 | 2480 | #!/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... | bsd-3-clause |
CAB-LAB/cablab-cubeio | test/providers/test_precip.py | 2 | 3183 | import os
import unittest
from datetime import datetime
from esdl import CubeConfig
from esdl.providers.precip import PrecipProvider
from test.providers.provider_test_utils import ProviderTestBase
from esdl.util import Config
SOURCE_DIR = Config.instance().get_cube_source_path('CPC_precip')
class PrecipProviderTest... | gpl-3.0 |
mpetyx/palmdrop | venv/lib/python2.7/site-packages/django/contrib/localflavor/ca/forms.py | 100 | 4953 | """
Canada-specific Form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, CharField, Select
from django.utils.encoding import smart_text
from django.utils.tran... | apache-2.0 |
ryanpstauffer/market-vis | marketvis/quotes.py | 1 | 5030 | # -*- coding: utf-8 -*-
"""
[Python 2.7 (Mayavi is not yet compatible with Python 3+)]
Created on Wed Dec 16 22:44:15 2015
@author: Ryan Stauffer
https://github.com/ryanpstauffer/market-vis
[This module referenced http://www.theodor.io/scraping-google-finance-data-using-pandas/]
Market Visualization Prototype
Quotes M... | mit |
razvanphp/arangodb | 3rdParty/V8-3.31.74.1/third_party/python_26/Lib/site-packages/pythonwin/pywin/framework/startup.py | 17 | 2151 | # startup.py
#
"The main application startup code for PythonWin."
#
# This does the basic command line handling.
# Keep this as short as possible, cos error output is only redirected if
# this runs OK. Errors in imported modules are much better - the messages go somewhere (not any more :-)
import sys
import win32ui... | apache-2.0 |
lmprice/ansible | docs/bin/generate_man.py | 26 | 8660 | #!/usr/bin/env python
import optparse
import os
import pprint
import sys
from jinja2 import Environment, FileSystemLoader
from ansible.module_utils._text import to_bytes
def generate_parser():
p = optparse.OptionParser(
version='%prog 1.0',
usage='usage: %prog [options]',
description='G... | gpl-3.0 |
RGood/praw | docs/conf.py | 2 | 1079 | import os
import sys
sys.path.insert(0, "..")
from praw import __version__
copyright = '2016, Bryce Boe'
exclude_patterns = ['_build']
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']
html_static_path = ['_static']
html_theme = 'sphinx_rtd_theme'
html_theme_options = {
'collapse_navigation': True
}
h... | bsd-2-clause |
GauravSahu/odoo | addons/website_event_track/models/event.py | 300 | 8344 | # -*- 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 |
JacobJacob/pyew | envi/archs/arm/__init__.py | 17 | 1417 |
"""
The initial arm module.
"""
import envi
from envi.archs.arm.regs import *
from envi.archs.arm.disasm import *
class ArmModule(envi.ArchitectureModule):
def __init__(self):
envi.ArchitectureModule.__init__(self, "armv6", maxinst=4)
self._arch_reg = self.archGetRegCtx()
self._arch_dis... | gpl-2.0 |
twiest/openshift-tools | openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/openshift_health_checker/library/docker_container.py | 41 | 76451 | #!/usr/bin/python
# pylint: skip-file
# flake8: noqa
# TODO: remove this file once openshift-ansible requires ansible >= 2.3.
# This file is a copy of
# https://github.com/ansible/ansible/blob/20bf02f/lib/ansible/modules/cloud/docker/docker_container.py.
# It has been temporarily vendored here due to issue https://git... | apache-2.0 |
caspartse/QQ-Groups-Spider | vendor/pyexcel/constants.py | 1 | 3090 | """
pyexcel.constants
~~~~~~~~~~~~~~~~~~~
Constants appeared in pyexcel
:copyright: (c) 2015-2017 by Onni Software Ltd.
:license: New BSD License
"""
# flake8: noqa
DEFAULT_NA = ''
DEFAULT_NAME = 'pyexcel sheet'
DEFAULT_SHEET_NAME = 'pyexcel_sheet1'
MESSAGE_WARNING = "We do not overwrite files"
M... | mit |
gisce/OCB | addons/portal_event/__openerp__.py | 53 | 1665 | # -*- 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 |
kapt/django-oscar | tests/unit/offer/results_tests.py | 62 | 1039 | from decimal import Decimal as D
from django.test import TestCase
from oscar.apps.offer import models, results
class TestOfferApplicationsObject(TestCase):
def setUp(self):
self.applications = results.OfferApplications()
self.offer = models.ConditionalOffer()
def test_is_countable(self):
... | bsd-3-clause |
VirtueSecurity/aws-extender | BappModules/boto/beanstalk/layer1.py | 146 | 56259 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 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... | mit |
gunchleoc/django | tests/annotations/tests.py | 194 | 19574 | from __future__ import unicode_literals
import datetime
from decimal import Decimal
from django.core.exceptions import FieldDoesNotExist, FieldError
from django.db.models import (
F, BooleanField, CharField, Count, DateTimeField, ExpressionWrapper, Func,
IntegerField, Sum, Value,
)
from django.db.models.funct... | bsd-3-clause |
brandond/ansible | test/units/modules/network/f5/test_bigip_gtm_global.py | 21 | 3688 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
rarcotvmw/capirca | lib/pcap.py | 1 | 15928 | # Copyright 2015 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 |
clubcapra/Ibex | src/seagoatvision_ros/scripts/CapraVision/server/recording/image.py | 1 | 1268 | #! /usr/bin/env python
# Copyright (C) 2012 Club Capra - capra.etsmtl.ca
#
# This filename is part of CapraVision.
#
# CapraVision 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 ve... | gpl-3.0 |
beacloudgenius/edx-platform | common/lib/xmodule/xmodule/modulestore/split_mongo/definition_lazy_loader.py | 213 | 1560 | from opaque_keys.edx.locator import DefinitionLocator
import copy
class DefinitionLazyLoader(object):
"""
A placeholder to put into an xblock in place of its definition which
when accessed knows how to get its content. Only useful if the containing
object doesn't force access during init but waits unt... | agpl-3.0 |
ahmetabdi/SickRage | autoProcessTV/lib/requests/packages/urllib3/response.py | 316 | 10537 | # urllib3/response.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 logging
import zlib
import io
from .exceptions import DecodeError
from .packages.six ... | gpl-3.0 |
gmr/infoblox | infoblox/record.py | 1 | 15975 | """
Base Record Object
"""
import logging
from infoblox import exceptions
from infoblox import mapping
LOGGER = logging.getLogger(__name__)
class Record(mapping.Mapping):
"""This object is extended by specific Infoblox record types and implements
the core API behavior of a record class. Attributes that map... | bsd-3-clause |
jalexvig/tensorflow | tensorflow/python/kernel_tests/decode_compressed_op_test.py | 29 | 2683 | # 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 |
sahana/Turkey | modules/templates/DRK/layouts.py | 5 | 10012 | # -*- coding: utf-8 -*-
from gluon import *
from gluon.storage import Storage
from s3 import *
from s3theme import NAV, SECTION
# =============================================================================
class S3MainMenuLayout(S3NavigationItem):
""" Custom Main Menu Layout """
@staticmethod
def layou... | mit |
prakxys/flask | Work/Trivia - Module 5/env/Lib/site-packages/pip/_vendor/requests/packages/chardet/compat.py | 2943 | 1157 | ######################## BEGIN LICENSE BLOCK ########################
# Contributor(s):
# Ian Cordasco - port to Python
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# versio... | apache-2.0 |
jbouse-debian/paramiko | tests/test_kex.py | 2 | 22512 | # Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (a... | lgpl-2.1 |
ryfeus/lambda-packs | Skimage_numpy/source/numpy/polynomial/chebyshev.py | 30 | 62880 | """
Objects for dealing with Chebyshev series.
This module provides a number of objects (mostly functions) useful for
dealing with Chebyshev series, including a `Chebyshev` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with such polynomials is in... | mit |
josjevv/django-cms | cms/cache/__init__.py | 46 | 2928 | # -*- coding: utf-8 -*-
import re
from cms.utils import get_cms_setting
CMS_PAGE_CACHE_VERSION_KEY = get_cms_setting("CACHE_PREFIX") + 'CMS_PAGE_CACHE_VERSION'
def _get_cache_version():
"""
Returns the current page cache version, explicitly setting one if not
defined.
"""
from django.core.cache i... | bsd-3-clause |
lixiangning888/whole_project | modules/signatures_orignal/modifies_uac_notify.py | 2 | 1067 | # Copyright (C) 2015 Kevin Ross
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.cuckoo.common.abstracts import Signature
class ModifiesUACNotify(Signature):
name = "modify_uac_prompt"
description = "Attempts to modify UAC prom... | lgpl-3.0 |
blacklin/kbengine | kbe/res/scripts/common/Lib/test/_test_multiprocessing.py | 67 | 120261 | #
# Unit tests for the multiprocessing package
#
import unittest
import queue as pyqueue
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import struct
import operator
import test.support
import test.script_helper
... | lgpl-3.0 |
yoelk/kivy | kivy/core/image/img_tex.py | 54 | 1548 | '''
Tex: Compressed texture
'''
__all__ = ('ImageLoaderTex', )
import json
from struct import unpack
from kivy.logger import Logger
from kivy.core.image import ImageLoaderBase, ImageData, ImageLoader
class ImageLoaderTex(ImageLoaderBase):
@staticmethod
def extensions():
return ('tex', )
def lo... | mit |
zhjunlang/kbengine | kbe/res/scripts/common/Lib/test/test_urllib2_localnet.py | 60 | 26073 | import base64
import os
import email
import urllib.parse
import urllib.request
import http.server
import unittest
import hashlib
from test import support
threading = support.import_module('threading')
try:
import ssl
except ImportError:
ssl = None
here = os.path.dirname(__file__)
# Self-signed cert file for... | lgpl-3.0 |
aleju/self-driving-truck | lib/plotting.py | 1 | 13772 | """Classes to handle plotting during the training."""
from __future__ import print_function, division
import math
import cPickle as pickle
from collections import OrderedDict
import numpy as np
import matplotlib.pyplot as plt
import time
GROWTH_BY = 500
class History(object):
def __init__(self):
self.line... | mit |
fldc/CouchPotatoServer | libs/dateutil/rrule.py | 214 | 41036 | """
Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard Python
datetime module.
"""
__license__ = "Simplified BSD"
import itertools
import datetime
import calendar
try:
import _thread
except ImportError:
import thread as _thread
import sys
from six i... | gpl-3.0 |
sugartom/tensorflow-alien | tensorflow/python/ops/data_flow_ops.py | 15 | 64923 | # 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 |
darjeeling/django | tests/select_related/models.py | 79 | 3040 | """
Tests for select_related()
``select_related()`` follows all relationships and pre-caches any foreign key
values so that complex trees can be fetched in a single query. However, this
isn't always a good idea, so the ``depth`` argument control how many "levels"
the select-related behavior will traverse.
"""
from dj... | bsd-3-clause |
ukanga/SickRage | lib/hachoir_parser/file_system/mbr.py | 86 | 7764 | """
Master Boot Record.
"""
# cfdisk uses the following algorithm to compute the geometry:
# 0. Use the values given by the user.
# 1. Try to guess the geometry from the partition table:
# if all the used partitions end at the same head H and the
# same sector S, then there are (H+1) heads and S sectors/cylind... | gpl-3.0 |
2uller/LotF | App/Lib/site-packages/numpy/oldnumeric/alter_code2.py | 101 | 4635 | """
This module converts code written for numpy.oldnumeric to work
with numpy
FIXME: Flesh this out.
Makes the following changes:
* Converts typecharacters '1swu' to 'bhHI' respectively
when used as typecodes
* Changes import statements
* Change typecode= to dtype=
* Eliminates savespace=xxx keyword arguments... | gpl-2.0 |
waile23/todo | models/pduser.py | 1 | 2906 | # -*- coding: utf-8 -*-
from basemodel import *
import md5
import math
import sys
class PDuser(BaseModel):
'''model autocreate by createModel'''
table_name = 'pd_user'
#db_name = 'todo_local'
db_name = web.config.write_db_name
def _format_user(self, row):
if hasattr(row, 'u_logo'):
if not row.u_logo:
... | mit |
Michal-Fularz/codingame_solutions | codingame_solutions/medium/medium_The_Paranoid_Android.py | 1 | 3099 | __author__ = 'Amin'
# COMPLETED
# PYTHON 3.x
import sys
import math
class Floor:
def __init__(self, width, contains_exit=False, exit_position=-1):
self.width = width
self.__contains_elevator = False
self.__elevator_position = -1
self.__contains_exit = contains_exit
self._... | mit |
JingheZ/shogun | tests/integration/python_modular/distribution.py | 21 | 1835 | """
Test Distribution
"""
from numpy import inf, nan
from modshogun import *
import util
def _evaluate (indata):
prefix='distribution_'
feats=util.get_features(indata, prefix)
if indata[prefix+'name']=='HMM':
distribution=HMM(feats['train'], indata[prefix+'N'],
indata[prefix+'M'], indata[prefix+'pseudo'])
... | gpl-3.0 |
johnkit/vtk-dev | ThirdParty/Twisted/twisted/mail/test/test_mail.py | 26 | 73828 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for large portions of L{twisted.mail}.
"""
import os
import errno
import shutil
import pickle
import StringIO
import rfc822
import tempfile
import signal
from hashlib import md5
from zope.interface.verify import verifyClass
from zope.i... | bsd-3-clause |
nihilus/DIE | DIE/Plugins/DataParsers/SegmentParser/ModuleParser.py | 9 | 1225 | from DIE.Lib.DataPluginBase import DataPluginBase
import idc
import idaapi
class ModuleParser(DataPluginBase):
"""
A parser for boolean values
"""
def __init__(self):
super(ModuleParser, self).__init__()
self.setPluginType("Module")
def registerSupportedTypes(self):
"""
... | mit |
garthylou/Libreosteo | libreosteoweb/api/file_integrator.py | 1 | 19791 | # This file is part of LibreOsteo.
#
# LibreOsteo 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.
#
# LibreOsteo is distributed ... | gpl-3.0 |
spiceqa/virt-test | libvirt/tests/src/virsh_cmd/snapshot/virsh_snapshot_create_as.py | 1 | 18414 | import re
import os
import commands
import logging
from autotest.client.shared import error
from virttest import virsh, utils_misc, xml_utils, libvirt_xml
from virttest.libvirt_xml import vm_xml, xcepts
def xml_recover(vmxml):
"""
Recover older xml config with backup vmxml.
:params: vmxml: VMXML object
... | gpl-2.0 |
chitr/neutron | neutron/db/migration/alembic_migrations/versions/57086602ca0a_scrap_nsx_adv_svcs_models.py | 47 | 1156 | # 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 ... | apache-2.0 |
victoredwardocallaghan/xen | tools/xm-test/tests/restore/01_restore_basic_pos.py | 42 | 2022 | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Dan Smith <danms@us.ibm.com>
# Save a domain and attempt to restore it
#
# Since we don't want to depend on the fact that save/01_basic_pos.py
# ran successfully, we try to save the domain here again
import time
from XmTestLib i... | gpl-2.0 |
fzimmermann89/pyload | module/setup.py | 35 | 18929 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
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 prog... | gpl-3.0 |
anguoyang/SMQTK | python/EventContentDescriptor/kernels.py | 3 | 12623 | """
LICENCE
-------
Copyright 2013 by Kitware, Inc. All Rights Reserved. Please refer to
KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
"""
import numpy as np
import math
import timeit
#import homkermap_wrapper as homkermap
#import... | bsd-3-clause |
vadimtk/chrome4sdp | third_party/mojo/src/mojo/public/tools/mojom_fetcher/mojom_gn.py | 26 | 2651 | #!/usr/bin/env python
# Copyright 2015 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.
"""BUILD file generator for mojoms."""
import argparse
import errno
import imp
import logging
import os
import sys
import urllib2
# L... | bsd-3-clause |
valsson/MD-MC-Codes-2016 | HarmonicOscillator-MD/HarmonicOscillator-MD-Verlet.py | 1 | 4262 | #! /usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from DataTools import writeDataToFile
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--time-step',dest='time_step',required=False)
parser.add_argument('--output-file',dest='fn_out',required=False)
args = parser.parse_ar... | mit |
Sweetgrassbuffalo/ReactionSweeGrass-v2 | .meteor/local/dev_bundle/python/Lib/site-packages/pip/utils/__init__.py | 124 | 27531 | from __future__ import absolute_import
from collections import deque
import contextlib
import errno
import io
import locale
# we have a submodule named 'logging' which would shadow this if we used the
# regular name:
import logging as std_logging
import re
import os
import posixpath
import shutil
import stat
import su... | gpl-3.0 |
takaakiaoki/PyFoam | PyFoam/Applications/CommonLibFunctionTrigger.py | 3 | 2804 | """Implements a trigger that removes the libs and/or function
entry from the controlDict"""
import sys
from os import path
from optparse import OptionGroup
from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
from PyFoam.Error import warning
class CommonLibFunctionTrigger(object):
""" The cla... | gpl-2.0 |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/fork_wait.py | 129 | 2291 | """This test case provides support for checking forking and wait behavior.
To test different wait behavior, override the wait_impl method.
We want fork1() semantics -- only the forking thread survives in the
child after a fork().
On some systems (e.g. Solaris without posix threads) we find that all
active threads su... | gpl-2.0 |
bsmr-ansible/ansible-modules-core | cloud/openstack/os_image.py | 68 | 6384 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
#
# 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 vers... | gpl-3.0 |
OCA/business-requirement | business_requirement_sale/models/business_requirement.py | 1 | 1458 | # Copyright 2019 Tecnativa Victor M.M. Torres>
# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class BusinessRequirement(models.Model):
_inherit = 'business.requirement'
sale_order_ids = fields.One2many(
... | agpl-3.0 |
deepmind/open_spiel | open_spiel/python/algorithms/external_sampling_mccfr_test.py | 1 | 4567 | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 |
wbushey/santaclaus | tests/test_santa_v0.py | 1 | 1789 | # -*- coding: utf8 -*-
from __future__ import absolute_import, unicode_literals
import json
from santaclaus import db
from santaclaus.models import Person
from santa_test_helper import SantaClausTestCase
class SantaClausV0Test(SantaClausTestCase):
def test_request_with_a_name(self):
r = self.app.get('/?n... | gpl-3.0 |
akhilari7/pa-dude | lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/appengine.py | 195 | 7531 | from __future__ import absolute_import
import logging
import os
import warnings
from ..exceptions import (
HTTPError,
HTTPWarning,
MaxRetryError,
ProtocolError,
TimeoutError,
SSLError
)
from ..packages.six import BytesIO
from ..request import RequestMethods
from ..response import HTTPResponse
... | mit |
QuLogic/specfem1d | Python_version/grid.py | 2 | 2988 | # -*- coding: utf-8 -*-
'''
Definitions of the grid.
'''
from __future__ import (absolute_import, division, print_function)
import numpy as np
import functions
import gll
class OneDimensionalGrid(object):
"""Contains the grid properties"""
def __init__(self, param):
"""Init"""
self.param =... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.