repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
clearswift/trafficserver | tests/gold_tests/tls_hooks/tls_hooks.test.py | 4 | 3671 | '''
Test 1 preaccept callback (without delay)
'''
# 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 Apach... | apache-2.0 |
louyihua/edx-platform | common/djangoapps/config_models/utils.py | 14 | 2544 | """
Utilities for working with ConfigurationModels.
"""
from django.apps import apps
from rest_framework.parsers import JSONParser
from rest_framework.serializers import ModelSerializer
from django.contrib.auth.models import User
def get_serializer_class(configuration_model):
""" Returns a ConfigurationModel seri... | agpl-3.0 |
SeanDS/picolog-adc-python | datalog/data.py | 2 | 11778 | """Data representation classes."""
import json
import datetime
# maximum requested readings
MAX_AMOUNT = 1000
class Reading(object):
"""Class to represent a device reading for a particular time. This contains
the samples for each active channel in the ADC for a particular time."""
# reading time
re... | gpl-2.0 |
mrkm4ntr/incubator-airflow | airflow/providers/google/cloud/operators/cloud_build.py | 7 | 8643 | #
# 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... | apache-2.0 |
HarryElSuzio/ShaniXBMCWork | plugin.video.pitelevision/default.py | 9 | 18685 | import xbmc, xbmcgui, xbmcplugin
import urllib2,urllib,cgi, re, urlresolver
import urlparse
import HTMLParser
import xbmcaddon
from dirCreator import parseList;
from TurlLib import getURL;
import thread
import time
#from f4mDownloader import F4MDownloader
from operator import itemgetter
import traceback
imp... | gpl-2.0 |
KontorConsulting/odoo | addons/hw_posbox_upgrade/__init__.py | 1894 | 1075 | # -*- 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 |
olologin/scikit-learn | examples/ensemble/plot_adaboost_twoclass.py | 347 | 3268 | """
==================
Two-class AdaBoost
==================
This example fits an AdaBoosted decision stump on a non-linearly separable
classification dataset composed of two "Gaussian quantiles" clusters
(see :func:`sklearn.datasets.make_gaussian_quantiles`) and plots the decision
boundary and decision scores. The di... | bsd-3-clause |
amchagas/python-neo | examples/generated_data.py | 7 | 4873 | # -*- coding: utf-8 -*-
"""
This is an example for creating simple plots from various Neo structures.
It includes a function that generates toy data.
"""
from __future__ import division # Use same division in Python 2 and 3
import numpy as np
import quantities as pq
from matplotlib import pyplot as plt
import neo
... | bsd-3-clause |
tempbottle/v8.rs | build/gyp/pylib/gyp/MSVSVersion.py | 30 | 15539 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import gyp
import glob
class VisualStudi... | isc |
QuLogic/specfem3d | EXAMPLES/Mount_StHelens/read_topo.py | 6 | 1989 | #!/usr/bin/env python
import cubit
import os
import sys
import fileinput
import string
import math
print sys.path
#############################################################
# USER PARAMETERS
# topography file, data points per lon-increment
inputFile = 'ptopo.mean.utm'
# X coordinate in topography file repeats ... | gpl-2.0 |
Qalthos/ansible | lib/ansible/modules/storage/netapp/na_elementsw_cluster.py | 37 | 7132 | #!/usr/bin/python
# (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or
# https://www.gnu.org/licenses/gpl-3.0.txt)
'''
Element Software Initialize Cluster
'''
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
ZhangXinNan/tensorflow | tensorflow/python/kernel_tests/qr_op_test.py | 45 | 8834 | # 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 |
thinksource/angularbigquery | lib/python-gflags/tests/gflags_googletest.py | 132 | 4256 | #!/usr/bin/env python
# Copyright (c) 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 l... | gpl-2.0 |
ujenmr/ansible | lib/ansible/modules/cloud/amazon/iam.py | 31 | 35352 | #!/usr/bin/python
# 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',
'status': ['stableinterf... | gpl-3.0 |
chokribr/invenioold | modules/bibformat/lib/elements/bfe_pagination.py | 39 | 1082 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2009, 2010, 2011 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
## Licens... | gpl-2.0 |
pandeyadarsh/sympy | sympy/assumptions/handlers/common.py | 78 | 3168 | from sympy.core.logic import _fuzzy_group
from sympy.logic.boolalg import conjuncts
from sympy.assumptions import Q, ask
class AskHandler(object):
"""Base class that all Ask Handlers must inherit"""
pass
class CommonHandler(AskHandler):
"""Defines some useful methods common to most Handlers """
@st... | bsd-3-clause |
ConnorGBrewster/servo | tests/wpt/web-platform-tests/tools/pywebsocket/test/testdata/handlers/abort_by_user_wsh.py | 496 | 1798 | # 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 of conditions and the f... | mpl-2.0 |
slank/ansible | lib/ansible/executor/action_write_locks.py | 84 | 1782 | # (c) 2016 - Red Hat, Inc. <info@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 Foundation, either version 3 of the License, or
# (at your option) any later versi... | gpl-3.0 |
AmesianX/capstone | bindings/python/test_lite.py | 9 | 5687 | #!/usr/bin/env python
# Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com>
from __future__ import print_function
from capstone import *
from xprint import to_hex
X86_CODE16 = b"\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x00\x00"
X86_CODE32 = b"\xba\xcd\xab\x00\x00\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12... | bsd-3-clause |
maartenq/ansible | lib/ansible/modules/cloud/ovirt/ovirt_permission.py | 41 | 10219 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCU... | gpl-3.0 |
yongshengwang/hue | desktop/core/ext-py/Paste-2.0.1/tests/test_util/test_datetimeutil.py | 47 | 6026 | # (c) 2005 Clark C. Evans and contributors
# This module is part of the Python Paste Project and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
# Some of this code was funded by: http://prometheusresearch.com
from time import localtime
from datetime import date
from paste.util.d... | apache-2.0 |
GUBotDev/mavlink | pymavlink/tools/mavsearch.py | 45 | 1164 | #!/usr/bin/env python
'''
search a set of log files for a condition
'''
import sys, time, os
from pymavlink import mavutil
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--condition", default=None, help="conditional check on log")
parser.add_argument("--types",... | lgpl-3.0 |
40223139/39g7test | static/Brython3.1.1-20150328-091302/Lib/_collections.py | 603 | 19111 | # "High performance data structures
# "
# copied from pypy repo
#
# Copied and completed from the sandbox of CPython
# (nondist/sandbox/collections/pydeque.py rev 1.1, Raymond Hettinger)
#
# edited for Brython line 558 : catch ImportError instead of AttributeError
import operator
#try:
# from thread import get_i... | gpl-3.0 |
js0701/chromium-crosswalk | third_party/closure_compiler/processor_test.py | 56 | 3825 | #!/usr/bin/env python
# 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.
"""Test resources processing, i.e. <if> and <include> tag handling."""
import unittest
from processor import FileCache, Processor, Lin... | bsd-3-clause |
elky/django | django/contrib/gis/gdal/raster/band.py | 12 | 8024 | from ctypes import byref, c_double, c_int, c_void_p
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import raster as capi
from django.contrib.gis.gdal.raster.base import GDALRasterBase
from django.contrib.gis.shortcuts import numpy
from django.utils.encoding import force... | bsd-3-clause |
krafczyk/spack | var/spack/repos/builtin/packages/py-docopt/package.py | 4 | 1596 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
starrybeam/samba | third_party/dnspython/dns/exception.py | 101 | 1318 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | gpl-3.0 |
caisq/tensorflow | tensorflow/compiler/tests/bucketize_op_test.py | 7 | 2992 | # 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 |
likit/dementia | webapp/manage.py | 1 | 2123 | #!/usr/bin/env python
import os
from app import create_app, db
from flask.ext.script import Manager, Shell
from flask.ext.migrate import Migrate, MigrateCommand
from werkzeug.security import generate_password_hash
from datetime import datetime
if os.environ.get('FLASK_COVERAGE'):
import coverage
COV = coverag... | gpl-2.0 |
robwarm/gpaw-symm | doc/tutorials/fxc_correlation/gs_diamond.py | 1 | 1096 | from ase import *
from ase.lattice import bulk
from ase.dft import monkhorst_pack
from ase.parallel import paropen
from gpaw import *
from gpaw.wavefunctions.pw import PW
from gpaw.xc.exx import EXX
# Monkhorst-Pack grid shifted to be gamma centered
k = 8
kpts = monkhorst_pack([k, k, k])
kpts += [1. / (2 * k), 1. / ( ... | gpl-3.0 |
nikolas/edx-platform | lms/djangoapps/certificates/migrations/0008_auto__del_revokedcertificate__del_field_generatedcertificate_name__add.py | 188 | 11649 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'RevokedCertificate'
db.delete_table('certificates_revokedcertificate')
# Deleting... | agpl-3.0 |
walchko/media_html_page_generator | media/media.py | 2 | 9947 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# copyright kevin j. walchko 17 Jan 2015
#------------------
# 17 Jan 2015 Created
# 13 Feb 2015 Made a python module and clean up
#
import sys # cmd line
import os # dir list
import re # clean up movie names
import time # sleep
import json # save mo... | mit |
dhermes/gcloud-python | bigquery/google/cloud/bigquery/dbapi/cursor.py | 2 | 12198 | # Copyright 2017 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
hdemeyer/king-phisher | king_phisher/version.py | 1 | 3552 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/version.py
#
# 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 lis... | bsd-3-clause |
tangyiyong/odoo | addons/l10n_mx/__openerp__.py | 379 | 2559 | # -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
# All Rights Reserved
###############Credits######################################################
# Coded by: Alejandro Negrin anegrin@vauxoo.com,
#... | agpl-3.0 |
binit92/OpenWARP | source/automated_test/bemio/utilities/hdf_utilities.py | 6 | 1625 | from __future__ import division
import numpy as np
import h5py
from bemio.data_structures.bem import HydrodynamicData
def combine_h5(files):
'''Function to combine df5 5 hydrodynamic files
Parameters:
files: list
A list of files to be combined
'''
hdf5_data = {}
for i,f in e... | apache-2.0 |
sekikn/incubator-airflow | airflow/operators/mysql_operator.py | 7 | 1146 | #
# 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... | apache-2.0 |
dashea/blivet | blivet/devices/file.py | 5 | 5320 | # devices/file.py
# Classes to represent various types of files and directories.
#
# Copyright (C) 2009-2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at you... | gpl-2.0 |
BorgERP/borg-erp-6of3 | l10n_coa/l10n_uk/__openerp__.py | 6 | 2036 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Smartmode LTD (<http://www.smartmode.co.uk>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as... | agpl-3.0 |
williamvitorino3/pox-mesh | tools/gui/topology.py | 5 | 43830 | '''
The topology panel of the GUI
@author Kyriakos Zarifis (kyr.zarifis@gmail.com)
'''
from PyQt4 import QtGui, QtCore
import math
from random import randint
from communication import Communication
from views.default import Default_View
import json
import jsonrpc
""""""""""""""""""""""""""""""""""""""... | gpl-3.0 |
failys/CAIRIS | cairis/core/ObstacleParameters.py | 2 | 1398 | # 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... | apache-2.0 |
mcclurmc/juju | juju/state/sshclient.py | 2 | 4898 | import re
import socket
import time
from twisted.internet.defer import Deferred, inlineCallbacks, returnValue
from txzookeeper.client import ConnectionTimeoutException
from juju.errors import NoConnection, InvalidHost, InvalidUser
from juju.state.security import SecurityPolicyConnection
from juju.state.sshforward imp... | agpl-3.0 |
Vito2015/tcc3-portal | tcc3portal/api/users.py | 1 | 1150 | # coding:utf-8
"""
tcc3portal.api.users
~~~~~~~~~~~~~~~~~~~~
User endpoints.
:copyright: (c) 2015 by Vito.
:license: GNU, see LICENSE for more details.
"""
from flask import Blueprint, current_app
from flask_login import login_required
# from flask import json
# from . import route
from ..tcc_core ... | gpl-2.0 |
momahajogami/Prime-Numbers | practical_sieve.py | 1 | 1165 | def primes_in_block(small_primes, L, R, B):
# Algorithm 3.2.1 in Prime Numbers, A Computational Perspective.
# p. 122
# 0. Choose R>L even,
# L > P := int_sqrt(R),
# B|R-L
primes_in_range = []
# 1. Initialize offsets.
primes_with_offsets = []
for p in small_... | mit |
keisuke-umezawa/chainer | chainerx/_docs/backend.py | 10 | 1249 | import chainerx
from chainerx import _docs
def _set_docs_backend():
Backend = chainerx.Backend
_docs.set_doc(
Backend,
"""Pluggable entity that abstracts various computing platforms.
A backend holds one or more :class:`~chainerx.Device`\\ s, each of which
represents a physical computing unit... | mit |
ykhalyavin/usbprog | simpleport/lib/simpleport.py | 3 | 2063 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.33
#
# Don't modify this file, modify the SWIG interface instead.
# This file is compatible with both classic and new-style classes.
import _simpleport
import new
new_instancemethod = new.instancemethod
try:
_swig_property = prope... | gpl-2.0 |
Zerknechterer/pyload | module/remote/ThriftBackend.py | 42 | 2092 | # -*- coding: utf-8 -*-
"""
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
This program is distributed in ... | gpl-3.0 |
niieani/rethinkdb | external/gtest_1.6.0/test/gtest_throw_on_failure_test.py | 2917 | 5766 | #!/usr/bin/env python
#
# Copyright 2009, 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... | agpl-3.0 |
Kefkius/electrum-frc | lib/qrscanner.py | 3 | 1278 | import os
from i18n import _
try:
import zbar
except ImportError:
zbar = None
proc = None
def scan_qr(config):
global proc
if not zbar:
raise BaseException("\n".join([_("Cannot start QR scanner."),_("The zbar package is not available."),_("On Linux, try 'sudo pip install zbar'")]))
if pr... | gpl-3.0 |
jef-n/QGIS | tests/src/python/test_qgslayoutexporter.py | 26 | 47796 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutExporter
.. note:: 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 option) any later version.
"""
... | gpl-2.0 |
elelinux/hero_kernel | tools/perf/scripts/python/sctop.py | 895 | 1936 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
cpcloud/ibis | ibis/pandas/tests/test_core.py | 1 | 4872 | from typing import Any
import pandas as pd
import pandas.util.testing as tm
import pytest
from multipledispatch.conflict import ambiguities
import ibis
import ibis.common.exceptions as com
import ibis.expr.datatypes as dt
import ibis.expr.operations as ops
from ibis.pandas.client import PandasClient
from ibis.pandas.... | apache-2.0 |
patsissons/Flexget | flexget/plugins/cli/check.py | 5 | 6270 | from __future__ import unicode_literals, division, absolute_import
import codecs
import logging
import yaml
from flexget import options
from flexget.event import event
from flexget.logger import console
log = logging.getLogger('check')
@event('manager.before_config_load')
def before_config_load(manager):
if man... | mit |
rancherio/rancher | tests/validation/tests/v3_api/test_workload.py | 3 | 48386 | import pytest
from .common import * # NOQA
from rancher import ApiError
namespace = {"p_client": None, "ns": None, "cluster": None, "project": None}
RBAC_ROLES = [CLUSTER_OWNER, PROJECT_MEMBER, PROJECT_OWNER,
PROJECT_READ_ONLY, CLUSTER_MEMBER]
WORKLOAD_TYPES = ["daemonSet", "statefulSet", "cronJob", "j... | apache-2.0 |
tiagofrepereira2012/tensorflow | tensorflow/contrib/framework/python/ops/ops_test.py | 118 | 2882 | # 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 |
Qalthos/ansible | lib/ansible/modules/monitoring/uptimerobot.py | 84 | 3712 | #!/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 |
Argon-Zhou/django | django/contrib/contenttypes/migrations/0002_remove_content_type_name.py | 582 | 1168 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def add_legacy_name(apps, schema_editor):
ContentType = apps.get_model('contenttypes', 'ContentType')
for ct in ContentType.objects.all():
try:
ct.name = apps.get_model(ct.app_label, c... | bsd-3-clause |
sestrella/ansible | test/units/modules/network/fortios/test_fortios_system_custom_language.py | 21 | 8159 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
BonexGu/Blik2D-SDK | Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/python/training/adadelta_test.py | 87 | 6527 | # Copyright 2015 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... | mit |
dequis/qtile | test/test_command.py | 3 | 11246 | # Copyright (c) 2011 Florian Mounier
# Copyright (c) 2012, 2014 Tycho Andersen
# Copyright (c) 2013 Craig Barnes
# Copyright (c) 2014 Sean Vig
#
# 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 Softwar... | mit |
n0m4dz/odoo | addons/account/wizard/pos_box.py | 126 | 3726 | from openerp.osv import fields, osv
import openerp.addons.decimal_precision as dp
from openerp.tools.translate import _
class CashBox(osv.osv_memory):
_register = False
_columns = {
'name' : fields.char('Reason', required=True),
# Attention, we don't set a domain, because there is a journal_typ... | agpl-3.0 |
zenodo/invenio | invenio/utils/apache.py | 20 | 4705 | # -*- coding: utf-8 -*-
# This file is part of Invenio.
# Copyright (C) 2010, 2011 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) any ... | gpl-2.0 |
CamelBackNotation/CarnotKE | jyhton/Neo4j/WDB-new/ext/apache-ant-1.7.0/bin/runant.py | 126 | 3285 | #!/usr/bin/python
# 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 "Licen... | apache-2.0 |
NZRS/content-analysis | netflix.py | 2 | 3126 | from bs4 import BeautifulSoup
from urllib2 import quote
import unicodedata
import requests
import json
import glob
import pandas as pd
movie_list = []
for page in glob.glob('*.html'):
with open(page, 'r+') as f:
my_page = f.read()
my_soup = BeautifulSoup(my_page)
for div in my_soup.find_al... | agpl-3.0 |
rcoscali/external-chromium-trace | trace-viewer/build/flatten.py | 10 | 1656 | #!/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.
import optparse
import calcdeps
import sys
import StringIO
def flatten_module_contents(filenames):
out = StringIO.StringIO()
lo... | bsd-3-clause |
RonnyPfannschmidt/pytest | testing/test_monkeypatch.py | 3 | 12327 | import os
import re
import sys
import textwrap
from pathlib import Path
from typing import Dict
from typing import Generator
from typing import Type
import pytest
from _pytest.monkeypatch import MonkeyPatch
from _pytest.pytester import Pytester
@pytest.fixture
def mp() -> Generator[MonkeyPatch, None, None]:
cwd ... | mit |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.5.0/Lib/unittest/test/testmock/testmock.py | 3 | 47728 | import copy
import sys
import tempfile
import unittest
from unittest.test.testmock.support import is_instance
from unittest import mock
from unittest.mock import (
call, DEFAULT, patch, sentinel,
MagicMock, Mock, NonCallableMock,
NonCallableMagicMock, _CallList,
create_autospec
)
class Iter(object):
... | mit |
AltSchool/django | tests/view_tests/generic_urls.py | 329 | 1356 | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.views.generic import RedirectView
from . import views
from .models import Article, DateArticle
date_based_info_dict = {
'queryset': Article.objects.all()... | bsd-3-clause |
k4cg/nichtparasoup | examples/nichtparasoup-imagecrawler-plugin/tests/test_10_nichtparasoup_placeholders/test_dummyimage.py | 1 | 4465 | import unittest
from typing import Type
from nichtparasoup_placeholders import DummyImage
from nichtparasoup.imagecrawler import BaseImageCrawler
from nichtparasoup.testing.imagecrawler import ImageCrawlerLoaderTest
_DUMMYIMAGE_RIGHT_CONFIG = {'width': 800, 'height': 600}
class DummyImageConfigCorrect(unittest.Tes... | mit |
renatofb/weblate | weblate/trans/tests/__init__.py | 9 | 1835 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.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, eithe... | gpl-3.0 |
Manuel4131/youtube-dl | youtube_dl/extractor/philharmoniedeparis.py | 116 | 2696 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
float_or_none,
int_or_none,
parse_iso8601,
xpath_text,
)
class PhilharmonieDeParisIE(InfoExtractor):
IE_DESC = 'Philharmonie de Paris'
_VALID_URL = r'http://live\.philharmoniedepari... | unlicense |
jgraham/treeherder | treeherder/etl/perf_data_adapters.py | 2 | 12451 | import logging
import math
from hashlib import sha1
import simplejson as json
from jsonschema import validate
from simplejson import encoder
logger = logging.getLogger(__name__)
encoder.FLOAT_REPR = lambda o: format(o, '.2f')
class PerformanceDataAdapter(object):
"""
Base class for translating different p... | mpl-2.0 |
jakeylube95/namebench | nb_third_party/dns/rdtypes/dsbase.py | 248 | 3445 | # Copyright (C) 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND NOMIN... | apache-2.0 |
lecaoquochung/ddnb.django | tests/utils_tests/test_timezone.py | 13 | 5318 | import copy
import datetime
import pickle
import unittest
try:
import pytz
except ImportError:
pytz = None
from django.test import override_settings
from django.utils import timezone
if pytz is not None:
CET = pytz.timezone("Europe/Paris")
EAT = timezone.get_fixed_timezone(180) # Africa/Nairobi
ICT... | bsd-3-clause |
40223235/w16b_test | static/Brython3.1.1-20150328-091302/Lib/warnings.py | 752 | 13825 | """Python part of the warnings subsystem."""
# Note: function level imports should *not* be used
# in this module as it may cause import lock deadlock.
# See bug 683658.
import linecache
import sys
__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
"resetwarnings", "catch_warnings"]
def... | agpl-3.0 |
marcelloceschia/asterisk-11-extended_codec | res/pjproject/tests/automated/run_continuous.py | 100 | 3442 | #!/usr/bin/python
import os
import sys
import time
import datetime
import ccdash
INTERVAL = 300
DELAY = 0
ONCE = False
SUFFIX = ""
FORCE = False
def run_scenarios(scenarios, group):
# Run each scenario
rc = 0
for scenario in scenarios:
argv = []
argv.append("ccdash.py")
argv.append("scenario")
argv.append(... | gpl-2.0 |
porridge/apt-forktracer | lib/apt_forktracer/tests/test_reporter.py | 1 | 2589 | #!/usr/bin/python3
# apt-forktracer - a utility for managing package versions
# Copyright (C) 2008,2010,2019 Marcin Owsiany <porridge@debian.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... | gpl-2.0 |
filias/django | tests/gis_tests/test_geoforms.py | 26 | 15044 | from unittest import skipUnless
from django.contrib.gis import forms
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import GEOSGeometry
from django.forms import ValidationError
from django.test import SimpleTestCase, override_settings, skipUnlessDBFeature
from django.utils.html import escape... | bsd-3-clause |
suttond/MODOI | ase/test/tasks/dcdft.py | 2 | 44744 | """Collection of bulk systems.
From here::
http://molmod.ugent.be/DeltaCodesDFT
Data extracted to csv file with
* Wien2K ref:
pdftotext -layout -f 13 -l 14 SupplMat.pdf - | sed -n '/text file/,$p' \
| grep -E -v "text" | sed '/^$/d' | tr '\f' ' ' \
| sed 's/,WIEN2k//g' | sed 's/V0/formula,V... | lgpl-3.0 |
zangsir/ANNIS | Misc/pygments-main/pygments/unistring.py | 51 | 51150 | # -*- coding: utf-8 -*-
"""
pygments.unistring
~~~~~~~~~~~~~~~~~~
Strings of all Unicode characters of a certain category.
Used for matching in Unicode-aware languages. Run to regenerate.
Inspired by chartypes_create.py from the MoinMoin project.
:copyright: Copyright 2006-2015 by the Pygment... | apache-2.0 |
KellyChan/python-examples | javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/db/backends/mysql/base.py | 11 | 20045 | """
MySQL database backend for Django.
Requires MySQLdb: http://sourceforge.net/projects/mysql-python
"""
import datetime
import re
import sys
import warnings
try:
import MySQLdb as Database
except ImportError, e:
from django.core.exceptions import ImproperlyConfigured
raise ImproperlyConfigured("Error l... | mit |
jkern/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/ilink32.py | 61 | 2096 | """SCons.Tool.ilink32
XXX
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without re... | apache-2.0 |
rafaellehmkuhl/OpenCV-Python-GUI | CvPyGui/PlotContainer.py | 1 | 2407 | import pandas as pd
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QWidget, QLabel, QHBoxLayout,
QVBoxLayout, QPushButton, QSlider,
QComboBox)
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.bac... | mit |
robhudson/zamboni | apps/discovery/urls.py | 6 | 1844 | from django.conf.urls import include, patterns, url
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from addons.urls import ADDON_ID
from . import views
# These will all start with /addon/<addon_id>/
addon_patterns = patterns('',
url('^$', views.addon_detail, name='discovery.ad... | bsd-3-clause |
Eagles2F/sync-engine | tests/imap/test_folder_state.py | 3 | 3034 | from inbox.crispin import RawFolder
from inbox.models import Folder
from inbox.mailsync.backends.imap.monitor import ImapSyncMonitor
from inbox.models.backends.imap import ImapFolderInfo, ImapFolderSyncStatus
def add_imap_status_info_rows(folder_id, account_id, db_session):
"""Add placeholder ImapFolderSyncStatus... | agpl-3.0 |
seanli9jan/tensorflow | tensorflow/contrib/lite/python/__init__.py | 10 | 1096 | # 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 |
pilou-/ansible | lib/ansible/module_utils/network/eos/providers/module.py | 18 | 2091 | #
# (c) 2019, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.connection import Connection
from ansible.module_utils.network.eos.providers import providers
from ansible.m... | gpl-3.0 |
UManPychron/pychron | pychron/core/i_datastore.py | 2 | 1325 | # ===============================================================================
# Copyright 2014 Jake Ross
#
# 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/licens... | apache-2.0 |
ilpianista/ansible | lib/ansible/parsing/splitter.py | 49 | 11324 | # (c) 2014 James Cammarata, <jcammarata@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 Foundation, either version 3 of the License, or
# (at your option) any late... | gpl-3.0 |
openplans/shareabouts-pbcambridge | src/project/urls.py | 19 | 1293 | from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
admin.autodiscover()
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
# By default, static assets will ... | gpl-3.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/flask/sessions.py | 428 | 13107 | # -*- coding: utf-8 -*-
"""
flask.sessions
~~~~~~~~~~~~~~
Implements cookie based sessions based on itsdangerous.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import uuid
import hashlib
from base64 import b64encode, b64decode
from datetime import dateti... | agpl-3.0 |
higebu/clime | clime/util.py | 4 | 1648 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''It contains the helper functions.'''
import inspect
def json(s):
'''Convert a JSON string `s` into a Python's type.'''
import json
return json.loads(s)
def autotype(s):
'''Automatively detect the type (int, float or string) of `s` and convert
`s` ... | mit |
AmrThabet/CouchPotatoServer | libs/git/files.py | 122 | 1831 | # Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com>
# 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 li... | gpl-3.0 |
ryfeus/lambda-packs | Selenium_PhantomJS/source/pip/_vendor/six.py | 2715 | 30098 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# 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 with... | mit |
appuio/ansible-role-openshift-zabbix-monitoring | vendor/openshift-tools/ansible/roles/lib_openshift_3.2/build/ansible/oadm_project.py | 13 | 3717 | # pylint: skip-file
def main():
'''
ansible oc module for project
'''
module = AnsibleModule(
argument_spec=dict(
kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'),
state=dict(default='present', type='str',
choices=['prese... | apache-2.0 |
shaglou/dotfiles | vim/autoload/conque_term/conque_sole_wrapper.py | 30 | 8791 | # FILE: autoload/conque_term/conque_sole_wrapper.py
# AUTHOR: Nico Raffo <nicoraffo@gmail.com>
# WEBSITE: http://conque.googlecode.com
# MODIFIED: 2011-09-02
# VERSION: 2.3, for Vim 7.0
# LICENSE:
# Conque - Vim terminal/console emulator
# Copyright (C) 2009-2011 Nico Raffo
#
# MIT License
#
# Permission is he... | mit |
adamcandy/QGIS-Meshing | extras/old_release_versions/mesh_netcdf/resources_rc.py | 3 | 6595 | # -*- coding: utf-8 -*-
##########################################################################
#
# QGIS-meshing plugins.
#
# Copyright (C) 2012-2013 Imperial College London and others.
#
# Please see the AUTHORS file in the main source directory for a
# full list of copyright holders.
#
# Dr Adam S. C... | lgpl-2.1 |
rubyinhell/brython | www/benchmarks/performance/util.py | 18 | 1129 | #!/usr/bin/env python
"""Utility code for benchmark scripts."""
__author__ = "collinwinter@google.com (Collin Winter)"
import math
#import operator
def run_benchmark(take_geo_mean, num_runs, bench_func, *args):
"""Run the given benchmark, print results to stdout.
Args:
options: optparse.Values inst... | bsd-3-clause |
ephoning/heroku-buildpack-python | vendor/pip-1.3.1/pip/vcs/git.py | 64 | 8929 | import tempfile
import re
import os.path
from pip.util import call_subprocess
from pip.util import display_path, rmtree
from pip.vcs import vcs, VersionControl
from pip.log import logger
from pip.backwardcompat import url2pathname, urlparse
urlsplit = urlparse.urlsplit
urlunsplit = urlparse.urlunsplit
class Git(Versi... | mit |
tcheneau/NDprotector | scapy6send/cert.py | 3 | 93309 | #!/usr/bin/env python
#############################################################################
## ##
## cert.py --- X.509 Certificate and CRL module (openssl wrapper) ##
## ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.