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 |
|---|---|---|---|---|---|
gspilio/nova | nova/scheduler/filters/ram_filter.py | 9 | 2051 | # Copyright (c) 2011 OpenStack Foundation
# Copyright (c) 2012 Cloudscaling
# 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/l... | apache-2.0 |
ephes/scikit-learn | examples/cluster/plot_ward_structured_vs_unstructured.py | 320 | 3369 | """
===========================================================
Hierarchical clustering: structured vs unstructured ward
===========================================================
Example builds a swiss roll dataset and runs
hierarchical clustering on their position.
For more information, see :ref:`hierarchical_clus... | bsd-3-clause |
obarquero/intro_machine_learning_udacity | Projects/ud120-projects-master/pca/eigenfaces.py | 9 | 4989 | """
===================================================
Faces recognition example using eigenfaces and SVMs
===================================================
The dataset used in this example is a preprocessed excerpt of the
"Labeled Faces in the Wild", aka LFW_:
http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz (2... | gpl-2.0 |
ytoyama/yans_chainer_hackathon | examples/modelzoo/evaluate_caffe_net.py | 9 | 4149 | #!/usr/bin/env python
"""Example code of evaluating a Caffe reference model for ILSVRC2012 task.
Prerequisite: To run this example, crop the center of ILSVRC2012 validation
images and scale them to 256x256, and make a list of space-separated CSV each
column of which contains a full path to an image at the fist column ... | mit |
Serag8/Bachelor | google_appengine/lib/django-1.3/django/contrib/comments/feeds.py | 310 | 1439 | from django.conf import settings
from django.contrib.syndication.views import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
from django.utils.translation import ugettext as _
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(sel... | mit |
junwucs/h2o-3 | py2/testdir_single_jvm/test_parse_multi_header_single.py | 21 | 6234 | import unittest, time, sys, random, os, pprint as pp
sys.path.extend(['.','..','../..','py'])
import h2o2 as h2o
import h2o_cmd, h2o_import as h2i, h2o_util
import h2o_browse as h2b
from h2o_test import dump_json, verboseprint
# for test debug
HEADER = True
dataRowsWithHeader = 0
DO_RF = False
# Don't write headerDat... | apache-2.0 |
pybursa/homeworks | a_kopitsa/hw3/task8.py | 1 | 1069 | __author__ = 'andrey'
text = "Cras ultricies ligula sed magna dictum porta. Vivamus magna justo, lacinia eget consectetur sed, convallis" \
" at tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec " \
"velit neque, auctor sit amet aliquam vel, ullamcorper... | gpl-2.0 |
jitendra29/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treebuilders/etree.py | 721 | 12609 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
import re
from . import _base
from .. import ihatexml
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
tag_regexp = re.compile("{([^}]*)}(.*)")
def getETreeBuilder(Elemen... | mpl-2.0 |
akosel/incubator-airflow | airflow/contrib/hooks/gcs_hook.py | 2 | 19943 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
inares/edx-platform | common/test/acceptance/tests/video/test_studio_video_editor.py | 69 | 24711 | # -*- coding: utf-8 -*-
"""
Acceptance tests for CMS Video Editor.
"""
from nose.plugins.attrib import attr
from .test_studio_video_module import CMSVideoBaseTest
@attr('shard_6')
class VideoEditorTest(CMSVideoBaseTest):
"""
CMS Video Editor Test Class
"""
def setUp(self):
super(VideoEditorT... | agpl-3.0 |
pschmitt/home-assistant | homeassistant/components/soma/cover.py | 13 | 2345 | """Support for Soma Covers."""
import logging
from homeassistant.components.cover import ATTR_POSITION, CoverEntity
from homeassistant.components.soma import API, DEVICES, DOMAIN, SomaEntity
_LOGGER = logging.getLogger(__name__)
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up the... | apache-2.0 |
dguerri/git-upstream-old | git_upstream/lib/utils.py | 1 | 2717 | #
# Copyright (c) 2012, 2013, 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
benpatterson/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/test_cross_modulestore_import_export.py | 45 | 19577 | """
This suite of tests verifies that courses exported from one modulestore can be imported into
another modulestore and the result will be identical (ignoring changes to identifiers that are
the result of being imported into a course with a different course id).
It does this by providing facilities for creating and c... | agpl-3.0 |
jorik041/scrapy | scrapy/utils/benchserver.py | 130 | 1312 | import random
from six.moves.urllib.parse import urlencode
from twisted.web.server import Site
from twisted.web.resource import Resource
from twisted.internet import reactor
class Root(Resource):
isLeaf = True
def getChild(self, name, request):
return self
def render(self, request):
tot... | bsd-3-clause |
ray-zhong/github_trend_spider | ENV/Lib/site-packages/pymongo/server_description.py | 19 | 5727 | # Copyright 2014-2015 MongoDB, 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 to in writin... | mit |
PrashntS/scikit-learn | sklearn/gaussian_process/gaussian_process.py | 78 | 34552 | # -*- coding: utf-8 -*-
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# (mostly translation, see implementation details)
# Licence: BSD 3 clause
from __future__ import print_function
import numpy as np
from scipy import linalg, optimize
from ..base import BaseEstimator, RegressorMixin
from ..metrics... | bsd-3-clause |
dagnir/servo | tests/wpt/web-platform-tests/conformance-checkers/tools/url.py | 125 | 23557 | # -*- coding: utf-8 -*-
import os
ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# based on https://github.com/w3c/web-platform-tests/blob/275544eab54a0d0c7f74ccc2baae9711293d8908/url/urltestdata.txt
invalid = {
"scheme-trailing-tab": "a:\tfoo.com",
"scheme-trailing-newline": "a:\nfoo.com",... | mpl-2.0 |
szecsi/Gears | GearsPy/Project/Components/Stimulus/FullfieldLinearModulation.py | 1 | 1063 | import Gears as gears
from .. import *
from .SingleShape import *
class FullfieldLinearModulation(SingleShape) :
def boot(self,
*,
duration : 'Stimulus time in frames (unless superseded by duration_s).'
= 1,
duration_s : 'Stimulus ti... | gpl-2.0 |
nugget/home-assistant | homeassistant/components/sensor/lacrosse.py | 4 | 7174 | """
Support for LaCrosse sensor components.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.lacrosse/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import ENTITY_ID_FORMAT, PLATFOR... | apache-2.0 |
ragmani/coreclr | src/ToolBox/SOS/tests/test_libsosplugin.py | 43 | 7780 | from __future__ import print_function
import unittest
import argparse
import re
import tempfile
import subprocess
import threading
import os
import sys
import inspect
lldb = ''
clrdir = ''
workdir = ''
corerun = ''
sosplugin = ''
assembly = ''
fail_flag = ''
fail_flag_lldb = ''
summary_file = ''
timeout = 0
regex = ''... | mit |
product-owner/2015scrum | static/Brython3.1.1-20150328-091302/Lib/threading.py | 730 | 45641 | """Thread module emulating a subset of Java's threading model."""
import sys as _sys
import _thread
from time import sleep as _sleep
try:
from time import monotonic as _time
except ImportError:
from time import time as _time
from traceback import format_exc as _format_exc
from _weakrefset import WeakSet
# No... | gpl-3.0 |
ubuntunux/PyEngine3D | PyEngine3D/Utilities/Logger.py | 2 | 3005 | import os
import traceback
import time
import logging
from logging import CRITICAL, FATAL, ERROR, WARNING, WARN, INFO, DEBUG, NOTSET
import collections
# add custom log level
MINOR_INFO = DEBUG + 5
logging.addLevelName(MINOR_INFO, "MINOR_INFO")
# global variables
LOGGER = collections.OrderedDict()
# defaultLogPath = ... | bsd-2-clause |
fulfilio/trytond-shipping-dpd | tests/test_client.py | 2 | 2643 | # -*- coding: utf-8 -*-
"""
tests/test_client.py
"""
import os
import unittest
import trytond.tests.test_tryton
from trytond.modules.shipping_dpd.dpd_client import DPDClient, DPDException
class TestClientAPI(unittest.TestCase):
'''
Test Client API
'''
def setUp(self):
"""
Set up... | bsd-3-clause |
imsparsh/python-for-android | python3-alpha/python3-src/Doc/includes/sqlite3/text_factory.py | 45 | 1355 | import sqlite3
con = sqlite3.connect(":memory:")
cur = con.cursor()
# Create the table
con.execute("create table person(lastname, firstname)")
AUSTRIA = "\xd6sterreich"
# by default, rows are returned as Unicode
cur.execute("select ?", (AUSTRIA,))
row = cur.fetchone()
assert row[0] == AUSTRIA
# but we can make sql... | apache-2.0 |
stonegithubs/odoo | addons/hw_proxy/controllers/main.py | 70 | 7800 | # -*- coding: utf-8 -*-
import logging
import commands
import simplejson
import os
import os.path
import openerp
import time
import random
import subprocess
import simplejson
import werkzeug
import werkzeug.wrappers
_logger = logging.getLogger(__name__)
from openerp import http
from openerp.http import request
# Tho... | agpl-3.0 |
sgshulman/DGEM | utils/mesh_formatter.py | 1 | 1083 | # convert .msh grid file into GridNodes.dat and GridElements.dat pair
def format_mesh(mesh_file, nodes_file, elements_file):
with open(mesh_file, "r") as mf, open(nodes_file, "w") as nf, open(elements_file, "w") as ef:
regime = 0
number_of_elements = 0
for line in mf:
if line.sta... | bsd-2-clause |
Communities-Communications/cc-odoo | addons/point_of_sale/wizard/pos_discount.py | 382 | 2266 | # -*- 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 |
pacoqueen/bbinn | formularios/tarifas_de_precios.py | 1 | 34007 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2005-2008 Francisco José Rodríguez Bogado, #
# Diego Muñoz Escalante. #
# (pacoqueen@users.sourceforge.ne... | gpl-2.0 |
roatienza/dl-keras | chapter2-neural-networks/lstm-mnist-2.2.1.py | 1 | 1247 | '''
Author: Rowel Atienza
Project: https://github.com/roatienza/dl-keras
Dependencies: keras
Usage: python3 <this file>
'''
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Activation, LSTM
from keras.datasets import mnist
from keras.utils import to_categorical
(x_train, y_train... | mit |
EWol234/osmc | package/mediacenter-eventclients-common-osmc/files/usr/share/pyshared/xbmc/ps3/sixaxis.py | 52 | 11090 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2009 Team XBMC http://www.xbmc.org
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
#... | gpl-2.0 |
randynobx/ansible | lib/ansible/galaxy/token.py | 35 | 2126 | ########################################################################
#
# (C) 2015, Chris Houseknecht <chouse@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 Fo... | gpl-3.0 |
surajssd/kuma | vendor/packages/logilab/astng/node_classes.py | 25 | 27162 | # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-astng.
#
# logilab-astng is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as publis... | mpl-2.0 |
roselleebarle04/django | django/db/backends/postgresql/operations.py | 207 | 10109 | from __future__ import unicode_literals
from psycopg2.extras import Inet
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
class DatabaseOperations(BaseDatabaseOperations):
def unification_cast_sql(self, output_field):
internal_type = output_field.get... | bsd-3-clause |
tempbottle/kbengine | kbe/src/lib/python/Lib/_strptime.py | 78 | 21679 | """Strptime-related classes and functions.
CLASSES:
LocaleTime -- Discovers and stores locale-specific time information
TimeRE -- Creates regexes for pattern matching a string of text containing
time information
FUNCTIONS:
_getlang -- Figure out what language is being used for the locale
... | lgpl-3.0 |
nekulin/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32/Demos/winprocess.py | 17 | 7016 | """
Windows Process Control
winprocess.run launches a child process and returns the exit code.
Optionally, it can:
redirect stdin, stdout & stderr to files
run the command as another user
limit the process's running time
control the process window (location, size, window state, desktop)
Works on Windows NT, 20... | apache-2.0 |
infobip/infobip-api-python-client | examples/deserialize_dr_ex.py | 1 | 1728 | from infobip.api.model.sms.mt.reports.SMSReportResponse import SMSReportResponse
response_body = """{
"results": [
{
"bulkId": "BULK-ID-123-xyz",
"messageId": "c9823180-94d4-4ea0-9bf3-ec907e7534a6",
"to": "41793026731",
"sentAt": "2015-06-04T13:01:52.933+0000",
"doneAt": "2... | apache-2.0 |
rajadhva/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_handshake.py | 452 | 7134 | #!/usr/bin/env python
#
# Copyright 2012, 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... | mpl-2.0 |
mszewczy/odoo | addons/crm_helpdesk/report/__init__.py | 442 | 1083 | # -*- 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... | agpl-3.0 |
diversys/wubi | src/pypack/altgraph/GraphStat.py | 9 | 1927 | '''
Functions providing various graph statistics
'''
import sys
def avg_hops(graph):
'''
'''
pass
def degree_dist(graph, limits=(0,0), bin_num=10, mode='out'):
'''
Computes the degree distribution for a graph.
Returns a list of tuples where the first element of the tuple is the center of the ... | gpl-2.0 |
astocko/statsmodels | statsmodels/examples/ex_kernel_regression_dgp.py | 34 | 1202 | # -*- coding: utf-8 -*-
"""
Created on Sun Jan 06 09:50:54 2013
Author: Josef Perktold
"""
from __future__ import print_function
if __name__ == '__main__':
import numpy as np
import matplotlib.pyplot as plt
from statsmodels.nonparametric.api import KernelReg
import statsmodels.sandbox.nonparametric... | bsd-3-clause |
direvus/ansible | test/units/playbook/test_taggable.py | 119 | 4453 | # (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 |
40223235/w16b_test | static/Brython3.1.1-20150328-091302/Lib/copyreg.py | 749 | 6611 | """Helper to provide extensibility for pickle.
This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
"""
__all__ = ["pickle", "constructor",
"add_extension", "remove_extension", "clear_extension_cache"]
dispatch_table = {}
def pickle(ob_typ... | agpl-3.0 |
Vector35/binaryninja-api | python/types.py | 1 | 49301 | # Copyright (c) 2015-2021 Vector 35 Inc
#
# 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, merge, publish, ... | mit |
shepdelacreme/ansible | test/units/modules/network/dellos6/test_dellos6_config.py | 68 | 6262 | #
# (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 |
chromium/chromium | tools/perf/page_sets/key_mobile_sites_smooth.py | 10 | 16034 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
FASTPATH_URLS = [
# Why: Top new... | bsd-3-clause |
NickDrabovich/EasyCNN | 3rdparty/gtest-1.7.0/test/gtest_output_test.py | 1733 | 12005 | #!/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... | mit |
rwl/PyCIM | CIM15/CDPSM/Geographical/IEC61970/Wires/SynchronousMachine.py | 1 | 1709 | # Copyright (C) 2010-2011 Richard Lincoln
#
# 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, merge, publish... | mit |
mitya57/debian-buildbot | buildbot/test/unit/test_scripts_tryserver.py | 3 | 1696 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
ParashRahman/Database-Project | Part1/helpers.py | 1 | 1743 | import cx_Oracle
class Helpers:
def __init__ (self, curs ):
self.cursor = curs
#############################
# Table Checking Methods
# - Each take in respective integeres
# - Returns True or False depending on
# the id is already there
#############################
def check_transaction_id( self, ... | apache-2.0 |
pyfa-org/eos | tests/integration/calculator/misc/test_state.py | 1 | 7300 | # ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... | lgpl-3.0 |
gsehub/edx-platform | openedx/core/djangoapps/ace_common/tracking.py | 16 | 4614 | # pylint: disable=missing-docstring
from urlparse import parse_qs
import attr
from django.utils.http import urlencode
from openedx.core.djangoapps.theming.helpers import get_config_value_from_site_or_settings
DEFAULT_CAMPAIGN_SOURCE = 'ace'
DEFAULT_CAMPAIGN_MEDIUM = 'email'
@attr.s
class CampaignTrackingInfo(objec... | agpl-3.0 |
Adel-Magebinary/odoo | addons/hw_escpos/__openerp__.py | 315 | 1780 | # -*- 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 |
Yuriy-Leonov/nova | nova/api/openstack/compute/plugins/v3/rescue.py | 3 | 3881 | # Copyright 2011 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 a... | apache-2.0 |
yumikohey/givelight | node_modules/pangyp/gyp/pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | mit |
tfiedor/perun | perun/view/scatter/factory.py | 1 | 10803 | """ Module with graphs creation and configuration functions. """
from operator import itemgetter
from collections import defaultdict
import demandimport
with demandimport.enabled():
import bkcharts as charts
import bokeh.palettes as palettes
import numpy as np
import perun.profile.query as query
import perun... | gpl-3.0 |
aaronblanchard/libkml | examples/python/helloenum.py | 25 | 2288 | #!/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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list ... | bsd-3-clause |
justacec/bokeh | bokeh/application/handlers/tests/test_function.py | 7 | 1096 | from __future__ import absolute_import, print_function
import unittest
from bokeh.application.handlers import FunctionHandler
from bokeh.document import Document
from bokeh.model import Model
from bokeh.core.properties import Int, Instance
class AnotherModelInTestFunction(Model):
bar = Int(1)
class SomeModelIn... | bsd-3-clause |
ceibal-tatu/pygobject | gi/module.py | 2 | 12076 | # -*- Mode: Python; py-indent-offset: 4 -*-
# vim: tabstop=4 shiftwidth=4 expandtab
#
# Copyright (C) 2007-2009 Johan Dahlin <johan@gnome.org>
#
# module.py: dynamic module for introspected libraries.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gener... | lgpl-2.1 |
j03lpr86/android_kernel_samsung_afyonltetmo | 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 |
RiccardoCurcio/hostswitcher | hostswitcher/cli/commands/remove.py | 1 | 2595 | import os, filecmp
import hostswitcher.lib
from hostswitcher.utils.logger import logger
import hostswitcher.utils.text as t
class remove(object):
def __init__(self, args):
self.args = args
self.name = self.args['name'][0]
self.log = logger()
self.__remove_hosts_file()
self... | gpl-3.0 |
xingyepei/edx-platform | common/test/acceptance/pages/lms/dashboard_search.py | 138 | 1130 | """
Dashboard search
"""
from bok_choy.page_object import PageObject
from . import BASE_URL
class DashboardSearchPage(PageObject):
"""
Dashboard page featuring a search form
"""
search_bar_selector = '#dashboard-search-bar'
url = "{base}/dashboard".format(base=BASE_URL)
@property
def se... | agpl-3.0 |
aleGpereira/libcloud | libcloud/test/compute/test_openstack.py | 12 | 83629 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
gabelula/b-counted | django/test/utils.py | 11 | 2515 | import sys, time, os
from django.conf import settings
from django.core import mail
from django.core.mail.backends import locmem
from django.test import signals
from django.template import Template
from django.utils.translation import deactivate
class ContextList(list):
"""A wrapper that provides direct key access ... | apache-2.0 |
levibostian/myBlanky | googleAppEngine/google/appengine/api/search/QueryParser.py | 3 | 78704 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | mit |
suhussai/youtube-dl | youtube_dl/extractor/tvp.py | 132 | 4801 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class TvpIE(InfoExtractor):
IE_NAME = 'tvp.pl'
_VALID_URL = r'https?://(?:vod|www)\.tvp\.pl/.*/(?P<id>\d+)$'
_TESTS = [{
'url': 'http://vod.tvp.pl/filmy-fabularne/filmy-za-darmo/ogniem-i-... | unlicense |
memsql/memsql-loader | memsql_loader/cli/tasks.py | 1 | 3170 | import sys
from memsql_loader.util.command import Command
from memsql_loader.util.pretty_printer import PrettyPrinter, TableFormat
from memsql_loader.util import log
from memsql_loader.api.tasks import Tasks as TasksApi
from memsql_loader.api import shared, exceptions
from memsql_loader.loader_db.jobs import Jobs
cl... | apache-2.0 |
jesopo/bitbot | modules/nr.py | 1 | 26887 | #--depends-on commands
#--require-config nre-api-key
import collections, re, time
from datetime import datetime, date
from collections import Counter
from src import ModuleManager, utils
from suds.client import Client
from suds import WebFault
# Note that this module requires the open *Staff Version* of the Darwin ... | gpl-2.0 |
answer-huang/dSYMTools | wxPython/MyInfo.py | 6 | 1652 | #coding=utf-8
__author__ = 'answer-huang'
import wx
import sys
reload(sys)
sys.setdefaultencoding('utf8')
"""
关于我
"""
class AboutMe(wx.Dialog):
def __init__(self, parent):
wx.Dialog.__init__(self, parent, -1, '关于我', size=(250, 300))
bitmap = wx.Image("avatar.jpg", wx.BITMAP_TYPE_JPEG).Rescale(15... | mit |
chujieyang/ice | java/test/src/main/java/test/Ice/objects/run.py | 3 | 1469 | #!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | gpl-2.0 |
dmsimard/ansible | lib/ansible/plugins/callback/__init__.py | 2 | 17213 | # (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 |
Mirantis/tempest | tempest/api_schema/response/compute/v2/limits.py | 12 | 4541 | # Copyright 2014 NEC Corporation. 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 ... | apache-2.0 |
csb-toolbox/CSB | csb/apps/hhfrag.py | 1 | 20748 | """
HHfrag: build a dynamic variable-length fragment library for protein structure
prediction with Rosetta AbInitio.
"""
import os
import multiprocessing
import csb.apps
import csb.apps.hhsearch as hhsearch
import csb.bio.io.hhpred
import csb.bio.fragments
import csb.bio.fragments.rosetta as rosetta
import csb.bio.s... | mit |
cainiaocome/scikit-learn | sklearn/manifold/tests/test_spectral_embedding.py | 216 | 8091 | from nose.tools import assert_true
from nose.tools import assert_equal
from scipy.sparse import csr_matrix
from scipy.sparse import csc_matrix
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from nose.tools import assert_raises
from nose.plugins.skip import SkipTest
from sk... | bsd-3-clause |
kmonsoor/python-for-android | python3-alpha/python3-src/Lib/encodings/cp1006.py | 272 | 13568 | """ Python Character Mapping Codec cp1006 generated from 'MAPPINGS/VENDORS/MISC/CP1006.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors... | apache-2.0 |
VisTrails/VisTrails | vistrails/db/versions/v0_9_4/translate/v0_9_3.py | 2 | 5733 | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | bsd-3-clause |
tyagiarpit/servo | tests/wpt/css-tests/css-text-decor-3_dev/xhtml1/support/generate-text-emphasis-line-height-tests.py | 829 | 3431 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-line-height-001 ~ 004 except
001z. They test the line height expansion in different directions. This
script outputs a list of all tests it generated in the format of Mozilla
reftest.list to the stdout.
"""
from __future__ ... | mpl-2.0 |
ojii/sandlib | lib/lib-python/2.7/test/test_platform.py | 56 | 9716 | import sys
import os
import unittest
import platform
import subprocess
from test import test_support
class PlatformTest(unittest.TestCase):
def test_architecture(self):
res = platform.architecture()
if hasattr(os, "symlink"):
def test_architecture_via_symlink(self): # issue3762
de... | bsd-3-clause |
realsaiko/odoo | addons/report/models/report_paperformat.py | 311 | 7814 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
VanirAOSP/external_chromium_org | third_party/tlslite/tlslite/SessionCache.py | 358 | 3470 | """Class for caching TLS sessions."""
import thread
import time
class SessionCache:
"""This class is used by the server to cache TLS sessions.
Caching sessions allows the client to use TLS session resumption
and avoid the expense of a full handshake. To use this class,
simply pass a SessionCache ins... | bsd-3-clause |
IRI-Research/django | django/contrib/auth/tests/test_decorators.py | 20 | 3833 | from django.conf import settings
from django.contrib.auth import models
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.auth.tests.test_views import AuthViewsTestCase
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.core.exceptions import Permis... | bsd-3-clause |
steedos/odoo | addons/account/report/report_vat.py | 172 | 11631 | # -*- 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 |
cognitiveclass/edx-platform | common/test/acceptance/pages/lms/problem.py | 23 | 5236 | """
Problem Page.
"""
from bok_choy.page_object import PageObject
class ProblemPage(PageObject):
"""
View of problem page.
"""
url = None
CSS_PROBLEM_HEADER = '.problem-header'
def is_browser_on_page(self):
return self.q(css='.xblock-student_view').present
@property
def prob... | agpl-3.0 |
lets-software/shinken | test/test_timeout.py | 15 | 4568 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License... | agpl-3.0 |
Suwmlee/XX-Net | Python3/lib/tokenize.py | 14 | 27791 | """Tokenization help for Python programs.
tokenize(readline) is a generator that breaks a stream of bytes into
Python tokens. It decodes the bytes according to PEP-0263 for
determining source file encoding.
It accepts a readline-like method which is called repeatedly to get the
next line of input (or b"" for EOF). ... | bsd-2-clause |
TC01/Treemaker | Treemaker/python/plugins/lep_vars.py | 1 | 3378 | import array
# Leptons plugin. This plugin also has some cuts for is_muon and is_electron.
# (and is_had, of course).
from Treemaker.Treemaker import cuts
etaCutoff = 2.4
ptCutoff = 10
def setup(variables, isData):
variables['lepphi'] = array.array('f', [100.0])
variables['leppt'] = array.array('f', [-1.0])
vari... | mit |
splunk/splunk-webframework | contrib/django/django/contrib/formtools/tests/wizard/forms.py | 90 | 7721 | from __future__ import unicode_literals
from django import forms, http
from django.conf import settings
from django.db import models
from django.test import TestCase
from django.template.response import TemplateResponse
from django.utils.importlib import import_module
from django.contrib.auth.models import User
from... | apache-2.0 |
zozo123/buildbot | master/buildbot/util/eventual.py | 3 | 2772 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-3.0 |
lexxito/monitoring | ceilometer/tests/test_notification.py | 1 | 7311 | # -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.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
#
# ... | apache-2.0 |
snapcore/snapcraft | tests/unit/states/test_pull.py | 2 | 4186 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016-2018 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | gpl-3.0 |
citrix-openstack/build-trove | trove/extensions/security_group/views.py | 2 | 3880 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# ... | apache-2.0 |
vicky2135/lucious | oscar/lib/python2.7/site-packages/django/template/loaders/base.py | 199 | 3759 | import warnings
from django.template import Origin, Template, TemplateDoesNotExist
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.inspect import func_supports_parameter
class Loader(object):
def __init__(self, engine):
self.engine = engine
def __call__(self, templat... | bsd-3-clause |
FairRootGroup/DDS-user-manual | lib/xsl/extensions/docbook.py | 65 | 7240 | # docbook.py: extension module
# $Id: docbook.py 8353 2009-03-17 16:57:50Z mzjn $
import sys
import string
import libxml2
import libxslt
import re
import math
# Some globals
pixelsPerInch = 96.0
unitHash = { 'in': pixelsPerInch,
'cm': pixelsPerInch / 2.54,
'mm': pixelsPerInch / 25.4,
... | gpl-3.0 |
mahendra-r/home-assistant | homeassistant/components/media_player/kodi.py | 8 | 8758 | """
homeassistant.components.media_player.kodi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides an interface to the XBMC/Kodi JSON-RPC API
Configuration:
To use the Kodi you will need to add something like the following to
your configuration.yaml file.
media_player:
platform: kodi
name: Kodi
url: http://192... | mit |
mikelj/h-store | third_party/python/boto/pyami/__init__.py | 396 | 1107 | # Copyright (c) 2006,2007 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... | gpl-3.0 |
jgoerzen/tla-buildpackage | tbppy/tbpconfig.py | 1 | 1975 | # arch-tag: tla buildpackage configuration system
# Copyright (C) 2003 John Goerzen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your o... | gpl-2.0 |
lepistone/sale-workflow | __unported__/sale_multi_picking/__openerp__.py | 3 | 1566 | # -*- coding: utf-8 -*-
#
#
# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publis... | agpl-3.0 |
eul721/The-Perfect-Pokemon-Team-Balancer | libs/env/Lib/site-packages/markdown/blockparser.py | 78 | 3566 | from __future__ import unicode_literals
from __future__ import absolute_import
from . import util
from . import odict
class State(list):
""" Track the current and nested state of the parser.
This utility class is used to track the state of the BlockParser and
support multiple levels if nesting. It's... | gpl-2.0 |
smartforceplus/SmartForceplus | addons/email_template/ir_actions.py | 281 | 3520 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013 OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 |
mylene-campana/hpp-rbprm-corba | script/tests/robot_withBridge_path.py | 2 | 3563 | from hpp.corbaserver.rbprm.rbprmbuilder import Builder
from hpp.gepetto import Viewer
white=[1.0,1.0,1.0,1.0]
green=[0.23,0.75,0.2,0.5]
yellow=[0.85,0.75,0.15,1]
pink=[1,0.6,1,1]
orange=[1,0.42,0,1]
brown=[0.85,0.75,0.15,0.5]
blue = [0.0, 0.0, 0.8, 1.0]
grey = [0.7,0.7,0.7,1.0]
red = [0.8,0.0,0.0,1.0]
black=[0,0,0,1]
... | lgpl-3.0 |
nens/raster-tools | raster_tools/gmfillnodata.py | 1 | 4546 | # -*- coding: utf-8 -*-
# (c) Nelen & Schuurmans, see LICENSE.rst.
import argparse
import logging
import os
import sys
import tempfile
from osgeo import gdal
import numpy as np
from raster_tools import datasets
from raster_tools import datasources
from raster_tools import groups
DRIVER = gdal.GetDriverByName('gtiff... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.