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 |
|---|---|---|---|---|---|
ppanczyk/ansible | test/units/modules/network/ios/test_ios_ping.py | 20 | 2742 | #
# (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 |
vishrutshah/autorest | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/fixtures/acceptancetestsazurespecials/operations/skip_url_encoding_operations.py | 14 | 16139 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
yetsky/extra | packages/my-application/python-all/files/usr/lib/python2.7/distutils/command/upload.py | 8 | 7056 | """distutils.command.upload
Implements the Distutils 'upload' subcommand (upload package to PyPI)."""
import os
import socket
import platform
from urllib2 import urlopen, Request, HTTPError
from base64 import standard_b64encode
import urlparse
import cStringIO as StringIO
from hashlib import md5
from distutils.errors... | gpl-2.0 |
mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/tests/python/relay/test_pass_check_kind.py | 1 | 8163 | # 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 |
alex/django-old | django/utils/unittest/suite.py | 353 | 9293 | """TestSuite"""
import sys
import unittest
from django.utils.unittest import case, util
__unittest = True
class BaseTestSuite(unittest.TestSuite):
"""A simple test suite that doesn't provide class or module shared fixtures.
"""
def __init__(self, tests=()):
self._tests = []
self.addTests... | bsd-3-clause |
napkindrawing/ansible | lib/ansible/plugins/connection/docker.py | 37 | 11772 | # Based on the chroot connection plugin by Maykel Moya
#
# Connection plugin for configuring docker containers
# (c) 2014, Lorin Hochstein
# (c) 2015, Leendert Brouwer
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# Maintainer: Leendert Brouwer (https://github.com/objectified)
#
# This file is part of Ansible
#... | gpl-3.0 |
ThirdProject/android_external_chromium_org | build/win/importlibs/create_importlib_win.py | 185 | 6790 | #!/usr/bin/env python
# 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.
#
"""Creates an import library from an import description file."""
import ast
import logging
import optparse
import os
import os.pat... | bsd-3-clause |
mennis/dpkt | dpkt/radius.py | 18 | 2106 | # $Id$
"""Remote Authentication Dial-In User Service."""
import dpkt
# http://www.untruth.org/~josh/security/radius/radius-auth.html
# RFC 2865
class RADIUS(dpkt.Packet):
__hdr__ = (
('code', 'B', 0),
('id', 'B', 0),
('len', 'H', 4),
('auth', '16s', '')
)
attrs = ''
... | bsd-3-clause |
15Dkatz/pants | tests/python/pants_test/targets/test_sort_targets.py | 15 | 1864 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.build_gra... | apache-2.0 |
snnn/tensorflow | tensorflow/contrib/lite/testing/model_coverage/model_coverage_lib_test.py | 2 | 5994 | # Copyright 2018 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 |
shabeebqadir/cpuset | cpuset/commands/proc.py | 1 | 29912 | """Process manipulation command
"""
__copyright__ = """
Copyright (C) 2007-2010 Novell Inc.
Author: Alex Tsariounov <alext@novell.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This... | gpl-2.0 |
rocio/rethinkdb | test/common/workload_runner.py | 6 | 7943 | # Copyright 2010-2012 RethinkDB, all rights reserved.
import subprocess, os, time, string, signal
from vcoptparse import *
# TODO: Merge this file into `scenario_common.py`?
class MemcachedPorts(object):
def __init__(self, host, http_port, memcached_port):
self.host = host
self.http_port = http_po... | agpl-3.0 |
aleksandr-bakanov/astropy | astropy/modeling/powerlaws.py | 3 | 15873 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Power law model variants
"""
import numpy as np
from .core import Fittable1DModel
from .parameters import Parameter, InputParameterError
from astropy.units import Quantity
__all__ = ['PowerLaw1D', 'BrokenPowerLaw1D', 'SmoothlyBrokenPowerLaw1D',
... | bsd-3-clause |
virgilio/timtec | ifs/models.py | 5 | 1246 | # coding=utf-8
from django.db import models
from accounts.models import AbstractTimtecUser
from django.utils.translation import ugettext_lazy as _
class Campus(models.Model):
name = models.CharField(_('Name'), max_length=30, blank=True)
city = models.CharField(_('City'), max_length=30)
address = models.Ch... | agpl-3.0 |
nemesisdesign/django | tests/sitemaps_tests/base.py | 380 | 1079 | from django.apps import apps
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.test import TestCase, modify_settings, override_settings
from .models import I18nTestModel, TestModel
@modify_settings(INSTALLED_APPS={'append': 'django.contrib.sitemaps'})
@override_settings(ROO... | bsd-3-clause |
jsburg/xdsme | XOconv/xds2best.py | 7 | 5072 | #!/usr/bin/env python
"""
08/05/05 First version, build from xds2mos.py
Uses the mat3 and vec3 classes from Python Computer Graphics Kit v1.2.0
module by Matthias Baas (see http://cgkit.sourceforge.net).
License: http://www.opensource.org/licenses/bsd-license.php
"""
__author__ = "Pierre Leg... | bsd-3-clause |
LePastis/pyload | module/plugins/accounts/FastshareCz.py | 5 | 1475 | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.Account import Account
from module.plugins.internal.Plugin import set_cookie
class FastshareCz(Account):
__name__ = "FastshareCz"
__type__ = "account"
__version__ = "0.09"
__status__ = "testing"
__description__ = """Fastshare... | gpl-3.0 |
jdcamp/cameron_bakery | sites/all/themes/new_zen/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py | 1382 | 30567 | # Copyright (c) 2014 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.
"""
This script is intended for use as a GYP_GENERATOR. It takes as input (by way of
the generator flag config_path) the path of a json file that dictates the file... | gpl-2.0 |
dims/cinder | cinder/db/sqlalchemy/migrate_repo/versions/061_add_snapshot_id_timestamp_to_backups.py | 6 | 1110 | # Copyright (c) 2015 EMC 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 requi... | apache-2.0 |
os2webscanner/os2webscanner | scrapy-webscanner/exchangescan/exchange_filescan.py | 1 | 6401 | """
VIGTIGT!!!!
Denne fil bruges ikke mere nogen steder og skal heller ikke bruges fremadrettet.
Gemmes kun midlertidigt indtil anden implementation virker efter hensigten.
Demands:
* starter når den første _done folder er markeret
* hvis filscan indhenter exchange download skal filscan vente indtil en ny folder er ma... | mpl-2.0 |
codemac/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/run_all.py | 465 | 3259 | #!/usr/bin/env python
#
# Copyright 2011, 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 |
vlk239/pystlink | lib/stlinkusb.py | 2 | 6274 | import usb.core
import usb.util
import lib.stlinkex
import re
class StlinkUsbConnector():
STLINK_CMD_SIZE_V2 = 16
DEV_TYPES = [
{
'version': 'V2',
'idVendor': 0x0483,
'idProduct': 0x3748,
'outPipe': 0x02,
'inPipe': 0x81,
}, {
... | gpl-2.0 |
dvliman/jaikuengine | .google_appengine/lib/django-1.2/django/db/models/sql/subqueries.py | 45 | 7688 | """
Query subclasses which provide extra functionality beyond simple data retrieval.
"""
from django.core.exceptions import FieldError
from django.db import connections
from django.db.models.sql.constants import *
from django.db.models.sql.datastructures import Date
from django.db.models.sql.expressions import SQLEval... | apache-2.0 |
stefanv/aandete | app/lib/funcsigs/__init__.py | 63 | 30390 | # Copyright 2001-2013 Python Software Foundation; All Rights Reserved
"""Function signature objects for callables
Back port of Python 3.3's function signature tools from the inspect module,
modified to be compatible with Python 2.6, 2.7 and 3.3+.
"""
from __future__ import absolute_import, division, print_function
imp... | bsd-3-clause |
subutai/nupic.research | nupic/research/frameworks/lightning/models/supervised_model.py | 3 | 8065 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2020, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
Pexego/odoo | addons/resource/faces/pcalendar.py | 433 | 28436 | #@+leo-ver=4
#@+node:@file pcalendar.py
#@@language python
#@<< Copyright >>
#@+node:<< Copyright >>
############################################################################
# Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH
# mreithinger@web.de
#
# This file is part of faces.
#
# faces is free softw... | agpl-3.0 |
edry/edx-platform | common/djangoapps/monitoring/signals.py | 172 | 4584 | """
Add receivers for django signals, and feed data into the monitoring system.
If a model has a class attribute 'METRIC_TAGS' that is a list of strings,
those fields will be retrieved from the model instance, and added as tags to
the recorded metrics.
"""
from django.db.models.signals import post_save, post_delete,... | agpl-3.0 |
SimVascular/VTK | Wrapping/Python/vtk/test/BlackBox.py | 11 | 2957 | from vtk.util import vtkMethodParser
class Tester:
def __init__(self, debug=0):
self.setDebug(debug)
self.parser = vtkMethodParser.VtkDirMethodParser()
self.obj = None
def setDebug(self, val):
"""Sets debug value of the vtkMethodParser. 1 is verbose and
0 is not. 0 i... | bsd-3-clause |
liduanw/viewfinder | backend/www/admin/otp.py | 13 | 4181 | #!/usr/bin/env python
#
# Copyright 2011 Viewfinder Inc. All Rights Reserved.
"""Provides OTP entry handler.
OTPEntryHandler: handler for OTP entry; login_url for AdminServer.
"""
__author__ = 'spencer@emailscrubbed.com (Spencer Kimball)'
import json
import logging
import sys
import time
import validictory
from... | apache-2.0 |
intip/django-cms | cms/utils/__init__.py | 14 | 2947 | # -*- coding: utf-8 -*-
# TODO: this is just stuff from utils.py - should be splitted / moved
from django.conf import settings
from django.core.files.storage import get_storage_class
from django.utils.functional import LazyObject
from cms import constants
from cms.utils.conf import get_cms_setting
from cms.utils.conf i... | bsd-3-clause |
ucfopen/canvasapi | canvasapi/file.py | 1 | 1358 | from canvasapi.canvas_object import CanvasObject
from canvasapi.util import combine_kwargs
class File(CanvasObject):
def __str__(self):
return "{}".format(self.display_name)
def delete(self, **kwargs):
"""
Delete this file.
:calls: `DELETE /api/v1/files/:id \
<https:... | mit |
xuweiliang/Codelibrary | openstack_dashboard/test/test_data/exceptions.py | 6 | 3389 | # Copyright 2012 Nebula, 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 |
lucychambers/lucychambers.github.io | .bundle/ruby/2.0.0/gems/pygments.rb-0.6.2/vendor/simplejson/simplejson/encoder.py | 219 | 21798 | """Implementation of JSONEncoder
"""
import re
from decimal import Decimal
def _import_speedups():
try:
from simplejson import _speedups
return _speedups.encode_basestring_ascii, _speedups.make_encoder
except ImportError:
return None, None
c_encode_basestring_ascii, c_make_encoder = _im... | gpl-2.0 |
sauloal/cufflinksviewer | venvlin/lib/python2.7/site-packages/Jinja2-2.6-py2.7.egg/jinja2/nodes.py | 122 | 28750 | # -*- coding: utf-8 -*-
"""
jinja2.nodes
~~~~~~~~~~~~
This module implements additional nodes derived from the ast base node.
It also provides some node tree helper functions like `in_lineno` and
`get_nodes` used by the parser and translator in order to normalize
python and jinja nodes.
:... | mit |
ubiar/odoo | openerp/addons/base/ir/ir_rule.py | 1 | 8308 | # -*- 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 |
willdavidc/piel | catkin_ws/src/piel/scripts/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.py | 2924 | 3268 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
wri/gfw-api | lib/apiclient/http.py | 3 | 20876 | # Copyright (C) 2010 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 or agreed to in writ... | gpl-2.0 |
rtucker/sycamore | Sycamore/support/pytz/zoneinfo/Asia/Yerevan.py | 9 | 5253 | '''tzinfo timezone information for Asia/Yerevan.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Yerevan(DstTzInfo):
'''Asia/Yerevan timezone definition. See datetime.tzinfo for details'''
zone = 'Asia/Yerevan'
_utc_... | gpl-2.0 |
rycus86/docker-pygen | tests/test_update.py | 1 | 4812 | import tempfile
import threading
import time
from datetime import datetime, timedelta
import pygen
from unittest_helper import BaseDockerTestCase
class UpdateTest(BaseDockerTestCase):
app = None
def setUp(self):
super(UpdateTest, self).setUp()
self.target_file = tempfile.NamedTemporaryFile(... | mit |
newerthcom/savagerebirth | libs/python-2.72/Lib/lib2to3/fixes/fix_execfile.py | 324 | 1998 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for execfile.
This converts usages of the execfile function into calls to the built-in
exec() function.
"""
from .. import fixer_base
from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node,
... | gpl-2.0 |
trezor/micropython | drivers/display/lcd160cr.py | 2 | 14404 | # Driver for official MicroPython LCD160CR display
# MIT license; Copyright (c) 2017 Damien P. George
from micropython import const
from utime import sleep_ms
from ustruct import calcsize, pack_into
import uerrno, machine
# for set_orient
PORTRAIT = const(0)
LANDSCAPE = const(1)
PORTRAIT_UPSIDEDOWN = const(2)
LANDSCA... | mit |
boada/ICD | sandbox/legacy_plot_code/plot_grad_vs_mass.py | 1 | 2378 | #!/usr/bin/env python
# File: plot_grad_vs_mass.py
# Created on: Thu 14 Jun 2012 11:12:28 AM CDT
# Last Change: Mon 01 Oct 2012 09:59:51 AM CDT
# Purpose of script: <+INSERT+>
# Author: Steven Boada
import pylab as pyl
from mpl_toolkits.mplot3d import Axes3D
from plotfix import plotfix
def plot_grad_vs_mass():
gr... | mit |
UrusTeam/android_ndk_toolchain_cross | lib/python2.7/idlelib/WidgetRedirector.py | 143 | 4476 | from Tkinter import *
class WidgetRedirector:
"""Support for redirecting arbitrary widget subcommands.
Some Tk operations don't normally pass through Tkinter. For example, if a
character is inserted into a Text widget by pressing a key, a default Tk
binding to the widget's 'insert' operation is acti... | gpl-2.0 |
JonathanPierce/Algae | helpers/corpus.py | 1 | 4845 | # valdiates the corpus and provides helper functions to it
import io
import os
import csv
import shutil
def splitFilename(path):
# returns a tuple of (folder_path, filename)
split = path.split('/')
return ("/".join(split[:-1]), split[-1])
class Corpus:
def __init__(self, config):
# keep a refere... | mit |
ECAM-Brussels/ECAMTV | modules/module.py | 1 | 1566 | # module.py
# Author: Sébastien Combéfis
# Version: June 7, 2016
from abc import *
import copy
class Module(metaclass=ABCMeta):
'''Abstract class representing a generic module.'''
def __init__(self, name, refreshrate=None, options=None):
'''Build a new module
Pre: name != ''
... | agpl-3.0 |
open-synergy/partner-contact | partner_contact_job_position/__openerp__.py | 9 | 1066 | # -*- coding: utf-8 -*-
# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com)
# Antonio Espinosa <antonioea@antiun.com>
# © 2015 ... | agpl-3.0 |
lowRISC/ot-sca | cw/cw305/simple_cpa_attack.py | 1 | 1625 | #!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import binascii
import pickle
import tqdm
import chipwhisperer as cw
import chipwhisperer.analyzer as cwa
project_file = "projects/opentitan_simp... | apache-2.0 |
psiinon/addons-server | src/olympia/translations/tests/test_helpers.py | 5 | 6104 | from django.conf import settings
from django.utils import translation
import pytest
from unittest.mock import Mock, patch
from olympia.addons.models import Addon
from olympia.amo.tests import TestCase
from olympia.amo.utils import from_string
from olympia.translations.fields import save_signal
from olympia.translati... | bsd-3-clause |
bryantbiggs/luther-02 | src/aggregate.py | 2 | 7563 | '''
Combine data sources on fuzzy-matched titles to create final data set
'''
from multiprocessing import Pool, cpu_count
from functools import partial
import pandas as pd
import numpy as np
from fuzzywuzzy import process
from src.my_aws import S3
KEY_OMDB_TOR = 'OMDB_Torrents.csv'
KEY_NUM = 'TheNumbers_budgets.... | mit |
saurabhiiit/coala | coalib/results/Diff.py | 6 | 8963 | import copy
import difflib
from coalib.results.LineDiff import LineDiff
from coalib.results.SourceRange import SourceRange
class ConflictError(Exception):
pass
class Diff:
"""
A Diff result represents a difference for one file.
"""
def __init__(self, file_list):
"""
Creates an ... | agpl-3.0 |
kingvuplus/PB-gui | lib/python/Plugins/SystemPlugins/DefaultServicesScanner/plugin.py | 28 | 5429 | #from Components.ActionMap import ActionMap, NumberActionMap
#from Components.Input import Input
#from Components.Ipkg import IpkgComponent
#from Components.Label import Label
#from Components.MenuList import MenuList
#from Components.Slider import Slider
from Components.NimManager import nimmanager
from Plugins.Plugin... | gpl-2.0 |
tinkhaven-organization/odoo | addons/stock_dropshipping/stock_dropshipping.py | 160 | 2228 | # coding: utf-8
from openerp import models, api, _
from openerp.exceptions import Warning
class sale_order_line(models.Model):
_inherit = 'sale.order.line'
@api.multi
def _check_routing(self, product, warehouse):
""" skip stock verification if the route goes from supplier to customer
... | agpl-3.0 |
vine/apns-client | vapnsclient/apns.py | 1 | 26786 | # Copyright 2014 Sardar Yumatov
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | apache-2.0 |
sdague/home-assistant | homeassistant/components/ipma/weather.py | 4 | 9677 | """Support for IPMA weather service."""
from datetime import timedelta
import logging
import async_timeout
from pyipma.api import IPMA_API
from pyipma.location import Location
import voluptuous as vol
from homeassistant.components.weather import (
ATTR_FORECAST_CONDITION,
ATTR_FORECAST_PRECIPITATION_PROBABILI... | apache-2.0 |
Pexego/odoo | addons/l10n_gr/__openerp__.py | 170 | 1883 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 P. Christeas <p_christ@hol.gr>. All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
mluke93/osf.io | scripts/googledrive/migrate_to_external_account.py | 30 | 3090 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Script to migrate GoogleDrive credentials from user settings object to external
account objects.
Changes:
- Create external account for authorized user settings
- Attach external account to user settings
- Attach external account to all node settings
"""
import sys... | apache-2.0 |
backtou/longlab | gr-wxgui/src/python/waterfall_window.py | 6 | 10621 | #
# Copyright 2008 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 your option)
# any later version.
#
#... | gpl-3.0 |
paolodedios/tensorflow | tensorflow/python/data/experimental/service/server_lib.py | 6 | 14039 | # Copyright 2020 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 |
vitan/hue | desktop/core/src/desktop/lib/rest/http_client.py | 25 | 5112 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | apache-2.0 |
Thraxis/pymedusa | lib/imdb/parser/http/characterParser.py | 143 | 8139 | """
parser.http.characterParser module (imdb package).
This module provides the classes (and the instances), used to parse
the IMDb pages on the akas.imdb.com server about a character.
E.g., for "Jesse James" the referred pages would be:
main details: http://www.imdb.com/character/ch0000001/
biography: ... | gpl-3.0 |
boomcan90/store | store/book/models.py | 4 | 3191 | # -*- coding: utf-8 -*-
"""Book models."""
from store.database import Column, Model, db
from store.compat import basestring
from sqlalchemy.ext.hybrid import hybrid_property, Comparator
# from sqlalchemy_utils import aggregated
from store.feedback.models import Feedback
from sqlalchemy import func, case
class Book(M... | bsd-3-clause |
InAnimaTe/CouchPotatoServer | libs/html5lib/treewalkers/lxmletree.py | 618 | 6033 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from lxml import etree
from ..treebuilders.etree import tag_regexp
from gettext import gettext
_ = gettext
from . import _base
from .. import ihatexml
def ensure_str(s):
if s is None:
return None
elif isin... | gpl-3.0 |
acrsilva/animated-zZz-machine | bundle_final_app/libs/pyqtgraph-develop/pyqtgraph/graphicsItems/PlotDataItem.py | 22 | 35686 | import numpy as np
from .. import metaarray as metaarray
from ..Qt import QtCore
from .GraphicsObject import GraphicsObject
from .PlotCurveItem import PlotCurveItem
from .ScatterPlotItem import ScatterPlotItem
from .. import functions as fn
from .. import debug as debug
from .. import getConfigOption
class PlotDataIt... | lgpl-3.0 |
LiveZenLK/CeygateERP | addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.py | 47 | 4552 | #-*- coding:utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
import time
from openerp.osv import osv
from openerp.report import report_sxw
class report_hr_salary_employee_bymonth(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(r... | gpl-3.0 |
ntt-sic/taskflow | taskflow/examples/resume_many_flows/resume_all.py | 1 | 1670 | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 Yahoo! 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
#
# ... | apache-2.0 |
singingwolfboy/readthedocs.org | readthedocs/projects/management/commands/import_project_from_live.py | 7 | 3077 | """
This is a helper to debug issues with projects on the server more easily
locally. It allows you to import projects based on the data that the public API
provides.
"""
from django.core.management import call_command
from django.core.management.base import BaseCommand
import json
import slumber
from django.contrib.... | mit |
applicationdevm/XlsxWriter | xlsxwriter/test/comparison/test_chart_display_units04.py | 8 | 1419 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
mmatyas/servo | tests/wpt/web-platform-tests/tools/pytest/testing/test_monkeypatch.py | 171 | 8404 | import os
import sys
import textwrap
import pytest
from _pytest.monkeypatch import monkeypatch as MonkeyPatch
def pytest_funcarg__mp(request):
cwd = os.getcwd()
sys_path = list(sys.path)
def cleanup():
sys.path[:] = sys_path
os.chdir(cwd)
request.addfinalizer(cleanup)
return Mon... | mpl-2.0 |
nuclear-wizard/moose | python/peacock/utils/ExeLauncher.py | 21 | 1932 | #* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
from peacoc... | lgpl-2.1 |
klmitch/nova | nova/objects/virt_device_metadata.py | 6 | 3806 | # Copyright (C) 2016, Red Hat, 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... | apache-2.0 |
michelts/lettuce | tests/integration/lib/Django-1.2.5/django/contrib/gis/db/backends/oracle/models.py | 310 | 2184 | """
The GeometryColumns and SpatialRefSys models for the Oracle spatial
backend.
It should be noted that Oracle Spatial does not have database tables
named according to the OGC standard, so the closest analogs are used.
For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns
model and the `SDO_... | gpl-3.0 |
agoose77/hivesystem | bee/segments/antenna_blockcontrol.py | 1 | 1514 | from ._io_base import io_base
import libcontext
from ._runtime_segment import tryfunc
class _runtime_antenna_blockcontrol(object):
segmentname = None
antenna_push_plugin = None
def __init__(self, beeinstance, beename):
self.beename = beename
self.beeinstance = beeinstance
self.inp... | bsd-2-clause |
soldag/home-assistant | homeassistant/components/wink/lock.py | 9 | 6584 | """Support for Wink locks."""
import pywink
import voluptuous as vol
from homeassistant.components.lock import LockEntity
from homeassistant.const import (
ATTR_CODE,
ATTR_ENTITY_ID,
ATTR_MODE,
ATTR_NAME,
STATE_UNKNOWN,
)
import homeassistant.helpers.config_validation as cv
from . import DOMAIN, W... | apache-2.0 |
drewwestrick/Repy-Web-Server | seattle_repy/softwareupdater.repyhelpercache/serialize_repy.py | 2 | 7215 | # -*- coding: utf-8 -*-
### Automatically generated by repyhelper.py ### /Users/andrewwestrick/Desktop/seattle/seattle_repy/serialize.repy
### THIS FILE WILL BE OVERWRITTEN!
### DO NOT MAKE CHANGES HERE, INSTEAD EDIT THE ORIGINAL SOURCE FILE
###
### If changes to the src aren't propagating here, try manually deleting ... | gpl-2.0 |
citibeth/modele-control | lib/ectl/iso8601.py | 2 | 8261 | # Modified From:
# https://bitbucket.org/micktwomey/pyiso8601/src/43c6749d06c4
#
# Copyright (c) 2007 - 2015 Michael Twomey
#
# 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 restr... | lgpl-2.1 |
BrandonY/python-docs-samples | appengine/standard/ndb/async/app_toplevel/app_toplevel.py | 9 | 1360 | # Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
felix1m/pyspotify | tests/test_playlist_container.py | 2 | 57024 | from __future__ import unicode_literals
import collections
import unittest
import spotify
from spotify.playlist_container import _PlaylistContainerCallbacks
import tests
from tests import mock
@mock.patch('spotify.playlist_container.lib', spec=spotify.lib)
class PlaylistContainerTest(unittest.TestCase):
def se... | apache-2.0 |
marcoantoniooliveira/labweb | oscar/lib/python2.7/site-packages/IPython/nbconvert/filters/tests/test_datatypefilter.py | 2 | 1558 | """
Module with tests for DataTypeFilter
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#... | bsd-3-clause |
nilmini20s/gem5-2016-08-13 | src/arch/x86/isa/insts/simd64/integer/data_transfer/move.py | 26 | 2968 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
songfj/calibre | src/calibre/gui2/add.py | 10 | 18887 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import shutil, os, weakref, traceback, tempfile, time
from threading import ... | gpl-3.0 |
MarkWh1te/xueqiu_predict | python3_env/lib/python3.4/site-packages/pip/exceptions.py | 142 | 7980 | """Exceptions used throughout package"""
from __future__ import absolute_import
from itertools import chain, groupby, repeat
from pip._vendor.six import iteritems
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class Unin... | mit |
google-research/xtreme | evaluate.py | 1 | 8430 | # coding=utf-8
# Copyright 2020 Google and DeepMind.
#
# 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... | apache-2.0 |
alexphelps/django-drip | docs/conf.py | 7 | 7845 | # -*- coding: utf-8 -*-
#
# Django Drip documentation build configuration file, created by
# sphinx-quickstart on Sat Oct 27 18:42:11 2012.
#
# 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 |
Endika/c2c-rd-addons | project_notes/__openerp__.py | 4 | 1447 | # -*- 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 |
johankaito/fufuka | microblog/flask/venv/lib/python2.7/site-packages/scipy/signal/waveforms.py | 17 | 14814 | # Author: Travis Oliphant
# 2003
#
# Feb. 2010: Updated by Warren Weckesser:
# Rewrote much of chirp()
# Added sweep_poly()
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import asarray, zeros, place, nan, mod, pi, extract, log, sqrt, \
exp, cos, sin, polyval, po... | apache-2.0 |
Yen-Chung-En/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/atexit.py | 743 | 1049 | """allow programmer to define multiple exit functions to be executedupon normal program termination.
Two public functions, register and unregister, are defined.
"""
class __loader__(object):
pass
def _clear(*args,**kw):
"""_clear() -> None
Clear the list of previously registered exit functions."""
... | agpl-3.0 |
youprofit/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/path.py | 191 | 5046 | # 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 |
sonu283304/onos | tools/dev/bin/clean-branches.py | 26 | 2053 | #!/usr/bin/env python
from subprocess import check_output
import sys
def get_merged_branches_by_change_id():
'''a list of merged branches, by change id excluding support branches and master'''
raw_changeIds = check_output('git log origin/master | grep -i change-id | awk {\' print $2 \'}', shell=True)
chan... | apache-2.0 |
fujunwei/chromium-crosswalk | tools/telemetry/telemetry/value/failure.py | 8 | 2727 | # 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.
import sys
import traceback
from telemetry import value as value_module
class FailureValue(value_module.Value):
def __init__(self, page, exc_info, desc... | bsd-3-clause |
912/M-new | virtualenvironment/experimental/lib/python2.7/site-packages/django/contrib/auth/tests/test_signals.py | 63 | 3272 | from django.contrib.auth import signals
from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TestCase
from django.test.client import RequestFactory
from django.test import override_settings
@skipIfCustomUser
@override_settings(USE_TZ=False, P... | gpl-2.0 |
hagifoo/gae-pomodoro | app/lib/requests/packages/chardet/utf8prober.py | 2919 | 2652 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | mit |
harshita-gupta/Harvard-FRSEM-Catalog-2016-17 | flask/lib/python2.7/site-packages/Crypto/SelfTest/Cipher/common.py | 115 | 16599 | # -*- coding: utf-8 -*-
#
# SelfTest/Hash/common.py: Common code for Crypto.SelfTest.Hash
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedicat... | mit |
2mf/moto | tests/test_ec2/test_spot_instances.py | 19 | 6579 | from __future__ import unicode_literals
import datetime
import boto
import sure # noqa
from moto import mock_ec2
from moto.backends import get_model
from moto.core.utils import iso_8601_datetime_with_milliseconds
@mock_ec2
def test_request_spot_instances():
conn = boto.connect_ec2()
conn.create_security_g... | apache-2.0 |
Vishruit/DDP_models | tf1/lib/python2.7/site-packages/pip/commands/show.py | 344 | 2767 | import os
from pip.basecommand import Command
from pip.log import logger
from pip._vendor import pkg_resources
class ShowCommand(Command):
"""Show information about one or more installed packages."""
name = 'show'
usage = """
%prog [options] <package> ..."""
summary = 'Show information about in... | gpl-3.0 |
rosswhitfield/mantid | scripts/test/Muon/elemental_analysis/periodic_table_test.py | 3 | 6522 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
impo... | gpl-3.0 |
google/starthinker | starthinker/task/cm_to_dv/preview_io.py | 1 | 15120 | ###########################################################################
#
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/l... | apache-2.0 |
Tangcuyu/perfectinfo | lib/tsd/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py | 193 | 45285 | # 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.
# Notes:
#
# This generates makefiles suitable for inclusion into the Android build system
# via an Android.mk file. It is based on make.py, the standard makefile
... | mit |
agrista/odoo-saas | addons/account/report/account_analytic_entries_report.py | 306 | 3879 | # -*- 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 |
x2nie/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/tools.py | 384 | 1576 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
bclau/nova | nova/virt/vmwareapi/vmware_images.py | 8 | 8147 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# 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
# ... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.