repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
Gadal/sympy | sympy/combinatorics/tests/test_util.py | 98 | 4542 | from sympy.core.compatibility import range
from sympy.combinatorics.named_groups import SymmetricGroup, DihedralGroup,\
AlternatingGroup
from sympy.combinatorics.permutations import Permutation
from sympy.combinatorics.util import _check_cycles_alt_sym, _strip,\
_distribute_gens_by_base, _strong_gens_from_distr... | bsd-3-clause |
njall/Orctrix | flaskapp/orcid.py | 1 | 3759 | """
API wrapper to Orcid.
"""
import hashlib
import logging
import re
import json
import requests
logging.basicConfig(level=logging.DEBUG)
BASE_URL = "https://pub.orcid.org/"
def _get_raw_json(orcid_id, action=""):
"""Get raw JSON file for orcid_id."""
url = orcid_url(orcid_id, action)
logging.info(url)... | mit |
xiaoyanit/kivy | examples/animation/animate.py | 40 | 1338 | '''
Widget animation
================
This example demonstrates creating and applying a multi-part animation to
a button widget. You should see a button labelled 'plop' that will move with
an animation when clicked.
'''
import kivy
kivy.require('1.0.7')
from kivy.animation import Animation
from kivy.app import App
f... | mit |
haridsv/pip | tests/functional/test_install_reqs.py | 21 | 8848 | import os.path
import textwrap
import pytest
from tests.lib import (pyversion, path_to_url,
_create_test_package_with_subdirectory)
from tests.lib.local_repos import local_checkout
@pytest.mark.network
def test_requirements_file(script):
"""
Test installing from a requirements file.
... | mit |
nghia-huynh/gem5-stable | tests/configs/simple-atomic-mp.py | 69 | 2376 | # Copyright (c) 2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
dgzurita/odoo | addons/purchase/partner.py | 210 | 2566 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
ramitalat/odoo | addons/hr_attendance/report/attendance_errors.py | 377 | 3669 | # -*- 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 |
kalilinuxoo7/bitsendupgrade | contrib/pyminer/pyminer.py | 2 | 6434 | #!/usr/bin/python
#
# Copyright (c) 2011 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 time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | mit |
GFDRR/geonode | geonode/documents/search_indexes.py | 20 | 4991 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... | gpl-3.0 |
yeming233/horizon | openstack_dashboard/dashboards/admin/networks/subnets/views.py | 6 | 1903 | # Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
nmercier/linux-cross-gcc | linux/lib/python2.7/dist-packages/Crypto/SelfTest/Hash/test_HMAC.py | 117 | 8197 | # -*- coding: utf-8 -*-
#
# SelfTest/Hash/HMAC.py: Self-test for the HMAC module
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to th... | bsd-3-clause |
raskolnikova/infomaps | node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py | 2779 | 1665 | # 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.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables... | mit |
lcf8858/Sample_Lua | frameworks/cocos2d-x/tools/particle/convert_YCoordFlipped.py | 124 | 2224 | #!/usr/bin/python
#ConvertYCoordFlipped.py
import plistlib
import os.path
import argparse
import glob
import shutil
#keys in dictionary
metaDataKey = 'metaData'
yCoordFlippedConvertedKey = 'yCoordFlippedConverted'
yCoordFlippedKey = 'yCoordFlipped'
#check if the particle file has been converted
def checkFlippedConve... | mit |
achang97/YouTunes | lib/python2.7/site-packages/oauth2client/contrib/django_util/models.py | 32 | 2742 | # 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 required by applicable law or ... | mit |
jit/pyew | vstruct/defs/macho/loader.py | 18 | 18784 | import vstruct
from vstruct.primitives import *
from vstruct.defs.macho.const import *
vm_prot_t = v_uint32
cpu_type_t = v_uint32
cpu_subtype_t = v_uint32
lc_str = v_uint32
class mach_header(vstruct.VStruct):
def __init__(self):
vstruct.VStruct.__init__(self)
self.magic = v_uint32() # mach ... | gpl-2.0 |
TheCrittaC/BigBen | modules/static/fourchanmonitor.py | 1 | 2518 | import irc
import json
from urllib import urlopen
import BeautifulSoup
import HTMLParser
import thread
from time import sleep
from re import sub, search
import traceback
class fourchanmonitor:
def __init__(self, connection):
self.connection = connection
monitorFile = open("./modules/static/ThreadMo... | gpl-2.0 |
frishberg/django | django/db/models/expressions.py | 16 | 31921 | import copy
import datetime
from django.core.exceptions import EmptyResultSet, FieldError
from django.db.backends import utils as backend_utils
from django.db.models import fields
from django.db.models.query_utils import Q
from django.utils import six
from django.utils.functional import cached_property
class Combina... | bsd-3-clause |
Dfred/concept-robot | HRI/vision/pyvision_0.9.0/src/pyvision/tools/face_scan.py | 7 | 8214 | # PyVision License
#
# Copyright (c) 2006-2008 David S. Bolme
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, thi... | gpl-3.0 |
christophreimer/pytesmo | setup.py | 1 | 8410 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup file for pytesmo.
This file was generated with PyScaffold 1.3, a tool that easily
puts up a scaffold for your new Python project. Learn more under:
http://pyscaffold.readthedocs.org/
"""
import os
import sys
import inspect
from distutils.cmd impo... | bsd-3-clause |
dimasad/numpy | numpy/polynomial/hermite_e.py | 49 | 57120 | """
Objects for dealing with Hermite_e series.
This module provides a number of objects (mostly functions) useful for
dealing with Hermite_e series, including a `HermiteE` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with such polynomials is in ... | bsd-3-clause |
grlee77/nipype | nipype/algorithms/tests/test_overlap.py | 7 | 1388 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
from shutil import rmtree
from tempfile import mkdtemp
from nipype.testing import (assert_equal, assert_raises,
assert_a... | bsd-3-clause |
Sorsly/subtle | google-cloud-sdk/lib/googlecloudsdk/third_party/apis/serviceregistry/v1alpha/serviceregistry_v1alpha_messages.py | 1 | 22119 | """Generated message classes for serviceregistry version v1alpha.
Manages service endpoints in Service Registry and provides integration with
DNS for service discovery and name resolution.
"""
# NOTE: This file is autogenerated and should not be edited by hand.
from apitools.base.protorpclite import messages as _mess... | mit |
ltiao/scikit-learn | sklearn/linear_model/tests/test_base.py | 101 | 12205 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.linear_model.... | bsd-3-clause |
mbychawski/traffic-simulator | site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH.py | 2 | 1765 | #!/usr/bin/env python
#
# Copyright (c) 2001-2010,2011,2012 The SCons Foundation
#
# 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 righ... | bsd-3-clause |
HyperBaton/ansible | lib/ansible/modules/windows/win_auto_logon.py | 10 | 2142 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Prasoon Karunan V (@prasoonkarunan)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by'... | gpl-3.0 |
LICEF/edx-platform | common/lib/capa/capa/tests/response_xml_factory.py | 47 | 34688 | from lxml import etree
from abc import ABCMeta, abstractmethod
class ResponseXMLFactory(object):
""" Abstract base class for capa response XML factories.
Subclasses override create_response_element and
create_input_element to produce XML of particular response types"""
__metaclass__ = ABCMeta
@a... | agpl-3.0 |
rahul003/mxnet | example/reinforcement-learning/dqn/game.py | 52 | 1555 | # 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 |
githubashto/browserscope | categories/acid3/test_set.py | 9 | 2659 | #!/usr/bin/python2.5
#
# Copyright 2009 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 |
Anaethelion/Geotrek | geotrek/trekking/migrations/0020_auto__add_field_accessibility_pictogram.py | 3 | 24350 | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
from django.conf import settings
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Accessibility.pictogram'
db.add_column('o_b_accessibilite', 'pictogram',
self.gf('... | bsd-2-clause |
facebookexperimental/eden | eden/hg-server/edenscm/hgext/commitcloud/background.py | 1 | 10766 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
"""background backup and sync
This module allows automatic backup or sync operations to be started after
every command that modifies the repo.
Automat... | gpl-2.0 |
jpaton/xen-4.1-LJX1 | tools/python/xen/sv/GenTabbed.py | 46 | 4954 | import types
from xen.sv.HTMLBase import HTMLBase
from xen.sv.util import getVar
class GenTabbed( HTMLBase ):
def __init__( self, title, urlWriter, tabStrings, tabObjects ):
HTMLBase.__init__(self)
self.tabStrings = tabStrings
self.tabObjects = tabObjects
self.urlWriter = urlWrite... | gpl-2.0 |
kangsterizer/linux-3.1.y-rsbac | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (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
import sys
sys.path.append(os.envir... | gpl-2.0 |
isabernardes/Heriga | Herigaenv/lib/python2.7/site-packages/django/contrib/gis/geos/libgeos.py | 345 | 6218 | """
This module houses the ctypes initialization procedures, as well
as the notice and error handler function callbacks (get called
when an error occurs in GEOS).
This module also houses GEOS Pointer utilities, including
get_pointer_arr(), and GEOM_PTR.
"""
import logging
import os
import re
from ctypes import CD... | mit |
ininex/geofire-python | resource/lib/python2.7/site-packages/past/__init__.py | 34 | 2948 | # coding=utf-8
"""
past: compatibility with Python 2 from Python 3
===============================================
``past`` is a package to aid with Python 2/3 compatibility. Whereas ``future``
contains backports of Python 3 constructs to Python 2, ``past`` provides
implementations of some Python 2 constructs in Pytho... | mit |
denisff/python-for-android | python3-alpha/python3-src/Lib/test/test_logging.py | 47 | 76391 | #!/usr/bin/env python
#
# Copyright 2001-2011 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright n... | apache-2.0 |
Waffle-Wrath/CrackMapExec | cme/modules/get_keystrokes.py | 1 | 4647 | from cme.helpers.powershell import *
from cme.helpers.misc import gen_random_string
from cme.servers.smb import CMESMBServer
from gevent import sleep
from sys import exit
import os
class CMEModule:
'''
Executes PowerSploit's Get-Keystrokes script
Module by @byt3bl33d3r
'''
name = 'get_keys... | bsd-2-clause |
ziirish/burp-ui | burpui/api/prefs.py | 1 | 8540 | # -*- coding: utf8 -*-
"""
.. module:: burpui.api.prefs
:platform: Unix
:synopsis: Burp-UI prefs api module.
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
"""
from flask import session, current_app, request
from flask_login import current_user
from werkzeug.datastructures import MultiDict
from . import ap... | bsd-3-clause |
escottgoodwin/djangolocallibrary | tests/test_forms.py | 2 | 1550 | from django.test import TestCase
# Create your tests here.
import datetime
from django.utils import timezone
from catalog.forms import RenewBookForm
class RenewBookFormTest(TestCase):
def test_renew_form_date_field_label(self):
form = RenewBookForm()
self.assertTrue(form.fields['renewal_date'].l... | mit |
quickresolve/accel.ai | flask-aws/lib/python2.7/site-packages/boto/pyami/copybot.py | 17 | 4262 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | mit |
dendisuhubdy/tensorflow | tensorflow/contrib/constrained_optimization/python/candidates_test.py | 30 | 4188 | # 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 |
ucloud/uai-sdk | examples/mxnet/train/cifar/code/symbols/mobilenet.py | 28 | 4928 | # 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 |
Jet-Streaming/framework | deps/v8/tools/testrunner/server/signatures.py | 123 | 2816 | # Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | mpl-2.0 |
xme1226/sahara | sahara/tests/unit/utils/test_heat.py | 2 | 10602 | # Copyright (c) 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 required by applicable law or agreed to in writ... | apache-2.0 |
evilbinary/robot | plugins/simsimi.py | 1 | 4085 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# Author : cold
# E-mail : wh_linux@126.com
# Date : 14/01/16 11:33:32
# Desc : SimSimi插件
#
import json
from tornadohttpclient import TornadoHTTPClient
import config
import random
from plugins import BasePlugin
class SimSimiTalk(object):
""... | mit |
allmyservos/allmyservos | contrib/AllMyServos/Camera/TkTimelapseManager.py | 1 | 29896 | #!/usr/bin/python
#######################################################################
# AllMyServos - Fun with PWM
# Copyright (C) 2015 Donate BTC:14rVTppdYQzLrqay5fp2FwP3AXvn3VSZxQ
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | gpl-2.0 |
SnakeJenny/TensorFlow | tensorflow/python/client/client_lib.py | 111 | 1698 | # 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 |
javiercantero/streamlink | tests/test_plugin_srgssr.py | 6 | 1345 | import unittest
from streamlink.plugins.srgssr import SRGSSR
class TestPluginSRGSSR(unittest.TestCase):
def test_can_handle_url(self):
# should match
self.assertTrue(SRGSSR.can_handle_url("http://srf.ch/play/tv/live"))
self.assertTrue(SRGSSR.can_handle_url("http://www.rsi.ch/play/tv/live#... | bsd-2-clause |
quattor/aquilon | tests/broker/test_update_dns_environment.py | 2 | 2249 | #!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2014,2015,2016 Contributor
#
# 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... | apache-2.0 |
inares/edx-platform | common/test/acceptance/performance/test_lms_performance.py | 103 | 4363 | """
Single page performance tests for LMS.
"""
from bok_choy.web_app_test import with_cache
from ..pages.lms.auto_auth import AutoAuthPage
from ..pages.lms.courseware import CoursewarePage
from ..pages.lms.dashboard import DashboardPage
from ..pages.lms.course_info import CourseInfoPage
from ..pages.lms.login import Lo... | agpl-3.0 |
mindbender-studio/setup | bin/windows/python36/Lib/ctypes/test/test_varsize_struct.py | 277 | 1842 | from ctypes import *
import unittest
class VarSizeTest(unittest.TestCase):
def test_resize(self):
class X(Structure):
_fields_ = [("item", c_int),
("array", c_int * 1)]
self.assertEqual(sizeof(X), sizeof(c_int) * 2)
x = X()
x.item = 42
x.... | mit |
CongSmile/tp-qemu | qemu/tests/virtio_port_hotplug.py | 6 | 3479 | import time
import logging
from autotest.client.shared import error
from avocado.core import exceptions
from virttest.qemu_devices import qdevices
@error.context_aware
def run(test, params, env):
"""
Test hot unplug virtio serial devices.
1) Start guest with virtio serial device(s).
2) Load modul... | gpl-2.0 |
akosyakov/intellij-community | plugins/hg4idea/testData/bin/mercurial/templater.py | 90 | 16673 | # templater.py - template expansion for output
#
# Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from i18n import _
import sys, os, re
import util, config, templatefilters, par... | apache-2.0 |
chwnam/lifemotif-desktop | python/oauth2client/gce.py | 224 | 3038 | # 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... | lgpl-2.1 |
bud4/samba | source4/heimdal/lib/wind/util.py | 88 | 1978 | #!/usr/local/bin/python
# -*- coding: iso-8859-1 -*-
# $Id$
# Copyright (c) 2004 Kungliga Tekniska Högskolan
# (Royal Institute of Technology, Stockholm, Sweden).
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following... | gpl-3.0 |
barykaed/Pelican-Test | activate/Lib/site-packages/pip/_vendor/requests/packages/chardet/sbcharsetprober.py | 2927 | 4793 | ######################## 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 |
xzzz9097/android_external_skia | tools/copyright/fileparser.py | 232 | 2883 | '''
Copyright 2011 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
'''
import datetime
import re
def CreateParser(filepath):
"""Returns a Parser as appropriate for the file at this filepath.
"""
if (filepath.endswith('.cpp') or
filepat... | bsd-3-clause |
droidsec-cn/hooker | hooker_common/hooker_common/elasticsearch/Models/EsEvent.py | 3 | 2305 | # -*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| |
#| Android's Hooker |
#| ... | gpl-3.0 |
uber/rides-python-sdk | example/rider_dashboard.py | 1 | 2712 |
from flask import Flask, redirect, request, render_template
from example import utils # NOQA
from example.utils import import_app_credentials
from uber_rides.auth import AuthorizationCodeGrant
from uber_rides.client import UberRidesClient
from collections import OrderedDict, Counter
app = Flask(__name__, template... | mit |
ashumeow/pcaphar | src/third_party/dpkt/dpkt/netflow.py | 15 | 14827 | # $Id: netflow.py 23 2006-11-08 15:45:33Z dugsong $
"""Cisco Netflow."""
import itertools, struct
import dpkt
class NetflowBase(dpkt.Packet):
"""Base class for Cisco Netflow packets."""
__hdr__ = (
('version', 'H', 1),
('count', 'H', 0),
('sys_uptime', 'I', 0),
('unix_sec', '... | apache-2.0 |
scs/uclinux | user/python/python-2.4.4/Demo/metaclasses/Trace.py | 47 | 4133 | """Tracing metaclass.
XXX This is very much a work in progress.
"""
import types, sys
class TraceMetaClass:
"""Metaclass for tracing.
Classes defined using this metaclass have an automatic tracing
feature -- by setting the __trace_output__ instance (or class)
variable to a file object, trace messag... | gpl-2.0 |
alexcrichton/gyp | pylib/gyp/generator/msvs.py | 5 | 123465 | # 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 collections
import copy
import ntpath
import os
import posixpath
import re
import subprocess
import sys
import gyp.common
import gyp.easy_xml as easy_xml
i... | bsd-3-clause |
pombredanne/pythran | pythran/tests/test_numpy_func1.py | 3 | 14718 | import unittest
from test_env import TestEnv
import numpy
@TestEnv.module
class TestNumpyFunc1(TestEnv):
def test_sum_bool2(self):
self.run_test("def np_sum_bool2(a): return a.sum()", numpy.ones(10,dtype=bool).reshape(2,5), np_sum_bool2=[numpy.array([[bool]])])
def test_sum_expr(self):
self.... | bsd-3-clause |
thaumos/ansible | test/units/module_utils/common/test_sys_info.py | 45 | 5231 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com>
# (c) 2017-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_func... | gpl-3.0 |
yeming233/horizon | openstack_dashboard/dashboards/admin/volume_types/extras/forms.py | 3 | 2389 | # 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 |
kevinr/750book-web | 750book-web-env/lib/python2.7/site-packages/django/contrib/comments/forms.py | 65 | 7896 | import time
import datetime
from django import forms
from django.forms.util import ErrorDict
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from models import Comment
from django.utils.encoding import force_unicode
from django.utils.hashcompat import sha_constructor
from dj... | mit |
mistercrunch/airflow | airflow/cli/simple_table.py | 5 | 4581 | # 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 |
vadimtk/chrome4sdp | build/android/pylib/remote/device/remote_device_test_run.py | 2 | 15140 | # 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.
"""Run specific test on specific environment."""
import json
import logging
import os
import re
import shutil
import string
import tempfile
import time
impo... | bsd-3-clause |
ojengwa/oh-mainline | vendor/packages/docutils/docutils/readers/standalone.py | 197 | 2340 | # $Id: standalone.py 4802 2006-11-12 18:02:17Z goodger $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Standalone file Reader for the reStructuredText markup syntax.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import frontend, rea... | agpl-3.0 |
Azure/azure-sdk-for-python | sdk/batchai/azure-mgmt-batchai/azure/mgmt/batchai/models/__init__.py | 1 | 11819 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
autrilla/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/_stream_hixie75.py | 681 | 8842 | # Copyright 2011, 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 |
halvertoluke/edx-platform | common/lib/capa/capa/checker.py | 101 | 5906 | #!/usr/bin/env python
"""
Commandline tool for doing operations on Problems
"""
from __future__ import unicode_literals
import argparse
import logging
import sys
from path import Path as path
from cStringIO import StringIO
from calc import UndefinedVariable
from capa.capa_problem import LoncapaProblem
from mako.look... | agpl-3.0 |
jacknjzhou/neutron | neutron/ipam/drivers/neutrondb_ipam/db_api.py | 22 | 8761 | # Copyright 2015 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
gamahead/nupic | examples/opf/experiments/classification/scalar_TP_0/description.py | 17 | 1684 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
davidt/reviewboard | contrib/internal/run-pyflakes.py | 10 | 1740 | #!/usr/bin/env python
#
# Utility script to run pyflakes with the modules we care about and
# exclude errors we know to be fine.
from __future__ import print_function, unicode_literals
import os
import re
import subprocess
import sys
module_exclusions = (
'build',
'djblets',
'django_evolution',
'dis... | mit |
Wuteyan/VTK | Examples/ImageProcessing/Python/Contours2D.py | 15 | 2351 | #!/usr/bin/env python
# This example shows how to sample a mathematical function over a
# volume. A slice from the volume is then extracted and then contoured
# to produce 2D contour lines.
#
import vtk
# Quadric definition. This is a type of implicit function. Here the
# coefficients to the equations are set.
quadr... | bsd-3-clause |
tchernomax/ansible | lib/ansible/modules/cloud/scaleway/scaleway_image_facts.py | 53 | 3563 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2018, Yanis Guenane <yanis+ansible@guenane.org>
# 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 |
dsaraujo/circulante | django/contrib/admin/sites.py | 80 | 17398 | import re
from django import http, template
from django.contrib.admin import ModelAdmin, actions
from django.contrib.admin.forms import AdminAuthenticationForm
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.contenttypes import views as contenttype_views
from django.views.decorators.csrf import ... | bsd-3-clause |
priyaganti/rockstor-core | src/rockstor/smart_manager/views/sm_service.py | 2 | 2032 | """
Copyright (c) 2012-2014 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... | gpl-3.0 |
pylayers/pylayers | pylayers/antprop/examples/ex_tud2.py | 3 | 4822 | from pylayers.simul.simulem import *
from pylayers.antprop.raysc import *
from pylayers.antprop.channel import *
import pylayers.util.pyutil as pyu
import pylayers.signal.bsignal as bs
import time
# create a Simul object
def plotray(r):
plt.ion()
plt.close('all')
fig=plt.figure('Cpp')
f,a=C.Cpp.plot(f... | mit |
Knio/miru | miru/osd2.py | 1 | 2435 | # Copyright (c) 2008 Drew Smathers.
# See LICENSE for details
"""On screen display
"""
from UserList import UserList
from pyglet import gl
from miru import imiru
from miru import core
from zope.interface import implements
class OSD(object):
"""The OSD is a container for objects that can be rendered in 2D
t... | mit |
JingJunYin/tensorflow | tensorflow/contrib/kfac/python/ops/fisher_blocks.py | 9 | 36853 | # 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 |
agconti/njode | env/lib/python2.7/site-packages/rest_framework/response.py | 5 | 3150 | """
The Response class in REST framework is similar to HTTPResponse, except that
it is initialized with unrendered data, instead of a pre-rendered string.
The appropriate renderer is called during Django's template response rendering.
"""
from __future__ import unicode_literals
from django.core.handlers.wsgi import ST... | bsd-3-clause |
pymedusa/Medusa | ext/boto/datapipeline/layer1.py | 148 | 29022 | # Copyright (c) 2013 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 restriction, including
# without limitation the rights ... | gpl-3.0 |
erudit/zenon | eruditorg/apps/userspace/journal/viewmixins.py | 1 | 4026 | # -*- coding: utf-8 -*-
from django.core.exceptions import PermissionDenied
from django.urls import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.utils.functional import cached_property
from django.contrib.auth.mixins import LoginRequiredMixin
from rule... | gpl-3.0 |
lamby/buildinfo.debian.net | bidb/buildinfo/buildinfo_submissions/migrations/0001_initial.py | 1 | 1336 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-22 13:37
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
import django.db.models.deletion
import django.utils.crypto
import functools
class Migration(migrations.Migration):
initial = True
depend... | agpl-3.0 |
achow101/forkmon | monitor/migrations/0005_auto_20170718_2122.py | 1 | 1037 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-07-19 04:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('monitor', '0004_auto_20170718_0105'),
]
operations = [
migrat... | mit |
jlecoeur/Firmware | Tools/process_sensor_caldata.py | 2 | 31623 | #! /usr/bin/env python
from __future__ import print_function
import argparse
import os
import matplotlib.pyplot as plt
import numpy as np
from pyulog import *
"""
Reads in IMU data from a static thermal calibration test and performs a curve fit of gyro, accel and baro bias vs temperature
Data can be gathered using ... | bsd-3-clause |
hsum/sqlalchemy | test/sql/test_insert_exec.py | 9 | 14651 | from sqlalchemy.testing import eq_, assert_raises_message, is_
from sqlalchemy import testing
from sqlalchemy.testing import fixtures, engines
from sqlalchemy import (
exc, sql, String, Integer, MetaData, and_, ForeignKey,
VARCHAR, INT, Sequence, func)
from sqlalchemy.testing.schema import Table, Column
class... | mit |
SEL-Columbia/TileStache | TileStache/Goodies/Providers/Cascadenik.py | 13 | 1591 | ''' Cascadenik Provider.
Simple wrapper for TileStache Mapnik provider that parses Cascadenik MML files
directly, skipping the typical compilation to XML step.
More information on Cascadenik:
- https://github.com/mapnik/Cascadenik/wiki/Cascadenik
Requires Cascadenik 2.x+.
'''
from tempfile import gettempdir
try:
... | bsd-3-clause |
mustafat/odoo-1 | addons/website_blog/wizard/document_page_show_diff.py | 372 | 2184 | # -*- 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 |
harshilasu/GraphicMelon | y/google-cloud-sdk/lib/googlecloudsdk/compute/subcommands/backend_services/update.py | 4 | 2586 | # Copyright 2014 Google Inc. All Rights Reserved.
"""Command for updating backend services."""
import copy
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.compute.lib import backend_services_utils
from googlecloudsdk.compute.lib import base_classes
class Update(base_classes.ReadWriteCommand):
""... | gpl-3.0 |
sergei-maertens/django | django/contrib/sites/migrations/0001_initial.py | 378 | 1134 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.sites.models
from django.contrib.sites.models import _simple_domain_name_validator
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.Create... | bsd-3-clause |
koushikpillai/simplecalci | plugins/ti.alloy/plugin.py | 1729 | 5251 | import os, sys, subprocess, hashlib
import subprocess
def check_output(*popenargs, **kwargs):
r"""Run command with arguments and return its output as a byte string.
Backported from Python 2.7 as it's implemented as pure python on stdlib.
>>> check_output(['/usr/bin/python', '--version'])
Python 2.6.... | apache-2.0 |
avneesh91/django | tests/admin_views/test_multidb.py | 23 | 2467 | from unittest import mock
from django.conf.urls import url
from django.contrib import admin
from django.contrib.auth.models import User
from django.db import connections
from django.test import TestCase, override_settings
from django.urls import reverse
from .models import Book
class Router:
target_db = None
... | bsd-3-clause |
jlspyaozhongkai/Uter | third_party_backup/Python-2.7.9/Lib/lib-tk/test/test_ttk/test_widgets.py | 13 | 57843 | import unittest
import Tkinter as tkinter
from Tkinter import TclError
import ttk
from test.test_support import requires, run_unittest
import sys
from test_functions import MockTclObj
from support import (AbstractTkTest, tcl_version, get_tk_patchlevel,
simulate_mouse_click)
from widget_tests impor... | gpl-3.0 |
hsfzxjy/wisecitymbc | site_packages/rest_framework/tests/test_fields.py | 2 | 36085 | """
General serializer field tests.
"""
from __future__ import unicode_literals
import datetime
from decimal import Decimal
from uuid import uuid4
from django.core import validators
from django.db import models
from django.test import TestCase
from django.utils.datastructures import SortedDict
from rest_fr... | gpl-2.0 |
scitran/utilities | tempdir.py | 5 | 3074 | """This is a backport of TemporaryDirectory from Python 3.3."""
from __future__ import print_function
import warnings as _warnings
import sys as _sys
import os as _os
from tempfile import mkdtemp
template = "tmp"
class TemporaryDirectory(object):
"""Create and return a temporary directory. This has the same
... | mit |
ProfessionalIT/maxigenios-website | sdk/google_appengine/lib/django-1.4/django/db/models/fields/__init__.py | 12 | 47526 | import copy
import datetime
import decimal
import math
import warnings
from itertools import tee
from django.db import connection
from django.db.models.query_utils import QueryWrapper
from django.conf import settings
from django import forms
from django.core import exceptions, validators
from django.utils.datastructur... | mit |
milrob/essentia | packaging/darwin/extras/tbb_linker.py | 10 | 1971 | #!/usr/bin/env python
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 Foundation (FSF), e... | agpl-3.0 |
faahbih/projetoolivarts | backend/appengine/apps/locale_app/middleware.py | 48 | 1406 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from webapp2_extras import i18n
from tekton.gae.middleware import Middleware
class LocaleMiddleware(Middleware):
def _handle(self, locale_key):
if locale_key in self.request_args:
locale = self.request_args.get(lo... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.