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 |
|---|---|---|---|---|---|
geoadmin/mapproxy | mapproxy/test/system/test_formats.py | 5 | 8765 | # This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.de>
#
# 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 |
dymkowsk/mantid | scripts/reduction/instruments/example/example_reducer.py | 3 | 3887 | #pylint: disable=invalid-name
"""
Simple Reducer example
"""
from __future__ import (absolute_import, division, print_function)
from reduction import Reducer
from reduction.instruments.example.ExampleRedStep import ExampleRedStep
# Validate_step is a decorator that allows both Python algorithms and ReductionStep ob... | gpl-3.0 |
di0spyr0s/pants | src/python/pants/backend/core/tasks/minimal_cover.py | 16 | 1126 | # 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.backend.c... | apache-2.0 |
arthru/OpenUpgrade | openerp/service/wsgi_server.py | 37 | 9415 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
boedy1996/SPARC | geonode/people/utils.py | 33 | 3269 | #########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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
#... | gpl-3.0 |
ppyordanov/HCI_4_Future_Cities | Server/src/virtualenv/Lib/site-packages/pip/_vendor/requests/adapters.py | 1 | 14468 | # -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import socket
from .models import Response
from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
from .packages.urllib3.response impo... | mit |
gautam1858/tensorflow | tensorflow/python/debug/lib/debug_utils.py | 24 | 11495 | # 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 |
Akasurde/ansible | lib/ansible/modules/getent.py | 15 | 4258 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, Brian Coca <brian.coca+dev@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: ge... | gpl-3.0 |
andersk/zulip | zerver/management/commands/merge_streams.py | 3 | 3565 | from argparse import ArgumentParser
from typing import Any, List
from zerver.lib.actions import (
bulk_add_subscriptions,
bulk_remove_subscriptions,
do_deactivate_stream,
)
from zerver.lib.cache import cache_delete_many, to_dict_cache_key_id
from zerver.lib.management import ZulipBaseCommand
from zerver.mo... | apache-2.0 |
pczerkas/tempest | tempest/api/compute/admin/test_quotas.py | 3 | 9139 | # Copyright 2012 OpenStack Foundation
# 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 requ... | apache-2.0 |
ndtran/l10n-switzerland | l10n_ch_payment_slip/tests/test_v11_import.py | 9 | 2973 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... | agpl-3.0 |
aljscott/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/changelog.py | 122 | 4368 | # Copyright (C) 2011 Patrick Gansterer <paroga@paroga.com>
#
# 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 conditions and... | bsd-3-clause |
geodrinx/gearthview | ext-libs/twisted/python/test/test_zipstream.py | 2 | 12047 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.zipstream}
"""
import sys
import random
import zipfile
from twisted.python import zipstream, filepath
from twisted.python.hashlib import md5
from twisted.trial import unittest
class FileEntryMixin:
"""
Fi... | gpl-3.0 |
arangodb/arangodb | 3rdParty/V8/v7.9.317/tools/testrunner/local/variants.py | 1 | 2368 | # Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Use this to run several variants of the tests.
ALL_VARIANT_FLAGS = {
"assert_types": [["--assert-types"]],
"code_serializer": [["--cache=code"]],
"... | apache-2.0 |
jaej-dev/Arduino | app/src/processing/app/i18n/python/transifex.py | 75 | 2038 | #!/usr/bin/env python
#vim:set fileencoding=utf-8 sw=2 expandtab
import update
import requests
import json
class Transifex(object):
def __init__(self, user, passwd):
self.auth_ = (user, passwd)
r = requests.get(
'http://www.transifex.com/api/2/project/'
'arduino-ide-15/resource/ide-15/?deta... | lgpl-2.1 |
dscorbett/pygments | pygments/lexers/basic.py | 4 | 27576 | # -*- coding: utf-8 -*-
"""
pygments.lexers.basic
~~~~~~~~~~~~~~~~~~~~~
Lexers for BASIC like languages (other than VB.net).
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, d... | bsd-2-clause |
lebabouin/CouchPotatoServer-develop | couchpotato/core/providers/nzb/binnewz/nzbdownloader.py | 1 | 3562 | # Author: Guillaume Serre <guillaume.serre@gmail.com>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 versi... | gpl-3.0 |
w1ndy/qtile | libqtile/widget/keyboardkbdd.py | 1 | 3411 | # Copyright (c) 2015 Ali Mousavi
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... | mit |
patchew-project/patchew | tests/test_mbox.py | 1 | 3040 | #!/usr/bin/env python3
#
# Copyright 2017 Red Hat, Inc.
#
# Authors:
# Fam Zheng <famz@redhat.com>
#
# This work is licensed under the MIT License. Please see the LICENSE file or
# http://opensource.org/licenses/MIT.
import mbox
from .patchewtest import PatchewTestCase, main
class MboxTest(PatchewTestCase):
... | mit |
yongshengwang/hue | build/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/big5prober.py | 2931 | 1684 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | apache-2.0 |
Averroes/statsmodels | statsmodels/tsa/tests/results/arima211_results.py | 36 | 44583 | import numpy as np
llf = np.array([-239.91961140777])
nobs = np.array([ 202])
k = np.array([ 5])
k_exog = np.array([ 1])
sigma = np.array([ .79249918716869])
chi2 = np.array([ 907.36856676748])
df_model = np.array([ 3])
k_ar = np.array([ 2])
k... | bsd-3-clause |
shardulgo/shardulgo.github.io | site/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py | 2767 | 2174 | # Copyright (c) 2011 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.
"""Applies a fix to CR LF TAB handling in xml.dom.
Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293
Working around this: http://bugs.python.or... | mit |
keedio/hue | desktop/core/ext-py/Django-1.6.10/tests/extra_regress/tests.py | 59 | 14222 | from __future__ import absolute_import, unicode_literals
import datetime
from django.contrib.auth.models import User
from django.test import TestCase
from django.utils.datastructures import SortedDict
from .models import TestObject, Order, RevisionableModel
class ExtraRegressTests(TestCase):
def setUp(self):
... | apache-2.0 |
IAmWave/blekota | src/blekota.py | 1 | 2295 | import argparse
parser = argparse.ArgumentParser(description='Load or create a Blekota model')
parser.add_argument('file',
help='Either a .pkl file containing an existing model or a .wav sound on which to train a new model. If a .wav is provided, other parameters can be used to specify model hyper... | mit |
alex/django-old | django/contrib/gis/utils/ogrinspect.py | 321 | 8939 | """
This module is for inspecting OGR data sources and generating either
models for GeoDjango and/or mapping dictionaries for use with the
`LayerMapping` utility.
Author: Travis Pinney, Dane Springmeyer, & Justin Bronn
"""
from itertools import izip
# Requires GDAL to use.
from django.contrib.gis.gdal import DataSourc... | bsd-3-clause |
hayderimran7/ec2-api | ec2api/tests/functional/botocoreclient.py | 1 | 1492 | # Copyright 2015 OpenStack Foundation
# 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 requ... | apache-2.0 |
jwodder/aptrepo | src/aptrepo/sources.py | 1 | 1579 | from collections import namedtuple
import re
from .archive import Archive
class AptSource(namedtuple('AptSource', 'deb options uri suite components')):
def __str__(self):
sline = self.deb
if self.options:
sline += ' ' + ' '.join(f'{k}={v}' if v is not None else k
... | mit |
charbeljc/OCB | addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py | 337 | 3000 | # -*- 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 |
0xffea/keystone | keystone/common/wsgi.py | 1 | 19339 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2010 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (... | apache-2.0 |
drbild/boto | boto/services/result.py | 153 | 5596 | #!/usr/bin/env python
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rig... | mit |
google/report2bq | application/classes/sa360_report_validation/product_lead_and_cross_sell.py | 1 | 3261 | """
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/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... | apache-2.0 |
catapult-project/catapult | catapult_build/build_steps.py | 3 | 12384 | # Copyright 2016 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 argparse
import json
import os
import sys
# This is the list of tests to run. It is a dictionary with the following
# fields:
#
# name (required): Th... | bsd-3-clause |
ahmadio/edx-platform | cms/djangoapps/course_creators/migrations/0001_initial.py | 114 | 4813 | # -*- 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):
# Adding model 'CourseCreator'
db.create_table('course_creators_coursecreator', (
('id', self.gf... | agpl-3.0 |
bbdj-dev/lessons-python4beginners | src/fibonacci.py | 4 | 1216 | # -*- coding: utf-8 -*-
def succ_fib_from_string(x):
s = "0 1 1 2 3 5 8"
if x < 0:
raise ValueError("Indice negativo non funziona")
else:
try:
return int(s[x*2])
except IndexError:
raise NotImplementedError("non implementato")
def succ_fib_from_list(... | agpl-3.0 |
ioggstream/mysql-utilities | scripts/mysqldiff.py | 3 | 10726 | #!/usr/bin/env python
#
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
#
# 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; version 2 of the License.
#
# This progra... | gpl-2.0 |
mindriot101/bokeh | examples/models/file/transform_jitter.py | 3 | 1673 | import numpy as np
from bokeh.plotting import figure, show, output_file
from bokeh.models.sources import ColumnDataSource
from bokeh.models import CustomJS, Button, LabelSet
from bokeh.models.transforms import Jitter
from bokeh.models.layouts import Column, WidgetBox
N = 1000
source = ColumnDataSource(data=dict(
... | bsd-3-clause |
MakeHer/edx-platform | openedx/core/djangoapps/content/course_structures/tests.py | 42 | 9174 | """
Course Structure Content sub-application test cases
"""
import json
from xmodule_django.models import UsageKey
from xmodule.modulestore.django import SignalHandler
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from ... | agpl-3.0 |
SuicideDev/SuicideCoin | share/qt/extract_strings_qt.py | 2945 | 1844 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... | mit |
Sorsly/subtle | google-cloud-sdk/lib/third_party/prompt_toolkit/layout/controls.py | 23 | 28537 | """
User interface Controls for the layout.
"""
from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
from collections import namedtuple
from six import with_metaclass
from six.moves import range
from prompt_toolkit.cache import SimpleCache
from prompt_toolkit.enums import DEFAULT_BUFFER, SE... | mit |
QuLogic/powerline | powerline/lint/__init__.py | 9 | 21309 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import logging
from collections import defaultdict
from itertools import chain
from functools import partial
from powerline import generate_config_finder, get_config_paths, load_config
from po... | mit |
tyll/bodhi | bodhi/server/scripts/approve_testing.py | 1 | 4185 | # -*- coding: utf-8 -*-
# Copyright © 2013-2017 Red Hat, Inc. and others.
#
# This file is part of Bodhi.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or ... | gpl-2.0 |
feer56/Kitsune2 | kitsune/wiki/migrations/0002_auto_20150430_1304.py | 20 | 6062 | # -*- coding: utf-8 -*-
"""
Update list of locale choices in the `document.locale` and `locale.locale` fields.
"""
from __future__ import unicode_literals
from django.db import models, migrations
import kitsune.sumo.models
class Migration(migrations.Migration):
dependencies = [
('wiki', '0001_initial')... | bsd-3-clause |
besserox/easybuild-easyblocks | easybuild/easyblocks/p/pyquante.py | 12 | 1792 | ##
# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | gpl-2.0 |
chen0031/genie | genie-client/src/main/python/setup.py | 5 | 2629 | """
Copyright 2015 Netflix, 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 agre... | apache-2.0 |
oppia/oppia | core/domain/wipeout_service.py | 2 | 60973 | # Copyright 2020 The Oppia 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 applicable ... | apache-2.0 |
Tiger66639/ansible-modules-core | windows/win_stat.py | 134 | 1450 | #!/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 distributed... | gpl-3.0 |
MobinRanjbar/hue | desktop/core/ext-py/boto-2.38.0/boto/dynamodb/item.py | 153 | 8280 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without ... | apache-2.0 |
NoBodyCam/TftpPxeBootBareMetal | nova/tests/baremetal/test_volume_driver.py | 1 | 4399 | # Copyright (c) 2012 NTT DOCOMO, 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 requ... | apache-2.0 |
clever-crow-consulting/otm-core | opentreemap/treemap/tests/test_instance.py | 2 | 8842 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import json
from django.contrib.gis.geos import MultiPolygon, Polygon
from django.core.exceptions import ValidationError
from django.utils.encoding import force_text
from treemap.inst... | agpl-3.0 |
wcmckee/wcmckee-notebook | hackbrobeur.py | 1 | 2509 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <markdowncell>
# Hack BroBeur
# <markdowncell>
# python script to make account at centre for logins.
# <codecell>
from github import Github
import os
import getpass
import git
import time
from clint.textui import colored
import dominate
from dominate.tags impo... | gpl-2.0 |
ZeeZerEn/jsunpack-n | debug.py | 23 | 5831 | #!/usr/bin/python
'''
Jsunpackn - A generic JavaScript Unpacker Network Edition
Copyright (C) 2010 Blake Hartstein
http://jsunpack.jeek.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 Softwar... | gpl-2.0 |
shuggiefisher/django-on-google-app-engine-base | django/utils/version.py | 320 | 1361 | import django
import os.path
import re
def get_svn_revision(path=None):
"""
Returns the SVN revision in the form SVN-XXXX,
where XXXX is the revision number.
Returns SVN-unknown if anything goes wrong, such as an unexpected
format of internal SVN files.
If path is provided, it should be a dir... | bsd-3-clause |
vmindru/ansible | lib/ansible/plugins/callback/debug.py | 49 | 1773 | # (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
DOCUMENTATION = '''
callback: debug
type: stdout
short_description: formatted stdout/stderr displa... | gpl-3.0 |
petecummings/NewsBlur | vendor/feedvalidator/demo/docs-xml/build-docs-index.py | 16 | 1320 | #!/usr/bin/python
# Put a header and a footer on a list of all documented diagnostics,
# linking to their pages.
# Note that this script has lots of hardcoded paths, needs to be run
# from the docs-xml directory, and modifies the index.html in docs.
from os import listdir
from os import path
import re
from sys im... | mit |
40223142/2015cad0623 | static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/constants.py | 603 | 15297 | #!/usr/bin/env python
'''Constants defined by SDL, and needed in pygame.
Note that many of the flags for SDL are not needed in pygame, and are not
included here. These constants are generally accessed from the
`pygame.locals` module. This module is automatically placed in the pygame
namespace, but you will usually ... | gpl-3.0 |
tracierenea/gnuradio | gr-filter/examples/channelize.py | 58 | 7003 | #!/usr/bin/env python
#
# Copyright 2009,2012,2013 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 ... | gpl-3.0 |
basicthinker/ThyNVM | src/python/m5/util/sorteddict.py | 84 | 6183 | # Copyright (c) 2006-2009 Nathan Binkert <nate@binkert.org>
# 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 ... | bsd-3-clause |
rjschwei/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/models/usage_name.py | 11 | 1040 | # 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 |
teramagazine/coin | contrib/devtools/test-security-check.py | 131 | 2460 | #!/usr/bin/python2
'''
Test script for security-check.py
'''
from __future__ import division,print_function
import subprocess
import sys
import unittest
def write_testcode(filename):
with open(filename, 'w') as f:
f.write('''
#include <stdio.h>
int main()
{
printf("the quick brown fox j... | mit |
davidobrien1985/ansible-modules-core | network/iosxr/iosxr_template.py | 8 | 5803 | #!/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 |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_dns_settings_py3.py | 9 | 2798 | # 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 |
liyancas/cuda-convnet2 | python_util/data.py | 180 | 7803 | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
ItsAnilSingh/android_kernel_samsung_logan2g | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
akosyakov/intellij-community | python/helpers/epydoc/markup/javadoc.py | 100 | 10031 | #
# javadoc.py: javadoc docstring parsing
# Edward Loper
#
# Created [07/03/03 12:37 PM]
# $Id: javadoc.py 1574 2007-03-07 02:55:14Z dvarrazzo $
#
"""
Epydoc parser for U{Javadoc<http://java.sun.com/j2se/javadoc/>}
docstrings. Javadoc is an HTML-based markup language that was
developed for documenting Java APIs with ... | apache-2.0 |
liuyisiyisi/django-cms | cms/south_migrations/0048_auto__add_field_page_application_namespace__add_unique_page_publisher_.py | 48 | 16928 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... | bsd-3-clause |
robwarm/gpaw-symm | tools/niflheim-agts.py | 1 | 5426 | import os
import sys
import glob
import shutil
import subprocess
def cmd(c):
x = os.system(c)
assert x == 0, c
def fail(subject, email=None, filename='/dev/null', mailer='mail'):
assert mailer in ['mailx', 'mail', 'mutt']
import os
if email is not None:
if filename == '/dev/null':
... | gpl-3.0 |
zoobab/gyp | pylib/gyp/generator/msvs.py | 15 | 121137 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import ntpath
import os
import posixpath
import re
import subprocess
import sys
import gyp.common
import gyp.easy_xml as easy_xml
import gyp.MSVSNew a... | bsd-3-clause |
rahul-c1/scikit-learn | examples/linear_model/lasso_dense_vs_sparse_data.py | 348 | 1862 | """
==============================
Lasso on dense and sparse data
==============================
We show that linear_model.Lasso provides the same results for dense and sparse
data and that in the case of sparse data the speed is improved.
"""
print(__doc__)
from time import time
from scipy import sparse
from scipy ... | bsd-3-clause |
meiavy/python-weixin | lib/python2.7/site-packages/werkzeug/contrib/atom.py | 259 | 15588 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.atom
~~~~~~~~~~~~~~~~~~~~~
This module provides a class called :class:`AtomFeed` which can be
used to generate feeds in the Atom syndication format (see :rfc:`4287`).
Example::
def atom_feed(request):
feed = AtomFeed("My Blog", feed... | apache-2.0 |
sunqb/oa_qian | flask/Lib/site-packages/sqlalchemy/sql/__init__.py | 33 | 1721 | # sql/__init__.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
from .expression import (
Alias,
ClauseElement,
ColumnCollection,
Co... | apache-2.0 |
diazejv/karateapp | languages/id.py | 148 | 11233 | # coding: utf8
{
'!langcode!': 'id',
'!langname!': 'Indonesian',
'%d days ago': '%d hari yang lalu',
'%d hours ago': '%d jam yang lalu',
'%d minutes ago': '%d menit yang lalu',
'%d months ago': '%d bulan yang lalu',
'%d seconds ago': '%d detik yang lalu',
'%d seconds from now': '%d detik dari sekarang',
'%d weeks ago':... | gpl-2.0 |
richardfergie/googleads-python-lib | examples/dfp/v201505/label_service/get_labels_by_statement.py | 4 | 1680 | #!/usr/bin/python
#
# Copyright 2015 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 b... | apache-2.0 |
ballzy/prove-my-identity | node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | mit |
zanderle/django | tests/test_discovery_sample/doctests.py | 471 | 1245 | """
Doctest example from the official Python documentation.
https://docs.python.org/3/library/doctest.html
"""
def factorial(n):
"""Return the factorial of n, an exact integer >= 0.
>>> [factorial(n) for n in range(6)]
[1, 1, 2, 6, 24, 120]
>>> factorial(30) # doctest: +ELLIPSIS
2652528598121910... | bsd-3-clause |
raycarnes/odoomrp-utils | crm_claim_ref_search/__openerp__.py | 12 | 1589 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c)
# 2015 Serv. Tec. Avanzados - Pedro M. Baeza (http://www.serviciosbaeza.com)
# 2015 AvanzOsc (http://www.avanzosc.es)
#
# This program is free software: you can redistribute it and/or modi... | agpl-3.0 |
vitchyr/rlkit | rlkit/util/hyperparameter.py | 1 | 7092 | """
Custom hyperparameter functions.
"""
import abc
import copy
import math
import random
import itertools
from typing import List
import rlkit.pythonplusplus as ppp
class Hyperparameter(metaclass=abc.ABCMeta):
def __init__(self, name):
self._name = name
@property
def name(self):
return ... | mit |
hassaanm/stock-trading | src/pybrain/auxiliary/kmeans.py | 6 | 1474 | #######################################################################
# k-means++
#
# this is a k-means clustering algorithm that selects its
# initial cluster centers in a smart way to speed up convergence.
# see: Arthur, D. and Vassilvitskii, S. "k-means++: the advantages
# of careful seeding". ACM-SIAM symposium o... | apache-2.0 |
matrix207/RAMCloud | scripts/colorize.py | 18 | 4525 | #!/usr/bin/env python
# Copyright (c) 2012 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 |
monkeysecurity/aws_api_classifier | apiapi.py | 1 | 2868 | """
Usage:
apiapi.py (all|mutating) [--csv=output_file]
"""
import csv
from policyuniverse import global_permissions
import re
from tabulate import tabulate
TAGS = {
'DATA_PLANE': ['object', 'bucket'],
'CONTROL_PLANE': ['policy', 'attribute', 'permission'],
'MUTATING': ['create', 'delete', 'm... | apache-2.0 |
zhuyongyong/crosswalk-test-suite | webapi/tct-csp-w3c-tests/csp-py/csp_ro_frame-src_self_allowed_ext-manual.py | 30 | 2556 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "frame-src 'self'"
... | bsd-3-clause |
mhogg/bonemapy | bonemapy/elementTypes.py | 1 | 6798 | # -*- coding: utf-8 -*-
# Copyright (C) 2013 Michael Hogg
# This file is part of bonemapy - See LICENSE.txt for information on usage and redistribution
import numpy as np
from abaqusConstants import C3D4, C3D4H, C3D10, C3D10H, C3D10I, C3D10M, C3D10MH
# ~~~~~~~~~~
class elementC3D4():
def __init__(self):
... | mit |
HyperBaton/ansible | lib/ansible/modules/network/cloudengine/ce_ntp.py | 13 | 21063 | #!/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 |
Kleptobismol/scikit-bio | doc/sphinxext/numpydoc/numpydoc/traitsdoc.py | 62 | 4273 | """
=========
traitsdoc
=========
Sphinx extension that handles docstrings in the Numpy standard format, [1]
and support Traits [2].
This extension can be used as a replacement for ``numpydoc`` when support
for Traits is required.
.. [1] http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines#docstring-standard
.... | bsd-3-clause |
sw-irou/flasktest | lib/mongoengine/django/auth.py | 3 | 15978 | from mongoengine import *
from django.utils.encoding import smart_str
from django.contrib.auth.models import _user_has_perm, _user_get_all_permissions, _user_has_module_perms
from django.db import models
from django.contrib.contenttypes.models import ContentTypeManager
from django.contrib import auth
from django.contr... | bsd-3-clause |
lordzuko/appengine-mapreduce | python/src/mapreduce/shard_life_cycle.py | 31 | 2019 | #!/usr/bin/env python
"""Shard life cycle abstract class."""
# pylint: disable=protected-access
# pylint: disable=invalid-name
class _ShardLifeCycle(object):
"""Abstract class for objects that live along shard's life cycle.
Objects that need to plug in business logic into a shard's life cycle
should implement... | apache-2.0 |
guarddogofww/cs108test | src/jarabe/model/friends.py | 3 | 5278 | # Copyright (C) 2006-2007 Red Hat, 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 distribute... | gpl-3.0 |
childsish/sofia | templates/genomics/steps/sequence_set.py | 1 | 2159 | import gzip
from sofia.step import Step
from lhc.binf.sequence.reverse_complement import reverse_complement
try:
import pysam
def get_fasta_set(filename):
return pysam.FastaFile(filename)
except ImportError:
from lhc.io.fasta import FastaInOrderAccessSet
def get_fasta_set(filename):
f... | gpl-2.0 |
linuzo/stock_kernel_lge_d852 | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # 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 |
thomasem/nova | nova/console/websocketproxy.py | 13 | 6605 | # Copyright (c) 2012 OpenStack Foundation
# 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 ... | apache-2.0 |
spraints/plugin.video.prime_instant | download.py | 3 | 2400 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import re
import base64
import json
import xbmcaddon
import urllib
import urllib2
import shutil
from operator import itemgetter
def download(jsonParams):
for item in jsonParams:
videoType = item['type'].encode('utf-8')
videoID = i... | gpl-2.0 |
wong2/sentry | src/sentry/web/frontend/organization_settings.py | 24 | 2313 | from __future__ import absolute_import
from django import forms
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext_lazy as _
from sentry.models import (
AuditLogEntry, AuditLogEntryEvent, Organ... | bsd-3-clause |
romankagan/DDBWorkbench | plugins/hg4idea/testData/bin/mercurial/win32.py | 93 | 13963 | # win32.py - utility functions that use win32 API
#
# Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import ctypes, errno, os, subprocess, random
_kernel32 = ctypes.w... | apache-2.0 |
SnabbCo/neutron | neutron/tests/unit/cisco/test_config.py | 11 | 2946 | # Copyright (c) 2013 Cisco Systems 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... | apache-2.0 |
ctxis/canape | CANAPE.Scripting/Lib/colorsys.py | 1066 | 3691 | """Conversion functions between RGB and other color systems.
This modules provides two functions for each color system ABC:
rgb_to_abc(r, g, b) --> a, b, c
abc_to_rgb(a, b, c) --> r, g, b
All inputs and outputs are triples of floats in the range [0.0...1.0]
(with the exception of I and Q, which covers a slightly... | gpl-3.0 |
ujjvala-addsol/addsol_hr | openerp/addons/base/tests/test_views.py | 60 | 39203 | # -*- encoding: utf-8 -*-
from functools import partial
import itertools
import unittest2
from lxml import etree as ET
from lxml.builder import E
from psycopg2 import IntegrityError
from openerp.tests import common
import openerp.tools
Field = E.field
class ViewCase(common.TransactionCase):
def setUp(self):
... | agpl-3.0 |
funkring/fdoo | addons-funkring/report_aeroo/barcodes/write.py | 1 | 8543 | # -*- coding: utf-8 -*-
"""
Barcodes for Python - Module for writing.
Copyright 2009 Peter Gebauer
Cairo backend for writing barcodes.
"Barcodes for Python" 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... | agpl-3.0 |
TC01/AutoCrab | AutoCrab2/python/crabutil.py | 1 | 1225 | """
Utility functions for working with CRAB. Used by most
of the autocrab commands.
"""
import os
def getCrabConfig(dir):
"""Retrieves backup copy of crab config file in directory."""
path = os.path.join(dir, "share", "crab.cfg")
return path
def getCrabLog(dir):
path = os.path.join(dir, "log", "crab.log")
retur... | mit |
ibushong/test-repo | flask_admin/tests/test_base.py | 3 | 10296 | from nose.tools import ok_, eq_, raises
from flask import Flask, request, abort, url_for
from flask.views import MethodView
from flask.ext.admin import base
class MockView(base.BaseView):
# Various properties
allow_call = True
allow_access = True
visible = True
@base.expose('/')
def index(se... | bsd-3-clause |
tritoanst/ccxt | python/ccxt/bxinth.py | 1 | 8476 | # -*- coding: utf-8 -*-
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
class bxinth (Exchange):
def describe(self):
return self.deep_extend(super(bxinth, self).describe(), {
'id': 'bxinth',
'name': 'BX.in.th',
'countries': 'TH', # ... | mit |
yoshinorim/mysql-5.6 | xtrabackup/test/python/testtools/content.py | 43 | 8747 | # Copyright (c) 2009-2011 testtools developers. See LICENSE for details.
"""Content - a MIME-like Content object."""
__all__ = [
'attach_file',
'Content',
'content_from_file',
'content_from_stream',
'text_content',
'TracebackContent',
]
import codecs
import os
from testtools import try_i... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.