repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
vipins/ccccms | env/Lib/site-packages/south/management/commands/startmigration.py | 37 | 2068 | """
Now-obsolete startmigration command.
"""
from optparse import make_option
from django.core.management.base import BaseCommand
from django.core.management.color import no_style
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--model', action='append', dest='added_mod... | bsd-3-clause |
fangcode/shadowsocks | shadowsocks/udprelay.py | 924 | 11154 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 |
chosenone75/Neural-Networks | tf/CNN-Sentence-Classification/evaluate.py | 1 | 4531 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 21 15:26:20 2017
@author: chosenone
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import tensorflow as tf
import numpy as np
import os
import time
import data_util
import datetime... | gpl-3.0 |
robhudson/django | django/core/files/base.py | 487 | 5717 | from __future__ import unicode_literals
import os
from io import BytesIO, StringIO, UnsupportedOperation
from django.core.files.utils import FileProxyMixin
from django.utils import six
from django.utils.encoding import (
force_bytes, force_str, python_2_unicode_compatible, smart_text,
)
@python_2_unicode_compat... | bsd-3-clause |
JorisDeRieck/Flexget | flexget/plugins/cli/plugins.py | 4 | 2221 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
from colorclass.toggles import disable_all_colors
from flexget import options
from flexget.event import event
from flexget.plugin import get_plugins
from fl... | mit |
Nekroze/partpy | partpy/sourcestring.py | 1 | 19118 | """SourceString stores the entire string to be parsed in memory and provides
some simple methods for retrieving and moving current position aswell as
methods for matching strings and patterns.
"""
__author__ = 'Taylor "Nekroze" Lawson'
__email__ = 'nekroze@eturnilnetwork.com'
class SourceString(object):
"""Stores... | mit |
BryanQuigley/sos | sos/collector/clusters/kubernetes.py | 3 | 1744 | # Copyright Red Hat 2020, Jake Hunsaker <jhunsake@redhat.com>
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Publi... | gpl-2.0 |
tedsunnyday/SE-Server | server/lib/jinja2/testsuite/filters.py | 74 | 13236 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.filters
~~~~~~~~~~~~~~~~~~~~~~~~
Tests for the jinja filters.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Markup, Environment
en... | apache-2.0 |
M-R-Houghton/euroscipy_2015 | bokeh/examples/glyphs/linked_tap_server.py | 24 | 2436 | from __future__ import print_function
import numpy as np
from bokeh.models import ColumnDataSource, DataRange1d, Plot, Circle, VBox, HBox, Button, TapTool
from bokeh.document import Document
from bokeh.session import Session
from bokeh.browserlib import view
document = Document()
session = Session()
session.use_doc(... | mit |
bob-the-hamster/commandergenius | project/jni/python/src/Lib/test/inspect_fodder2.py | 213 | 1279 | # line 1
def wrap(foo=None):
def wrapper(func):
return func
return wrapper
# line 7
def replace(func):
def insteadfunc():
print 'hello'
return insteadfunc
# line 13
@wrap()
@wrap(wrap)
def wrapped():
pass
# line 19
@replace
def gone():
pass
# line 24
oll = lambda m: m
# line... | lgpl-2.1 |
Murgeye/teamspeak3-python-bot | modules/Quotes.py | 1 | 1924 | """Quote module for the Teamspeak 3 Bot. Sends quotes to people joining the server."""
import Bot
import random
import codecs
import Moduleloader
import ts3.Events as Events
bot = None
# Server groups who should not receiver quotes upon joining the server
dont_send = []
def random_line(afile):
"""
... | apache-2.0 |
antlarr/picard | test/test_script.py | 1 | 23720 | from test.picardtestcase import PicardTestCase
from unittest.mock import MagicMock
from picard import config
from picard.const import DEFAULT_FILE_NAMING_FORMAT
from picard.metadata import Metadata
from picard.script import (
ScriptError,
ScriptParser,
register_script_function,
)
class ScriptParserTest(P... | gpl-2.0 |
playfulgod/lge-kernel-iproj | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
dan1/horizon-x509 | openstack_dashboard/dashboards/admin/metering/urls.py | 63 | 1039 | # 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, software
# distributed under t... | apache-2.0 |
pam-bot/SMSBeds | lib/mechanize/_response.py | 134 | 17803 | """Response classes.
The seek_wrapper code is not used if you're using UserAgent with
.set_seekable_responses(False), or if you're using the urllib2-level interface
HTTPEquivProcessor. Class closeable_response is instantiated by some handlers
(AbstractHTTPHandler), but the closeable_response interface is only depende... | gpl-2.0 |
potatolondon/django-nonrel-1-4 | django/contrib/localflavor/in_/forms.py | 87 | 3908 | """
India-specific Form helpers.
"""
from __future__ import absolute_import
import re
from django.contrib.localflavor.in_.in_states import STATES_NORMALIZED, STATE_CHOICES
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, CharF... | bsd-3-clause |
Karel-van-de-Plassche/onie | test/lib/power.py | 6 | 2301 | #
# DUT Power Control classes
#
# Copyright (C) 2013 Curt Brune <curt@cumulusnetworks.com>
#
# SPDX-License-Identifier: GPL-2.0
'''
Defines a 'PowerControl' object that a the test fixture uses to power cycle
the DUT.
'''
#-------------------------------------------------------------------------------
#
# Impor... | gpl-2.0 |
viollarr/alab | site2011/tmp/install_4f6284a0685dd/admin/help/en-GB/plugin_manual/source/conf.py | 2 | 6702 | # -*- coding: utf-8 -*-
#
# Attachments Extensions Plugin Manual documentation build configuration file, created by
# sphinx-quickstart on Fri Nov 6 14:49:34 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present i... | gpl-2.0 |
sanjeevtripurari/hue | apps/zookeeper/src/zookeeper/rest.py | 24 | 7646 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
datadesk/django-bigbuild | bigbuild/urls.py | 1 | 1502 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bigbuild import get_base_url
from django.conf.urls import url, include
from bigbuild import views, feeds, sitemaps
basepatterns = [
# Pages
url(
r'^$',
views.PageListView.as_view(),
name='bigbuild-page-list'
),
url(
r'^... | mit |
flavour/Turkey | controllers/mpr.py | 14 | 7708 | # -*- coding: utf-8 -*-
""" Missing Person Registry """
module = request.controller
prefix = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % prefix)
MISSING = str(T("Missing"))
FOUND = str(T("Found"))
DETAILS = str(T("Details"))... | mit |
JimCircadian/ansible | test/units/modules/network/nxos/test_nxos_config.py | 7 | 6992 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
joebowen/movement_validation_cloud | djangodev/lib/python2.7/site-packages/boto/sdb/db/sequence.py | 153 | 8223 | # 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 |
mgagne/nova | nova/api/openstack/compute/images.py | 17 | 5443 | # Copyright 2011 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 |
bufferapp/buffer-django-nonrel | tests/regressiontests/admin_util/tests.py | 49 | 7534 | from datetime import datetime
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.util import display_for_field, label_for_field, lookup_field
from django.contrib.admin.util import NestedObjects
from django.contrib.admin.views.main import EMPTY_CHANGELIST_VALUE
from django.contr... | bsd-3-clause |
filias/django | django/db/models/fields/files.py | 6 | 18810 | import datetime
import os
from django import forms
from django.core import checks
from django.core.files.base import File
from django.core.files.images import ImageFile
from django.core.files.storage import default_storage
from django.db.models import signals
from django.db.models.fields import Field
from django.utils... | bsd-3-clause |
ibab/tensorflow | tensorflow/python/training/server_lib.py | 7 | 11747 | # 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 by applicable law or a... | apache-2.0 |
kustodian/ansible | lib/ansible/modules/identity/ipa/ipa_service.py | 8 | 6668 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, 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 |
davedg629/RedditRatings | app/spider.py | 1 | 11690 | from app import db
from app.models import User, Thread, Comment
from config import REDDIT_USER_AGENT, REDDIT_APP_ID, \
REDDIT_APP_SECRET, OAUTH_REDIRECT_URI, SERVER_NAME, \
REDDIT_USERNAME, REDDIT_PASSWORD
import praw
import datetime
import time
from requests import HTTPError
from flask.ext.script import Comman... | gpl-2.0 |
lordkman/burnman | burnman/minerals/Murakami_etal_2012.py | 6 | 5028 | # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences
# Copyright (C) 2012 - 2017 by the BurnMan team, released under the GNU
# GPL v2 or later.
"""
Murakami_etal_2012
^^^^^^^^^^^^^^^^^^
Minerals from Murakami et al. (2012) supplementary table 5 and reference... | gpl-2.0 |
philsch/ansible | lib/ansible/modules/cloud/rackspace/rax_mon_notification.py | 70 | 5722 | #!/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 |
Edu-Glez/Bank_sentiment_analysis | env/lib/python3.6/site-packages/ipywidgets/__init__.py | 3 | 1524 | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""Interactive widgets for the Jupyter notebook.
Provide simple interactive controls in the notebook.
Each Widget corresponds to an object in Python and Javascript,
with controls on the page.
To put a Widget on the p... | apache-2.0 |
carlitolucasg/carlitolucasg.github.io | node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py | 886 | 131038 | # 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.generator... | mit |
eduNEXT/edx-platform | openedx/core/djangoapps/waffle_utils/views.py | 4 | 5040 | """
Views that we will use to view toggle state in edx-platform.
"""
from collections import OrderedDict
from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication
from edx_rest_framework_extensions.permissions import IsStaff
from edx_toggles.toggles.state import ToggleStateReport, get_or_crea... | agpl-3.0 |
robhudson/zamboni | apps/devhub/tasks.py | 1 | 16766 | # -*- coding: utf-8 -*-
import base64
import json
import logging
import os
import socket
import sys
import tempfile
import traceback
import urllib2
import uuid
from django.conf import settings
from django.core.files.storage import default_storage as storage
from django.core.management import call_command
from cache_n... | bsd-3-clause |
s4n7h0/intelmq | intelmq/tests/bots/parsers/dcu/lib.py | 2 | 3471 | from intelmq.bots.parsers.dcu import lib
import unittest
class TestDCUParserLib(unittest.TestCase):
"""Tests if the dcu-parser library works as expected"""
def setUp(self):
# fake dcu records for later testing
self.test_dcu = ["SinkHoleMessage",
"130366192837417292",
... | agpl-3.0 |
jstoxrocky/statsmodels | statsmodels/stats/tests/test_contrast.py | 34 | 1385 | import numpy as np
import numpy.random as R
from numpy.testing import assert_almost_equal, assert_equal
from statsmodels.stats.contrast import Contrast
class TestContrast(object):
@classmethod
def setupClass(cls):
R.seed(54321)
cls.X = R.standard_normal((40,10))
def test_contrast1(self):
... | bsd-3-clause |
linktlh/Toontown-journey | toontown/toonbase/UserFunnel.py | 1 | 26059 | import os
import sys
import random
from pandac.PandaModules import HTTPClient
from pandac.PandaModules import HTTPCookie
from pandac.PandaModules import URLSpec
from pandac.PandaModules import Ramfile
from pandac.PandaModules import DocumentSpec
from direct.task.Task import Task
from direct.directnotify.DirectNotifyGlo... | apache-2.0 |
GNOME/kupfer | kupfer/plugin/fileactions.py | 4 | 5107 | __kupfer_name__ = _("File Actions")
__kupfer_sources__ = ()
__kupfer_text_sources__ = ()
__kupfer_actions__ = (
"MoveTo",
"Rename",
"CopyTo",
)
__description__ = _("More file actions")
__version__ = ""
__author__ = "Ulrik"
import gio
import os
# since "path" is a very generic name, you often forget..
from os im... | gpl-3.0 |
geekboxzone/mmallow_external_protobuf | python/google/protobuf/internal/api_implementation.py | 80 | 3726 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | bsd-3-clause |
nikolas/edx-platform | common/djangoapps/student/migrations/0020_add_test_center_user.py | 188 | 15924 | # -*- 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 'TestCenterUser'
db.create_table('student_testcenteruser', (
('id', self.gf('djan... | agpl-3.0 |
pigeonflight/strider-plone | docker/appengine/lib/django-1.4/tests/regressiontests/file_uploads/tests.py | 27 | 15240 | #! -*- coding: utf-8 -*-
from __future__ import absolute_import
import base64
import errno
import hashlib
import os
import shutil
from StringIO import StringIO
from django.core.files import temp as tempfile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.http.multipartparser import MultiPar... | mit |
yglazko/bedrock | bedrock/mozorg/hierarchy.py | 29 | 5461 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django.conf.urls import patterns
from bedrock.base.urlresolvers import reverse
from bedrock.mozorg.util import pa... | mpl-2.0 |
trondhindenes/ansible | lib/ansible/modules/identity/ipa/ipa_group.py | 74 | 8359 | #!/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)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
kevin-coder/tensorflow-fork | tensorflow/python/autograph/converters/list_comprehensions_test.py | 33 | 1955 | # Copyright 2017 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 |
harshilasu/GraphicMelon | y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/pyami/installers/ubuntu/trac.py | 47 | 6271 | # Copyright (c) 2008 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, m... | gpl-3.0 |
nelango/ViralityAnalysis | model/lib/nltk/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 |
yoki/phantomjs | src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/generator_test.py | 252 | 10129 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | bsd-3-clause |
hoatle/odoo | addons/payment_paypal/models/res_company.py | 422 | 1752 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
class ResCompany(osv.Model):
_inherit = "res.company"
def _get_paypal_account(self, cr, uid, ids, name, arg, context=None):
Acquirer = self.pool['payment.acquirer']
company_id = self.pool['res.users'].browse(cr, uid, uid, context=co... | agpl-3.0 |
armersong/zato | code/zato-server/src/zato/server/service/internal/info.py | 6 | 3019 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2014 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
from contextlib import closing
from json import dumps, loads
# Zato
fro... | gpl-3.0 |
tectronics/arsenalsuite | cpp/apps/burner/build.py | 6 | 1603 |
from blur.build import *
import os, sys
path = os.path.dirname(os.path.abspath(__file__))
sip_path = os.path.join(path,'sipBurner')
rev_path = os.path.join(path,'../..')
try:
os.mkdir(sip_path)
except: pass
instPrefix = ""
destDir = ""
if "DESTDIR" in os.environ:
destDir = os.environ["DESTDIR"]
elif sys.pl... | gpl-2.0 |
amimof/ansible-websphere | library/was_server.py | 1 | 6667 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Amir Mofasser <amir.mofasser@gmail.com> (@amimof)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = """
module: was_server
version_added: "1.9.4"
short_description: Stop/Start a WebSphere Applicat... | mit |
B-MOOC/edx-platform | common/djangoapps/util/tests/test_sandboxing.py | 162 | 1763 | """
Tests for sandboxing.py in util app
"""
from django.test import TestCase
from opaque_keys.edx.locator import LibraryLocator
from util.sandboxing import can_execute_unsafe_code
from django.test.utils import override_settings
from opaque_keys.edx.locations import SlashSeparatedCourseKey
class SandboxingTest(TestCa... | agpl-3.0 |
pnwairfire/bluesky | test/regression/consumption_emissions/regress.py | 1 | 21855 | #!/usr/bin/env python3
__author__ = "Joel Dubowy"
import copy
import csv
import glob
import logging
import os
import sys
import traceback
import uuid
import afscripting
import numpy
# Hack to put the repo root dir at the front of sys.path so that
# the local bluesky package is found
# app_root = os.path.dirname(os.... | gpl-3.0 |
pmitros/pyfs | fs/expose/fuse/fuse3.py | 12 | 22126 | # Copyright (c) 2008 Giorgos Verigakis <verigak@gmail.com>
#
# 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 THE A... | bsd-3-clause |
xuxiao19910803/edx-platform | lms/djangoapps/course_wiki/views.py | 100 | 4689 | """
This file contains view functions for wrapping the django-wiki.
"""
import logging
import re
import cgi
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.shortcuts import redirect
from django.utils.translation import ug... | agpl-3.0 |
veger/ansible | lib/ansible/modules/cloud/azure/azure_rm_trafficmanagerprofile.py | 16 | 16524 | #!/usr/bin/python
#
# Copyright (c) 2018 Hai Cao, <t-haicao@microsoft.com> Yunge Zhu <yungez@microsoft.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
ANSIBLE_METADATA = {'metadata... | gpl-3.0 |
mdhaber/scipy | tools/download-wheels.py | 5 | 2989 | #!/usr/bin/env python
"""
Download SciPy wheels from Anaconda staging area.
"""
import sys
import os
import re
import shutil
import argparse
import urllib
import urllib.request
import urllib3
from bs4 import BeautifulSoup
__version__ = '0.1'
# Edit these for other projects.
STAGING_URL = 'https://anaconda.org/multi... | bsd-3-clause |
fornaxco/Mars-Express-Challenge | preprocessing/merge_data.py | 1 | 1100 | # -*- coding: utf-8 -*-
"""
@author: fornax
"""
import os
import pandas as pd
os.chdir(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.append(os.path.dirname(os.getcwd()))
import prepare_data1 as prep
DATA_PATH = os.path.join('..', prep.DATA_PATH)
dates = ['2008-08-22_2010-07-10', '2010-07-10_2012-05-27', '20... | bsd-3-clause |
bitfixer/bitfixer | raspberrypi/pi2c64/64loader/makeloader.py | 3 | 1302 | output = 'asmloaders.c'
func_name = 'load_image'
startaddr = 8192
size = 8000
loops = size / 256
rem = size - (loops * 256)
print loops, rem
f = open(output, 'w')
#init
f.write('void %s() {\n' % func_name)
f.write('asm("ldx #$00");\n')
f.write('asm("lda %w", 0xDD00);\n')
f.write('asm("tay");\n');
for i in range(0, ... | gpl-2.0 |
eatbyte/depot_tools | third_party/boto/s3/lifecycle.py | 69 | 7793 | # 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 ... | bsd-3-clause |
zasdfgbnm/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/relaxed_bernoulli_test.py | 110 | 6469 | # 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 |
zihua/scikit-learn | sklearn/utils/optimize.py | 31 | 5739 | """
Our own implementation of the Newton algorithm
Unlike the scipy.optimize version, this version of the Newton conjugate
gradient solver uses only one function call to retrieve the
func value, the gradient value and a callable for the Hessian matvec
product. If the function call is very expensive (e.g. for logistic
... | bsd-3-clause |
shackra/thomas-aquinas | tests/test_menu_bottom_right.py | 1 | 1164 | # This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "s, q"
tags = "menu, menu_valign, menu_halign"
from pyglet import image
from pyglet import gl
from pyglet import font
from summa.director import... | bsd-3-clause |
michaeldavidcarr/namebench | libnamebench/reporter.py | 173 | 16737 | # Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
Snesha/kubernetes | hack/lookup_pull.py | 368 | 1319 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
pwoodworth/intellij-community | python/lib/Lib/site-packages/django/contrib/comments/signals.py | 425 | 1079 | """
Signals relating to comments.
"""
from django.dispatch import Signal
# Sent just before a comment will be posted (after it's been approved and
# moderated; this can be used to modify the comment (in place) with posting
# details or other such actions. If any receiver returns False the comment will be
# discarded a... | apache-2.0 |
john-wang-metro/metro-openerp | metro_stock_out/stock_partial_picking.py | 2 | 4654 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
hurricup/intellij-community | python/lib/Lib/encodings/mbcs.py | 860 | 1211 | """ Python 'mbcs' Codec for Windows
Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py,
which was written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
# Import them explicitly to cause an ImportError
# on non-Windows systems
from codecs import mbcs... | apache-2.0 |
vFense/vFenseAgent-nix | agent/deps/rpm6/Python-2.7.5/lib/python2.7/bsddb/test/test_dbshelve.py | 44 | 11698 | """
TestCases for checking dbShelve objects.
"""
import os, string, sys
import random
import unittest
from test_all import db, dbshelve, test_support, verbose, \
get_new_environment_path, get_new_database_path
#----------------------------------------------------------------------
# We want the objects... | lgpl-3.0 |
MengjiaoH/UpSet-Phovea | node_modules/node-gyp/gyp/PRESUBMIT.py | 1369 | 3662 | # 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.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... | bsd-3-clause |
PurpleBooth/python-vm | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/sbcsgroupprober.py | 2936 | 3291 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
TeamEOS/external_chromium_org | tools/perf/measurements/rasterize_and_record_micro_unittest.py | 9 | 4012 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
from measurements import rasterize_and_record_micro
from telemetry import test
from telemetry.core import wpr_modes
from telemetry.page impor... | bsd-3-clause |
JRock007/boxxy | dist/Boxxy.app/Contents/Resources/lib/python2.7/numpy/f2py/use_rules.py | 75 | 3514 | #!/usr/bin/env python
"""
Build 'use others module data' mechanism for f2py2e.
Unfinished.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE... | mit |
timohtey/mediadrop_copy | mediacore_env/Lib/site-packages/pip/vcs/subversion.py | 473 | 10640 | import os
import re
from pip.backwardcompat import urlparse
from pip.index import Link
from pip.util import rmtree, display_path, call_subprocess
from pip.log import logger
from pip.vcs import vcs, VersionControl
_svn_xml_url_re = re.compile('url="([^"]+)"')
_svn_rev_re = re.compile('committed-rev="(\d+)"')
_svn_url_r... | gpl-3.0 |
gemagomez/keepnote | keepnote/extensions/editor_insert_date/__init__.py | 3 | 5836 | """
KeepNote
Insert date extension
"""
#
# KeepNote
# Copyright (c) 2008-2009 Matt Rasmussen
# Author: Matt Rasmussen <rasmus@mit.edu>
#
# 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 Foundat... | gpl-2.0 |
RyanYoung25/tensorflow | tensorflow/python/ops/linalg_ops.py | 6 | 11219 | # 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 by applicable law or a... | apache-2.0 |
Micronaet/micronaet-sql | sql_purchase_order/utility.py | 2 | 6669 | # -*- coding: utf-8 -*-
###############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2001-2015 Micronaet S.r.l. (<http://www.micronaet.it>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
craigds/mapnik2 | scons/scons-local-1.2.0/SCons/Tool/jar.py | 12 | 3741 | """SCons.Tool.jar
Tool-specific initialization for jar.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
#
# Permission is... | lgpl-2.1 |
Mazecreator/tensorflow | tensorflow/contrib/learn/python/learn/estimators/__init__.py | 34 | 12484 | # 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 |
ANDABO/plugin.video.aresiptv-1.9.8 | _DMsearch.py | 172 | 4286 | import urllib
import urllib2
import xbmcvfs
import os,xbmc,xbmcaddon,xbmcgui,re,xbmcplugin,sys
import json
import datetime
addon = xbmcaddon.Addon('plugin.video.live.streamspro')
profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8'))
cacheDir = os.path.join(profile, 'cachedir')
headers=dict({'User-... | gpl-2.0 |
ahmed-mahran/hue | desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/utf8prober.py | 2919 | 2652 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | apache-2.0 |
Epirex/android_external_chromium_org | tools/telemetry/telemetry/page/page_set_archive_info.py | 23 | 6197 | # Copyright (c) 2013 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 json
import logging
import os
import re
import shutil
import sys
from telemetry.page import cloud_storage
class PageSetArchiveInfo(object):
d... | bsd-3-clause |
kant/videonotes | lib/uritemplate/__init__.py | 195 | 4780 | # Early, and incomplete implementation of -04.
#
import re
import urllib
RESERVED = ":/?#[]@!$&'()*+,;="
OPERATOR = "+./;?|!@"
EXPLODE = "*+"
MODIFIER = ":^"
TEMPLATE = re.compile(r"{(?P<operator>[\+\./;\?|!@])?(?P<varlist>[^}]+)}", re.UNICODE)
VAR = re.compile(r"^(?P<varname>[^=\+\*:\^]+)((?P<explode>[\+\*])|(?P<part... | mit |
namjae/AutobahnTestSuite | autobahntestsuite/autobahntestsuite/case/case5_2.py | 14 | 1356 | ###############################################################################
##
## Copyright 2011 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
##
## ht... | apache-2.0 |
ntt-sic/nova | nova/virt/fake.py | 2 | 16029 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you m... | apache-2.0 |
Orav/kbengine | kbe/res/scripts/common/Lib/shelve.py | 2 | 8667 | """Manage shelves of pickled objects.
A "shelf" is a persistent, dictionary-like object. The difference
with dbm databases is that the values (not the keys!) in a shelf can
be essentially arbitrary Python objects -- anything that the "pickle"
module can handle. This includes most class instances, recursive data... | lgpl-3.0 |
ZiftrCOIN/ziftrcoin | contrib/linearize/linearize.py | 145 | 3351 | #!/usr/bin/python
#
# linearize.py: Construct a linear, no-fork, best version of the blockchain.
#
#
# Copyright (c) 2013 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import json
import struct
impo... | mit |
jaysulk/Python | cloudbase.py | 1 | 1667 | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 20 09:01:12 2017
@author: Jason
"""
import numpy as np
import phycon
import tdfuncs
# Function to determine the lifted condensation level using a "Skew-T method"
# Tf/Tdf is in C, Pf in hPa.
def cloudbase(Tf,Tdf,Pf):
# Define Arrays
T=(np.arange(801)*0.1)-30 # Cr... | gpl-3.0 |
harisibrahimkv/django | django/contrib/gis/db/backends/postgis/adapter.py | 25 | 2203 | """
This object provides quoting for GEOS geometries into PostgreSQL/PostGIS.
"""
from psycopg2 import Binary
from psycopg2.extensions import ISQLQuote
from django.contrib.gis.db.backends.postgis.pgraster import to_pgraster
from django.contrib.gis.geometry.backend import Geometry
class PostGISAdapter:
def __ini... | bsd-3-clause |
samdowd/drumm-farm | drumm_env/bin/pilprint.py | 1 | 2564 | #!/home/sam/p/drumm-farm/drumm_env/bin/python
#
# The Python Imaging Library.
# $Id$
#
# print image files to postscript printer
#
# History:
# 0.1 1996-04-20 fl Created
# 0.2 1996-10-04 fl Use draft mode when converting.
# 0.3 2003-05-06 fl Fixed a typo or two.
#
from __future__ import print_function
impo... | mit |
p0cisk/Quantum-GIS | python/console/__init__.py | 32 | 1155 | # -*- coding: utf-8 -*-
"""
***************************************************************************
__init__.py
---------------------
Date : September 2012
Copyright : (C) 2012 by Salvatore Larosa
Email : lrssvtml at gmail dot com
**********************... | gpl-2.0 |
suranap/qiime | tests/test_split_libraries.py | 15 | 87673 | #!/usr/bin/env python
# file test_split_libraries.py
__author__ = "Rob Knight"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Rob Knight", "William Walters", "Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "William Walters"
__email__ = "william.a.walters@colorado.... | gpl-2.0 |
vpistis/soapfish | soapfish/soap_dispatch.py | 1 | 10936 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import functools
import itertools
import logging
from lxml import etree
import six
from . import py2xsd
from . import py2wsdl
from . import wsa
from .compat import basestring
from .core import SOAPError, SOAPRequest, SOAPResponse
from .py2xsd import sch... | bsd-3-clause |
Neui/MCEdit-Unified | pymclevel/blockrotation.py | 4 | 21965 | import materials
from materials import alphaMaterials
from numpy import arange, zeros
def genericRoll(cls):
rotation = arange(16, dtype='uint8')
if hasattr(cls, "Up") and hasattr(cls, "Down"):
rotation[cls.Up] = cls.North
rotation[cls.Down] = cls.South
rotation[cls.South] = cls.Up
... | isc |
renyi533/tensorflow | tensorflow/python/util/tf_export.py | 14 | 13529 | # Copyright 2017 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 |
bregman-arie/ansible | lib/ansible/modules/system/aix_inittab.py | 46 | 7274 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Joris Weijters <joris.weijters@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
ANSIBLE_METADATA = {'metadata_version': '1... | gpl-3.0 |
prisis/sublime-text-packages | Packages/SublimeCodeIntel/libs/koCatalog.py | 7 | 25517 | # ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozilla.org/MPL/
#
# Softwa... | mit |
Honry/crosswalk-test-suite | tools/atip/atip/common/common.py | 15 | 7357 | # Copyright (c) 2014 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this list
# of conditions and the following disclaimer.... | bsd-3-clause |
agusc/scrapy | scrapy/http/request/rpc.py | 169 | 1109 | """
This module implements the XmlRpcRequest class which is a more convenient class
(that Request) to generate xml-rpc requests.
See documentation in docs/topics/request-response.rst
"""
from six.moves import xmlrpc_client as xmlrpclib
from scrapy.http.request import Request
from scrapy.utils.python import get_func_a... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.