repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/test_dist_tree_index.py | 2 | 8950 | # Copyright (c) 2020 PaddlePaddle 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 appli... | apache-2.0 |
Ashaba/rms | rmslocalenv/lib/python2.7/site-packages/django/contrib/gis/db/models/lookups.py | 104 | 10927 | from __future__ import unicode_literals
import re
from django.core.exceptions import FieldDoesNotExist
from django.db.models.constants import LOOKUP_SEP
from django.db.models.expressions import Col, Expression
from django.db.models.lookups import Lookup
from django.utils import six
gis_lookups = {}
class GISLookup... | mit |
orgito/ansible | test/units/modules/network/onyx/test_onyx_ptp.py | 63 | 5200 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
Johnetordoff/osf.io | api_tests/base/test_root.py | 6 | 5164 | # -*- coding: utf-8 -*-
import itsdangerous
import mock
from nose.tools import * # noqa:
import unittest
from django.utils import timezone
import pytest
from tests.base import ApiTestCase
from osf_tests.factories import (
AuthUserFactory,
ApiOAuth2ScopeFactory,
)
from api.base.settings.defaults import API_BA... | apache-2.0 |
aabbox/kbengine | kbe/res/scripts/common/Lib/test/test_pulldom.py | 118 | 12467 | import io
import unittest
import sys
import xml.sax
from xml.sax.xmlreader import AttributesImpl
from xml.dom import pulldom
from test.support import run_unittest, findfile
tstfile = findfile("test.xml", subdir="xmltestdata")
# A handy XML snippet, containing attributes, a namespace prefix, and a
# self-closing ta... | lgpl-3.0 |
thedrow/django | django/db/backends/sqlite3/creation.py | 193 | 2859 | import os
import sys
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.base.creation import BaseDatabaseCreation
from django.utils.six.moves import input
class DatabaseCreation(BaseDatabaseCreation):
def _get_test_db_name(self):
test_database_name = self.connection.settings... | bsd-3-clause |
PuZZleDucK/pixelated-platform | test/features/page_objects/pixelated_page.py | 2 | 2282 | #
# Copyright (c) 2015 ThoughtWorks, Inc.
#
# Pixelated is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pixelated is distrib... | agpl-3.0 |
Yarrick13/hwasp | tests/sat/Models/c745.180.SAT.dimacs.test.py | 5 | 10374 | input = """
c num blocks = 1
c num vars = 180
c minblockids[0] = 1
c maxblockids[0] = 180
p cnf 180 745
-91 56 -175 0
118 74 115 0
-36 -83 167 0
16 44 142 0
-88 33 20 0
177 132 -8 0
115 121 2 0
-13 -47 28 0
48 -174 163 0
-67 -54 123 0
-130 -132 -71 0
-171 -158 2 0
-35 23 83 0
129 109 -137 0
-8 -139 75 0
-52 -42 -79 0
5... | apache-2.0 |
iamsarin/geonode | geonode/groups/tests.py | 27 | 16338 | import json
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.conf import settings
from guardian.shortcuts import get_anonymous_user
from geonode.groups.models import GroupProfile, Group... | gpl-3.0 |
DarkPurple141/Maps | MapGen/voronoi.py | 1 | 28973 | #!/usr/bin/env python3
import pygame, os, random, numpy, math, color_palettes, queue, name_gen, triangle
from pygame.locals import *
from geom import *
from PIL import ImageFilter, Image
class City:
"""docstring for City."""
def __init__(self, location, name="default"):
self.name = name
self.l... | gpl-3.0 |
HybridF5/jacket | jacket/db/compute/sqlalchemy/migrate_repo/versions/274_update_instances_project_id_index.py | 2 | 1616 | # Copyright 2014 Rackspace Hosting
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
petersanchez/django-allauth | allauth/socialaccount/providers/twitch/views.py | 62 | 1037 | import requests
from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
from .provider import TwitchProvider
class TwitchOAuth2Adapter(OAuth2Adapt... | mit |
iut-ibk/DynaMind-UrbanSim | 3rdparty/opus/src/urbansim/household_x_gridcell/income_less_housing_cost_scaled.py | 2 | 2763 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.variables.variable import Variable
from urbansim.functions import attribute_label
from numpy import reshape
class income_less_housing_cost_scaled(Variable):
""" (income - ... | gpl-2.0 |
ogenstad/ansible | lib/ansible/modules/network/avi/avi_cloudconnectoruser.py | 41 | 4186 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | gpl-3.0 |
lidiamcfreitas/FenixScheduleMaker | ScheduleMaker/brython/www/src/Lib/formatter.py | 751 | 14930 | """Generic output formatting.
Formatter objects transform an abstract flow of formatting events into
specific output events on writer objects. Formatters manage several stack
structures to allow various properties of a writer object to be changed and
restored; writers need not be able to handle relative changes nor an... | bsd-2-clause |
G-P-S/depot_tools | third_party/gsutil/gslib/command_runner.py | 45 | 4281 | #!/usr/bin/env python
# coding=utf8
# Copyright 2011 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
#
# Un... | bsd-3-clause |
sysalexis/kbengine | kbe/src/lib/python/Lib/idlelib/GrepDialog.py | 61 | 5143 | import os
import fnmatch
import re # for htest
import sys
from tkinter import StringVar, BooleanVar, Checkbutton # for GrepDialog
from tkinter import Tk, Text, Button, SEL, END # for htest
from idlelib import SearchEngine
import itertools
from idlelib.SearchDialogBase import SearchDialogBase
# Importing OutputWindow... | lgpl-3.0 |
stefanv/aandete | app/lib/pygments/styles/autumn.py | 31 | 2144 | # -*- coding: utf-8 -*-
"""
pygments.styles.autumn
~~~~~~~~~~~~~~~~~~~~~~
A colorful style, inspired by the terminal highlighting style.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.to... | bsd-3-clause |
ApuliaSoftware/odoo | addons/account_asset/__openerp__.py | 314 | 2182 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
takeshineshiro/nova | nova/cells/scheduler.py | 46 | 11483 | # Copyright (c) 2012 Rackspace Hosting
# 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 req... | apache-2.0 |
redbo/swift | swift/proxy/controllers/account.py | 4 | 8385 | # Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
zentyal/sogo | Tests/Integration/test-davacl.py | 2 | 47735 | #!/usr/bin/python
from config import hostname, port, username, password, subscriber_username, subscriber_password, \
superuser, superuser_password
import sys
import unittest
import webdavlib
import time
import sogotests
import utilities
# TODO:
# - cal: complete test for "modify": "respond to" causes a 204 but... | gpl-2.0 |
jeroendierckx/Camelot | camelot/core/utils.py | 1 | 9051 | # ============================================================================
#
# Copyright (C) 2007-2012 Conceptive Engineering bvba. All rights reserved.
# www.conceptive.be / project-camelot@conceptive.be
#
# This file is part of the Camelot Library.
#
# This file may be used under the terms of the GNU General... | gpl-2.0 |
triveous/LearnFlask | flask/lib/python2.7/site-packages/pip/_vendor/html5lib/treeadapters/sax.py | 1835 | 1661 | from __future__ import absolute_import, division, unicode_literals
from xml.sax.xmlreader import AttributesNSImpl
from ..constants import adjustForeignAttributes, unadjustForeignAttributes
prefix_mapping = {}
for prefix, localName, namespace in adjustForeignAttributes.values():
if prefix is not None:
pre... | apache-2.0 |
bjss/BJSS_liveobs_selenium | liveobs_ui/selectors/desktop/nursing_shift_change_selectors.py | 2 | 1670 | """ Selectors for Nursing Shift Change Wizard """
from selenium.webdriver.common.by import By
WIZARD_STAGE_CONTAINER = (
By.CSS_SELECTOR,
'.modal .oe_form_field_status'
)
WIZARD_STAGE = (
By.CSS_SELECTOR,
'.modal .oe_form_field_status .label'
)
WIZARD_BUTTON = (
By.CSS_SELECTOR,
'.modal .oe_fo... | gpl-3.0 |
ttsubo/ryu | ryu/contrib/ovs/reconnect.py | 54 | 23121 | # Copyright (c) 2010, 2011, 2012 Nicira, 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 agre... | apache-2.0 |
BartoszCichecki/onlinepython | onlinepython/pypy-2.4.0-win32/lib-python/2.7/lib2to3/tests/pytree_idempotency.py | 129 | 2385 | #!/usr/bin/env python
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Main program for testing the infrastructure."""
__author__ = "Guido van Rossum <guido@python.org>"
# Support imports (need to be imported first)
from . import support
# Python imports
import ... | gpl-2.0 |
anakinsolo/backend | Lib/site-packages/pip/_vendor/progress/__init__.py | 916 | 3023 | # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE A... | mit |
luci/luci-py | client/third_party/oauth2client/_pycrypto_crypt.py | 6 | 4295 | # 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 ... | apache-2.0 |
hhru/ansible | lib/ansible/module_utils/a10.py | 322 | 4194 | # 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 the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
lancezlin/pylearn2 | pylearn2/costs/gated_autoencoder.py | 39 | 5793 | """
Definitions of the cost for the gated-autoencoder.
"""
from pylearn2.costs.cost import Cost, DefaultDataSpecsMixin
from pylearn2.space import VectorSpace
class SymmetricCost(DefaultDataSpecsMixin, Cost):
"""
Summary (Class representing the symmetric cost).
Subclasses can define the type of data they... | bsd-3-clause |
sogelink/ansible | lib/ansible/module_utils/vyos.py | 14 | 4939 | # 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 the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
epitron/youtube-dl | youtube_dl/extractor/nba.py | 27 | 5956 | from __future__ import unicode_literals
import functools
import re
from .turner import TurnerBaseIE
from ..compat import (
compat_urllib_parse_urlencode,
compat_urlparse,
)
from ..utils import (
OnDemandPagedList,
remove_start,
)
class NBAIE(TurnerBaseIE):
_VALID_URL = r'https?://(?:watch\.|www\... | unlicense |
todaychi/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/geos/prototypes/__init__.py | 314 | 1305 | """
This module contains all of the GEOS ctypes function prototypes. Each
prototype handles the interaction between the GEOS library and Python
via ctypes.
"""
# Coordinate sequence routines.
from django.contrib.gis.geos.prototypes.coordseq import (create_cs, get_cs,
cs_clone, cs_getordinate, cs_setordinate, cs... | apache-2.0 |
andyneff/voxel-globe | voxel_globe/ingest/metadata/tools.py | 1 | 6144 | import os
import json
from celery.utils.log import get_task_logger
from vsi.iglob import glob as iglob
logger = get_task_logger(__name__);
#Move to ingest.tools when done devving
def match_images(images, camera_names, json_config={}):
''' returns dictionary camera_name:image pairs
json example:
{... | mit |
stvstnfrd/edx-platform | lms/djangoapps/grades/tests/test_signals.py | 5 | 9726 | """
Tests for the score change signals defined in the courseware models module.
"""
import re
from datetime import datetime
from unittest.mock import MagicMock, patch
import ddt
import pytest
import pytz
from django.test import TestCase
from submissions.models import score_reset, score_set
from common.djangoapps.ut... | agpl-3.0 |
fidomason/kbengine | kbe/res/scripts/common/Lib/encodings/hex_codec.py | 202 | 1508 | """Python 'hex_codec' Codec - 2-digit hex content transfer encoding.
This codec de/encodes from bytes to bytes.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs
import binascii
### Codec APIs
def hex_encode(input, errors='strict'):
assert errors == 'strict'
return (binascii.b2a_hex(input)... | lgpl-3.0 |
meletakis/collato | lib/python2.7/site-packages/django/templatetags/static.py | 114 | 4022 | try:
from urllib.parse import urljoin
except ImportError: # Python 2
from urlparse import urljoin
from django import template
from django.template.base import Node
from django.utils.encoding import iri_to_uri
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
... | gpl-2.0 |
termie/nova-migration-demo | nova/tests/test_volume.py | 2 | 14447 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | apache-2.0 |
ivanovev/hm | srv/ANASAT.py | 1 | 8497 |
from util import CachedDict
from util.serial import query_serial
cache = CachedDict()
table_act = {
'TEMP': 0,
'TXOUT': 1,
'RXOUT': 1,
'P12V': 3,
'PA3': 4,
'PA4': 5,
'PA5': 6,
'PA6': 7,
'N5V': 8,
'OSLPLL': 9,
'TXPLL': 10,
'RXPLL': 11,
'LNBV': 12,... | gpl-3.0 |
ggalancs/marionette | marionette_tg/record_layer.py | 3 | 5370 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import binascii
PAYLOAD_HEADER_SIZE_IN_BITS = 200
PAYLOAD_HEADER_SIZE_IN_BYTES = PAYLOAD_HEADER_SIZE_IN_BITS / 8
NORMAL = 0x1
END_OF_STREAM = 0x2
class Cell(object):
def __init__(self, model_uuid, model_instance_id, stream_id, seq_id,
length=0, ce... | apache-2.0 |
WojciechMigda/TCO-PCFStupskiPrize1 | src/cell_patches_dbscan.py | 1 | 8930 | #!/opt/anaconda2/bin/python
# -*- coding: utf-8 -*-
"""
################################################################################
#
# Copyright (c) 2015 Wojciech Migda
# All rights reserved
# Distributed under the terms of the MIT license
#
####################################################################... | mit |
nis-sdn/odenos | src/main/python/org/o3project/odenos/remoteobject/manager/event_subscription.py | 6 | 2243 | # -*- coding:utf-8 -*-
# Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License... | apache-2.0 |
kjw0106/GCM_app_server | venv/lib/python2.7/site-packages/sqlalchemy/ext/instrumentation.py | 147 | 14856 | """Extensible class instrumentation.
The :mod:`sqlalchemy.ext.instrumentation` package provides for alternate
systems of class instrumentation within the ORM. Class instrumentation
refers to how the ORM places attributes on the class which maintain
data and track changes to that data, as well as event hooks installed... | mit |
ModdedPA/android_external_chromium_org | build/android/pylib/instrumentation/test_package.py | 61 | 1121 | # Copyright (c) 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.
"""Class representing instrumentation test apk and jar."""
import os
from pylib.utils import apk_helper
import test_jar
class TestPackage(test_jar.T... | bsd-3-clause |
imruahmed/microblog | flask/lib/python2.7/site-packages/sqlalchemy/sql/__init__.py | 49 | 1737 | # sql/__init__.py
# Copyright (C) 2005-2015 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 .expression import (
Alias,
ClauseElement,
ColumnCollection,
Co... | bsd-3-clause |
sunny94/temp | sympy/mpmath/tests/test_ode.py | 39 | 1834 | #from sympy.mpmath.calculus import ODE_step_euler, ODE_step_rk4, odeint, arange
from sympy.mpmath import odefun, cos, sin, mpf, sinc, mp
'''
solvers = [ODE_step_euler, ODE_step_rk4]
def test_ode1():
"""
Let's solve:
x'' + w**2 * x = 0
i.e. x1 = x, x2 = x1':
x1' = x2
x2' = -x1
"""
d... | bsd-3-clause |
llhe/tensorflow | tensorflow/python/training/basic_session_run_hooks.py | 21 | 27030 | # 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 |
grueni75/GeoDiscoverer | Source/Platform/Target/Android/core/src/main/jni/libxml2-2.9.2/python/tests/reader.py | 35 | 12521 | #!/usr/bin/python -u
# -*- coding: ISO-8859-1 -*-
#
# this tests the basic APIs of the XmlTextReader interface
#
import libxml2
import sys
try:
import StringIO
str_io = StringIO.StringIO
except:
import io
str_io = io.StringIO
# Memory debug specific
libxml2.debugMemory(1)
f = str_io("""<a><b b1="b1"/>... | gpl-3.0 |
viki9698/jizhanggroup | django/contrib/auth/tests/basic.py | 95 | 8948 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import locale
from django.contrib.auth import get_user_model
from django.contrib.auth.management.commands import createsuperuser
from django.contrib.auth.models import User, AnonymousUser
from django.contrib.auth.tests.custom_user import CustomUser
fro... | bsd-3-clause |
campbe13/openhatch | vendor/packages/mechanize/mechanize/_headersutil.py | 133 | 8371 | """Utility functions for HTTP header value parsing and construction.
Copyright 1997-1998, Gisle Aas
Copyright 2002-2006, John J. Lee
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD or ZPL 2.1 licenses (see the file
COPYING.txt included with the distribution).
"""
impo... | agpl-3.0 |
amyvmiwei/kbengine | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/html5lib/treewalkers/etree.py | 310 | 4625 | from __future__ import absolute_import, division, unicode_literals
try:
from collections import OrderedDict
except ImportError:
try:
from ordereddict import OrderedDict
except ImportError:
OrderedDict = dict
import gettext
_ = gettext.gettext
import re
from pip._vendor.six import text_typ... | lgpl-3.0 |
meletakis/collato | lib/python2.7/site-packages/django/contrib/admin/views/main.py | 85 | 16606 | import operator
from functools import reduce
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
from django.core.paginator import InvalidPage
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models.fields import FieldDoesNotExist
from django.utils.datas... | gpl-2.0 |
andersonresende/django | django/contrib/formtools/wizard/storage/base.py | 79 | 4920 | from django.core.files.uploadedfile import UploadedFile
from django.utils.datastructures import MultiValueDict
from django.utils.functional import lazy_property
from django.utils import six
from django.contrib.formtools.wizard.storage.exceptions import NoFileStorageConfigured
class BaseStorage(object):
step_key ... | bsd-3-clause |
CMUSV-VisTrails/WorkflowRecommendation | vistrails/db/versions/v0_9_3/translate/v0_9_1.py | 1 | 3964 | ###############################################################################
##
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary forms, with or without
## modification, ... | bsd-3-clause |
yesudeep/old-milsalumni | app/console/app/pygments/cmdline.py | 19 | 12149 | # -*- coding: utf-8 -*-
"""
pygments.cmdline
~~~~~~~~~~~~~~~~
Command line interface.
:copyright: 2006-2008 by Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import sys
import getopt
from textwrap import dedent
from pygments import __version__, __author__, highlight
from pygments.... | mit |
wang701/nexus_9_flounder_kernel_src | scripts/tracing/dma-api/smmu.py | 96 | 7013 | """Low-level memory management tracking"""
VERBOSITY = 0 # TODO: use logging
class Bitmap(object):
"""Just a raw bitmap for reserving the pages"""
def __init__(self, size, verbosity):
self._size = size
self._bits = 0
self._verbosity = verbosity
self._bits_allocd = 0
def _m... | gpl-2.0 |
TheoChevalier/bedrock | bedrock/mozorg/tests/test_models.py | 3 | 4006 | # -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django.core.cache import cache
from django.db.utils import DatabaseError
from django.db.mod... | mpl-2.0 |
h4ck3rm1k3/ansible | docsite/build-site.py | 211 | 2937 | #!/usr/bin/env python
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of the Ansible Documentation
#
# 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 th... | gpl-3.0 |
myfluxi/android_kernel_lge_hammerhead | scripts/gcc-wrapper.py | 181 | 3495 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... | gpl-2.0 |
pjaehrling/finetuneAlexVGG | preprocessing/tf_models/inception.py | 1 | 13193 | # 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 |
alikins/ansible | test/units/module_utils/facts/base.py | 118 | 2325 | # base unit test classes for ansible/module_utils/facts/ tests
# -*- coding: utf-8 -*-
#
# 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 lat... | gpl-3.0 |
ganzenmg/lammps_current | tools/i-pi/ipi/inputs/atoms.py | 33 | 5049 | """Deals with creating the atoms class.
Copyright (C) 2013, Joshua More and Michele Ceriotti
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 ... | gpl-2.0 |
xq262144/hue | desktop/core/ext-py/boto-2.46.1/boto/fps/__init__.py | 429 | 1101 | # Copyright (c) 2008, Chris Moyer http://coredumped.org
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, ... | apache-2.0 |
hanv89/api-client-python | lib/pyasn1/type/namedtype.py | 162 | 5725 | # NamedType specification for constructed types
import sys
from pyasn1.type import tagmap
from pyasn1 import error
class NamedType:
isOptional = 0
isDefaulted = 0
def __init__(self, name, t):
self.__name = name; self.__type = t
def __repr__(self): return '%s(%r, %r)' % (
self.__class__.... | apache-2.0 |
debugger22/sympy | sympy/functions/special/hyper.py | 56 | 33825 | """Hypergeometric and Meijer G-functions"""
from __future__ import print_function, division
from sympy.core import S, I, pi, oo, ilcm, Mod
from sympy.core.function import Function, Derivative, ArgumentIndexError
from sympy.core.containers import Tuple
from sympy.core.compatibility import reduce, range
from sympy.core... | bsd-3-clause |
vodik/pacman | test/pacman/tests/upgrade078.py | 23 | 1514 | self.description = "-U --recursive upgrades outdated dependencies"
# git (new package)
# |-- perl (up to date)
# |-- glibc (out of date, will be updated)
# |-- curl (out of date, will be updated)
# |-- expat (up to date)
perl_lpkg = pmpkg("perl", "5.14.1-3")
perl_lpkg.depends = ["glibc"]
self.addpkg2db("local", p... | gpl-2.0 |
daniel-brettschneider/SiENA | ns-3.26/src/uan/bindings/modulegen__gcc_LP64.py | 38 | 545082 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-3.0 |
Plain-Andy-legacy/android_external_chromium_org | native_client_sdk/src/build_tools/sdk_tools/command/info.py | 160 | 1162 | # 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.
import command_common
import logging
import manifest_util
def Info(manifest, bundle_names):
valid_bundles, invalid_bundles = command_common.GetValidBu... | bsd-3-clause |
fw1121/luigi | sitecustomize.py | 56 | 1375 | import os
import sys
def patch_process_for_coverage():
# patch multiprocessing module to get coverage
# https://bitbucket.org/ned/coveragepy/issue/117/enable-coverage-measurement-of-code-run-by
from coverage.collector import Collector
from coverage import coverage
import multiprocessing
# dete... | apache-2.0 |
fernandog/Sick-Beard | lib/unidecode/x004.py | 249 | 4071 | data = (
'Ie', # 0x00
'Io', # 0x01
'Dj', # 0x02
'Gj', # 0x03
'Ie', # 0x04
'Dz', # 0x05
'I', # 0x06
'Yi', # 0x07
'J', # 0x08
'Lj', # 0x09
'Nj', # 0x0a
'Tsh', # 0x0b
'Kj', # 0x0c
'I', # 0x0d
'U', # 0x0e
'Dzh', # 0x0f
'A', # 0x10
'B', # 0x11
'V', # 0x12
'G', # 0x... | gpl-3.0 |
SpaceKatt/CSPLN | apps/scaffolding/mac/web2py/web2py.app/Contents/Resources/gluon/tests/test_tools.py | 13 | 2558 | #!/bin/python
# -*- coding: utf-8 -*-
"""
Unit tests for gluon.tools
"""
import os
import sys
if sys.version < "2.7":
import unittest2 as unittest
else:
import unittest
from fix_path import fix_sys_path
fix_sys_path(__file__)
DEFAULT_URI = os.getenv('DB', 'sqlite:memory')
from gluon.dal import DAL, Fie... | gpl-3.0 |
MichaelAquilina/restructured-preview | lib/pygments/lexers/make.py | 72 | 7247 | # -*- coding: utf-8 -*-
"""
pygments.lexers.make
~~~~~~~~~~~~~~~~~~~~
Lexers for Makefiles and similar.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, include, bygroups, \
... | mit |
DiptoDas8/Biponi | lib/python2.7/site-packages/django/conf/locale/el/formats.py | 120 | 1477 | # -*- 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/m/Y'
TIME_FORMAT = 'P'
DATETIME... | mit |
a1ezzz/wasp-general | tests/wasp_general_network_messenger_proto_test.py | 1 | 3944 | # -*- coding: utf-8 -*-
import pytest
from wasp_general.network.messenger.proto import WMessengerOnionProto, WMessengerEnvelopeProto
from wasp_general.network.messenger.proto import WMessengerOnionSessionProto, WMessengerOnionLayerProto
from wasp_general.network.messenger.proto import WMessengerOnionSessionFlowProto
... | lgpl-3.0 |
dimdung/boto | boto/ec2/regioninfo.py | 152 | 1568 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# 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 res... | mit |
Arcanemagus/plexpy | lib/tqdm/_tqdm_notebook.py | 3 | 8426 | """
IPython/Jupyter Notebook progressbar decorator for iterators.
Includes a default (x)range iterator printing to stderr.
Usage:
>>> from tqdm_notebook import tnrange[, tqdm_notebook]
>>> for i in tnrange(10): #same as: for i in tqdm_notebook(xrange(10))
... ...
"""
# future division is important to divide ... | gpl-3.0 |
mrbox/django | tests/delete_regress/models.py | 325 | 3172 | from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
class Award(models.Model):
name = models.CharField(max_length=25)
object_id = models.PositiveIntegerField()
content_type = mode... | bsd-3-clause |
onecloud/neutron | neutron/openstack/common/service.py | 15 | 15623 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | apache-2.0 |
eeason3/Bootstrap | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | 240 | 99242 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... | mit |
2014c2g2/2014c2 | wsgi/static/Brython2.1.0-20140419-113919/Lib/inspect.py | 91 | 78882 | """Get useful information from live Python objects.
This module encapsulates the interface provided by the internal special
attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.
Here are some of the useful functions provided by this module:... | gpl-2.0 |
TheTypoMaster/chromium-crosswalk | build/android/pylib/base/test_dispatcher_unittest.py | 36 | 8197 | #!/usr/bin/env python
# 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.
"""Unittests for test_dispatcher.py."""
# pylint: disable=R0201
# pylint: disable=W0212
import os
import sys
import unittest
from py... | bsd-3-clause |
kyunghyuncho/GroundHog | tutorials/DT_RNN_Tut_Ex_Pieces.py | 28 | 1136 | ##############
outhid = outhid_dropout(outhid, use_noise=False)
##############
outhid_activ = UnaryOp(activation=eval(state['dout_activ']))
##############
emb_words_out = MultiLayer(
rng,
n_in=state['n_in'],
n_hids=eval(state['dout_nhid']),
activation=linear,
init_fn='sample_weights_classic',
... | bsd-3-clause |
DarkmatterVale/Haiku-Configuration-Repo | hello/models.py | 1 | 2729 | from django.db import models
from django.contrib.auth.models import User
class Component(models.Model):
name = models.CharField(default='', max_length=200)
notes = models.CharField(default='', max_length=500)
is_working = models.CharField(default='', max_length=10)
rating = models.CharField(default=''... | mit |
wgcv/SWW-Crashphone | lib/python2.7/site-packages/django/contrib/sessions/tests.py | 31 | 22770 | import base64
from datetime import timedelta
import os
import shutil
import string
import tempfile
import unittest
import warnings
from django.conf import settings
from django.contrib.sessions.backends.db import SessionStore as DatabaseSession
from django.contrib.sessions.backends.cache import SessionStore as CacheSes... | apache-2.0 |
TornikeNatsvlishvili/GeorgianAutoComplete | backend/app.py | 1 | 1103 | from flask import Flask, request, jsonify
import heapq
import logging
import trie
server = Flask(__name__, static_url_path='')
LOGGING_FILE_NAME = 'log.txt'
NUM_SUGGESTIONS_TO_RETURN = 10
single_word_trie = None
def init():
global single_word_trie
logging.basicConfig(filename=LOGGING_FILE_NAME, level=logging... | mit |
handspring/bite-project | tools/bugs/server/appengine/handlers/bugs/create.py | 17 | 2214 | # Copyright 2011 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 |
uber/pyro | tests/contrib/gp/test_models.py | 1 | 15173 | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import logging
from collections import namedtuple
import pytest
import torch
import pyro.distributions as dist
from pyro.contrib.gp.kernels import Cosine, Matern32, RBF, WhiteNoise
from pyro.contrib.gp.likelihoods import Gaussian... | apache-2.0 |
crowdworks/redash | redash/handlers/embed.py | 4 | 3657 | from __future__ import absolute_import
import logging
import time
import pystache
from flask import request
from .authentication import current_org
from flask_login import current_user, login_required
from flask_restful import abort
from redash import models, utils
from redash.handlers import routes
from redash.handl... | bsd-2-clause |
dolph/keystone-workout | keystoneworkout/cli/subcommands.py | 1 | 8625 | # 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
# distributed under t... | apache-2.0 |
alfredodeza/boto | boto/manage/volume.py | 153 | 16296 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | mit |
jordiclariana/ansible | lib/ansible/modules/cloud/openstack/os_stack.py | 27 | 9090 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2016, Mathieu Bultel <mbultel@redhat.com>
# (c) 2016, Steve Baker <sbaker@redhat.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 version ... | gpl-3.0 |
alexsavio/scikit-learn | sklearn/gaussian_process/gpr.py | 13 | 18747 | """Gaussian processes regression. """
# Authors: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
from operator import itemgetter
import numpy as np
from scipy.linalg import cholesky, cho_solve, solve_triangular
from scipy.optimize import fmin_l_bfgs_b
from sklearn.base im... | bsd-3-clause |
jaysonsantos/python-binary-memcached | test/test_auth.py | 1 | 2626 | import os
import unittest
import six
import bmemcached
from bmemcached.exceptions import AuthenticationNotSupported, InvalidCredentials, MemcachedException
if six.PY3:
from unittest import mock
else:
import mock
class TestServerAuth(unittest.TestCase):
@mock.patch.object(bmemcached.protocol.Protocol, '... | mit |
sovietspy2/uzletiProject | python/Lib/encodings/charmap.py | 103 | 2153 | """ Generic Python Character Mapping Codec.
Use this codec directly rather than through the automatic
conversion mechanisms supplied by unicode() and .encode().
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import codecs
### Cod... | gpl-3.0 |
samueldotj/TeeRISC-Simulator | tests/configs/realview-simple-timing.py | 6 | 2284 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
pmeier82/spike_gnode | demo/forms.py | 1 | 1639 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.forms.formsets import BaseFormSet, formset_factory
from bootstrap3.tests import TestForm
RADIO_CHOICES = (
('1', 'Radio 1'),
('2', 'Radio 2'),
)
MEDIA_CHOICES = (
('Audio', (
('vinyl', 'Vinyl'),
... | bsd-3-clause |
Lanozavr/pvs | python/src/ui/mmgr.py | 4 | 9888 |
# This class manages all the menu items in the main menu of the editor
import wx
from constants import *
from evhdlr import *
import util
import logging
from preference import Preferences
from wx.lib.pubsub import setupkwargs, pub
import pvscomm
class MainFrameMenu(wx.MenuBar):
"""The class implementing and man... | gpl-2.0 |
andytimes/kernel-msm8660 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
Vishluck/sympy | sympy/physics/quantum/matrixcache.py | 124 | 3519 | """A cache for storing small matrices in multiple formats."""
from __future__ import print_function, division
from sympy import Matrix, I, Pow, Rational, exp, pi
from sympy.physics.quantum.matrixutils import (
to_sympy, to_numpy, to_scipy_sparse
)
class MatrixCache(object):
"""A cache for small matrices in... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.