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 |
|---|---|---|---|---|---|
dohop/supervisor-logstash-notifier | tests/test_include.py | 1 | 2353 | #
# Copyright 2016 Dohop hf.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
vlas-sokolov/pyspeckit | examples/ammonia_fit_example.py | 6 | 3890 | from __future__ import print_function
import pyspeckit
import numpy as np
# Grab a .fits spectrum with a legitimate header
sp = pyspeckit.Spectrum('G031.947+00.076_nh3_11_Tastar.fits')
""" HEADER:
SIMPLE = T / Written by IDL: Tue Aug 31 18:17:01 2010
BITPIX = -64
NAXIS = 1 / ... | mit |
KasenJ/CommunityPython | code/push/google/protobuf/internal/message_test.py | 224 | 22295 | #! /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:
#
# ... | gpl-2.0 |
kobejean/tensorflow | tensorflow/python/ops/boosted_trees_ops.py | 9 | 8018 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
Just-D/chromium-1 | tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/pass_through.py | 31 | 1161 | # Copyright 2015 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.
from telemetry.page import page as page_module
from telemetry import story
class PassThroughPage(page_module.Page):
"""
A test page for the chrome proxy... | bsd-3-clause |
chenruixuan/PopClip-Extensions | source/Trello/requests/status_codes.py | 926 | 3200 | # -*- coding: utf-8 -*-
from .structures import LookupDict
_codes = {
# Informational.
100: ('continue',),
101: ('switching_protocols',),
102: ('processing',),
103: ('checkpoint',),
122: ('uri_too_long', 'request_uri_too_long'),
200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'... | mit |
oklink-dev/bitcoin | qa/rpc-tests/test_framework/comptool.py | 56 | 18090 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from .mininode import *
from .blockstore import BlockStore, TxStore
from .util import p2p_port
'''
This ... | mit |
jhjguxin/blogserver | lib/python2.7/site-packages/django/core/mail/__init__.py | 229 | 5072 | """
Tools for sending email.
"""
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
# Imported for backwards compatibility, and for the sake
# of a cleaner namespace. These symbols used to be in
# django/core/mail.py before the int... | mit |
ludwiktrammer/odoo | openerp/cli/server.py | 14 | 5063 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
"""
OpenERP - Server
OpenERP is an ERP+CRM program for small and medium businesses.
The whole source code is distributed under the terms of the
GNU Public Licence.
(c) 2003-TODAY, Fabien Pinckaers - OpenERP SA
"""
imp... | agpl-3.0 |
egtaonline/GameAnalysis | gameanalysis/reduction/twins.py | 1 | 2919 | """Twins reduction
This is the same as a deviation preserving reduction reduced to two for all
roles."""
import numpy as np
from gameanalysis import rsgame
from gameanalysis import utils
from gameanalysis.reduction import deviation_preserving as dpr
def reduce_game(full_game, red_players=None):
"""Reduce a game... | apache-2.0 |
doctoromer/haya-data | server/reconstruct.py | 1 | 5009 | """The reconstruct thread module."""
import threading
import logging
import os
import protocol.thread
from utils import handle_except
class ReconstructThread(threading.Thread):
"""
The reconstruction thread handles the reconstruction of the system.
Attributes:
virtual_file (str): The name of the... | mit |
sclabs/sccms-nonrel | django/contrib/gis/db/backends/spatialite/base.py | 244 | 4347 | from ctypes.util import find_library
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.sqlite3.base import *
from django.db.backends.sqlite3.base import DatabaseWrapper as SqliteDatabaseWrapper, \
_sqlite_extract, _sqlite_date_trunc, _sqlite_regexp
fro... | bsd-3-clause |
ClearCorp-dev/odoo | addons/l10n_ae/__init__.py | 669 | 1059 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the te... | agpl-3.0 |
jbedorf/tensorflow | tensorflow/python/autograph/pyct/qual_names.py | 24 | 8125 | # 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 |
adrienbrault/home-assistant | homeassistant/components/rflink/__init__.py | 5 | 20855 | """Support for Rflink devices."""
import asyncio
from collections import defaultdict
import logging
import async_timeout
from rflink.protocol import create_rflink_connection
from serial import SerialException
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_STATE,
CONF_COMMA... | mit |
slayerjain/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/testdata/handlers/blank_wsh.py | 499 | 1557 | # Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
CodeDJ/qt5-hidpi | qt/qtwebkit/Tools/Scripts/webkitpy/test/finder_unittest.py | 124 | 5471 | # Copyright (C) 2012 Google, Inc.
#
# 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 the following disclaimer... | lgpl-2.1 |
GIJensen/bitcoin | qa/rpc-tests/test_framework/mininode.py | 5 | 36233 | # mininode.py - Bitcoin P2P network half-a-node
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# This python code was modified from ArtForz' public domain half-a-node, as
# found in the mini-node branch of http://github.c... | mit |
TeslaProject/external_chromium_org | tools/cr/cr/commands/select.py | 65 | 1802 | # 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.
"""A module for the select command."""
import cr
# The set of variables SELECT writes into the client plugin to control the
# active output directory.
SELE... | bsd-3-clause |
marcuskelly/recover | Lib/site-packages/coverage/plugin_support.py | 76 | 7892 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Support for plugins."""
import os
import os.path
import sys
from coverage.misc import CoverageException, isolate_module
from coverage.plugin import CoveragePlu... | bsd-2-clause |
Jorge-Rodriguez/ansible | lib/ansible/modules/network/aci/aci_interface_policy_port_security.py | 12 | 6440 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
garverp/gnuradio | gr-digital/python/digital/ofdm_packet_utils.py | 27 | 26971 | #
# Copyright 2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
#... | gpl-3.0 |
KohlsTechnology/ansible | lib/ansible/modules/storage/infinidat/infini_export_client.py | 43 | 5489 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Gregory Shulov (gregory.shulov@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': '... | gpl-3.0 |
dhermes/gcloud-python | texttospeech/google/cloud/texttospeech_v1/gapic/transports/text_to_speech_grpc_transport.py | 2 | 4586 | # -*- coding: utf-8 -*-
#
# Copyright 2018 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... | apache-2.0 |
codilime/cloudify-agent | cloudify_agent/installer/config/configuration.py | 1 | 12706 | #########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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 |
shakaran/casterly | money/views.py | 1 | 1281 | from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponse, HttpResponseForbidden
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from money.forms import UploadCSVstatementForm
from money.models import Movement, MovementCategory
de... | bsd-3-clause |
scy-phy/minicps | bin/pox-init.py | 2 | 1959 | #!/usr/bin/env python
"""
Script to perform pox init.
Pox dir defaults to ~/pox
minicps dir defaults to ~/minicps
Use POX_COMPONENTS list to add new symlinks.
Use -v for verbose and -vv for colored verbose.
"""
import argparse
import os
POX_COMPONENTS = [
'antiarppoison.py',
'hub.py',
'l2_pairs.py',
... | mit |
r-mibu/ceilometer | ceilometer/image/notifications.py | 2 | 3994 | #
# Copyright 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-2.0
#
# Unless required by applicable law or agreed to in writi... | apache-2.0 |
pgmillon/ansible | lib/ansible/modules/windows/win_mapped_drive.py | 45 | 4162 | #!/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)
# this is a windows documentation stub, actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
ThirdProject/android_external_chromium_org | third_party/protobuf/python/google/protobuf/internal/decoder.py | 223 | 26136 | # 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:
#
# * Redistributions o... | bsd-3-clause |
tianweizhang/nova | nova/virt/hyperv/snapshotops.py | 18 | 5368 | # Copyright 2012 Cloudbase Solutions Srl
# 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 r... | apache-2.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/idlelib/idle_test/test_parenmatch.py | 43 | 3822 | """Test idlelib.ParenMatch."""
# This must currently be a gui test because ParenMatch methods use
# several text methods not defined on idlelib.idle_test.mock_tk.Text.
import unittest
from test.test_support import requires
from Tkinter import Tk, Text
from idlelib.ParenMatch import ParenMatch
class Mock: # 2.7 does ... | gpl-3.0 |
Sparker0i/fosswebsite | noticeBoard/forms.py | 8 | 1131 | from django import forms
from noticeBoard.models import Notice
class NoticeCreateForm(forms.ModelForm):
title = forms.CharField(label='Title', help_text="Enter title",
widget=forms.TextInput(attrs={'placeholder': "Title"}))
message = forms.CharField(label="Message", help_text="En... | mit |
fkolacek/FIT-VUT | bp-revok/python/lib/python2.7/csv.py | 4 | 16343 |
"""
csv.py - read/write/investigate CSV files
"""
import re
from functools import reduce
from _csv import Error, __version__, writer, reader, register_dialect, \
unregister_dialect, get_dialect, list_dialects, \
field_size_limit, \
QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NON... | apache-2.0 |
brchiu/tensorflow | tensorflow/contrib/boosted_trees/estimator_batch/custom_loss_head.py | 87 | 3030 | # 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 |
rosudrag/Freemium-winner | VirtualEnvironment/Lib/site-packages/pip-7.1.0-py3.4.egg/pip/_vendor/requests/packages/chardet/big5freq.py | 3133 | 82594 | ######################## 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... | mit |
rampantpixels/task_lib | build/ninja/codesign.py | 14 | 8808 | #!/usr/bin/env python
"""Codesign utility"""
import argparse
import subprocess
import os
import time
import shutil
import json
parser = argparse.ArgumentParser(description = 'Codesign utility for Ninja builds')
parser.add_argument('file', type=str,
help = 'Bundle/package to sign')
parser.add_argu... | unlicense |
liuqr/edx-xiaodun | lms/envs/acceptance.py | 6 | 5707 | """
This config file extends the test environment configuration
so that we can run the lettuce acceptance tests.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=W0401, W0614
from .test import *
from .sauce import *
# You ... | agpl-3.0 |
pkleimert/hrpt | apps/survey/migrations/0006_auto__add_field_surveyuser_oneuser.py | 4 | 12365 | # encoding: 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 field 'SurveyUser.oneuser'
db.add_column('survey_surveyuser', 'oneuser', self.gf('django.db.model... | agpl-3.0 |
babyliynfg/cross | tools/project-creator/Python2.6.6/Lib/test/test_doctest2.py | 1 | 2389 | # -*- coding: utf-8 -*-
u"""A module to test whether doctest recognizes some 2.2 features,
like static and class methods.
>>> print 'yup' # 1
yup
We include some (random) encoded (utf-8) text in the text surrounding
the example. It should be ignored:
ЉЊЈЁЂ
"""
from test import test_support
class... | mit |
mancoast/CPythonPyc_test | fail/332_test_codecmaps_kr.py | 28 | 1393 | #!/usr/bin/env python3
#
# test_codecmaps_kr.py
# Codec mapping tests for ROK encodings
#
from test import support
from test import multibytecodec_support
import unittest
class TestCP949Map(multibytecodec_support.TestBase_Mapping,
unittest.TestCase):
encoding = 'cp949'
mapfileurl = 'http:... | gpl-3.0 |
EPDCenter/android_kernel_archos_97_titan | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | gpl-2.0 |
baronleonardo/mailchecker | account.py | 1 | 3594 | import sys
from sys_keyring import MailChecker_Keyring
from settings import MailChecker_AccountSettings
class MailChecker_AccountsManagerData():
nickname = ""
email_address = ""
password = ""
imap = ""
mailbox = "",
timeout = -1
def __init__(self,
nickname: str,
... | gpl-3.0 |
zstyblik/infernal-twin | build/pillow/Scripts/painter.py | 11 | 2037 | #!/usr/bin/env python
#
# The Python Imaging Library
# $Id$
#
# this demo script illustrates pasting into an already displayed
# photoimage. note that the current version of Tk updates the whole
# image everytime we paste, so to get decent performance, we split
# the image into a set of tiles.
#
try:
from tkinter... | gpl-3.0 |
helldorado/ansible | test/units/vars/test_variable_manager.py | 25 | 11823 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
01org/yoko-tool | yokolibs/PowerMeter.py | 1 | 5430 | #!/usr/bin/env python
#
# Copyright (C) 2016-2020 Intel Corporation
# SPDX-License-Identifier: GPL-2.0-only
#
# -*- coding: utf-8 -*-
# vim: ts=4 sw=4 tw=100 et ai si
#
# Authors: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
# Helia Correia <helia.correia@linux.intel.com>
"""
This module provides API f... | gpl-2.0 |
Suwmlee/XX-Net | Python3/lib/hmac.py | 142 | 5063 | """HMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
"""
import warnings as _warnings
from _operator import _compare_digest as compare_digest
import hashlib as _hashlib
trans_5C = bytes((x ^ 0x5C) for x in range(256))
trans_36 = bytes((x ^ 0x36) fo... | bsd-2-clause |
asgard-lab/neutron | neutron/tests/unit/plugins/ml2/drivers/mech_sriov/agent/extension_drivers/test_qos_driver.py | 11 | 4385 | # Copyright 2015 Mellanox Technologies, Ltd
#
# 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 t... | apache-2.0 |
prampey/servo | tests/wpt/web-platform-tests/tools/py/testing/root/test_py_imports.py | 163 | 1983 | import py
import types
import sys
def checksubpackage(name):
obj = getattr(py, name)
if hasattr(obj, '__map__'): # isinstance(obj, Module):
keys = dir(obj)
assert len(keys) > 0
print (obj.__map__)
for name in list(obj.__map__):
assert hasattr(obj, name), (obj, name)
... | mpl-2.0 |
Russell-IO/ansible | lib/ansible/plugins/lookup/pipe.py | 150 | 2325 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.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
DOCUMENTATION = """
lookup: pipe
author: Daniel H... | gpl-3.0 |
leppa/home-assistant | homeassistant/components/netgear_lte/__init__.py | 3 | 11410 | """Support for Netgear LTE modems."""
import asyncio
from datetime import timedelta
import logging
import aiohttp
import attr
import eternalegypt
import voluptuous as vol
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
from homeassistant.components.notify import DOMAIN as NOTIFY_DOMA... | apache-2.0 |
maurofaccenda/ansible | lib/ansible/modules/cloud/vmware/vca_nat.py | 49 | 6957 | #!/usr/bin/python
# Copyright (c) 2015 VMware, Inc. All Rights Reserved.
#
# 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 ... | gpl-3.0 |
jtyr/ansible | lib/ansible/utils/unicode.py | 158 | 1166 | # (c) 2012-2014, Toshio Kuratomi <a.badger@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
Endika/connector-magento | magentoerpconnect/unit/delete_synchronizer.py | 11 | 1917 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2013 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
# pu... | agpl-3.0 |
gxx/lettuce | tests/integration/lib/Django-1.3/tests/regressiontests/forms/tests/models.py | 50 | 9010 | # -*- coding: utf-8 -*-
import datetime
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import Form, ModelForm, FileField, ModelChoiceField
from django.test import TestCase
from regressiontests.forms.models import ChoiceModel, ChoiceOptionModel, ChoiceFieldModel, FileModel, Group, Bounda... | gpl-3.0 |
cogeorg/BlackRhino | networkx/algorithms/flow/utils.py | 23 | 5880 | # -*- coding: utf-8 -*-
"""
Utility classes and functions for network flow algorithms.
"""
__author__ = """ysitu <ysitu@users.noreply.github.com>"""
# Copyright (C) 2014 ysitu <ysitu@users.noreply.github.com>
# All rights reserved.
# BSD license.
from collections import deque
import networkx as nx
__all__ = ['Curren... | gpl-3.0 |
Lightmatter/django-inlineformfield | .tox/py27/lib/python2.7/site-packages/django/contrib/sessions/backends/signed_cookies.py | 288 | 2798 | from django.conf import settings
from django.core import signing
from django.contrib.sessions.backends.base import SessionBase
class SessionStore(SessionBase):
def load(self):
"""
We load the data from the key itself instead of fetching from
some external data store. Opposite of _get_ses... | mit |
OptiPop/external_chromium_org | tools/android/memdump/memsymbols.py | 170 | 4857 | #!/usr/bin/env python
#
# 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 base64
import os
import sys
import re
from optparse import OptionParser
"""Extracts the list of resident symbols of a librar... | bsd-3-clause |
OptiPop/external_chromium_org | tools/memory_inspector/memory_inspector/core/stacktrace.py | 89 | 2438 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import posixpath
from memory_inspector.core import symbol
class Stacktrace(object):
"""Models a stack-trace, which is a sequence of stack |Frame|s."""
... | bsd-3-clause |
yfdyh000/pontoon | pontoon/sync/formats/__init__.py | 2 | 1325 | """
Parsing resource files.
See base.py for the ParsedResource base class.
"""
import os.path
from pontoon.sync.formats import lang, po, silme, xliff
# To add support for a new resource format, add an entry to this dict
# where the key is the extension you're parsing and the value is a
# callable returning an insta... | bsd-3-clause |
tuxfux-hlp-notes/python-batches | batch-67/19-files/myenv/lib/python2.7/site-packages/setuptools/monkey.py | 39 | 5789 | """
Monkey patching of distutils.
"""
import sys
import distutils.filelist
import platform
import types
import functools
from importlib import import_module
import inspect
from setuptools.extern import six
import setuptools
__all__ = []
"""
Everything is private. Contact the project team
if you think you need this ... | gpl-3.0 |
konstruktoid/ansible-upstream | lib/ansible/modules/cloud/docker/docker_secret.py | 16 | 8297 | #!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['prev... | gpl-3.0 |
clobrano/personfinder | app/create.py | 8 | 11669 | #!/usr/bin/python2.7
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
akhilari7/pa-dude | lib/python2.7/site-packages/setuptools/package_index.py | 95 | 39490 | """PyPI and direct package downloading"""
import sys
import os
import re
import shutil
import socket
import base64
import hashlib
import itertools
from functools import wraps
try:
from urllib.parse import splituser
except ImportError:
from urllib2 import splituser
from setuptools.extern import six
from setupt... | mit |
blois/AndroidSDKCloneMin | ndk/prebuilt/linux-x86_64/lib/python2.7/unittest/test/test_case.py | 89 | 43816 | import difflib
import pprint
import pickle
import re
import sys
from copy import deepcopy
from test import test_support
import unittest
from .support import (
TestEquality, TestHashing, LoggingResult, ResultWithNoStartTestRunStopTestRun
)
class Test(object):
"Keep these TestCase classes out of the main nam... | apache-2.0 |
perror/hackingweek | hackingweek/templatetags/hackingweek_tags.py | 1 | 2799 | from datetime import datetime
from django import template
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.template.base import Variable, VariableDoesNotExist
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from hackingweek.... | bsd-2-clause |
ZihengJiang/mxnet | example/speech-demo/config_util.py | 25 | 2990 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
johnny-die-tulpe/sauron | sauron/metrics/MySQLMetric.py | 2 | 2536 | #! /usr/bin/env python
#
# Copyright (c) 2011 SEOmoz
#
# 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... | mit |
huggingface/transformers | src/transformers/models/bert_generation/configuration_bert_generation.py | 2 | 6324 | # coding=utf-8
# Copyright 2020 The Google AI Language Team Authors and The HuggingFace Inc. team.
#
# 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/LICEN... | apache-2.0 |
farhaanbukhsh/sympy | sympy/physics/quantum/circuitplot.py | 58 | 12941 | """Matplotlib based plotting of quantum circuits.
Todo:
* Optimize printing of large circuits.
* Get this to work with single gates.
* Do a better job checking the form of circuits to make sure it is a Mul of
Gates.
* Get multi-target gates plotting.
* Get initial and final states to plot.
* Get measurements to plo... | bsd-3-clause |
opbeat/opbeatcli | opbeatcli/client.py | 1 | 4139 | """
Opbeat log API client.
"""
import json
import logging
from opbeatcli import __version__
from opbeatcli.log import logger
from opbeatcli import settings
from opbeatcli.exceptions import ClientConnectionError, ClientHTTPError
from opbeatcli.compat import (Request, urlopen, URLError,
HT... | bsd-3-clause |
Tesora/tesora-tempest | tempest/api/identity/admin/v3/test_projects.py | 2 | 9663 | # Copyright 2013 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 |
rduivenvoorde/QGIS | python/plugins/db_manager/db_plugins/postgis/plugin.py | 25 | 17115 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
usersource/tasks | tasks_phonegap/Tasks/plugins/io.usersource.anno/tools/copytool2/apiclient/http.py | 102 | 52847 | # Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | mpl-2.0 |
kylerbrown/bark | tests/test_spikes.py | 2 | 2232 | import numpy as np
import bark
import pytest
from scipy.signal import argrelextrema
from bark.tools.datspike import main, spikes, thres_extrema, stream_spikes
data0 = np.array([[0], [1], [0], ])
data1 = np.array([[0, 0], [1, 0], [0, 0], ])
data2 = np.array([[0], [1], [1], [0], ])
def test_thres_extrema():
rs, =... | gpl-2.0 |
qtproject/qt-labs-qbs | src/3rdparty/python/lib/python2.7/site-packages/ds_store/store.py | 11 | 45209 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
import binascii
import struct
import biplist
import mac_alias
try:
next
except NameError:
next = lambda x: x.next()
try:
unicode
except NameError:
unicode = str
from .... | lgpl-2.1 |
ariakerstein/twitterFlaskClone | project/lib/python2.7/site-packages/pip/vcs/git.py | 280 | 7608 | from __future__ import absolute_import
import logging
import tempfile
import os.path
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves.urllib import request as urllib_request
from pip.utils import display_path, rmtree
from pip.vcs import vcs, VersionControl
urlsplit = urllib... | mit |
ABcDexter/cython | tests/run/withstat_py.py | 29 | 4281 | import sys
def typename(t):
name = type(t).__name__
if sys.version_info < (2,5):
if name == 'classobj' and issubclass(t, MyException):
name = 'type'
elif name == 'instance' and isinstance(t, MyException):
name = 'MyException'
return "<type '%s'>" % name
class MyEx... | apache-2.0 |
nebril/fuel-web | nailgun/nailgun/db/migration/__init__.py | 5 | 3917 | # -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, 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 requi... | apache-2.0 |
loulich/Couchpotato | libs/guessit/transfo/guess_weak_episodes_rexps.py | 94 | 2184 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2012 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
indashnet/InDashNet.Open.UN2000 | android/external/chromium_org/third_party/mesa/src/src/gallium/drivers/svga/svgadump/svga_dump.py | 50 | 11879 | #!/usr/bin/env python
'''
Generates dumper for the SVGA 3D command stream using pygccxml.
Jose Fonseca <jfonseca@vmware.com>
'''
copyright = '''
/**********************************************************
* Copyright 2009 VMware, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any p... | apache-2.0 |
darktears/chromium-crosswalk | tools/cr/cr/commands/install.py | 113 | 1206 | # 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.
"""A module for the install command."""
import cr
class InstallCommand(cr.Command):
"""The implementation of the install command.
This first uses Bui... | bsd-3-clause |
steventimberman/masterDebater | venv/lib/python2.7/site-packages/pip/wheel.py | 338 | 32010 | """
Support for installing and building the "wheel" binary package format.
"""
from __future__ import absolute_import
import compileall
import csv
import errno
import functools
import hashlib
import logging
import os
import os.path
import re
import shutil
import stat
import sys
import tempfile
import warnings
from ba... | mit |
bhilburn/gnuradio | gnuradio-runtime/python/gnuradio/gr_unittest.py | 58 | 6303 | #!/usr/bin/env python
#
# Copyright 2004,2010 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 optio... | gpl-3.0 |
bbaumer/ansible-modules-core | cloud/openstack/os_auth.py | 131 | 2039 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | gpl-3.0 |
dmart914/CTCI | 02-linked-lists/2-2-kth-last.py | 1 | 2647 | # 2-2 Implement an algorithm to find the kth to last element of a
# a singly linked list
# Pseudo:
# Iterate through all to find the length
# Iterate again to get the kth last
class Node:
'''A node in a singly linked list'''
def __init__(self, data):
self.data = data
self.next = None
def... | apache-2.0 |
couchapp/couchapp | tests/test_cli.py | 2 | 9635 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Benoit Chesneau <benoitc@e-engura.org>
#
# This software is licensed as described in the file LICENSE, which
# you should have received as part of this distribution.
import os
import tempfile
import shutil
import sys
import unittest2 as unittest
from tes... | apache-2.0 |
kjc88/sl4a | python/src/Lib/test/test_codecencodings_jp.py | 149 | 3938 | #!/usr/bin/env python
#
# test_codecencodings_jp.py
# Codec encoding tests for Japanese encodings.
#
from test import test_support
from test import test_multibytecodec_support
import unittest
class Test_CP932(test_multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'cp932'
tstring = test_multiby... | apache-2.0 |
santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/SQLAlchemy-0.4.5-py2.5.egg/sqlalchemy/orm/uowdumper.py | 4 | 7115 | # orm/uowdumper.py
# Copyright (C) 2005, 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Dumps out a string representation of a UOWTask structure"""
from sqlalchemy.orm import u... | bsd-3-clause |
nan86150/ImageFusion | lib/python2.7/site-packages/pip/commands/__init__.py | 280 | 2007 | """
Package containing all pip commands
"""
from __future__ import absolute_import
from pip.commands.completion import CompletionCommand
from pip.commands.freeze import FreezeCommand
from pip.commands.help import HelpCommand
from pip.commands.list import ListCommand
from pip.commands.search import SearchCommand
from p... | mit |
JavML/django | tests/gis_tests/geoapp/test_regress.py | 318 | 3857 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
from django.contrib.gis.db.models import Extent
from django.contrib.gis.shortcuts import render_to_kmz
from django.db.models import Count, Min
from django.test import TestCase, skipUnlessDBFeature
from ..utils import no_o... | bsd-3-clause |
cmichal/python-social-auth | social/tests/backends/test_saml.py | 49 | 4569 | import re
import json
import sys
import unittest2
import requests
from os import path
from mock import patch
from httpretty import HTTPretty
try:
from onelogin.saml2.utils import OneLogin_Saml2_Utils
except ImportError:
# Only available for python 2.7 at the moment, so don't worry if this fails
pass
from... | bsd-3-clause |
thomasyu888/Genie | genie/validate.py | 1 | 10061 | #!/usr/bin/env python3
import importlib
import inspect
import logging
import sys
import synapseclient
try:
from synapseclient.core.exceptions import SynapseHTTPError
except ModuleNotFoundError:
from synapseclient.exceptions import SynapseHTTPError
from . import config
from . import example_filetype_format
fro... | mit |
mrquim/mrquimrepo | script.module.unidecode/lib/unidecode/x061.py | 252 | 4662 | data = (
'Qiao ', # 0x00
'Chou ', # 0x01
'Bei ', # 0x02
'Xuan ', # 0x03
'Wei ', # 0x04
'Ge ', # 0x05
'Qian ', # 0x06
'Wei ', # 0x07
'Yu ', # 0x08
'Yu ', # 0x09
'Bi ', # 0x0a
'Xuan ', # 0x0b
'Huan ', # 0x0c
'Min ', # 0x0d
'Bi ', # 0x0e
'Yi ', # 0x0f
'Mian ', # 0x10
'Yon... | gpl-2.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/matplotlib/backends/backend_tkagg.py | 10 | 40267 | # Todd Miller jmiller@stsci.edu
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import tkinter as Tk
from six.moves import tkinter_filedialog as FileDialog
import os, sys, math
import os.path
# Paint image to Tk photo blitter ex... | gpl-3.0 |
Allow2CEO/browser-ios | brave/node_modules/bloom-filter-cpp/vendor/depot_tools/third_party/protobuf26/internal/message_listener.py | 590 | 3354 | # 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:
#
# * Redistributions o... | mpl-2.0 |
Manojkumar91/odoo_inresto | addons/website_sale_delivery/controllers/main.py | 214 | 1205 | # -*- coding: utf-8 -*-
import openerp
from openerp import http
from openerp.http import request
import openerp.addons.website_sale.controllers.main
class website_sale(openerp.addons.website_sale.controllers.main.website_sale):
@http.route(['/shop/payment'], type='http', auth="public", website=True)
def paym... | agpl-3.0 |
lalanza808/lalanza808.github.io | vendor/bundle/ruby/2.0.0/gems/pygments.rb-0.6.3/vendor/pygments-main/pygments/lexers/_stan_builtins.py | 47 | 8721 | # -*- coding: utf-8 -*-
"""
pygments.lexers._stan_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains the names of functions for Stan used by
``pygments.lexers.math.StanLexer``. These builtins are from Stan language v2.2.0.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
... | mit |
ampax/edx-platform | lms/djangoapps/course_api/tests/test_forms.py | 33 | 4212 | """
Tests for Course API forms.
"""
import ddt
from django.contrib.auth.models import AnonymousUser
from django.http import QueryDict
from itertools import product
from urllib import urlencode
from openedx.core.djangoapps.util.test_forms import FormTestMixin
from student.tests.factories import UserFactory
from xmodul... | agpl-3.0 |
demiangomez/Parallel.GAMIT | classes/pyETM.py | 1 | 109441 | # -*- coding: utf-8 -*-
"""
Project: Parallel.Archive
Date: 3/3/17 11:27 AM
Author: Demian D. Gomez
"""
import numpy as np
import pyStationInfo
import pyDate
from numpy import sin
from numpy import cos
from numpy import pi
from scipy.stats import chi2
import pyEvents
from zlib import crc32
from Utils import ct2lg
from... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.