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 |
|---|---|---|---|---|---|
Haxynox/kernel_samsung_n7100-old | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
ybellavance/python-for-android | sl4atools/fullscreenwrapper2/examples/gyro_sl4a_test/gyro_sl4a_test.py | 44 | 5686 | '''
@copyright: Hariharan Srinath, 2012
@license: This work is licensed under a Creative Commons Attribution 3.0 Unported License. http://creativecommons.org/licenses/by/3.0/
'''
xmldata = """<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_par... | apache-2.0 |
tarikgwa/nfd | newfies/newfies_factory/factories.py | 5 | 8782 | from __future__ import absolute_import
import factory
from django.contrib.auth.models import Group, Permission, User
from user_profile.models import CalendarUserProfile, CalendarUser
from calendar_settings.models import CalendarSetting
from user_profile.models import UserProfile, Manager
from dialer_gateway.models imp... | mpl-2.0 |
gsi-upm/senpy | senpy/__init__.py | 1 | 1141 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Grupo de Sistemas Inteligentes (GSI) DIT, UPM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.ap... | apache-2.0 |
grengojbo/st2 | st2client/st2client/models/core.py | 1 | 11692 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | apache-2.0 |
ogenstad/ansible | lib/ansible/modules/network/nxos/nxos_static_route.py | 16 | 9227 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
tenpoku1000/UEFI_FreeType_MSVC | src/lib/external/FreeType/freetype/builds/meson/extract_libtool_version.py | 12 | 2521 | #!/usr/bin/env python
"""Extract the libtool version from `configure.raw`.
This script parses the `configure.raw` file to extract the libtool version
number. By default, the full dotted version number is printed, but
`--major`, `--minor` or `--patch` can be used to only print one of these
values instead.
"""
from __... | mit |
yanheven/neutron | neutron/db/migration/__init__.py | 5 | 5970 | # Copyright 2012 New Dream Network, LLC (DreamHost)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | apache-2.0 |
lammps/lammps-packages | mingw-cross/cmake-win-on-linux.py | 1 | 14980 | #!/usr/bin/env python
# Script to build windows installer packages for LAMMPS
# (c) 2017,2018,2019,2020 Axel Kohlmeyer <akohlmey@gmail.com>
from __future__ import print_function
import sys,os,shutil,glob,re,subprocess,tarfile,gzip,time,inspect
try: from urllib.request import urlretrieve as geturl
except: from urllib ... | mit |
KellyChan/python-examples | python/aldebaran/hana/hana/vision/vision/vision_landMarkDetection.py | 3 | 2654 | # -*- encoding: UTF-8 -*-
# This test demonstrates how to use the ALLandMarkDetection module.
# Note that you might not have this module depending on your distribution
#
# /!\ Please change the IP address with your robot IP.
#
# - We first instantiate a proxy to the ALLandMarkDetection module
# Note that this mod... | mit |
ptdtan/Ragout | lib/networkx/drawing/nx_agraph.py | 40 | 13359 | """
***************
Graphviz AGraph
***************
Interface to pygraphviz AGraph class.
Examples
--------
>>> G=nx.complete_graph(5)
>>> A=nx.to_agraph(G)
>>> H=nx.from_agraph(A)
See Also
--------
Pygraphviz: http://networkx.lanl.gov/pygraphviz
"""
# Copyright (C) 2004-2012 by
# Aric Hagberg <hagberg@lanl.go... | gpl-3.0 |
eahneahn/free | lib/python2.7/site-packages/psycopg2/tests/testutils.py | 14 | 9867 | # testutils.py - utility module for psycopg2 testing.
#
# Copyright (C) 2010-2011 Daniele Varrazzo <daniele.varrazzo@gmail.com>
#
# psycopg2 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 vers... | agpl-3.0 |
aleknaui/genetic-sequence | genetic.py | 2 | 2657 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
class Chromosome:
def __init__(self, chain):
self.chain = chain
self.length = len(chain)
@classmethod
def cross(cls, parent1, parent2, mutation_rate):
switch_point = random.choice(range(parent1.length))
chains = [parent1.chain[:switch_point] + par... | mit |
catapult-project/catapult | third_party/pyasn1_modules/pyasn1_modules/rfc5083.py | 11 | 1668 | # This file is being contributed to of pyasn1-modules software.
#
# Created by Russ Housley without assistance from the asn1ate tool.
# Copyright (c) 2018, Vigil Security, LLC
# License: http://snmplabs.com/pyasn1/license.html
#
# Authenticated-Enveloped-Data for the Cryptographic Message Syntax (CMS)
#
# ASN.1 source... | bsd-3-clause |
liuquansheng47/ansible | lib/ansible/playbook/attribute.py | 85 | 1773 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
benhoff/listenerplugins | listenerplugins/octopart.py | 26 | 1312 | """
octopart.py
Search for electronic parts using the Octopart API.
Created By:
- foxlet <https://github.com/foxlet>
Modified By:
- Luke Rogers <https://github.com/lukeroge>
License:
GPL v3
"""
import requests
from cloudbot import hook
API_URL = "http://octopart.com/api/v3/parts/search"
@hook.on_st... | gpl-3.0 |
caterinaurban/Lyra | src/lyra/unittests/container/fulara/interval/running_example_A.py | 1 | 9726 | # INITIAL: a -> [-inf, inf]; b -> [-inf, inf]; k -> [-inf, inf]; len(score_occurrences) -> [-inf, inf]; len(scores) -> [-inf, inf]; scores_gt_10 -> [-inf, inf]; weight -> [-inf, inf], score_occurrences -> {([-inf, inf], [-inf, inf])}; scores -> {([-inf, inf], [-inf, inf])}, score_occurrences -> {([-inf, inf], True)}; s... | mpl-2.0 |
PeterWangIntel/chromium-crosswalk | third_party/libxml/src/check-xsddata-test-suite.py | 343 | 10682 | #!/usr/bin/python
import sys
import time
import os
import string
import StringIO
sys.path.insert(0, "python")
import libxml2
# Memory debug specific
libxml2.debugMemory(1)
debug = 0
verbose = 0
quiet = 1
#
# the testsuite description
#
CONF=os.path.join(os.path.dirname(__file__), "test/xsdtest/xsdtestsuite.xml")
LOG=... | bsd-3-clause |
kasisnu/calico | calico/monotonic.py | 4 | 1697 | # -*- coding: utf-8 -*-
# Copyright 2015 Metaswitch Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
subfusc/anki | tests/test_latex.py | 13 | 3758 | # coding: utf-8
import os
from tests.shared import getEmptyCol
from anki.utils import stripHTML
def test_latex():
d = getEmptyCol()
# change latex cmd to simulate broken build
import anki.latex
anki.latex.latexCmds[0][0] = "nolatex"
# add a note with latex
f = d.newNote()
f['Front'] = u"[... | agpl-3.0 |
tatsuhiro-t/grpc | src/python/src/grpc/_adapter/__init__.py | 1496 | 1530 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
tinybike/catchcoin | qa/rpc-tests/listtransactions.py | 1 | 5892 | #!/usr/bin/env python
# Exercise the listtransactions API
# Add python-catchcoinrpc to module search path:
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-catchcoinrpc"))
import json
import shutil
import subprocess
import tempfile
import traceback
from catchcoin... | mit |
Kopachris/seshet | seshet/bot.py | 1 | 18891 | """Implement SeshetBot as subclass of ircutils3.bot.SimpleBot."""
import logging
import os
from io import StringIO
from datetime import datetime
from ircutils3 import bot, client
from .utils import KVStore, Storage, IRCstr
class SeshetUser(object):
"""Represent one IRC user."""
def __init__(self, nick... | bsd-3-clause |
pratikmallya/hue | desktop/core/ext-py/Django-1.6.10/tests/model_forms_regress/models.py | 109 | 2375 | from __future__ import unicode_literals
import os
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils._os import upath
class Person(models.Model):
name = models.CharField(max_length=100)
class Triple(mod... | apache-2.0 |
dursk/django | tests/template_tests/test_logging.py | 117 | 4628 | from __future__ import unicode_literals
import logging
from django.template import Context, Engine, Variable, VariableDoesNotExist
from django.test import SimpleTestCase
class TestHandler(logging.Handler):
def __init__(self):
super(TestHandler, self).__init__()
self.log_record = None
def em... | bsd-3-clause |
iamutkarshtiwari/sympy | sympy/printing/pretty/pretty_symbology.py | 17 | 17640 | """Symbolic primitives + unicode/ASCII abstraction for pretty.py"""
from __future__ import print_function, division
import sys
import warnings
unicode_warnings = ''
from sympy.core.compatibility import u, unicode, range
# first, setup unicodedate environment
try:
import unicodedata
def U(name):
"""... | bsd-3-clause |
Naeka/vosae-app | www/organizer/api/resources/event.py | 1 | 10316 | # -*- coding:Utf-8 -*-
from django.conf.urls import url
from django.core.exceptions import ObjectDoesNotExist
from tastypie import fields as base_fields, http
from tastypie.utils import trailing_slash
from tastypie.validation import Validation
from tastypie_mongoengine import fields
from dateutil.parser import parse
... | agpl-3.0 |
snpabilonia/rgims | modules/eden/menus.py | 2 | 73170 | # -*- coding: utf-8 -*-
""" Sahana Eden Menu Structure and Layout
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
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 So... | mit |
ncliam/serverpos | openerp/addons/base/module/wizard/base_update_translations.py | 447 | 2931 | # -*- coding: 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 GNU... | agpl-3.0 |
Zanzibar82/plugin.video.pelisalacarta | pelisalacarta/channels/oranline.py | 5 | 11984 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para oranline
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys
from core imp... | gpl-3.0 |
kirca/odoo | addons/crm/__openerp__.py | 10 | 4547 | # -*- 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 |
cuongnv23/ansible | lib/ansible/module_utils/facts/virtual/openbsd.py | 199 | 2319 | # 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 distributed in the hope that ... | gpl-3.0 |
m-tmatma/svnmailer | src/lib/svnmailer/settings.py | 1 | 19703 | # -*- coding: utf-8 -*-
#
# Copyright 2004-2006 André Malo or his licensors, as applicable
#
# 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
#... | apache-2.0 |
zhaodelong/django | tests/template_tests/filter_tests/test_escape.py | 324 | 1495 | from django.template.defaultfilters import escape
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class EscapeTests(SimpleTestCase):
"""
The "escape" filter works the same whether autoescape is on or off,
but it has no effect on strings alrea... | bsd-3-clause |
WatchPeopleCode/WatchPeopleCode | wpc/utils.py | 2 | 2123 | from urlparse import urlparse, parse_qs
import requests
import re
# this functions is originally FROM: http://stackoverflow.com/questions/4356538/how-can-i-extract-video-id-from-youtubes-link-in-python
def youtube_video_id(url):
"""
Examples:
- http://youtu.be/SA2iWivDJiE
- http://www.youtube.com/watc... | mit |
LockScreen/Backend | venv/lib/python2.7/site-packages/boto/kinesis/layer1.py | 102 | 40879 | # Copyright (c) 2014 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 |
gautamkmr/incubator-mxnet | python/mxnet/gluon/model_zoo/vision/vgg.py | 10 | 8490 | # 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 |
mattseymour/django | tests/utils_tests/test_archive.py | 91 | 3007 | import os
import shutil
import stat
import sys
import tempfile
import unittest
from django.utils.archive import Archive, extract
TEST_DIR = os.path.join(os.path.dirname(__file__), 'archives')
class ArchiveTester:
archive = None
def setUp(self):
"""
Create temporary directory for testing ext... | bsd-3-clause |
mts90/ardupilot | Tools/autotest/pysim/rotmat.py | 154 | 11197 | #!/usr/bin/env python
#
# vector3 and rotation matrix classes
# This follows the conventions in the ArduPilot code,
# and is essentially a python version of the AP_Math library
#
# Andrew Tridgell, March 2012
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser... | gpl-3.0 |
mdavid/horizon | openstack_dashboard/dashboards/admin/defaults/tabs.py | 82 | 1417 | # Copyright 2013 Kylin, 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 agreed... | apache-2.0 |
photoninger/ansible | test/runner/lib/classification.py | 13 | 21342 | """Classify changes in Ansible code."""
from __future__ import absolute_import, print_function
import os
import time
from lib.target import (
walk_module_targets,
walk_integration_targets,
walk_units_targets,
walk_compile_targets,
walk_sanity_targets,
load_integration_prefixes,
analyze_in... | gpl-3.0 |
kutenai/django | django/template/loader.py | 126 | 2401 | from django.utils import six
from django.utils.deprecation import (
DeprecationInstanceCheck, RemovedInDjango20Warning,
)
from . import engines
from .base import Origin
from .exceptions import TemplateDoesNotExist
def get_template(template_name, using=None):
"""
Loads and returns a template for the given... | bsd-3-clause |
GarySparrow/mFlaskWeb | venv/Lib/site-packages/sqlalchemy/orm/sync.py | 21 | 4736 | # orm/sync.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
"""private module containing functions used for copying data
between instances based on ... | mit |
gotcha/selenium | py/test/selenium/webdriver/firefox/ff_profile_tests.py | 63 | 8290 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
kylerichardson/incubator-metron | dev-utilities/build-utils/generate_license.py | 26 | 4821 | #
# 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 n... | apache-2.0 |
polyaxon/polyaxon-api | polyaxon_lib/estimators/hooks/general_hooks.py | 1 | 2631 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from collections import OrderedDict
from tensorflow.python.training import basic_session_run_hooks
from tensorflow.python.training import evaluation
from polyaxon_lib.estimators.hooks.utils import can_run_hook
class GlobalStep... | mit |
TechBK/horizon-dev | openstack_dashboard/test/api_tests/network_tests.py | 18 | 35286 | # Copyright 2013 NEC Corporation
#
# 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... | apache-2.0 |
oliverychen/oliverychen.github.io | vendor/cache/ruby/2.1.0/gems/pygments.rb-0.6.2/vendor/pygments-main/scripts/find_error.py | 36 | 6017 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Lexing error finder
~~~~~~~~~~~~~~~~~~~
For the source files given on the command line, display
the text where Error tokens are being generated, along
with some context.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:licens... | mit |
petteyg/intellij-community | python/helpers/docutils/languages/en.py | 246 | 1848 | # $Id: en.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated... | apache-2.0 |
andreparrish/python-for-android | python-modules/twisted/twisted/python/randbytes.py | 49 | 4154 | # -*- test-case-name: twisted.test.test_randbytes -*-
# Copyright (c) 2007-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Cryptographically secure random implementation, with fallback on normal random.
"""
# System imports
import warnings, os, random
getrandbits = getattr(random, 'getrandbits', Non... | apache-2.0 |
wSedlacek/sensei-n6 | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
thesuperzapper/tensorflow | tensorflow/contrib/sparsemax/python/kernel_tests/sparsemax_test.py | 36 | 8789 | # 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 |
gagoncal/Selenium | pywinauto/build/lib/pywinauto/controlproperties.py | 2 | 7961 | # GUI Application automation and testing library
# Copyright (C) 2015 Intel Corporation
# Copyright (C) 2015 airelil
# Copyright (C) 2010 Mark Mc Mahon
#
# 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 Softwa... | lgpl-2.1 |
levigross/pyscanner | mytests/django/contrib/gis/geos/collections.py | 92 | 4637 | """
This module houses the Geometry Collection objects:
GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon
"""
from ctypes import c_int, c_uint, byref
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.libgeos i... | mit |
breznak/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/afm.py | 69 | 15057 | """
This is a python interface to Adobe Font Metrics Files. Although a
number of other python implementations exist (and may be more complete
than mine) I decided not to go with them because either they were
either
1) copyrighted or used a non-BSD compatible license
2) had too many dependencies and I wanted a fr... | agpl-3.0 |
Cojacfar/Maker | comm/lib/python2.7/site-packages/django/contrib/admin/options.py | 47 | 74403 | import copy
import operator
from functools import partial, reduce, update_wrapper
from django import forms
from django.conf import settings
from django.contrib import messages
from django.contrib.admin import widgets, helpers
from django.contrib.admin.util import (unquote, flatten_fieldsets, get_deleted_objects,
m... | gpl-2.0 |
sigma-geosistemas/django-tenants | docs/conf.py | 1 | 6550 | # -*- coding: utf-8 -*-
#
# dinnertime documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 19 10:27:46 2009.
#
# 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
# autogenerated file.
#
# ... | mit |
unsiloai/syntaxnet-ops-hack | tensorflow/python/ops/ctc_ops.py | 43 | 11713 | # 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 |
shakamunyi/tensorflow | tensorflow/contrib/learn/python/learn/monitored_session.py | 145 | 1269 | # pylint: disable=g-bad-file-header
# 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/LICENS... | apache-2.0 |
ShovanSarker/mango_office | actions/views.py | 1 | 15639 | from django.shortcuts import render, redirect
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from users.models import AllUsers, ACL
from status.models import Status
from task.models import Task
im... | gpl-2.0 |
davelab6/pyfontaine | fontaine/ext/extensis.py | 2 | 2215 | from __future__ import print_function
import logging
from lxml import etree
import re
import unicodedata
from fontaine.ext.base import BaseExt
from fontaine.ext.update import get_from_cache
EXTENSIS_LANG_XML = 'https://github.com/davelab6/extensis-languages/raw/gh-pages/languages.xml'
class Extension(BaseExt):
... | gpl-3.0 |
sendit2me/kaggle-ndsb | configurations/featharalick_convroll4_1024_lesswd.py | 6 | 2850 | import numpy as np
import theano
import theano.tensor as T
import lasagne as nn
import data
import load
import nn_plankton
import dihedral
import tmp_dnn
import tta
features = [
# "hu",
# "tutorial",
"haralick",
# "aaronmoments",
# "lbp",
# "pftas",
# "zernike_moments",
# "image_siz... | mit |
Yukarumya/Yukarum-Redfoxes | media/webrtc/trunk/build/android/pylib/sharded_tests_queue.py | 15 | 1204 | # 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.
"""A module that contains a queue for running sharded tests."""
import multiprocessing
class ShardedTestsQueue(object):
"""A queue for managing pen... | mpl-2.0 |
golden-warning/giraffedraft-api | bs4/tests/test_html5lib.py | 293 | 2929 | """Tests to ensure that the html5lib tree builder generates good trees."""
import warnings
try:
from bs4.builder import HTML5TreeBuilder
HTML5LIB_PRESENT = True
except ImportError, e:
HTML5LIB_PRESENT = False
from bs4.element import SoupStrainer
from bs4.testing import (
HTML5TreeBuilderSmokeTest,
... | mit |
munhanha/mtg-random | django/contrib/gis/tests/relatedapp/models.py | 274 | 1686 | from django.contrib.gis.db import models
from django.contrib.localflavor.us.models import USStateField
class Location(models.Model):
point = models.PointField()
objects = models.GeoManager()
def __unicode__(self): return self.point.wkt
class City(models.Model):
name = models.CharField(max_length=50)
... | bsd-3-clause |
Pretio/boto | tests/unit/vpc/test_vpngateway.py | 114 | 8709 | # -*- coding: UTF-8 -*-
from tests.compat import OrderedDict
from tests.unit import unittest
from tests.unit import AWSMockServiceTestCase
from boto.vpc import VPCConnection, VpnGateway, Attachment
class TestDescribeVpnGateways(AWSMockServiceTestCase):
connection_class = VPCConnection
def default_body(self... | mit |
soldag/home-assistant | homeassistant/components/futurenow/light.py | 7 | 3730 | """Support for FutureNow Ethernet unit outputs as Lights."""
import pyfnip
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
PLATFORM_SCHEMA,
SUPPORT_BRIGHTNESS,
LightEntity,
)
from homeassistant.const import CONF_DEVICES, CONF_HOST, CONF_NAME, CONF_PORT
import home... | apache-2.0 |
mattrobenolt/marathon-python | docs/conf.py | 10 | 10428 | # -*- coding: utf-8 -*-
#
# marathon-python documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 22 11:36:23 2014.
#
# 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
# autogenerated fil... | mit |
Semi-global/edx-platform | openedx/core/djangoapps/user_api/preferences/views.py | 47 | 10884 | """
NOTE: this API is WIP and has not yet been approved. Do not use this API
without talking to Christina or Andy.
For more information, see:
https://openedx.atlassian.net/wiki/display/TNL/User+API
"""
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import stat... | agpl-3.0 |
ecliptik/ansible-modules-core | utilities/logic/wait_for.py | 29 | 17649 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# 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 Licens... | gpl-3.0 |
jeffreyliu3230/osf.io | website/addons/dataverse/routes.py | 29 | 3257 | """
"""
from framework.routing import Rule, json_renderer
from website.routes import OsfWebRenderer
from . import views
settings_routes = {
'rules': [
Rule(
'/settings/dataverse/',
'get',
views.auth.dataverse_user_config_get,
json_renderer,
),
... | apache-2.0 |
huaweiswitch/neutron | neutron/db/portbindings_db.py | 7 | 4761 | # Copyright 2013 IBM Corp.
# 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 app... | apache-2.0 |
bwrsandman/OpenUpgrade | addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py | 382 | 1726 | ##########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gener... | agpl-3.0 |
qingtech/weibome | weibome/settings.py | 1 | 5454 | # Django settings for weibome project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
import os
if 'SERVER_SOFTWARE' in os.environ:
from sae.const import (
MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASS, MYSQL_DB
)
else:
# Make ... | gpl-2.0 |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/numpy/f2py/func2subr.py | 188 | 9224 | #!/usr/bin/env python
"""
Rules for building C/API module with f2py2e.
Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RIS... | bsd-2-clause |
havt/odoo | addons/crm_partner_assign/crm_lead.py | 221 | 3039 | # -*- 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 |
vbraun/SageUI | src/sageui/view/trac_window.py | 1 | 13199 | """
Window showing a Trac Ticket
"""
##############################################################################
# SageUI: A graphical user interface to Sage, Trac, and Git.
# Copyright (C) 2013 Volker Braun <vbraun.name@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it u... | gpl-3.0 |
marty331/jakesclock | flask/lib/python2.7/site-packages/sqlalchemy/ext/declarative/clsregistry.py | 48 | 10754 | # ext/declarative/clsregistry.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
"""Routines to handle the string class registry used by declarative.
... | gpl-2.0 |
zhuwenping/python-for-android | python-build/python-libs/gdata/tests/gdata_tests/books/service_test.py | 127 | 2096 | #!/usr/bin/python
__author__ = "James Sams <sams.james@gmail.com>"
import unittest
import getpass
import atom
import gdata.books
import gdata.books.service
from gdata import test_data
username = ""
password = ""
class BookCRUDTests(unittest.TestCase):
def setUp(self):
self.service = gdata.books.s... | apache-2.0 |
benfinkelcbt/CPD200 | CPD200-Lab08-Python/simplejson/tests/test_scanstring.py | 139 | 7311 | import sys
from unittest import TestCase
import simplejson as json
import simplejson.decoder
from simplejson.compat import b, PY3
class TestScanString(TestCase):
# The bytes type is intentionally not used in most of these tests
# under Python 3 because the decoder immediately coerces to str before
# calli... | gpl-3.0 |
cloudbau/keystone | keystone/common/sql/core.py | 2 | 9910 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 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
#
# Unle... | apache-2.0 |
berkeley-stat159/project-lambda | code/stat159lambda/utils/tests/test_parse_demographics.py | 1 | 1388 | from __future__ import absolute_import
from stat159lambda.utils import parse_demographics
import os
import csv
def prepare_for_tests():
with open('demographics.csv', 'w') as csvfile:
file_writer = csv.writer(csvfile, delimiter=',', quotechar='"')
file_writer.writerow(['id', 'gender', 'age', 'forr... | bsd-3-clause |
ralphbean/ansible | lib/ansible/module_utils/database.py | 56 | 5840 | # 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 |
lrowe/rdflib | rdflib/plugins/serializers/nquads.py | 22 | 1649 | import warnings
from rdflib.term import Literal
from rdflib.serializer import Serializer
from rdflib.py3compat import b
from rdflib.plugins.serializers.nt import _xmlcharref_encode, _quoteLiteral
__all__ = ['NQuadsSerializer']
class NQuadsSerializer(Serializer):
def __init__(self, store):
if not store... | bsd-3-clause |
googleads/googleads-dfa-reporting-samples | python/v3_3/create_content_category.py | 3 | 1851 | #!/usr/bin/python
#
# 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 b... | apache-2.0 |
trabucayre/gnuradio | gr-audio/examples/python/dial_tone_daemon.py | 1 | 1411 | #!/usr/bin/env python
#
# Copyright 2004,2005,2007,2008,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr, gru
from gnuradio import audio
from gnuradio.eng_arg import eng_float
from argparse import ArgumentParser
import os
... | gpl-3.0 |
robdennis/sideboard | tests/plugins/manypackages/multi/env/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/install_egg_info.py | 357 | 3833 | from setuptools import Command
from setuptools.archive_util import unpack_archive
from distutils import log, dir_util
import os, shutil, pkg_resources
class install_egg_info(Command):
"""Install an .egg-info directory for the package"""
description = "Install an .egg-info directory for the package"
user_... | bsd-3-clause |
mtl/svg2mod | svg2mod/svg2mod.py | 1 | 39409 | #!/usr/bin/python
from __future__ import absolute_import
import argparse
import datetime
import os
from pprint import pformat, pprint
import re
import svg2mod.svg as svg
import sys
#----------------------------------------------------------------------------
DEFAULT_DPI = 96 # 96 as of Inkscape 0.92
def main():
... | cc0-1.0 |
yuyu2172/chainercv | chainercv/utils/mask/scale_mask.py | 3 | 2274 | from __future__ import division
import numpy as np
import PIL.Image
import chainer
from chainercv import transforms
def scale_mask(mask, bbox, size):
"""Scale instance segmentation mask while keeping the aspect ratio.
This function exploits the sparsity of :obj:`mask` to speed up
resize operation.
... | mit |
robovero/python | robovero/windows.py | 2 | 1055 | import sys
if (sys.platform == "win32"):
import _winreg as winreg
import itertools, re
def fullPortName(portname):
""" Given a port-name (of the form COM7,
COM12, CNCA0, etc.) returns a full
name suitable for opening with the
Serial class.
"""
m = re.m... | bsd-2-clause |
mikehulluk/morphforge | src/morphforge/constants/ions.py | 1 | 1668 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 Michael Hull.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... | bsd-2-clause |
christianurich/VIBe2UrbanSim | 3rdparty/opus/src/urbansim/zone/home_access_to_employment_DDD.py | 2 | 6081 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from abstract_zone_access_variable import Abstract_Zone_Access_Variable
class home_access_to_employment_DDD(Abstract_Zone_Access_Variable):
"""The accessibility for the households in the g... | gpl-2.0 |
dfalt974/SickRage | lib/sqlalchemy/dialects/drizzle/base.py | 79 | 14993 | # drizzle/base.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
# Copyright (C) 2010-2011 Monty Taylor <mordred@inaugust.com>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: drizz... | gpl-3.0 |
paninetworks/neutron | neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py | 1 | 46084 | #!/usr/bin/env python
# Copyright 2012 Cisco Systems, 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... | apache-2.0 |
andrius-preimantas/odoo | addons/payment_paypal/models/res_company.py | 422 | 1752 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
class ResCompany(osv.Model):
_inherit = "res.company"
def _get_paypal_account(self, cr, uid, ids, name, arg, context=None):
Acquirer = self.pool['payment.acquirer']
company_id = self.pool['res.users'].browse(cr, uid, uid, context=co... | agpl-3.0 |
intel-hpdd/intel-manager-for-lustre | tests/unit/services/test_plugin_runner.py | 1 | 1732 | import mock
from chroma_core.models import VolumeNode
from tests.unit.lib.iml_unit_test_case import IMLUnitTestCase
from chroma_core.services.plugin_runner import AgentPluginHandlerCollection
from tests.unit.chroma_core.helpers import synthetic_host, synthetic_volume_full
from tests.unit.chroma_core.helpers import loa... | mit |
zhang0137/chromite | lib/patch.py | 2 | 45935 | # Copyright (c) 2011-2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module that handles the processing of patches to the source tree."""
import logging
import os
import random
import re
from chromite.buildbot... | bsd-3-clause |
mattcaldwell/boto | tests/integration/route53/test_zone.py | 13 | 5683 | # Copyright (c) 2011 Blue Pines Technologies LLC, Brad Carleton
# www.bluepines.org
# Copyright (c) 2012 42 Lines Inc., Jim Browne
#
# 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 re... | mit |
GinnyN/towerofdimensions-django | tests/regressiontests/localflavor/uy/tests.py | 33 | 1995 | from django.contrib.localflavor.uy.forms import UYDepartamentSelect, UYCIField
from django.contrib.localflavor.uy.util import get_validation_digit
from django.test import SimpleTestCase
class UYLocalFlavorTests(SimpleTestCase):
def test_UYDepartmentSelect(self):
f = UYDepartamentSelect()
out = u'... | bsd-3-clause |
pdellaert/ansible | test/units/modules/network/fortios/test_fortios_user_local.py | 21 | 15293 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.