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 |
|---|---|---|---|---|---|
pycharmers-hackathon/hackathon-rep | SmartFuel/SmartFuel/aco.py | 2 | 3615 | from math import radians, cos, sin, sqrt, atan2
import random
import operator
def aco(petrol_stations, gas_type, capacity, initial_petrol, overall_dist,
consumption, source, target, ants=2, a=1, b=1, iterations=10):
pheromone = {station['id']: 4 for station in petrol_stations}
probability = lambda sour... | cc0-1.0 |
bcarlin/flask-scss | doc/conf.py | 1 | 7157 | # -*- coding: utf-8 -*-
#
# Flask-Scss documentation build configuration file, created by
# sphinx-quickstart on Fri Jul 8 17:32:32 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | mit |
tdmsinc/three.js | utils/converters/msgpack/msgpack/fallback.py | 641 | 26403 | """Fallback pure Python implementation of msgpack"""
import sys
import array
import struct
if sys.version_info[0] == 3:
PY3 = True
int_types = int
Unicode = str
xrange = range
def dict_iteritems(d):
return d.items()
else:
PY3 = False
int_types = (int, long)
Unicode = unicode
... | mit |
djabber/Dashboard | bottle/dash/local/lib/python2.7/site-packages/setuptools/tests/server.py | 452 | 2651 | """Basic http server for tests to simulate PyPI or custom indexes
"""
import sys
import time
import threading
from setuptools.compat import BaseHTTPRequestHandler
from setuptools.compat import (urllib2, URLError, HTTPServer,
SimpleHTTPRequestHandler)
class IndexServer(HTTPServer):
""... | mit |
dexterx17/nodoSocket | clients/Python-2.7.6/Lib/distutils/command/upload.py | 176 | 7002 | """distutils.command.upload
Implements the Distutils 'upload' subcommand (upload package to PyPI)."""
import os
import socket
import platform
from urllib2 import urlopen, Request, HTTPError
from base64 import standard_b64encode
import urlparse
import cStringIO as StringIO
from hashlib import md5
from distutils.errors... | mit |
baylee/django | tests/template_tests/filter_tests/test_dictsortreversed.py | 181 | 1686 | from django.template.defaultfilters import dictsortreversed
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_sort(self):
sorted_dicts = dictsortreversed(
[{'age': 23, 'name': 'Barbara-Ann'},
{'age': 63, 'name': 'Ra Ra Rasputin'},
{... | bsd-3-clause |
yank555-lu/N3-Sammy-JB | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
p4datasystems/CarnotKE | jyhton/lib-python/2.7/plat-linux2/DLFCN.py | 158 | 1628 | # Generated by h2py from /usr/include/dlfcn.h
_DLFCN_H = 1
# Included from features.h
_FEATURES_H = 1
__USE_ANSI = 1
__FAVOR_BSD = 1
_ISOC99_SOURCE = 1
_POSIX_SOURCE = 1
_POSIX_C_SOURCE = 199506L
_XOPEN_SOURCE = 600
_XOPEN_SOURCE_EXTENDED = 1
_LARGEFILE64_SOURCE = 1
_BSD_SOURCE = 1
_SVID_SOURCE = 1
_BSD_SOURCE = 1
_SV... | apache-2.0 |
zcbenz/cefode-chromium | tools/find_runtime_symbols/tests/proc_maps_test.py | 38 | 4611 | #!/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.
import cStringIO
import logging
import os
import sys
import unittest
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__... | bsd-3-clause |
wangyum/spark | sql/gen-sql-config-docs.py | 15 | 4773 | #
# 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 us... | apache-2.0 |
lybicat/lybica-runner | tst/test_lybica/actions/user_script.py | 1 | 1597 | from unittest import TestCase
from lybica.actions.user_script import _UserScriptAction
from lybica.__main__ import Context
import os
import shutil
class TestUserScriptAction(TestCase):
def setUp(self):
super(TestUserScriptAction, self).setUp()
self.context = Context()
os.environ['WORKSPACE... | mit |
kellyaj/pytactoe | pytactoe/test/test_computer.py | 1 | 3921 | import unittest
from mock import MagicMock
from pytactoe.board import Board
from pytactoe.computer import Computer
class ComputerTests(unittest.TestCase):
def setUp(self):
self.computer = Computer("O")
self.board = Board()
def test_computer_initializes_with_a_mark(self):
self.assertEq... | mit |
mrtukkin/svm-street-detector | devkit_kitti/helper.py | 1 | 12022 | #!/usr/bin/env python
#
# THE KITTI VISION BENCHMARK SUITE: ROAD BENCHMARK
#
# Copyright (C) 2013
# Honda Research Institute Europe GmbH
# Carl-Legien-Str. 30
# 63073 Offenbach/Main
# Germany
#
# UNPUBLISHED PROPRIETARY MATERIAL.
# ALL RIGHTS RESERVED.
#
# Authors: Tobias Kuehnl <tkuehnl@cor-lab.uni-bielefeld.... | gpl-3.0 |
mlperf/training_results_v0.6 | Google/benchmarks/transformer/implementations/tpu-v3-256-transformer/dataset_preproc/data_generators/tokenizer.py | 7 | 6150 | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 |
fishstamp82/loprop | test/h2o_data.py | 2 | 11431 | from ..daltools.util.full import init
Z = [8., 1., 1.]
Rc = init([0.00000000, 0.00000000, 0.48860959])
Dtot = [0, 0, -0.76539388]
Daa = init([
[ 0.00000000, 0.00000000, -0.28357300],
[ 0.15342658, 0.00000000, 0.12734703],
[-0.15342658, 0.00000000, 0.12734703],
])
QUc = init([-7.31176220, 0., 0., -5.432... | gpl-3.0 |
linkedin/Zopkio | examples/zookeeper/zookeeper_example.py | 4 | 1235 | # Copyright 2015 LinkedIn Corp.
#
# 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.... | apache-2.0 |
nwokeo/supysonic | venv/lib/python2.7/site-packages/psycopg2/errorcodes.py | 7 | 13246 | """Error codes for PostgresSQL
This module contains symbolic names for all PostgreSQL error codes.
"""
# psycopg2/errorcodes.py - PostgreSQL error codes
#
# Copyright (C) 2006-2010 Johan Dahlin <jdahlin@async.com.br>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU ... | agpl-3.0 |
dipeshbh/nodebbdb | node_modules/sitemap/env/lib/node_modules/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py | 270 | 8338 | #!/usr/bin/env python
# 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.
"""Argument-less script to select what to run on the buildbots."""
import filecmp
import os
import shutil
import subprocess
import sys
i... | gpl-3.0 |
samuelhavron/heroku-buildpack-python | Python-3.4.3/Lib/test/test_itertools.py | 8 | 89289 | import unittest
from test import support
from itertools import *
import weakref
from decimal import Decimal
from fractions import Fraction
import sys
import operator
import random
import copy
import pickle
from functools import reduce
import sys
import struct
maxsize = support.MAX_Py_ssize_t
minsize = -maxsize-1
def l... | mit |
elmgone/coligui | vendor.etc/json-to-elm/generate.py | 5 | 3247 | from __future__ import print_function, unicode_literals
import json
import sys
from type_alias import create_type_alias, find_type_aliases, find_union_types
from decoder import create_decoder, create_encoder, create_union_type_decoder, create_union_type_encoder
from helpers import *
def test():
testJson = """... | apache-2.0 |
chirilo/kuma | vendor/packages/setuptools/command/test.py | 363 | 6471 | from distutils.errors import DistutilsOptionError
from unittest import TestLoader
import unittest
import sys
from pkg_resources import (resource_listdir, resource_exists, normalize_path,
working_set, _namespace_packages,
add_activation_listener, require, EntryPoint... | mpl-2.0 |
uchida/selenium | py/selenium/webdriver/ie/service.py | 8 | 2235 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
Adjective-Object/ligament | ligament/__init__.py | 1 | 2250 | """
A python task automator, with a focus on task composition
"""
import ligament
import helpers
import buildtarget
import buildcontext
import buildcontextfseventhandler
import exceptions
import sys
import getopt
from helpers import pout
def print_helptext():
""" print helptext for command-line interface """
... | apache-2.0 |
edx/edx-load-tests | loadtests/ecommerce_deadlock/authentication.py | 1 | 2577 | import uuid
from locust import TaskSet
from helpers import settings
LMS_HOST = settings.data['LMS_HOST'].rstrip('\/')
class AuthenticationMixin(TaskSet):
"""Mixin that gives tasks different authentication methods."""
def __init__(self, parent):
super().__init__(parent)
self._setup_basic_au... | apache-2.0 |
henriquejensen/marolo | controllers/default.py | 2 | 3682 | # -*- coding: utf-8 -*-
def index():
pagina = request.args(0, cast=int, default=1)
itens_por_pagina = 5
total = db(db.noticias).count()
paginas = total / itens_por_pagina
if total % itens_por_pagina:
paginas += 1
limites = (itens_por_pagina * (pagina - 1), (itens_por_pagina * pagina))
... | mit |
CloudWareChile/OpenChile | openerp/addons/account_analytic_plans/account_analytic_plans.py | 6 | 24178 | # -*- 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 |
jonathanverner/brython | www/src/Lib/test/test_imp.py | 23 | 19284 | import imp
import importlib
import os
import os.path
import shutil
import sys
from test import support
from test.test_importlib import util
import unittest
import warnings
class LockTests(unittest.TestCase):
"""Very basic test of import lock functions."""
def verify_lock_state(self, expected):
self.a... | bsd-3-clause |
Distrotech/qtcreator | tests/system/tools/findUnusedObjects.py | 6 | 5941 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2015 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this fil... | lgpl-2.1 |
pescobar/easybuild-framework | easybuild/toolchains/mpi/__init__.py | 2 | 1244 | ##
# Copyright 2012-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | gpl-2.0 |
mengqiy/kubernetes | cluster/juju/layers/kubernetes-worker/reactive/kubernetes_worker.py | 24 | 55854 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 |
savoirfairelinux/odoo | addons/hr_expense/hr_expense.py | 22 | 25312 | # -*- 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 |
geometalab/Vector-Tiles-Reader-QGIS-Plugin | ext-libs/google/protobuf/internal/text_encoding_test.py | 126 | 2903 | #! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | gpl-2.0 |
emilio/servo | tests/wpt/web-platform-tests/tools/third_party/html5lib/html5lib/tests/test_sanitizer.py | 29 | 5540 | from __future__ import absolute_import, division, unicode_literals
from html5lib import constants, parseFragment, serialize
from html5lib.filters import sanitizer
def runSanitizerTest(_, expected, input):
parsed = parseFragment(expected)
expected = serialize(parsed,
omit_optional_tag... | mpl-2.0 |
benoitsteiner/tensorflow-xsmm | tensorflow/python/profiler/pprof_profiler_test.py | 70 | 5174 | # 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 |
odootr/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py | 384 | 11372 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
ozzyjohnson/zaproxy | python/api/src/zapv2/users.py | 15 | 2918 | # Zed Attack Proxy (ZAP) and its related class files.
#
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
#
# Copyright 2015 the ZAP development 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... | apache-2.0 |
ajnirp/servo | tests/wpt/web-platform-tests/tools/pytest/testing/test_unittest.py | 171 | 22302 | from _pytest.main import EXIT_NOTESTSCOLLECTED
import pytest
def test_simple_unittest(testdir):
testpath = testdir.makepyfile("""
import unittest
class MyTestCase(unittest.TestCase):
def testpassing(self):
self.assertEquals('foo', 'foo')
def test_failing(self... | mpl-2.0 |
blahgeek/xiami_downloader | lib/track.py | 1 | 2132 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by i@BlahGeek.com at 2014-04-18
import os
from .decrypt import decrypt
from .http import download
from mutagen.easyid3 import EasyID3
from mutagen.id3 import ID3, APIC
class Track(object):
''' A song '''
def __init__(self, tag):
''' @tag: a Beau... | mit |
cryptickp/libcloud | libcloud/test/compute/test_types.py | 26 | 1969 | from unittest import TestCase
from libcloud.compute.types import Provider, NodeState, StorageVolumeState, \
VolumeSnapshotState, Type
class TestType(Type):
INUSE = "inuse"
class TestTestType(TestCase):
model = TestType
attribute = TestType.INUSE
def test_provider_tostring(self):
self.a... | apache-2.0 |
lmprice/ansible | lib/ansible/modules/web_infrastructure/htpasswd.py | 48 | 8684 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Nimbis Services, Inc.
# 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 |
nephila/cmsplugin-filer | cmsplugin_filer_teaser/south_migrations/0002_add_teaser_style_choice.py | 11 | 14099 |
from south.db import db
from django.db import models
from cmsplugin_filer_teaser.models import *
from cmsplugin_filer_utils.migration import rename_tables_new_to_old
class Migration:
cms_plugin_table_mapping = (
# (old_name, new_name),
('cmsplugin_filerteaser', 'cmsplugin_filer_teaser_filertease... | bsd-3-clause |
EKiefer/edge-starter | py34env/Lib/site-packages/pip/utils/outdated.py | 513 | 5455 | from __future__ import absolute_import
import datetime
import json
import logging
import os.path
import sys
from pip._vendor import lockfile
from pip._vendor.packaging import version as packaging_version
from pip.compat import total_seconds, WINDOWS
from pip.models import PyPI
from pip.locations import USER_CACHE_DI... | mit |
JimTheMan/Ngrx-Effect-Chaining-Example | NgrxEffectChaining/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | 1407 | 47697 | # 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.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
fr... | gpl-3.0 |
tyndare/osmose-backend | analysers/analyser_merge_bicycle_rental_FR_bm.py | 1 | 3368 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Frédéric Rodrigo 2014 ##
## ... | gpl-3.0 |
fabioz/Pydev | plugins/org.python.pydev.jython/Lib/sysconfig.py | 13 | 26368 | """Provide access to Python's configuration information.
"""
import sys
import os
from os.path import pardir, realpath
_INSTALL_SCHEMES = {
'posix_prefix': {
'stdlib': '{base}/lib/python{py_version_short}',
'platstdlib': '{platbase}/lib/python{py_version_short}',
'purelib': '{base}/lib/pyt... | epl-1.0 |
Endika/django | tests/many_to_one/tests.py | 15 | 29129 | import datetime
from copy import deepcopy
from django.core.exceptions import FieldError, MultipleObjectsReturned
from django.db import models, transaction
from django.db.utils import IntegrityError
from django.test import TestCase
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warni... | bsd-3-clause |
TangibleDisplay/garden-ddd | view.py | 4 | 7639 | from object_renderer import ObjectRenderer
from kivy.core.window import Window # noqa
from kivy.lang import Builder
from kivy.properties import NumericProperty, BooleanProperty
from kivy.clock import Clock
from kivy.animation import Animation
from math import cos, sin, pi
def dist(p1, p2):
return ((p1[0] - p2[0... | mit |
timeyyy/PyUpdater | pyupdater/utils/keydb.py | 1 | 4569 | # --------------------------------------------------------------------------
# Copyright 2014 Digital Sapphire Development 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://... | bsd-2-clause |
osamak/student-portal | api/serializers.py | 2 | 4168 | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth import authenticate
from rest_framework import serializers, exceptions
from rest_framework.authtoken.serializers import AuthTokenSerializer
from activities.mode... | agpl-3.0 |
p-l-/miasm | example/jitter/mips32.py | 6 | 2383 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
from argparse import ArgumentParser
from miasm2.analysis import debugging, gdbserver
from miasm2.jitter.csts import *
from miasm2.analysis.machine import Machine
from pdb import pm
parser = ArgumentParser(
description="""Sandbox raw binary with mips32 engine
(ex: jit_mi... | gpl-2.0 |
chipsCode/cocosbuilder3 | CocosBuilder/libs/nodejs/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | mit |
cyberark-bizdev/ansible | lib/ansible/modules/remote_management/hpilo/hpilo_boot.py | 56 | 6644 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
landrito/api-client-staging | generated/python/gapic-google-cloud-monitoring-v3/google/cloud/gapic/monitoring/v3/metric_service_client.py | 7 | 30336 | # Copyright 2017, 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 ... | bsd-3-clause |
mdeemer/XlsxWriter | xlsxwriter/test/comparison/test_chartsheet09.py | 8 | 1773 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/pip/_vendor/distlib/locators.py | 328 | 51013 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
import threading
except Impo... | mit |
MarkWh1te/xueqiu_predict | python3_env/lib/python3.4/site-packages/pymysql/converters.py | 20 | 12487 | from ._compat import PY2, text_type, long_type, JYTHON, IRONPYTHON, unichr
import datetime
from decimal import Decimal
import re
import time
from .constants import FIELD_TYPE, FLAG
from .charset import charset_by_id, charset_to_encoding
def escape_item(val, charset, mapping=None):
if mapping is None:
ma... | mit |
rayNymous/nupic | src/nupic/regions/ImageSensorExplorers/Jiggle.py | 17 | 5887 | # ----------------------------------------------------------------------
# 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... | agpl-3.0 |
h4r5h1t/django-hauthy | tests/view_tests/tests/test_specials.py | 66 | 1428 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase, override_settings
@override_settings(ROOT_URLCONF='view_tests.generic_urls')
class URLHandling(TestCase):
"""
Tests for URL handling in views and responses.
"""
redirect_target = "/%E4%B8%AD%E6%96%87/tar... | bsd-3-clause |
40223136/2015cdag1man | static/Brython3.1.0-20150301-090019/Lib/formatter.py | 751 | 14930 | """Generic output formatting.
Formatter objects transform an abstract flow of formatting events into
specific output events on writer objects. Formatters manage several stack
structures to allow various properties of a writer object to be changed and
restored; writers need not be able to handle relative changes nor an... | gpl-3.0 |
peterheim1/robbie | bin/follow_head.py | 1 | 5817 | #!/usr/bin/env python
# freely inspired by http://www.ros.org/wiki/arbotix_python/follow_controller
import roslib
import rospy, actionlib
from control_msgs.msg import FollowJointTrajectoryAction
from dynamixel_msgs.msg import JointState as JointStateDynamixel
from std_msgs.msg import Float64
... | gpl-3.0 |
hospace/ToughRADIUS | toughradius/radiusd/plugins/auth_rate_limit.py | 5 | 2192 | #!/usr/bin/env python
#coding=utf-8
from twisted.python import log
from toughradius.radiusd.settings import *
import datetime
def std_rate(resp,_in,_out):
input_limit = str(_in)
output_limit = str(_out)
_class = input_limit.zfill(8) + input_limit.zfill(8) + output_limit.zfill(8) + output_limit.zfill(8)
... | agpl-3.0 |
TeamExodus/external_chromium_org | tools/memory_inspector/memory_inspector/classification/native_heap_classifier.py | 89 | 8377 | # 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.
"""This module classifies NativeHeap objects filtering their allocations.
The only filter currently available is 'stacktrace', which works as follows:
{'na... | bsd-3-clause |
cloudwatt/contrail-controller | src/opserver/stats.py | 7 | 5232 | #!/usr/bin/python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# stats
#
# Query StatsOracle info from analytics
#
import sys
import argparse
import json
import datetime
from opserver_util import OpServerUtils
from sandesh_common.vns.ttypes import Module
from sandesh_common.vns.constants im... | apache-2.0 |
JinfengChen/CIRCfinder | script/extract_anchor.py | 1 | 1494 | #!/usr/bin/env python
import sys
import pysam
def main():
if len(sys.argv) != 5:
print('extract_anchor.py sam fa i length')
sys.exit(0)
i = sys.argv[3]
length = int(sys.argv[4]) + 10
flag = ''
fa = pysam.Fastafile(sys.argv[2])
with open(sys.argv[1], 'r') as sam:
for lin... | mit |
Nirvedh/CoarseCoherence | src/mem/slicc/symbols/Event.py | 92 | 1754 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | bsd-3-clause |
Phrozyn/MozDef | alerts/auditd_sftp.py | 2 | 1625 | #!/usr/bin/env python
# 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/.
# Copyright (c) 2014 Mozilla Corporation
from lib.alerttask import AlertTask
from mozdef_util.que... | mpl-2.0 |
auferack08/edx-platform | common/lib/xmodule/xmodule/tests/test_editing_module.py | 27 | 2425 | """ Tests for editing descriptors"""
import unittest
import os
import logging
from mock import Mock
from pkg_resources import resource_string
from opaque_keys.edx.locations import Location
from xmodule.editing_module import TabsEditingDescriptor
from xblock.field_data import DictFieldData
from xblock.fields import Sco... | agpl-3.0 |
nitin-cherian/LifeLongLearning | Python/Experiments/JINJA/RealPython/jinja_env/lib/python3.5/site-packages/flask/sessions.py | 119 | 14394 | # -*- coding: utf-8 -*-
"""
flask.sessions
~~~~~~~~~~~~~~
Implements cookie based sessions based on itsdangerous.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import uuid
import hashlib
from base64 import b64encode, b64decode
from datetime import dateti... | mit |
BjerknesClimateDataCentre/QuinCe | external_scripts/NRT/configure_nrt.py | 2 | 5398 | import os, logging
import toml, json
import urllib.error
import base64
from tabulate import tabulate
# Local modules
import quince, nrtdb, nrtftp
import RetrieverFactory, PreprocessorFactory
# Extract the list of IDs from a set of instruments
def get_ids(instruments):
result = []
for instrument in instruments:
... | gpl-3.0 |
odoousers2014/LibrERP | account_invoice_force_number/invoice.py | 2 | 1305 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
# All Rights Reserved
#
# This program is free software: you ca... | agpl-3.0 |
paltman/nashvegas | nashvegas/management/commands/syncdb.py | 4 | 1185 | from django.core.management import call_command
from django.core.management.commands.syncdb import Command as SyncDBCommand
from optparse import make_option
class Command(SyncDBCommand):
option_list = SyncDBCommand.option_list + (
make_option('--skip-migrations',
action='store_false',
... | mit |
Wilee999/panda3d | direct/src/controls/NonPhysicsWalker.py | 11 | 11774 | """
NonPhysicsWalker.py is for avatars.
A walker control such as this one provides:
- creation of the collision nodes
- handling the keyboard and mouse input for avatar movement
- moving the avatar
it does not:
- play sounds
- play animations
although it does send messeges that allow a listener t... | bsd-3-clause |
dkavraal/typecatcher | typecatcher/html_preview.py | 1 | 5738 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (C) 2012 Andrew Starr-Bochicchio <a.starr.b@gmail.com>
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the... | gpl-3.0 |
arouzrokh1/jon | synth.py | 1 | 1436 | from pyttsx.drivers import _espeak
import ctypes
import wave
import time
import threading
import StringIO
class Synth(object):
_done = False
def __init__(self):
self.rate = _espeak.Initialize(_espeak.AUDIO_OUTPUT_RETRIEVAL, 1000)
assert self.rate != -1, 'could not initialize espeak'
_esp... | apache-2.0 |
pincopallino93/rdfendpoints | lib/rdflib/plugins/parsers/structureddata.py | 6 | 12225 | #!/usr/bin/env python
"""
Extraction parsers for structured data embedded into HTML or XML files.
The former may include RDFa or microdata. The syntax and the extraction
procedures are based on:
* The RDFa specifications: http://www.w3.org/TR/#tr_RDFa
* The microdata specification: http://www.w3.org/TR/microdata/
* Th... | apache-2.0 |
nkalodimas/invenio | modules/websession/lib/websession_web_tests.py | 27 | 12821 | # -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 2011 CERN.
##
## Invenio 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... | gpl-2.0 |
mozilla-metrics/socorro-toolbox | src/main/python/graphics-correlations.py | 1 | 6775 | from optparse import OptionParser
import psycopg2
import os, sys
import csv
import re
from collections import namedtuple
p = OptionParser(usage='usage: %prog [options] outfile')
p.add_option('-V', '--product-version', dest='productversion',
help='Firefox version', default=None)
p.add_option('-s', '--start... | apache-2.0 |
mdtraj/mdtraj | mdtraj/__init__.py | 6 | 2628 | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors:
#
# MDTraj is free software: y... | lgpl-2.1 |
decebel/dataAtom_alpha | bin/plug/py/external/pattern/text/search.py | 1 | 41884 | #### PATTERN | EN | PATTERN MATCHING ###############################################################
# Copyright (c) 2010 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
####################################... | apache-2.0 |
hanx11/shadowsocks | shadowsocks/crypto/rc4_md5.py | 1042 | 1339 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
mrquim/repository.mrquim | script.video.F4mProxy/lib/f4mUtils/codec.py | 88 | 2613 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""Classes for reading/writing binary data (such as TLS records)."""
from .compat import *
class Writer(object):
def __init__(self):
self.bytes = bytearray(0)
def add(self, x, length):
self.bytes... | gpl-2.0 |
alphafoobar/intellij-community | python/lib/Lib/site-packages/django/contrib/auth/backends.py | 230 | 4582 | from django.db import connection
from django.contrib.auth.models import User, Permission
class ModelBackend(object):
"""
Authenticates against django.contrib.auth.models.User.
"""
supports_object_permissions = False
supports_anonymous_user = True
supports_inactive_user = True
# TODO: Mode... | apache-2.0 |
hilaskis/UAV_MissionPlanner | Lib/xml/sax/xmlreader.py | 113 | 12632 | """An XML Reader is the SAX 2 name for an XML parser. XML Parsers
should be based on this code. """
import handler
from _exceptions import SAXNotSupportedException, SAXNotRecognizedException
# ===== XMLREADER =====
class XMLReader:
"""Interface for reading an XML document using callbacks.
XMLReader is the... | gpl-2.0 |
codepython/CollectorCity-Market-Place | stores/apps/sell/migrations/0004_auto__add_field_sell_cancel.py | 2 | 11769 | # 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 'Sell.cancel'
db.add_column('sell_sell', 'cancel', self.gf('django.db.models.fields.Boolean... | apache-2.0 |
eusi/MissionPlanerHM | Lib/site-packages/numpy/distutils/from_template.py | 51 | 7890 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
"""
process_file(filename)
takes templated file .xxx.src and produces .xxx file where .xxx
is .pyf .f90 or .f using the following template rules:
'<..>' denotes a template.
All function and subroutine blocks... | gpl-3.0 |
av8ramit/tensorflow | tensorflow/contrib/distributions/python/ops/bijectors/softplus.py | 81 | 5398 | # 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 |
mith1979/ansible_automation | applied_python/applied_python/lib64/python2.7/site-packages/Crypto/Hash/MD4.py | 124 | 2716 | # -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... | apache-2.0 |
minhtuancn/odoo | addons/l10n_bo/__init__.py | 2120 | 1456 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
40223125/w17t2 | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/event.py | 603 | 19086 | #!/usr/bin/env python
'''Pygame module for interacting with events and queues.
Pygame handles all it's event messaging through an event queue. The routines
in this module help you manage that event queue. The input queue is heavily
dependent on the pygame display module. If the display has not been
initialized and a ... | gpl-3.0 |
botswana-harvard/ba-namotswe | ba_namotswe/models/pregnancy.py | 1 | 1266 | from django.db import models
from simple_history.models import HistoricalRecords
from .crf_model_mixin import CrfModelMixin, CrfInlineModelMixin
class PregnancyHistory(CrfModelMixin):
history = HistoricalRecords()
class Meta(CrfModelMixin.Meta):
app_label = 'ba_namotswe'
verbose_name = 'Pr... | gpl-3.0 |
pratapvardhan/pandas | pandas/tests/test_base.py | 2 | 46174 | # -*- coding: utf-8 -*-
from __future__ import print_function
import re
import sys
from datetime import datetime, timedelta
import pytest
import numpy as np
import pandas as pd
import pandas.compat as compat
from pandas.core.dtypes.common import (
is_object_dtype, is_datetimetz, is_datetime64_dtype,
needs_i8_... | bsd-3-clause |
invisiblek/python-for-android | python-modules/twisted/twisted/names/secondary.py | 57 | 3201 | # Copyright (c) 2001-2006 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.internet import task, defer
from twisted.names import dns
from twisted.names import common
from twisted.names import client
from twisted.names import resolve
from twisted.python import log, failure
from twisted.application i... | apache-2.0 |
dkluffy/dkluff-code | code/work/testpassport.py | 1 | 2023 | #!/usr/bin/env python
# coding=utf-8
import re
import json
import sys
fmt = '\033[0;3{}m{}\033[0m'.format
def cls():
print chr(27) + "[2J"
def fmtAnswer(s,sp=None):
r=re.sub("Answer:| |\r|\n","",s)
if sp is None:
a=[]
for i in r.upper():
a+=[i]
return a
return r.upper().split(sp)
def fmtI... | apache-2.0 |
kmacinnis/sympy | examples/intermediate/infinite_1d_box.py | 116 | 2911 | #!/usr/bin/env python
"""
Applying perturbation theory to calculate the ground state energy
of the infinite 1D box of width ``a`` with a perturbation
which is linear in ``x``, up to second order in perturbation
"""
from sympy.core import pi
from sympy import Integral, var, S
from sympy.functions import sin, sqrt
de... | bsd-3-clause |
atheed/servo | tests/wpt/web-platform-tests/tools/pytest/_pytest/genscript.py | 191 | 4129 | """ (deprecated) generate a single-file self-contained version of pytest """
import os
import sys
import pkgutil
import py
import _pytest
def find_toplevel(name):
for syspath in sys.path:
base = py.path.local(syspath)
lib = base/name
if lib.check(dir=1):
return lib
mo... | mpl-2.0 |
gitaarik/django | tests/m2m_through/models.py | 58 | 4699 | from datetime import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# M2M described on one of the models
@python_2_unicode_compatible
class Person(models.Model):
name = models.CharField(max_length=128)
class Meta:
ordering = ('name',)
def __s... | bsd-3-clause |
NicolasHerin/game_book_share | node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py | 1569 | 23354 | #!/usr/bin/env python
# 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.
"""Utility functions to perform Xcode-style build steps.
These functions are executed via gyp-mac-tool when using the Makefile generator.
""... | mit |
jelugbo/ddi | lms/djangoapps/instructor/tests/test_ecommerce.py | 13 | 13342 | """
Unit tests for Ecommerce feature flag in new instructor dashboard.
"""
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from courseware.tests.tests import TEST_DATA_MONGO_MODULESTORE
from student.tests.factories import AdminFactory
from xmodule.modulestore.tests.django_... | agpl-3.0 |
vipulroxx/sympy | sympy/core/core.py | 30 | 3814 | """ The core's core. """
from __future__ import print_function, division
# used for canonical ordering of symbolic sequences
# via __cmp__ method:
# FIXME this is *so* irrelevant and outdated!
ordering_of_classes = [
# singleton numbers
'Zero', 'One', 'Half', 'Infinity', 'NaN', 'NegativeOne', 'NegativeInfinity... | bsd-3-clause |
archilogic-com/three.js | utils/exporters/blender/addons/io_three/exporter/utilities.py | 1 | 2246 | import uuid
import hashlib
from .. import constants
ROUND = constants.DEFAULT_PRECISION
def bit_mask(flags):
"""Generate a bit mask.
:type flags: dict
:return: int
"""
bit = 0
true = lambda x, y: (x | (1 << y))
false = lambda x, y: (x & (~(1 << y)))
for mask, position in constant... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.