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 |
|---|---|---|---|---|---|
Trinitaria/namebench | libnamebench/providers.py | 172 | 3505 | # Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
gundalow/ansible | test/lib/ansible_test/_internal/commands/integration/posix.py | 13 | 1412 | """POSIX integration testing."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ... import types as t
from ...util import (
ANSIBLE_TEST_DATA_ROOT,
)
from ...util_common import (
handle_layout_messages,
)
from ...containers import (
SshConnectionD... | gpl-3.0 |
samuelhavron/heroku-buildpack-python | Python-3.4.3/Lib/test/test_xml_etree_c.py | 80 | 3005 | # xml.etree test for cElementTree
import sys, struct
from test import support
from test.support import import_fresh_module
import types
import unittest
cET = import_fresh_module('xml.etree.ElementTree',
fresh=['_elementtree'])
cET_alias = import_fresh_module('xml.etree.cElementTree',
... | mit |
rrohan/scikit-learn | sklearn/tree/tests/test_tree.py | 11 | 48140 | """
Testing for the tree module (sklearn.tree).
"""
import pickle
from functools import partial
from itertools import product
import platform
import numpy as np
from scipy.sparse import csc_matrix
from scipy.sparse import csr_matrix
from scipy.sparse import coo_matrix
from sklearn.random_projection import sparse_rand... | bsd-3-clause |
TheProjecter/soundblizzard | soundblizzard-gst0.10/soundblizzard.py | 2 | 1089 | #!/usr/bin/python
''' Main soundblizzard program'''
from gi.repository import GObject
import gst
class soundblizzard():
def __init__(self):
self.mainloop = GObject.MainLoop()
import loggy
loggy.debug_setting = True
loggy.sb = self
import config
self.config = config.config(self)
import sbdb
self.sbd... | gpl-3.0 |
msreis/SigNetSim | signetsim/managers/optimizations.py | 2 | 3060 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2017 Vincent Noel (vincent.noel@butantan.gov.br)
#
# This file is part of libSigNetSim.
#
# libSigNetSim 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 Fou... | agpl-3.0 |
geodynamics/pylith | tests/pytests/meshio/TestPointsList.py | 1 | 1076 | #!/usr/bin/env nemesis
#
# ======================================================================
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University at Buffalo
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://g... | mit |
Edeleon4/PoolShark | Python279/Tools/Scripts/nm2def.py | 94 | 2444 | #! /usr/bin/env python
"""nm2def.py
Helpers to extract symbols from Unix libs and auto-generate
Windows definition files from them. Depends on nm(1). Tested
on Linux and Solaris only (-p option to nm is for Solaris only).
By Marc-Andre Lemburg, Aug 1998.
Additional notes: the output of nm is supposed to look like th... | mit |
cmelange/ansible | lib/ansible/modules/cloud/misc/virt_pool.py | 69 | 22302 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Maciej Delmanowski <drybjed@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 th... | gpl-3.0 |
norayr/unisubs | apps/videos/types/dailymotion.py | 4 | 2603 | # Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# This program 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 op... | agpl-3.0 |
rosmo/boto | tests/integration/codedeploy/__init__.py | 586 | 1123 | # Copyright (c) 2015 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 |
s20121035/rk3288_android5.1_repo | external/chromium_org/third_party/motemplate/motemplate.py | 93 | 36667 | # Copyright 2012 Benjamin Kalman
#
# 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 writi... | gpl-3.0 |
jalexvig/tensorflow | tensorflow/python/ops/distributions/laplace.py | 17 | 7777 | # 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 |
listamilton/supermilton.repository | script.module.youtube.dl/lib/youtube_dl/extractor/tudou.py | 23 | 6954 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
int_or_none,
InAdvancePagedList,
float_or_none,
unescapeHTML,
)
class TudouIE(InfoExtractor):
IE_NAME = 'tudou'
_VALID_URL = r'h... | gpl-2.0 |
SimeonFritz/aima-python | submissions/Hess/mygames.py | 18 | 4089 | from collections import namedtuple
from games import (Game)
class GameState:
def __init__(self, to_move, board, label=None):
self.to_move = to_move
self.board = board
self.label = label
def __str__(self):
if self.label == None:
return super(GameState, self).__str__(... | mit |
GovReady/readthedocs.org | readthedocs/donate/models.py | 31 | 2714 | from django.db import models
from django.utils.translation import ugettext_lazy as _
AMOUNT_CHOICES = (
(5, '$5'),
(10, '$10'),
(25, '$25'),
(50, '1 Hour ($50)'),
(100, '2 Hours ($100)'),
(200, '4 Hours ($200)'),
(400, '1 Day ($400)'),
(800, '2 Days ($800)'),
(1200, '3 Days ($1200)'... | mit |
rooterkyberian/elen | tests/test_elen_article.py | 1 | 3034 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `elen` package."""
from decimal import Decimal
import pytest
import elen
@pytest.mark.parametrize('number,representation', [
(7, '+7'),
(99, '++299'),
(1234567890, '+++2101234567890'),
(10 ** 999, '+++41000' + str(10 ** 999)),
])
def test_... | mit |
rtucker-mozilla/WhistlePig | vendor-local/lib/python/tastypie/migrations/0001_initial.py | 5 | 5927 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from tastypie.compat import AUTH_USER_MODEL
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ApiAccess'
db.create_table('tastypie_apiaccess', (
... | bsd-3-clause |
pranto157/django-pipeline | tests/tests/test_glob.py | 40 | 3708 | from __future__ import unicode_literals
import os
import shutil
from django.core.files.base import ContentFile
from django.core.files.storage import FileSystemStorage
from django.test import TestCase
from pipeline import glob
local_path = lambda path: os.path.join(os.path.dirname(__file__), path)
class GlobTest(T... | mit |
yujikato/DIRAC | src/DIRAC/RequestManagementSystem/Service/ReqManagerHandler.py | 1 | 13201 | #####################################################################
# File: ReqManagerHandler.py
########################################################################
"""Implementation of the RequestDB service in the DISET framework
.. literalinclude:: ../ConfigTemplate.cfg
:start-after: ##BEGIN ReqManager
:... | gpl-3.0 |
fxfitz/ansible | lib/ansible/plugins/action/asa_config.py | 8 | 4209 | #
# (c) 2017, 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... | gpl-3.0 |
bearstech/modoboa | modoboa/admin/views/export.py | 1 | 2899 | """Export related views."""
from __future__ import unicode_literals
import csv
from rfc6266 import build_header
from django.contrib.auth.decorators import (
login_required, permission_required, user_passes_test
)
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.short... | isc |
mfanjie/kubernetes | vendor/github.com/ugorji/go/codec/test.py | 1138 | 3876 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... | apache-2.0 |
chokribr/inveniocnudst | modules/miscutil/lib/upgrades/invenio_2013_02_06_new_collectionboxname_table.py | 16 | 1314 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | gpl-2.0 |
cmfeng/class_project | Analysis/data_cleaning_utils.py | 1 | 2753 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
"""
Importing the data.
This step is key, as we have to ensure that the time format
of the data is recognized
"""
datecol = ""
def import_data(datafile):
raw_data = pd.read_csv(datafile, parse_dates=True,
infer_datetime_format=True, ... | mit |
AOSPA-legacy/android_kernel_lge_msm8974 | tools/perf/scripts/python/net_dropmonitor.py | 1258 | 1562 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
wangjun/odoo | addons/resource/__init__.py | 448 | 1086 | # -*- 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... | agpl-3.0 |
ArthurGarnier/SickRage | lib/hachoir_metadata/jpeg.py | 71 | 10210 | from hachoir_metadata.metadata import RootMetadata, registerExtractor
from hachoir_metadata.image import computeComprRate
from hachoir_parser.image.exif import IFD, BasicIFDEntry
from hachoir_parser.image.jpeg import (
JpegFile, JpegChunk,
QUALITY_HASH_COLOR, QUALITY_SUM_COLOR,
QUALITY_HASH_GRAY, QUALITY_SU... | gpl-3.0 |
seecurity/klausuromat | klausuromat/exceptions.py | 2 | 3450 | # General generator error
class GeneratorError(Exception):
def __init__(self, msg, **kwargs):
self.msg = msg
# Add optional arguments
for key, value in kwargs.items():
setattr(self, key, value)
def __str__(self):
return self.msg
# General identifier error
class Ge... | mit |
heuermh/gemini | gemini/gemini_utils.py | 2 | 5901 | #!/usr/bin/env python
import collections
from collections import defaultdict
from itertools import tee, ifilterfalse
from gemini_subjects import Subject
try:
from cyordereddict import OrderedDict
except ImportError:
from collections import OrderedDict
def get_gt_cols(cur):
keys = ('cid', 'name', 'type', '... | mit |
offtools/linux-show-player | lisp/modules/gst_backend/settings/db_meter.py | 3 | 3935 | # -*- coding: utf-8 -*-
#
# This file is part of Linux Show Player
#
# Copyright 2012-2016 Francesco Ceruti <ceppofrancy@gmail.com>
#
# Linux Show Player 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 ... | gpl-3.0 |
yghannam/teuthology | teuthology/suite.py | 1 | 30154 | # this file is responsible for submitting tests into the queue
# by generating combinations of facets found in
# https://github.com/ceph/ceph-qa-suite.git
import copy
from datetime import datetime
import itertools
import logging
import os
import requests
import pwd
import subprocess
import smtplib
import socket
import... | mit |
YeEmrick/learning | PCI/PCI_Code/chapter10/stockvolume.py | 4 | 1296 | import nnmf
import urllib2
from numpy import *
tickers=['YHOO','AVP','BIIB','BP','CL','CVX',
'DNA','EXPE','GOOG','PG','XOM','AMGN']
shortest=300
prices={}
dates=None
for t in tickers:
# Open the URL
rows=urllib2.urlopen('http://ichart.finance.yahoo.com/table.csv?'+\
... | apache-2.0 |
LeJay/android_kernel_samsung_jactivelte | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
CloudServer/nova | nova/tests/unit/virt/xenapi/test_driver.py | 63 | 6296 | # Copyright (c) 2013 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... | apache-2.0 |
gregdek/ansible | lib/ansible/modules/cloud/alicloud/ali_instance.py | 5 | 31235 | #!/usr/bin/python
# Copyright (c) 2017 Alibaba Group Holding Limited. He Guimin <heguimin36@163.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of ... | gpl-3.0 |
2ndQuadrant/ansible | lib/ansible/modules/system/sysctl.py | 1 | 15304 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, David "DaviXX" CHANIAL <david.chanial@gmail.com>
# (c) 2014, James Tanner <tanner.jc@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclas... | gpl-3.0 |
SaleJumper/android-source-browsing.platform--external--chromium-trace | trace-viewer/third_party/closure_linter/closure_linter/common/filetestcase.py | 135 | 3835 | #!/usr/bin/env python
#
# Copyright 2007 The Closure Linter 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
#... | bsd-3-clause |
nlholdem/icodoom | .venv/lib/python2.7/site-packages/tensorflow/contrib/tensor_forest/hybrid/python/models/decisions_to_data_then_nn.py | 190 | 1889 | # 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... | gpl-3.0 |
zenoss/Community-Zenpacks | ZenPacks.dnalley.AMQPEventMonitor/ZenPacks/dnalley/AMQPEventMonitor/lib/txamqp/content.py | 3 | 1591 | #
# 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... | gpl-2.0 |
aehlig/bazel | third_party/protobuf/3.6.1/python/google/protobuf/proto_builder.py | 168 | 5202 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | apache-2.0 |
bastianh/django-devserver | devserver/modules/request.py | 13 | 2777 | import urllib
from devserver.modules import DevServerModule
class SessionInfoModule(DevServerModule):
"""
Displays information about the currently authenticated user and session.
"""
logger_name = 'session'
def process_request(self, request):
self.has_session = bool(getattr(request, 'se... | bsd-3-clause |
bunnyitvn/webptn | build/lib.linux-i686-2.7/django/template/defaulttags.py | 39 | 47883 | """Default tags used by the template system, available to all templates."""
from __future__ import unicode_literals
import sys
import re
from datetime import datetime
from itertools import groupby, cycle as itertools_cycle
from django.conf import settings
from django.template.base import (Node, NodeList, Template, Co... | bsd-3-clause |
monetate/sqlalchemy | examples/sharding/separate_tables.py | 3 | 10067 | """Illustrates sharding using a single SQLite database, that will however
have multiple tables using a naming convention."""
import datetime
from sqlalchemy import Column
from sqlalchemy import create_engine
from sqlalchemy import DateTime
from sqlalchemy import event
from sqlalchemy import Float
from sqlalchemy impo... | mit |
artemh/asuswrt-merlin | release/src/router/samba36/source4/dsdb/tests/python/ldap.py | 19 | 124490 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is a port of the original in testprogs/ejs/ldap.js
import optparse
import sys
import time
import base64
import os
sys.path.insert(0, "bin/python")
import samba
samba.ensure_external_module("testtools", "testtools")
samba.ensure_external_module("subunit", "subunit/p... | gpl-2.0 |
balloob/home-assistant | homeassistant/components/tankerkoenig/sensor.py | 10 | 4399 | """Tankerkoenig sensor integration."""
import logging
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_LATITUDE,
ATTR_LONGITUDE,
CURRENCY_EURO,
)
from homeassistant.helpers.update_coordinator import (
CoordinatorEntity,
DataUpdateCoordinator,
UpdateFailed,
)
from .const import DOM... | apache-2.0 |
kytvi2p/Sigil | 3rdparty/python/Lib/distutils/tests/test_sysconfig.py | 83 | 8393 | """Tests for distutils.sysconfig."""
import os
import shutil
import subprocess
import sys
import textwrap
import unittest
from distutils import sysconfig
from distutils.ccompiler import get_default_compiler
from distutils.tests import support
from test.support import TESTFN, run_unittest, check_warnings
class Sysconf... | gpl-3.0 |
GREO/gnuradio-git | gr-pager/apps/usrp_flex_all.py | 11 | 4216 | #!/usr/bin/env python
#
# Copyright 2006,2007,2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at you... | gpl-3.0 |
stephenjoe1/gaap-roadmaps | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py | 1825 | 17014 | # Copyright (c) 2012 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.
"""GYP backend that generates Eclipse CDT settings files.
This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML
files that can be importe... | mit |
erinspace/osf.io | framework/auth/forms.py | 16 | 5111 | # -*- coding: utf-8 -*-
# TODO: Most of the forms are no longer used, need clean up
from wtforms import ValidationError
from framework import auth
from framework.forms import (
Form,
NoHtmlCharacters,
PasswordField,
TextField,
HiddenField,
validators,
BootstrapTextInput,
BootstrapPass... | apache-2.0 |
mahak/ansible | lib/ansible/modules/yum_repository.py | 15 | 24937 | #!/usr/bin/python
# encoding: utf-8
# (c) 2015-2016, Jiri Tyr <jiri.tyr@gmail.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: yum_repository
autho... | gpl-3.0 |
diorcety/intellij-community | python/helpers/pydev/pydevd_io.py | 52 | 2490 | import pydevd_constants #@UnusedImport -- defines False and True if not there.
IS_PY3K = pydevd_constants.IS_PY3K
class IORedirector:
'''This class works to redirect the write function to many streams
'''
def __init__(self, *args):
self._redirectTo = args
def write(self, s):
for r in... | apache-2.0 |
albertomurillo/ansible | lib/ansible/modules/monitoring/grafana_plugin.py | 17 | 8464 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Thierry Sallé (@seuf)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
ANSIBLE_METADATA = {
'status': ['preview'],
'supported_by': 'com... | gpl-3.0 |
yakky/django | django/views/debug.py | 30 | 46776 | from __future__ import unicode_literals
import re
import sys
import types
from django.conf import settings
from django.core.urlresolvers import Resolver404, resolve
from django.http import HttpResponse, HttpResponseNotFound
from django.template import Context, Engine, TemplateDoesNotExist
from django.template.default... | bsd-3-clause |
DreadPirateRobert/stock_visualiser | stock_visualiser_virtualenv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/langhebrewmodel.py | 2763 | 11318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... | mit |
CapOM/ChromiumGStreamerBackend | tools/metrics/rappor/pretty_print.py | 23 | 5101 | #!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common'))
import models
import pres... | bsd-3-clause |
shastah/spacewalk | backend/satellite_exporter/handlers/non_auth_dumper.py | 1 | 20583 | # Copyright (c) 2008--2017 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a cop... | gpl-2.0 |
balloob/home-assistant | tests/components/homeassistant/triggers/test_homeassistant.py | 7 | 2193 | """The tests for the Event automation."""
import homeassistant.components.automation as automation
from homeassistant.core import CoreState
from homeassistant.setup import async_setup_component
from tests.async_mock import AsyncMock, patch
from tests.common import async_mock_service
async def test_if_fires_on_hass_s... | apache-2.0 |
castroflavio/ryu | ryu/lib/packet/tcp.py | 22 | 3834 | # Copyright (C) 2012 Nippon Telegraph and Telephone 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 appli... | apache-2.0 |
jbenden/ansible | test/integration/setup_gce.py | 185 | 1423 | '''
Create GCE resources for use in integration tests.
Takes a prefix as a command-line argument and creates two persistent disks named
${prefix}-base and ${prefix}-extra and a snapshot of the base disk named
${prefix}-snapshot. prefix will be forced to lowercase, to ensure the names are
legal GCE resource names.
'''
... | gpl-3.0 |
zhjunlang/kbengine | kbe/src/lib/python/Lib/test/test_http_cookiejar.py | 84 | 71684 | """Tests for http/cookiejar.py."""
import os
import re
import test.support
import time
import unittest
import urllib.request
from http.cookiejar import (time2isoz, http2time, iso2time, time2netscape,
parse_ns_headers, join_header_words, split_header_words, Cookie,
CookieJar, DefaultCookiePolicy, LWPCookieJa... | lgpl-3.0 |
LameName/financetools | databaseinfo.py | 1 | 1150 | #! /usr/bin/python3
class DatabaseManagerInfo(object):
def __init__(self, tablename, primary_key, auto_increment_handling, wildcard, column_list):
self.name = tablename
self.primary_key = primary_key
self.auto_increment_handling = auto_increment_handling
self.column_list = column_l... | gpl-2.0 |
mshubian/BAK_open-hackathon | open-hackathon/src/hackathon/hack/__init__.py | 1 | 1466 | import sys
sys.path.append("..")
from hackathon.database.models import Hackathon, User, UserEmail, Register
from hackathon.database import db_adapter
class HackathonManager():
def __init__(self, db):
self.db = db
def get_hackathon_by_name(self, name):
return self.db.find_first_object_by(Hack... | apache-2.0 |
LittleLama/Sick-Beard-BoxCar2 | lib/requests/packages/chardet2/langgreekmodel.py | 63 | 12651 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
MarkWh1te/xueqiu_predict | p3_env/lib/python3.5/site-packages/requests/packages/chardet/chardistribution.py | 2755 | 9226 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
automl/pysmac | examples/sklearn_example.py | 1 | 3555 | from __future__ import print_function, division
import pysmac
import sklearn.ensemble
import sklearn.datasets
import sklearn.cross_validation
# First, let us generate some random classification problem. Note that, due to the
# way pysmac implements parallelism, the data is either a global variable, or
# the function... | agpl-3.0 |
sestrella/ansible | lib/ansible/modules/network/fortios/fortios_wireless_controller_hotspot20_h2qp_osu_provider.py | 13 | 13230 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# 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 Lic... | gpl-3.0 |
jantoniomartin/django-machinery | wm/models.py | 1 | 5098 | from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from mptt.models import MPTTModel, TreeForeignKey
from crm.models import Company
from dm.models import Document
class Brand(models.Model):
name = models.CharField(_("name"), max_length=50)
class ... | agpl-3.0 |
spallavolu/scikit-learn | examples/ensemble/plot_gradient_boosting_oob.py | 230 | 4762 | """
======================================
Gradient Boosting Out-of-Bag estimates
======================================
Out-of-bag (OOB) estimates can be a useful heuristic to estimate
the "optimal" number of boosting iterations.
OOB estimates are almost identical to cross-validation estimates but
they can be compute... | bsd-3-clause |
ellis429/learning-spark-examples | src/python/ChapterSixExample.py | 41 | 4772 | """Contains the Chapter 6 Example illustrating accumulators, broadcast
variables, numeric operations, and pipe."""
import bisect
import re
import sys
import urllib3
import json
import math
import os
from pyspark import SparkContext
from pyspark import SparkFiles
sparkMaster = sys.argv[1]
inputFile = sys.argv[2]
outpu... | mit |
Klaudit/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/to_be_moved/update_webgl_conformance_tests_unittest.py | 120 | 4192 | # Copyright (C) 2010 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 ... | bsd-3-clause |
facebook/mysql-5.6 | mysql-test/t/admission_control_multi_query.py | 1 | 5787 | import time
import sys
import MySQLdb
from MySQLdb.constants import *
import argparse
import random
import threading
import traceback
NUM_WORKERS = 50
NUM_TRANSACTIONS = 10000
def parse_args():
parser = argparse.ArgumentParser(
'multi_query',
description='Generate Multi query load',
)
pars... | gpl-2.0 |
andela-bojengwa/talk | venv/lib/python2.7/site-packages/django/utils/log.py | 43 | 5561 | from __future__ import unicode_literals
import logging
import sys
import warnings
from django.conf import settings
from django.core import mail
from django.core.mail import get_connection
from django.utils.deprecation import RemovedInNextVersionWarning
from django.utils.encoding import force_text
from django.utils.mo... | mit |
epicserve/django-environment | django_env/utils/vcs.py | 1 | 1876 | #!/usr/bin/env python
from subprocess import call
import os
import sys
import re
import shutil
def main():
vcs_schemes = ['git', 'hg', 'svn', 'file']
vcs_scheme_url = sys.argv[1]
target_dir = sys.argv[2]
url_match = re.search(r'^(?P<scheme>[a-z]{2,3})\+(?P<url>.+)', vcs_scheme_url)
if not url_m... | bsd-3-clause |
MaxMorais/frappe | frappe/utils/jinja.py | 9 | 4026 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
def get_jenv():
import frappe
if not frappe.local.jenv:
from jinja2 import Environment, DebugUndefined
# frappe will be loaded last, so app templates will get precedence
... | mit |
invisiblek/android_kernel_htc_msm8960 | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
archos-sa/archos-gpl-gen8-kernel | arch/ia64/scripts/unwcheck.py | 916 | 1718 | #!/usr/bin/env 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 Matthe... | gpl-2.0 |
t794104/ansible | lib/ansible/modules/monitoring/pagerduty.py | 52 | 8814 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
bfontaine/didelcli | didel/base.py | 1 | 3206 | # -*- coding: UTF-8 -*-
try:
from urlparse import urljoin
except ImportError: # Python 3
from urllib.parse import urljoin
from bs4 import BeautifulSoup
ROOT_URL = 'http://didel.script.univ-paris-diderot.fr'
class DidelError(Exception):
"""
Base exception for Didel errors
"""
pass
class D... | mit |
pulse-project/mss | mss/agent/classes/validation.py | 1 | 1854 | # -*- coding: UTF-8 -*-
#
# (c) 2010 Mandriva, http://www.mandriva.com/
#
# This file is part of Management Server Setup
#
# MSS 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,... | gpl-3.0 |
googkit/googkit | test/test_init.py | 1 | 3816 | import unittest
import logging
import googkit
from googkit.compat.unittest import mock
from googkit.lib.error import GoogkitError
class TestGoogkit(unittest.TestCase):
def test_run(self):
MockCmd = mock.MagicMock()
MockCmd.needs_project_config.return_value = False
mock_cmd = MockCmd.retur... | mit |
teedoo/dotfiles | .sublime/Packages/dateutil/all/dateutil/tz/win.py | 48 | 11466 | # This code was originally contributed by Jeffrey Harris.
import datetime
import struct
from six.moves import winreg
from six import text_type
try:
import ctypes
from ctypes import wintypes
except ValueError:
# ValueError is raised on non-Windows systems for some horrible reason.
raise ImportError("Ru... | mit |
jkandasa/integration_tests | sprout/appliances/migrations/0038_auto_20170201_1218.py | 14 | 1800 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-02-01 12:18
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('appliances', '0037_auto_20170131_1058_squashed_0043_auto_20170131_1609'),
]
operati... | gpl-2.0 |
csachs/openmicroscopy | components/tools/bump_bf_version.py | 11 | 2090 | #! /usr/bin/env python
# Script to bump Bio-Formats version
import os
import re
import argparse
toplevel_dir = os.path.join(os.path.dirname(__file__), "..", "..")
etc_dir = os.path.join(toplevel_dir, "etc")
build_file = os.path.join(toplevel_dir, "build.xml")
properties_file = os.path.join(etc_dir, "omero.properties"... | gpl-2.0 |
mdj2/django | django/db/models/fields/files.py | 111 | 15938 | import datetime
import os
from django import forms
from django.db.models.fields import Field
from django.core.files.base import File
from django.core.files.storage import default_storage
from django.core.files.images import ImageFile
from django.db.models import signals
from django.utils.encoding import force_str, for... | bsd-3-clause |
ronalcc/zipline | tests/test_events_through_risk.py | 17 | 11560 | #
# Copyright 2013 Quantopian, 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 wr... | apache-2.0 |
DDRBoxman/obs-studio | docs/sphinx/conf.py | 19 | 5127 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# OBS Studio documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 25 00:03:21 2017.
#
# 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
#... | gpl-2.0 |
cmcantalupo/geopm | scripts/test/__init__.py | 2 | 1890 | #
# Copyright (c) 2015 - 2021, Intel Corporation
#
# 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 a... | bsd-3-clause |
dubnio/djangomx | djangomx/blog/models.py | 2 | 3677 | # coding: utf-8
import os
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.core import urlresolvers
from django.db import models
from django.utils.translation import ugettext as _
from core.utils import get_... | mit |
EricCline/CEM_inc | env/lib/python2.7/site-packages/django/core/cache/backends/base.py | 99 | 7900 | "Base Cache class."
from __future__ import unicode_literals
import warnings
from django.core.exceptions import ImproperlyConfigured, DjangoRuntimeWarning
from django.utils.importlib import import_module
class InvalidCacheBackendError(ImproperlyConfigured):
pass
class CacheKeyWarning(DjangoRuntimeWarning):
p... | mit |
zding5/Microblog-Flask | flask/lib/python2.7/site-packages/babel/messages/plurals.py | 151 | 6696 | # -*- coding: utf-8 -*-
"""
babel.messages.plurals
~~~~~~~~~~~~~~~~~~~~~~
Plural form definitions.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
from babel.core import default_locale, Locale
from operator import itemgetter
# XXX: remove this file, dupl... | mit |
CongSmile/tp-qemu | qemu/tests/rng_bat.py | 2 | 4969 | import re
import logging
import aexpect
from virttest import utils_misc
from virttest import error_context
from virttest import utils_test
from avocado.core import exceptions
from avocado.utils import process
@error_context.context_aware
def run(test, params, env):
"""
Qemu virtio-rng device test:
1) boo... | gpl-2.0 |
PacificBiosciences/rDnaTools | src/pbrdna/fasta/PositionMasker.py | 2 | 4194 | import sys
import os
import logging
from pbrdna.io.FastaIO import FastaReader, FastaWriter
__version__ = "0.1"
class PositionMasker(object):
"""
Tool for masking regions in aligned FASTA files
"""
##########################
# Initialization Methods #
##########################
def __ini... | bsd-3-clause |
LICEF/edx-platform | common/test/acceptance/pages/lms/login.py | 205 | 1412 | """
Login page for the LMS.
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise
from . import BASE_URL
from .dashboard import DashboardPage
class LoginPage(PageObject):
"""
Login page for the LMS.
"""
url = BASE_URL + "/login"
def is_browser_on_page(self):
... | agpl-3.0 |
brianonn/Cinnamon | files/usr/lib/cinnamon-settings/modules/cs_backgrounds.py | 3 | 28522 | #!/usr/bin/env python2
import sys
sys.path.append('/usr/lib/cinnamon-settings/bin')
from SettingsWidgets import *
import os
from gi.repository import Gio, Gtk, GObject, Gdk, Pango, GLib
import imtools
import gettext
import thread
import subprocess
import tempfile
import commands
import locale
from xml.etree import Ele... | gpl-2.0 |
ddworken/mitmproxy | mitmproxy/contentviews/image/view.py | 2 | 1342 | import imghdr
from mitmproxy.contentviews import base
from mitmproxy.types import multidict
from . import image_parser
def test_ico(h, f):
if h.startswith(b"\x00\x00\x01\x00"):
return "ico"
imghdr.tests.append(test_ico)
class ViewImage(base.View):
name = "Image"
prompt = ("image", "i")
#... | mit |
TonyThompson/fail2ban-patch | fail2ban/tests/action_d/test_smtp.py | 4 | 4129 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation;... | gpl-2.0 |
schlos/eden | modules/pygsm/errors.py | 65 | 3781 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import serial
class GsmError(serial.SerialException):
pass
class GsmIOError(GsmError):
pass
class GsmWriteError(GsmIOError):
pass
class GsmReadError(GsmIOError):
pass
class GsmReadTimeoutError(GsmReadError):
def __init__(self, pending_da... | mit |
redhat-openstack/neutron | neutron/tests/unit/vmware/apiclient/fake.py | 9 | 28979 | # Copyright 2012 VMware, 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 agree... | apache-2.0 |
qtOS/practRivus | node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py | 1534 | 3426 | # Copyright (c) 2012 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 os
import gyp
import gyp.common
import gyp.msvs_emulation
import json
import sys
generator_supports_multiple_toolsets = True
generator_... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.