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 |
|---|---|---|---|---|---|
rlanyi/got-your-back | gimaplib.py | 1 | 5066 | # Functions that make IMAP behave more Gmail-ish
import imaplib
import re
import shlex
import sys
import gyb
def GImapHasExtensions(imapconn):
'''
Args:
imapconn: object, an authenticated IMAP connection
Returns:
boolean, True if Gmail IMAP Extensions defined at:
http://... | apache-2.0 |
wwjiang007/flink | flink-python/pyflink/fn_execution/datastream/window/window_operator.py | 5 | 24831 | ################################################################################
# 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... | apache-2.0 |
fedepad/espressopp | src/tools/units.py | 7 | 3518 | # Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of t... | gpl-3.0 |
madprof/alpha-hub | hub/test_model.py | 1 | 14826 | # |ALPHA| Hub - an authorization server for alpha-ioq3
# See files README and COPYING for copyright and licensing details.
"""
test_model.py - test the data model
- writing all this testing code is fairly tedious, but let's
stick with the TDD program and see where it leads...
- both py.test and nose run setup_modu... | agpl-3.0 |
ChristianFrisson/gaia | test/scratch/classification/run_tests.py | 3 | 2660 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Gaia
#
# Gaia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Fou... | agpl-3.0 |
ATNF/askapsdp | Tools/scons_tools/cloptions.py | 1 | 8340 | # Copyright (c) 2009 CSIRO
# Australia Telescope National Facility (ATNF)
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# PO Box 76, Epping NSW 1710, Australia
# atnf-enquiries@csiro.au
#
# This file is part of the ASKAP software distribution.
#
# The ASKAP software distribution is free softwar... | gpl-2.0 |
knowmetools/km-api | km_api/know_me/profile/tests/permissions/test_has_list_entry_list_permissions.py | 1 | 3219 | from unittest import mock
import pytest
from django.http import Http404
from rest_framework.permissions import SAFE_METHODS
from know_me.profile import permissions
UNSAFE_METHODS = ("DELETE", "PATCH", "POST", "PUT")
ALL_METHODS = SAFE_METHODS + UNSAFE_METHODS
mock_has_object_read_permission = mock.patch(
"kno... | apache-2.0 |
Avira/tox | src/tox/package.py | 1 | 10776 | import json
import os
import sys
import textwrap
from collections import namedtuple
from itertools import chain
import pkg_resources
import py
import six
from filelock import FileLock, Timeout
import tox
from tox.config import DepConfig, get_py_project_toml
BuildInfo = namedtuple("BuildInfo", ["requires", "backend_m... | mit |
pquentin/django | tests/forms_tests/tests/test_extra.py | 13 | 35893 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.forms import (
CharField, DateField, EmailField, FileField, Form, GenericIPAddressField,
HiddenInput, ImageField, IPAddressField, MultipleChoiceField,
MultiValueField, MultiWidget, PasswordInput, SelectMultiple, Sl... | bsd-3-clause |
MrBasset/libcloud | libcloud/utils/dist.py | 57 | 4973 | # 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 use ... | apache-2.0 |
sbidoul/odoo | addons/l10n_in_hr_payroll/wizard/hr_yearly_salary_detail.py | 374 | 2376 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
piyushroshan/xen-4.3.2 | tools/xm-test/tests/block-create/10_block_attach_dettach_multiple_devices.py | 38 | 2427 | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Copyright (C) flonatel GmbH & Co. KG, 2009
# Authors: Murillo F. Bernardes <mfb@br.ibm.com>
# Andreas Florath <xen@flonatel.org>
# Block devices are by random attached to and detached from the domU.
import re
import random
from... | gpl-2.0 |
K-Constantine/Amaraki | core/deps/gyp/test/win/gyptest-link-ordering.py | 225 | 3058 | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure the link order of object files is the same between msvs and ninja.
"""
import TestGyp
import sys
if sys.platform == 'win32'... | mit |
google/llvm-propeller | llvm/test/CodeGen/SystemZ/Large/branch-range-05.py | 16 | 3639 | # Test 32-bit COMPARE IMMEDIATE AND BRANCH in cases where the sheer number of
# instructions causes some branches to be out of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# Construct:
#
# before0:
# conditional branch to after0
# ...
# beforeN:
# conditional branch to after0
# main:
# ... | apache-2.0 |
radzhome/AWS-ElasticBeanstalk-CLI | eb/linux/python3/lib/aws/requests/packages/urllib3/response.py | 8 | 7411 | # urllib3/response.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import gzip
import logging
import zlib
from io import BytesIO
from .exceptions import Decode... | apache-2.0 |
dagwieers/ansible | lib/ansible/modules/packaging/language/easy_install.py | 102 | 6683 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Matt Wright <matt@nobien.net>
# 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 |
chidea/GoPythonDLLWrapper | bin/lib/encodings/cp1125.py | 213 | 34597 | """ Python Character Mapping Codec for CP1125
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
return codecs.charmap_decode(input,errors,deco... | mit |
heke123/chromium-crosswalk | third_party/typ/typ/__init__.py | 81 | 3167 | # 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 ag... | bsd-3-clause |
Valloric/hyde | hyde/ext/publishers/pypi.py | 2 | 5327 | """
Contains classes and utilities that help publishing a hyde website to
the documentation hosting on http://packages.python.org/.
"""
import os
import getpass
import zipfile
import tempfile
import httplib
import urlparse
from base64 import standard_b64encode
import ConfigParser
from hyde.fs import File, Folder
fro... | mit |
pwong-mapr/private-hue | desktop/core/ext-py/Django-1.4.5/tests/modeltests/basic/tests.py | 25 | 22647 | from __future__ import absolute_import
from datetime import datetime
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.fields import FieldDoesNotExist
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
from django.utils.translation import ugettext_lazy
from .models impor... | apache-2.0 |
usingjsonschema/ujs-jsonvalidate-python | setup.py | 1 | 1154 | from setuptools import setup
setup (
name='ujs-jsonvalidate',
version='0.1.0',
description='JSON validation utility',
long_description=open('README.rst').read(),
url='http://github.com/usingjsonschema/ujs-jsonvalidate-python',
author='Joe McIntyre',
author_email='j_h_mcintyre@yahoo.com',
... | mit |
40223202/test2 | static/Brython3.1.1-20150328-091302/Lib/copyreg.py | 749 | 6611 | """Helper to provide extensibility for pickle.
This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
"""
__all__ = ["pickle", "constructor",
"add_extension", "remove_extension", "clear_extension_cache"]
dispatch_table = {}
def pickle(ob_typ... | gpl-3.0 |
jart/tensorflow | tensorflow/python/kernel_tests/nth_element_op_test.py | 20 | 6683 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
abhishek-ch/hue | desktop/core/ext-py/kazoo-2.0/kazoo/tests/test_security.py | 51 | 1321 | import unittest
from nose.tools import eq_
from kazoo.security import Permissions
class TestACL(unittest.TestCase):
def _makeOne(self, *args, **kwargs):
from kazoo.security import make_acl
return make_acl(*args, **kwargs)
def test_read_acl(self):
acl = self._makeOne("digest", ":", re... | apache-2.0 |
petemounce/ansible | lib/ansible/modules/cloud/azure/azure_rm_storageblob.py | 56 | 22010 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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 Soft... | gpl-3.0 |
yantrabuddhi/nativeclient | tools/toolchain_tester/toolchain_tester.py | 10 | 10639 | #!/usr/bin/python
# Copyright (c) 2011 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Simple test suite for toolchains espcially llvm arm toolchains.
Sample invocations
tools/toolchain_tester/toolchain_tester.py... | bsd-3-clause |
javelinanddart/bricked-pyramid-3.0 | Documentation/target/tcm_mod_builder.py | 3119 | 42754 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
fzheng/codejam | lib/python2.7/site-packages/path.py | 5 | 55644 | #
# Copyright (c) 2010 Mikhail Gusarov
#
# 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, d... | mit |
rtoma/Diamond | src/collectors/numa/numa.py | 61 | 1615 | #!/usr/bin/env python
# coding=utf-8
"""
This class collects data on NUMA utilization
#### Dependencies
* numactl
"""
import diamond.collector
from subprocess import Popen, PIPE
from re import compile as re_compile
import logging
node_re = re_compile('(?P<node>^node \d+ (free|size)): (?P<size>\d+) \MB')
class Num... | mit |
kaiweifan/neutron | neutron/tests/unit/nec/test_ofc_client.py | 9 | 4551 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 NEC Corporation. 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.or... | apache-2.0 |
firebitsbr/pwn_plug_sources | src/set/src/webattack/harvester/scraper.py | 6 | 2358 | #!/usr/bin/env python
import os
import sys
import re
import subprocess
import urlparse
import shutil
#
# Scraper will grab the cloned website and try defining post parameters
#
# grab ipaddr
fileopen=file("src/program_junk/ipaddr.file","r").readlines()
for line in fileopen:
ipaddr=line.rstrip()
# end ipaddr
# set ... | gpl-3.0 |
girving/tensorflow | tensorflow/contrib/distributions/python/ops/bijectors/batch_normalization.py | 30 | 11169 | # 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 |
wsmith323/django | tests/cache/tests.py | 86 | 85128 | # -*- coding: utf-8 -*-
# Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
from __future__ import unicode_literals
import copy
import os
import re
import shutil
import tempfile
import threading
import time
import unittest
import warnings
from django.conf import settings
... | bsd-3-clause |
sillywilly42/simian | src/tests/simian/mac/api/groups_test.py | 1 | 3629 | #!/usr/bin/env python
#
# Copyright 2016 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 require... | apache-2.0 |
eul-721/The-Perfect-Pokemon-Team-Balancer | libs/env/Lib/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py | 3132 | 36011 | ######################## 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... | gpl-2.0 |
pschmitt/home-assistant | homeassistant/components/rpi_camera/camera.py | 19 | 4050 | """Camera platform that has a Raspberry Pi camera."""
import logging
import os
import shutil
import subprocess
from tempfile import NamedTemporaryFile
from homeassistant.components.camera import Camera
from homeassistant.const import CONF_FILE_PATH, CONF_NAME, EVENT_HOMEASSISTANT_STOP
from .const import (
CONF_HO... | apache-2.0 |
paulczar/magnum | magnum/cmd/api.py | 10 | 1772 | # Copyright 2013 - 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 agr... | apache-2.0 |
gsehub/edx-platform | openedx/core/djangoapps/credit/exceptions.py | 24 | 2283 | """Exceptions raised by the credit API. """
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from rest_framework import status
from rest_framework.exceptions import APIException
# TODO: Cleanup this mess! ECOM-2908
class CreditApiBadRequest(Exception):
"""
Cou... | agpl-3.0 |
turbokongen/home-assistant | homeassistant/components/lutron/__init__.py | 15 | 5882 | """Component for interacting with a Lutron RadioRA 2 system."""
import logging
from pylutron import Button, Lutron
import voluptuous as vol
from homeassistant.const import ATTR_ID, CONF_HOST, CONF_PASSWORD, CONF_USERNAME
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv
... | apache-2.0 |
arnaudsj/titanium_mobile | support/android/mako/_ast_util.py | 63 | 25415 | # -*- coding: utf-8 -*-
"""
ast
~~~
The `ast` module helps Python applications to process trees of the Python
abstract syntax grammar. The abstract syntax itself might change with
each Python release; this module helps to find out programmatically what
the current grammar looks like and allows... | apache-2.0 |
kantel/processingpy | mpmathtest/mpmath/ctx_iv.py | 18 | 16798 | import operator
from . import libmp
from .libmp.backend import basestring
from .libmp import (
int_types, MPZ_ONE,
prec_to_dps, dps_to_prec, repr_dps,
round_floor, round_ceiling,
fzero, finf, fninf, fnan,
mpf_le, mpf_neg,
from_int, from_float, from_str, from_rational,
mpi_mid, mpi_delta, ... | mit |
da1z/intellij-community | python/lib/Lib/site-packages/django/utils/termcolors.py | 417 | 6885 | """
termcolors.py
"""
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = dict([(color_names[x], '3%s' % x) for x in range(8)])
background = dict([(color_names[x], '4%s' % x) for x in range(8)])
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink': '5', 'rever... | apache-2.0 |
kaedroho/django | tests/model_fields/test_decimalfield.py | 20 | 3780 | import unittest
from decimal import Decimal
from django.core import validators
from django.core.exceptions import ValidationError
from django.db import connection, models
from django.test import TestCase
from .models import BigD, Foo
class DecimalFieldTests(TestCase):
def test_to_python(self):
f = mode... | bsd-3-clause |
MotorolaMobilityLLC/external-chromium_org | tools/checkperms/checkperms.py | 34 | 13745 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Makes sure files have the right permissions.
Some developers have broken SCM configurations that flip the svn:executable
permis... | bsd-3-clause |
wavicles/fossasia-pslab-apps | psl_res/GUI/E_MISCELLANEOUS/A_Add-ons/Z_NFC.py | 1 | 4539 | #!/usr/bin/python
'''
Use the MF522 RFID Reader via the SPI port.
uses chip select 1
'''
from __future__ import print_function
import os
from PyQt4 import QtCore, QtGui
import time,sys
from .templates import NFC
import sys
params = {
'image' : 'mf522.png',
'helpfile': 'diodeIV.html',
'name':'RFID Reader\nMF522'
}
... | gpl-3.0 |
dbarsam/python-vsgen-ptvs | vsgenptvs/suite.py | 1 | 4394 | # -*- coding: utf-8 -*-
"""
This module provides all functionality for extending Python's suite class of functionality.
The module defines the class VSGSuite. The VSGSuite class groups the different functionalities into a single class.
"""
import sys
import os
import argparse
import pkg_resources
from vsgen.suite i... | mit |
2014c2g2/2014c2 | exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/xml/dom/minicompat.py | 781 | 3228 | """Python version compatibility support for minidom."""
# This module should only be imported using "import *".
#
# The following names are defined:
#
# NodeList -- lightest possible NodeList implementation
#
# EmptyNodeList -- lightest possible NodeList that is guaranteed to
# remain empty... | gpl-2.0 |
mkminer/p2pool | p2pool/data.py | 63 | 38817 | from __future__ import division
import hashlib
import os
import random
import sys
import time
from twisted.python import log
import p2pool
from p2pool.bitcoin import data as bitcoin_data, script, sha256
from p2pool.util import math, forest, pack
# hashlink
hash_link_type = pack.ComposedType([
('state', pack.Fi... | gpl-3.0 |
GregDMeyer/dynamite | tests/integration/test_states.py | 1 | 4702 | '''
Integration tests for states.
'''
import unittest as ut
import numpy as np
import dynamite_test_runner as dtr
from dynamite.states import State
class RandomSeed(dtr.DynamiteTestCase):
def test_generation(self):
'''
Make sure that different processors get the same random seed.
'''
... | mit |
vad/django-cms | cms/tests/frontend.py | 11 | 17786 | # -*- coding: utf-8 -*-
import sys
import datetime
import os
import time
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.core.urlresolvers import clear_url_caches
from django.te... | bsd-3-clause |
michaltakac/autokey | src/lib/gtkapp.py | 48 | 10468 | # -*- coding: utf-8 -*-
# Copyright (C) 2011 Chris Dekter
#
# 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 pr... | gpl-3.0 |
rockneurotiko/django | django/db/backends/sqlite3/base.py | 323 | 18115 | """
SQLite3 backend for django.
Works with either the pysqlite2 module or the sqlite3 module in the
standard library.
"""
from __future__ import unicode_literals
import datetime
import decimal
import re
import warnings
from django.conf import settings
from django.db import utils
from django.db.backends import utils ... | bsd-3-clause |
kcpawan/django | django/contrib/admin/bin/compress.py | 266 | 2282 | #!/usr/bin/env python
import argparse
import os
import subprocess
import sys
try:
import closure
except ImportError:
closure_compiler = None
else:
closure_compiler = os.path.join(os.path.dirname(closure.__file__), 'closure.jar')
js_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'static', ... | bsd-3-clause |
mohamed--abdel-maksoud/chromium.src | build/android/pylib/device/adb_wrapper.py | 9 | 16586 | # 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.
"""This module wraps Android's adb tool.
This is a thin wrapper around the adb interface. Any additional complexity
should be delegated to a higher level (e... | bsd-3-clause |
AgainstWind/python-demos | mathematics/function_visual.py | 1 | 1714 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
def printTwoDimension():
plt.figure(1)
ax = plt.subplot(111)
x = np.linspace(0, np.pi * 2, 200) # 在0到2pi之间,均匀产生200点的数组
# r = 2cosθ
r = 2 * np.cos(x) # 半径
ax.p... | apache-2.0 |
chadnickbok/npm | node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py | 1558 | 4945 | # 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.
import re
import os
def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
... | artistic-2.0 |
drawks/ansible | lib/ansible/modules/cloud/ovirt/ovirt_vm_facts.py | 40 | 4928 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... | gpl-3.0 |
linuxvom/linux | 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 |
fernandog/Medusa | ext/cachecontrol/_cmd.py | 4 | 1267 | import logging
import requests
from cachecontrol.adapter import CacheControlAdapter
from cachecontrol.cache import DictCache
from cachecontrol.controller import logger
from argparse import ArgumentParser
def setup_logging():
logger.setLevel(logging.DEBUG)
handler = logging.StreamHandler()
logger.addHan... | gpl-3.0 |
douggeiger/gnuradio | gr-digital/python/digital/bpsk.py | 49 | 5593 | #
# Copyright 2005,2006,2011 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 ve... | gpl-3.0 |
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated | python-packages/mne-python-0.10/tutorials/plot_cluster_stats_spatio_temporal.py | 15 | 7497 | """
.. _tut_stats_cluster_source_1samp:
=================================================================
Permutation t-test on source data with spatio-temporal clustering
=================================================================
Tests if the evoked response is significantly different between
conditions acros... | bsd-3-clause |
Arcanemagus/SickRage | lib/hachoir_parser/archive/rar.py | 84 | 13364 | """
RAR parser
Status: can only read higher-level attructures
Author: Christophe Gisquet
"""
from hachoir_parser import Parser
from hachoir_core.field import (StaticFieldSet, FieldSet,
Bit, Bits, Enum,
UInt8, UInt16, UInt32, UInt64,
String, TimeDateMSDOS32,
NullBytes, NullBits, RawBytes)
from hachoir_... | gpl-3.0 |
klahnakoski/SpotManager | vendor/jx_base/namespace.py | 3 | 1653 | # encoding: utf-8
#
#
# 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/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, divisi... | mpl-2.0 |
mgax/babel | babel/dates.py | 1 | 43523 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists... | bsd-3-clause |
project-zerus/thrift | lib/py/src/server/TServer.py | 28 | 9642 | #
# 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 |
sarvex/django | django/utils/dates.py | 590 | 2296 | "Commonly-used date structures"
from django.utils.translation import pgettext_lazy, ugettext_lazy as _
WEEKDAYS = {
0: _('Monday'), 1: _('Tuesday'), 2: _('Wednesday'), 3: _('Thursday'), 4: _('Friday'),
5: _('Saturday'), 6: _('Sunday')
}
WEEKDAYS_ABBR = {
0: _('Mon'), 1: _('Tue'), 2: _('Wed'), 3: _('Thu'),... | bsd-3-clause |
ronabop/cobbler | cobbler/collection_manager.py | 15 | 6636 | """
Repository of the Cobbler object model
Copyright 2006-2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
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 t... | gpl-2.0 |
tempbottle/rethinkdb | test/common/driver.py | 3 | 34146 | # Copyright 2010-2015 RethinkDB, all rights reserved.
"""Manage a cluster of RethinkDB nodes, including simulating netsplits.
This is designed to simulate normal operations, so does not include support
for things like `--join`ing to an invalid port."""
import atexit, copy, datetime, os, random, re, shutil, signal, so... | agpl-3.0 |
qedi-r/home-assistant | homeassistant/components/life360/config_flow.py | 5 | 3963 | """Config flow to configure Life360 integration."""
from collections import OrderedDict
import logging
from life360 import Life360Error, LoginError
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from .const import CONF_AUTHORIZATION, DOM... | apache-2.0 |
KohlsTechnology/ansible | test/units/playbook/test_attribute.py | 119 | 1823 | # (c) 2015, Marius Gedminas <marius@gedmin.as>
#
# 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 vers... | gpl-3.0 |
aperigault/ansible | lib/ansible/executor/playbook_executor.py | 35 | 13929 | # (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 |
ahaym/eden | languages/pt.py | 9 | 207809 | # -*- coding: utf-8 -*-
{
"A location that specifies the geographic area for this region. This can be a location from the location hierarchy, or a 'group location', or a location that has a boundary for the area.": "Uma localização que especifica a área geográfica para esta região. Pode ser uma localização da hierarq... | mit |
bunnyinc/django-oidc-provider | oidc_provider/lib/utils/oauth2.py | 3 | 2127 | import logging
import re
from django.http import HttpResponse
from oidc_provider.lib.errors import BearerTokenError
from oidc_provider.models import Token
logger = logging.getLogger(__name__)
def extract_access_token(request):
"""
Get the access token using Authorization Request Header Field method.
O... | mit |
XWARIOSWX/wnframework | webnotes/utils/datautils.py | 34 | 4907 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import msgprint, _
import json
import csv, cStringIO
from webnotes.utils import encode, cstr, cint, flt
def read_csv_content_from_uploaded_file(i... | mit |
cecep-edu/edx-platform | lms/djangoapps/commerce/tests/factories.py | 49 | 1469 | """ Factories for generating fake commerce-related data. """
import factory
from factory.fuzzy import FuzzyText
class OrderFactory(factory.Factory):
""" Factory for stubbing orders resources from Ecommerce (v2). """
class Meta(object):
model = dict
number = factory.Sequence(lambda n: 'edx-%d' % n... | agpl-3.0 |
scottmcmaster/catapult | third_party/html5lib-python/html5lib/tests/test_tokenizer.py | 21 | 7852 | from __future__ import absolute_import, division, unicode_literals
import json
import warnings
import re
from six import unichr
from .support import get_data_files
from html5lib.tokenizer import HTMLTokenizer
from html5lib import constants, utils
class TokenizerTestParser(object):
def __init__(self, initialSt... | bsd-3-clause |
ArneBab/pypyjs | website/demo/home/rfk/repos/pypy/lib-python/2.7/idlelib/EditorWindow.py | 18 | 63644 | import sys
import os
import re
import imp
from Tkinter import *
import tkSimpleDialog
import tkMessageBox
import webbrowser
from idlelib.MultiCall import MultiCallCreator
from idlelib import idlever
from idlelib import WindowList
from idlelib import SearchDialog
from idlelib import GrepDialog
from idlelib import Repla... | mit |
AnishShah/tensorflow | tensorflow/contrib/framework/__init__.py | 7 | 4185 | # 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 |
ingadhoc/odoo | addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py | 337 | 3122 | # -*- 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 |
tjwei/jedi | jedi/evaluate/imports.py | 33 | 19845 | """
:mod:`jedi.evaluate.imports` is here to resolve import statements and return
the modules/classes/functions/whatever, which they stand for. However there's
not any actual importing done. This module is about finding modules in the
filesystem. This can be quite tricky sometimes, because Python imports are not
always ... | mit |
pfnet/chainer | tests/onnx_chainer_tests/functions_tests/test_normalizations.py | 4 | 5991 | import chainer
import chainer.functions as F
import chainer.links as L
from chainer import testing
import numpy as np
from onnx_chainer.testing import input_generator
from onnx_chainer_tests.helper import get_initializer_names
from onnx_chainer_tests.helper import ONNXModelTest
@testing.parameterize(
{
'... | mit |
knowsis/django | tests/urlpatterns_reverse/tests.py | 40 | 35009 | # -*- coding: utf-8 -*-
"""
Unit tests for reverse URL lookups.
"""
from __future__ import absolute_import, unicode_literals
import sys
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
from django.core.urlresolvers i... | bsd-3-clause |
pombredanne/product-definition-center | pdc/apps/component/tests.py | 1 | 98542 | #
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import mock
import unittest
from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from pdc.apps.common.test_utils import TestCaseWithChangeS... | mit |
imx6uldev/depedency_tools | glib/glib-2.46.2/gio/gdbus-2.0/codegen/dbustypes.py | 33 | 17493 | # -*- Mode: Python -*-
# GDBus - GLib D-Bus Library
#
# Copyright (C) 2008-2011 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at ... | mit |
ARM-software/trappy | tests/test_copyright.py | 1 | 3717 | # Copyright 2015-2017 ARM Limited
#
# 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 w... | apache-2.0 |
pilou-/ansible | lib/ansible/modules/network/enos/enos_facts.py | 52 | 15750 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (C) 2017 Red Hat Inc.
# Copyright (C) 2017 Lenovo.
#
# GNU General Public License v3.0+
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE... | gpl-3.0 |
wackywendell/numpy | numpy/core/tests/test_einsum.py | 36 | 39597 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_array_equal,
assert_almost_equal, assert_raises, suppress_warnings
)
# Setup for optimize einsum
chars = 'abcdefghij'
sizes = np.array([... | bsd-3-clause |
Achuth17/scikit-bio | skbio/sequence/_nucleotide_sequence.py | 1 | 7434 | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | bsd-3-clause |
moshele/networking-mlnx-master | neutron/plugins/ml2/drivers/mlnx/mech_mlnx.py | 10 | 3448 | # Copyright (c) 2014 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 required by appli... | apache-2.0 |
eggsandbeer/scheduler | synergy/db/model/managed_process_entry.py | 1 | 3501 | __author__ = 'Bohdan Mushkevych'
from odm.fields import StringField, ObjectIdField, BooleanField
from synergy.db.model.daemon_process_entry import DaemonProcessEntry
from synergy.scheduler.scheduler_constants import BLOCKING_CHILDREN, BLOCKING_DEPENDENCIES, BLOCKING_NORMAL, \
EXCHANGE_MANAGED_WORKER, TYPE_MANAGED... | bsd-3-clause |
ShaheenHossain/eagle-medical | medical_medicament_attributes/models/medical_medicament_attribute_abstract.py | 2 | 1420 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Dave Lasley <dave@laslabs.com>
# Copyright: 2015 LasLabs, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | agpl-3.0 |
dbckz/ansible | lib/ansible/modules/database/postgresql/postgresql_user.py | 13 | 29174 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#... | gpl-3.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/pandas/core/resample.py | 3 | 44151 | from datetime import timedelta
import numpy as np
import warnings
import copy
from textwrap import dedent
import pandas as pd
from pandas.core.base import AbstractMethodError, GroupByMixin
from pandas.core.groupby import (BinGrouper, Grouper, _GroupBy, GroupBy,
SeriesGroupBy, groupby,... | mit |
mariosky/evo-drawings | venv/lib/python2.7/site-packages/pystache/common.py | 48 | 2022 | # coding: utf-8
"""
Exposes functionality needed throughout the project.
"""
from sys import version_info
def _get_string_types():
# TODO: come up with a better solution for this. One of the issues here
# is that in Python 3 there is no common base class for unicode strings
# and byte strings, and ... | agpl-3.0 |
DinoCow/airflow | tests/dags/test_retry_handling_job.py | 10 | 1369 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
abhattad4/Digi-Menu | build/lib.linux-x86_64-2.7/django/template/smartif.py | 81 | 6639 | """
Parser and utilities for the smart 'if' tag
"""
import warnings
from django.utils.deprecation import RemovedInDjango20Warning
# Using a simple top down parser, as described here:
# http://effbot.org/zone/simple-top-down-parsing.htm.
# 'led' = left denotation
# 'nud' = null denotation
# 'bp' = binding power (l... | bsd-3-clause |
zyf-website/pocket48-tools | pocket48_tools/subscribe/db.py | 1 | 3379 | """
author: sljeff
email: kindjeff.com@gmail.com
"""
import datetime
import peewee
from playhouse.sqlite_ext import SqliteExtDatabase
db = SqliteExtDatabase('subscribe.db')
class BaseModel(peewee.Model):
created_at = peewee.DateTimeField(default=datetime.datetime.now)
class Meta:
database = db
cl... | mit |
mszewczy/odoo | addons/sale_stock/report/sale_report.py | 231 | 2100 | # -*- 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... | agpl-3.0 |
zaddach/ida_tools | qt_resource_extractor.py | 1 | 4226 | MANGLED_qRegisterResourceData_FUNCTION_NAMES = ["__Z21qRegisterResourceDataiPKhS0_S0_"]
class QResourceRoot():
def __init__(self, tree_ptr, names_ptr, data_ptr):
self._tree_ptr = tree_ptr
self._data_ptr = data_ptr
self._names_ptr = names_ptr
def findOffset(self, node):
... | mit |
demisto/content | Packs/BastilleNetworks/Integrations/BastilleNetworks/BastilleNetworks.py | 1 | 12933 | import demistomock as demisto
from CommonServerPython import * # noqa: E402 lgtm [py/polluting-import]
from CommonServerUserPython import * # noqa: E402 lgtm [py/polluting-import]
# IMPORTS
import json
import copy
import requests
from datetime import datetime
import dateparser
# Disable insecure warnings
requests.... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.