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 |
|---|---|---|---|---|---|
no-net/gr-winelo | python/channel/models/const_multi_cc.py | 1 | 1510 | from gnuradio import gr
class const_multi_cc(gr.hier_block2):
""" Constant channel model.
"""
def __init__(self, tx_id, rx_id,
k11=0.0, k12=1.0, k13=1.0,
k21=1.0, k22=0.0, k23=1.0,
k31=1.0, k32=1.0, k33=0.0):
gr.hier_block2.__init__(
s... | gpl-3.0 |
fnp/wolnelektury | src/social/migrations/0012_auto_20210120_1444.py | 1 | 1182 | # Generated by Django 2.2.16 on 2021-01-20 13:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('social', '0011_auto_20190807_1056'),
]
operations = [
migrations.AlterModelOptions(
name='carousel',
options={'verb... | agpl-3.0 |
yeming233/rally | rally/plugins/openstack/verification/tempest/config.py | 1 | 9370 | # Copyright 2014: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
rvalyi/OpenUpgrade | addons/product_margin/__openerp__.py | 121 | 1927 | # -*- 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 |
neteler/QGIS | python/plugins/processing/algs/lidar/lastools/lasgrid.py | 9 | 3382 | # -*- coding: utf-8 -*-
"""
***************************************************************************
lasgrid.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
---------------------
D... | gpl-2.0 |
dan1/horizon-proto | openstack_dashboard/api/__init__.py | 8 | 2280 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright 2013 Big Switch Networks
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use th... | apache-2.0 |
Tejas-Subramanya/RYU_MEC | ryu/services/protocols/vrrp/sample_router.py | 27 | 20622 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 Isaku Yamahata <yamahata at private email ne jp>
#
# 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
#
# h... | apache-2.0 |
leoliujie/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 |
Yannig/ansible-modules-core | cloud/openstack/os_server.py | 9 | 14843 | #!/usr/bin/python
# coding: utf-8 -*-
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
# Copyright (c) 2013, John Dewey <john@dewey.ws>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publi... | gpl-3.0 |
robk5uj/invenio | modules/websubmit/lib/functions/Second_Report_Number_Generation.py | 33 | 18015 | # -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 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
## License, or (a... | gpl-2.0 |
evlyapin/ansible-modules-core | web_infrastructure/htpasswd.py | 99 | 8780 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Nimbis Services, 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
# (... | gpl-3.0 |
softlayer/softlayer-python | SoftLayer/managers/network.py | 2 | 30739 | """
SoftLayer.network
~~~~~~~~~~~~~~~~~
Network Manager/helpers
:license: MIT, see LICENSE for more details.
"""
import collections
import json
import logging
from SoftLayer.decoration import retry
from SoftLayer import exceptions
from SoftLayer import utils
from SoftLayer.managers import event_log
... | mit |
steedos/odoo | addons/l10n_be/wizard/l10n_be_partner_vat_listing.py | 302 | 14738 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# Corrections & modifications by Noviat nv/sa, (http://www.noviat.be):
# - VAT listing based upon year... | agpl-3.0 |
cnsoft/kbengine-cocos2dx | kbe/src/lib/python/Tools/pybench/CommandLine.py | 47 | 16870 | """ CommandLine - Get and parse command line options
NOTE: This still is very much work in progress !!!
Different version are likely to be incompatible.
TODO:
* Incorporate the changes made by (see Inbox)
* Add number range option using srange()
"""
from __future__ import print_function
__cop... | lgpl-3.0 |
dorant/home-assistant | homeassistant/components/keyboard.py | 13 | 2654 | """
homeassistant.components.keyboard
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides functionality to emulate keyboard presses on host machine.
"""
import logging
from homeassistant.const import (
SERVICE_VOLUME_UP, SERVICE_VOLUME_DOWN, SERVICE_VOLUME_MUTE,
SERVICE_MEDIA_NEXT_TRACK, SERVICE_MEDIA_PREVIOUS_TRACK,
... | mit |
kaiyuanheshang/zulip | zerver/templatetags/app_filters.py | 125 | 1391 | from django.template import Library
register = Library()
def and_n_others(values, limit):
# A helper for the commonly appended "and N other(s)" string, with
# the appropriate pluralization.
return " and %d other%s" % (len(values) - limit,
"" if len(values) == limit + 1 else... | apache-2.0 |
chrrrles/ansible-modules-extras | network/nmcli.py | 61 | 40842 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Chris Long <alcamie@gmail.com> <chlong@redhat.com>
#
# This file is a module for Ansible that interacts with Network Manager
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#... | gpl-3.0 |
JunhwanPark/TizenRT | external/iotivity/iotivity_1.3-rel/build_common/iotivityconfig/compiler/gcc_configuration.py | 64 | 4297 | # ------------------------------------------------------------------------
# Copyright 2015 Intel 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/li... | apache-2.0 |
sparkslabs/kamaelia | Sketches/PT/BouncingCatGame/Simplegame.py | 3 | 8013 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ve... | apache-2.0 |
julienvey/solum | solum/openstack/common/db/sqlalchemy/utils.py | 7 | 20415 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2010-2011 OpenStack Foundation.
# Copyright 2012 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | apache-2.0 |
tdhopper/scikit-learn | sklearn/decomposition/factor_analysis.py | 206 | 11946 | """Factor Analysis.
A latent linear variable model.
FactorAnalysis is similar to probabilistic PCA implemented by PCA.score
While PCA assumes Gaussian noise with the same variance for each
feature, the FactorAnalysis model assumes different variances for
each of them.
This implementation is based on David Barber's B... | bsd-3-clause |
robocomp/robocomp-robolab | components/localization/UWBpublisher/src/genericworker.py | 1 | 4050 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 by YOUR NAME HERE
#
# This file is part of RoboComp
#
# RoboComp 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 o... | gpl-3.0 |
IMCG/RamCloud | scripts/common.py | 7 | 10155 | #!/usr/bin/env python
# Copyright (c) 2010 Stanford University
#
# Permission to use, copy, modify, and distribute this software 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 T... | isc |
fr34kyn01535/PyForum | modules/header.html.py | 1 | 3727 | # -*- coding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
STOP_RENDERING = runtime.STOP_RENDERING
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 10
_modified_time = 1449340931.2884288
_enable_loop = True
_template_filename = 'templates/header.html'
_template_uri ... | gpl-2.0 |
analyseuc3m/ANALYSE-v1 | cms/djangoapps/contentstore/management/commands/tests/test_force_publish.py | 34 | 4436 | """
Tests for the force_publish management command
"""
import mock
from django.core.management import call_command, CommandError
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, Ite... | agpl-3.0 |
huang4fstudio/django | tests/auth_tests/test_handlers.py | 328 | 2868 | from __future__ import unicode_literals
from django.contrib.auth.handlers.modwsgi import (
check_password, groups_for_user,
)
from django.contrib.auth.models import Group, User
from django.contrib.auth.tests.custom_user import CustomUser
from django.test import TransactionTestCase, override_settings
# This must ... | bsd-3-clause |
taiwenko/python | Visa.py | 1 | 3504 | #!c:\Python27\python
import vxi11Device as vxi11
#import numpy
import os,sys, time
# FSW
#['Rohde&Schwarz', 'FSW-50', '1312.8000K50/100970', '2.10\n']
#inst = rm.open_resource('TCPIP::10.0.0.160::INSTR')
#SMW200A
#['Rohde&Schwarz', 'SMW200A', '1412.0000K02/101575', '3.1.18.2-3.01.086.171_SP2\n']
#inst... | mit |
joerocklin/gem5 | src/mem/slicc/ast/ExprStatementAST.py | 33 | 2360 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | bsd-3-clause |
kaarolch/ansible | lib/ansible/modules/system/openwrt_init.py | 23 | 6930 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Andrew Gaffney <andrew@agaffney.org>
#
# 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 L... | gpl-3.0 |
vFense/vFenseAgent-nix | agent/deps/rpm6/Python-2.7.5/lib/python2.7/test/test_shutil.py | 45 | 30948 | # Copyright (C) 2003 Python Software Foundation
import unittest
import shutil
import tempfile
import sys
import stat
import os
import os.path
import errno
from os.path import splitdrive
from distutils.spawn import find_executable, spawn
from shutil import (_make_tarball, _make_zipfile, make_archive,
... | lgpl-3.0 |
tkelman/utf8rewind | tools/gyp/test/make_global_settings/basics/gyptest-make_global_settings.py | 81 | 1139 | #!/usr/bin/env python
# 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.
"""
Verifies make_global_settings.
"""
import os
import sys
import TestGyp
test_format = ['ninja']
if sys.platform in ('linux2', 'darwin')... | mit |
codeforamerica/skillcamp | ENV/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py | 75 | 85273 | # postgresql/base.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: postgresql
:name: PostgreSQL
Sequences/SERIAL
--------------... | mit |
dmsurti/mayavi | tvtk/tools/tvtk_doc.py | 1 | 13554 | """
Utility code that provides classes helpful in choosing a suitable TVTK
class. It does this by providing a list of all the classes along with
the option to be able to search for the documentation.
The nice thing about the UI is that it performs some kind of completion
on names typed by the user, plus it allows us... | bsd-3-clause |
wh1100717/AutobahnPython | examples/twisted/websocket/echo_compressed/client_advanced.py | 18 | 4393 | ###############################################################################
##
## Copyright (C) 2011-2013 Tavendo GmbH
##
## 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
##
## h... | apache-2.0 |
HPENetworking/PYHPEIMC | docs/conf.py | 3 | 5330 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# PYHPEIMC documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 9 08:40:34 2016.
#
# 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
# a... | apache-2.0 |
anarcher/enso-launcher-continued | enso/commands/suggestions.py | 1 | 18589 | # Copyright (c) 2008, Humanized, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditio... | bsd-3-clause |
smarkets/raven-python | raven/contrib/bottle/utils.py | 25 | 1045 | """
raven.contrib.bottle.utils
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import logging
from raven.utils.compat import _urlparse
from raven.utils.wsgi import get_header... | bsd-3-clause |
bealdav/OCB | addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py | 384 | 8450 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
falcong/or-tools | examples/python/langford.py | 32 | 3192 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
mdietrichc2c/account-financial-reporting | __unported__/account_chart_report/report/chart_of_accounts.py | 34 | 2246 | # -*- coding: utf-8 -*-
###############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Savoir-faire Linux (<www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the ... | agpl-3.0 |
ignaeche/barf-project | barf/barf/arch/arm/armbase.py | 7 | 18487 | # Copyright (c) 2014, Fundacion Dr. Manuel Sadosky
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condit... | bsd-2-clause |
porduna/weblabdeusto | server/src/test/stress/voodoo/sessions/manager_print.py | 3 | 2099 | #!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individual... | bsd-2-clause |
hgl888/crosswalk-android-extensions | build/idl-generator/third_party/WebKit/Source/bindings/scripts/idl_validator.py | 78 | 5099 | # Copyright (C) 2013 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 |
mikewiebe-ansible/ansible | lib/ansible/modules/network/fortimanager/fmgr_device_provision_template.py | 21 | 58532 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
ffmmjj/desafio-dados-2016 | data_preparation_pipeline/outliers_separation.py | 1 | 1185 | import luigi
import pandas as pd
from augment_data import AppendFeaturesAggregatedFromTeachersDatasetToSchool
class SplitSchoolOutliersData(luigi.Task):
input_task = AppendFeaturesAggregatedFromTeachersDatasetToSchool()
def requires(self):
return self.input_task
def output(self):
return... | apache-2.0 |
iamutkarshtiwari/sympy | sympy/vector/functions.py | 66 | 13904 | from sympy.vector.coordsysrect import CoordSysCartesian
from sympy.vector.dyadic import Dyadic
from sympy.vector.vector import Vector, BaseVector
from sympy.vector.scalar import BaseScalar
from sympy import sympify, diff, integrate, S
def express(expr, system, system2=None, variables=False):
"""
Global functi... | bsd-3-clause |
imzcy/JavaScriptExecutable | thirdparty/v8/src/tools/testrunner/objects/__init__.py | 651 | 1571 | # Copyright 2012 the V8 project authors. 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 conditi... | mit |
piskvorky/gensim | gensim/scripts/glove2word2vec.py | 4 | 3964 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Radim Rehurek <radimrehurek@seznam.cz>
# Copyright (C) 2016 Manas Ranjan Kar <manasrkar91@gmail.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This script allows to convert GloVe vectors into the word2vec. Both fi... | lgpl-2.1 |
wehlutyk/Watson | scripts/fuzzer.py | 1 | 1043 | import arrow
import random
from watson import Watson
watson = Watson(frames=None, current=None)
projects = [
("apollo11", ["reactor", "module", "wheels", "steering", "brakes"]),
("hubble", ["lens", "camera", "transmission"]),
("voyager1", ["probe", "generators", "sensors", "antenna"]),
("voyager2", [... | mit |
Geode/geonode | geonode/contrib/favorite/tests.py | 21 | 8021 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
nedbat/zellij | tests/test_intersection.py | 1 | 1510 | from hypothesis import assume, given
from hypothesis.strategies import builds, lists, integers, tuples
from zellij.defuzz import Defuzzer
from zellij.euclid import collinear, Segment, BadGeometry
from zellij.intersection import segment_intersections
from zellij.postulates import all_pairs
nums = integers(min_value=-... | apache-2.0 |
patcon/open-cabinet | venv/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/operations.py | 64 | 10630 | """
This module contains the spatial lookup types, and the `get_geo_where_clause`
routine for Oracle Spatial.
Please note that WKT support is broken on the XE version, and thus
this backend will not work on such platforms. Specifically, XE lacks
support for an internal JVM, and Java libraries are required to use... | mit |
riscmaster/risc_maap | risc_control/src/circles3_traj.py | 2 | 3789 | #!/usr/bin/env python
'''======================================================
Created by: D. Spencer Maughan
Last updated: July 2015
File name: circles3_traj.py
Organization: RISC Lab, Utah State University
======================================================'''
import roslib; roslib... | bsd-2-clause |
reingart/support-tools | googlecode-issues-exporter/github_issue_converter.py | 50 | 16479 | # Copyright 2013 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 |
jeremykid/Algorithm_project | trial_division.py | 1 | 1193 | import math
import time
def primeGenerate(number):
largest = number
prime_list = largest*[1]
if (number<4):
return [2,3]
prime_list[1] = 0
for i in range(0,largest,2):
prime_list[i] = 0
prime_list[2] = 1
for i in range(3,largest,2):
if (prime_list[i] == 1):
... | mit |
KISSMonX/micropython | stmhal/boards/STM32F4DISC/staccel.py | 66 | 3312 | """
Driver for accelerometer on STM32F4 Discover board.
Sets accelerometer range at +-2g.
Returns list containing X,Y,Z axis acceleration values in 'g' units (9.8m/s^2).
See:
STM32Cube_FW_F4_V1.1.0/Drivers/BSP/Components/lis302dl/lis302dl.h
STM32Cube_FW_F4_V1.1.0/Drivers/BSP/Components/lis302dl/lis302dl.c
... | mit |
richardcs/ansible | test/units/module_utils/basic/test_no_log.py | 30 | 6152 | # -*- coding: utf-8 -*-
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
# (c) 2017, 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
from units.compat import unittest
... | gpl-3.0 |
sgibbes/carbon-budget | gain/utilities.py | 1 | 4640 | import subprocess
import glob
import sys
sys.path.append('../')
import constants_and_names as cn
def s3_folder_download(source, dest):
cmd = ['aws', 's3', 'cp', source, dest, '--recursive']
subprocess.check_call(cmd)
def s3_file_download(source, dest):
cmd = ['aws', 's3', 'cp', source, dest]
subproces... | apache-2.0 |
hzj123/56th | pombola/place_data/bin/import_place_data.py | 5 | 3048 | #!/usr/bin/env python
import sys
import csv
import os
import decimal
os.environ['DJANGO_SETTINGS_MODULE'] = 'pombola.settings'
sys.path.append('../../../')
sys.path.append('../../')
from django.utils.text import slugify
from pombola.core.models import Place
from pombola.place_data.models import Entry
place_kind_sl... | agpl-3.0 |
r8b7xy/qutebrowser | tests/unit/utils/overflow_test_cases.py | 5 | 2309 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
dwhoman/CVPI | tests/hypothesis/testing_hypothesis.py | 1 | 2209 | import subprocess
import numpy as np
import hypothesis as h
import hypothesis.strategies as st
import hypothesis.extra.numpy as hnp
#h.settings(buffer_size = 819200000)
min_img_width = 1
min_img_height = 1
max_img_width = 10
max_img_height = 10
max_uint32 = 2**32 - 1
max_int32 = 2**31 - 1
min_int32 = -(2**31)
max_sho... | apache-2.0 |
a-parhom/edx-platform | common/test/acceptance/fixtures/config.py | 14 | 3153 | """
Fixture to manipulate configuration models.
"""
import json
import re
import requests
from lazy import lazy
from common.test.acceptance.fixtures import LMS_BASE_URL, STUDIO_BASE_URL
class ConfigModelFixtureError(Exception):
"""
Error occurred while configuring the stub XQueue.
"""
pass
class C... | agpl-3.0 |
thnee/ansible | test/units/modules/network/check_point/test_cp_mgmt_threat_exception.py | 19 | 4108 | # Ansible module to manage CheckPoint Firewall (c) 2019
#
# 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 dist... | gpl-3.0 |
nakul02/systemml | src/main/python/systemml/classloader.py | 4 | 7952 | #-------------------------------------------------------------
#
# 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... | apache-2.0 |
OddEssay/ansible | contrib/inventory/rax.py | 98 | 15875 | #!/usr/bin/env python
# (c) 2013, Jesse Keating <jesse.keating@rackspace.com,
# Paul Durivage <paul.durivage@rackspace.com>,
# Matt Martz <matt@sivel.net>
#
# 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 Pu... | gpl-3.0 |
theanalyst/cinder | cinder/db/sqlalchemy/api.py | 1 | 94793 | # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2014 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you... | apache-2.0 |
pombredanne/MOG | nova/tests/compute/test_vmmode.py | 11 | 1575 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012 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... | apache-2.0 |
openelisglobal/openelisglobal-core | liquibase/OE5.1/testCatalogKenya/Scripts/testEntry.py | 9 | 4182 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
test_names = []
test_sections = []
sample_types = []
descriptions = []
print_names = []
old_sort = []
uom = []
loinc_codes = []
sort_order = []
name_file = open('testName.txt','r')
test_section_file = open("testSections.txt",'r')
sample_type_file = open("... | mpl-2.0 |
Azure/azure-sdk-for-python | sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py | 1 | 3246 | # 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 may ... | mit |
dholbach/snapcraft | snapcraft/tests/test_commands_init.py | 2 | 2941 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015, 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in... | gpl-3.0 |
tudennis/LeetCode---kamyu104-11-24-2015 | Python/k-diff-pairs-in-an-array.py | 2 | 1483 | # Time: O(n)
# Space: O(n)
# Total Accepted: 5671
# Total Submissions: 20941
# Difficulty: Easy
# Contributors: murali.kf370
# Given an array of integers and an integer k,
# you need to find the number of unique k-diff pairs in the array.
# Here a k-diff pair is defined as an integer pair (i, j),
# where i and j are ... | mit |
edwardzhou1980/bite-project | server/handlers/storage_handler.py | 17 | 10284 | # Copyright 2011 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 |
miptliot/edx-platform | lms/djangoapps/courseware/management/commands/regrade_partial.py | 5 | 6545 | '''
This is a one-off command aimed at fixing a temporary problem encountered where partial credit was awarded for
code problems, but the resulting score (or grade) was mistakenly set to zero because of a bug in
CorrectMap.get_npoints().
'''
import json
import logging
from optparse import make_option
from django.core... | agpl-3.0 |
projectcalico/calico-neutron | neutron/neutron_plugin_base_v2.py | 17 | 14715 | # Copyright 2011 VMware, 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 ... | apache-2.0 |
simonwydooghe/ansible | test/units/modules/network/exos/test_exos_config.py | 38 | 11863 | #
# (c) 2018 Extreme Networks 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.
#
# Ans... | gpl-3.0 |
lepistone/odoo | addons/l10n_fr_rib/__openerp__.py | 425 | 2754 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Numérigraphe SARL.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... | agpl-3.0 |
GuillaumeGomez/servo | tests/wpt/web-platform-tests/tools/manifest/tests/test_XMLParser.py | 142 | 1445 | from xml.etree.ElementTree import ParseError
import pytest
from ..XMLParser import XMLParser
@pytest.mark.parametrize("s", [
'<foo> </foo>',
'<!DOCTYPE foo><foo> </foo>',
'<!DOCTYPE foo PUBLIC "fake" "id"><foo> </foo>',
'<!DOCTYPE foo PUBLIC "fake" "http://www.w3.org/TR/xhtml1/DTD/xht... | mpl-2.0 |
Darkmoth/python-django-4 | Thing/env/Lib/site-packages/setuptools/command/alias.py | 467 | 2381 | from distutils.errors import DistutilsOptionError
from setuptools.command.setopt import edit_config, option_base, config_file
def shquote(arg):
"""Quote an argument for later parsing by shlex.split()"""
for c in '"', "'", "\\", "#":
if c in arg:
return repr(arg)
if arg.split() != [arg... | gpl-2.0 |
kerr-huang/Testerman | plugins/probes/configurationfile/ConfigurationFileProbe.py | 2 | 9951 | # -*- coding: utf-8 -*-
##
# This file is part of Testerman, a test automation system.
# Copyright (c) 2008-2013 Sebastien Lefevre and other contributors
#
# 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
# Fo... | gpl-2.0 |
catapult-project/catapult | third_party/gsutil/third_party/pyasn1/tests/type/test_opentype.py | 6 | 2676 | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
try:
import unittest2 as unittest
except ImportError:
import unittest
from tests.base import BaseTestCase
from pyasn1.type import univ
from ... | bsd-3-clause |
cfairweather/adafruit-led-pixels | gluon/contrib/pymysql/tests/test_SSCursor.py | 46 | 3641 | import sys
try:
from pymysql.tests import base
import pymysql.cursors
except:
# For local testing from top-level directory, without installing
sys.path.append('../pymysql')
from pymysql.tests import base
import pymysql.cursors
class TestSSCursor(base.PyMySQLTestCase):
def test_SSCursor(sel... | gpl-2.0 |
PriceChild/ansible | lib/ansible/module_utils/docker_common.py | 24 | 18325 | #
# Copyright 2016 Red Hat | Ansible
#
# 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.
#
# ... | gpl-3.0 |
loveyoupeng/rt | modules/web/src/main/native/Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py | 5 | 7321 | # 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 ... | gpl-2.0 |
nelango/ViralityAnalysis | model/lib/sklearn/gaussian_process/gaussian_process.py | 78 | 34552 | # -*- coding: utf-8 -*-
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# (mostly translation, see implementation details)
# Licence: BSD 3 clause
from __future__ import print_function
import numpy as np
from scipy import linalg, optimize
from ..base import BaseEstimator, RegressorMixin
from ..metrics... | mit |
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/PIL/CurImagePlugin.py | 17 | 2071 | #
# The Python Imaging Library.
# $Id$
#
# Windows Cursor support for PIL
#
# notes:
# uses BmpImagePlugin.py to read the bitmap data.
#
# history:
# 96-05-27 fl Created
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1996.
#
# See the README file for information on usage and redist... | bsd-3-clause |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.4.3/Lib/mimetypes.py | 8 | 17638 | """Guess the MIME type of a file.
This module defines two useful functions:
guess_type(url, strict=1) -- guess the MIME type and encoding of a URL.
guess_extension(type, strict=1) -- guess the extension for a given MIME type.
It also contains the following, for tuning the behavior:
Data:
knownfiles -- list of fil... | mit |
odejesush/tensorflow | tensorflow/python/training/supervisor.py | 15 | 41772 | # 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 |
tomkralidis/pywps | pywps/processing/job.py | 1 | 3570 | ##################################################################
# Copyright 2018 Open Source Geospatial Foundation and others #
# licensed under MIT, Please consult LICENSE.txt for details #
##################################################################
import os
import tempfile
import pywps.configuratio... | mit |
sbalde/edx-platform | openedx/core/lib/django_test_client_utils.py | 80 | 1717 | """
This file includes the monkey-patch for requests' PATCH method, as we are using
older version of django that does not contains the PATCH method in its test client.
"""
# pylint: disable=protected-access
from __future__ import unicode_literals
from urlparse import urlparse
from django.test.client import RequestF... | agpl-3.0 |
jcmcclurg/serverpower | profiling/defaultGetSetpoints.py | 1 | 1840 | #!/usr/bin/python
import numpy
import re
import cPickle as pickle
import gzip
import time
def getSetpointsFromRaw(filename,verbose=False):
printEvery = 1
if(verbose):
startTime = time.time()
print "Opened raw file %s."%(filename)
else:
startTime = 0
f=open(filename,'rb')
data = []
for line in f:
if re.... | gpl-2.0 |
denis-pitul/django | tests/gis_tests/layermap/models.py | 67 | 2507 | from django.utils.encoding import python_2_unicode_compatible
from ..models import models
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=25)
objects = models.GeoManager()
class Meta:
abstract = True
required_db_features = ['gis_enabled']
... | bsd-3-clause |
zzzirk/boto | boto/ecs/item.py | 153 | 5510 | # Copyright (c) 2010 Chris Moyer http://coredumped.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, ... | mit |
kaarolch/ansible | lib/ansible/modules/cloud/cloudstack/cs_vmsnapshot.py | 48 | 8721 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
beni55/sympy | sympy/utilities/tests/test_iterables.py | 14 | 26586 | from __future__ import print_function
from textwrap import dedent
from sympy import (
symbols, Integral, Tuple, Dummy, Basic, default_sort_key, Matrix,
factorial, true)
from sympy.combinatorics import RGS_enum, RGS_unrank, Permutation
from sympy.utilities.iterables import (
_partition, _set_partitions, bin... | bsd-3-clause |
eyosen/kernel_htc_endeavoru | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
bacher09/gpackages-metadata | tests/test_news.py | 1 | 1144 | from .utils import TestCase, TESTDATA_DIR
from packages_metadata.generic_metadata import news
import os.path
class TestNews(TestCase):
@classmethod
def setUpClass(cls):
cls.news_dir = os.path.join(TESTDATA_DIR, 'news')
cls.news_titles = [
'ia64-java-removal', 'glib-228', 'gnustep-... | gpl-2.0 |
grrr2/Flexget | tests/test_feed_control.py | 22 | 2148 | from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase
class TestOnlytask(FlexGetBase):
"""
Test --task option
"""
__yaml__ = """
tasks:
test:
mock:
- {title: 'download', url: 'http://localhost/download'}
... | mit |
scifiswapnil/Project-LoCatr | lib/python2.7/site-packages/django/contrib/auth/decorators.py | 115 | 3047 | from functools import wraps
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import PermissionDenied
from django.shortcuts import resolve_url
from django.utils import six
from django.utils.decorators import available_attrs
from django.utils.six.moves.urll... | mit |
rizumu/django | tests/auth_tests/test_context_processors.py | 269 | 6773 | import datetime
from django.contrib.auth import authenticate
from django.contrib.auth.context_processors import PermLookupDict, PermWrapper
from django.contrib.auth.models import Permission, User
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from django.test import SimpleTes... | bsd-3-clause |
MareAtlantica/agora-ciudadana | userena/managers.py | 2 | 10106 | from django.db import models
from django.db.models import Q
from django.contrib.auth.models import User, UserManager, Permission, AnonymousUser
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext as _
from django.utils import timezone
from userena import settings as... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.