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 |
|---|---|---|---|---|---|
ilexius/odoo | addons/im_livechat/report/im_livechat_report_channel.py | 7 | 3048 | # -*- coding: utf-8 -*-
from openerp import fields, models, tools
class ImLivechatReportChannel(models.Model):
""" Livechat Support Report on the Channels """
_name = "im_livechat.report.channel"
_description = "Livechat Support Report"
_order = 'start_date, technical_name'
_auto = False
uui... | gpl-3.0 |
njantrania/osf.io | tasks.py | 2 | 25686 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Invoke tasks. To run a task, run ``$ invoke <COMMAND>``. To see a list of
commands, run ``$ invoke --list``.
"""
import os
import sys
import code
import platform
import subprocess
import logging
from invoke import task, run
from website import settings
logging.getLogg... | apache-2.0 |
Adel-Magebinary/odoo | addons/l10n_ch/__openerp__.py | 260 | 2575 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Financial contributors: Hasa SA, Open Net SA,
# Prisme Solutions Informatique SA, Quod SA
#
# Translation contributors: brain-te... | agpl-3.0 |
rmfitzpatrick/ansible | lib/ansible/modules/commands/shell.py | 44 | 5468 | # Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# # There is no actual shell module source, when you use 'shell' in ansible,
# it runs the 'command' module with special arguments and it behaves differently.
# See the command source and the comme... | gpl-3.0 |
chenhengjie123/crosswalk-web-driver | xwalkdriver/embed_version_in_cpp.py | 3 | 1108 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Embeds Xwalk user data files in C++ code."""
import optparse
import os
import sys
import xwalk_paths
import cpp_source
sys.path.i... | bsd-3-clause |
magicwang-cn/kubernetes | examples/selenium/selenium-test.py | 173 | 1109 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | apache-2.0 |
nschmidtALICE/AliPhysics | PWGPP/Alignment/utils/readMilleBinary.py | 41 | 4281 | #!/usr/bin/python
## \file
# Read millepede binary file and print records
#
# Hardcoded defaults can be replaced by command line arguments for
# - Name of binary file
# - Number of records to print
# - Number of records to skip (optional)
#
# Description of the output from readMilleBinary.py
# - Record... | bsd-3-clause |
intgr/django | tests/template_tests/syntax_tests/i18n/test_get_language_info_list.py | 55 | 2028 | from django.test import SimpleTestCase
from django.utils import translation
from ...utils import setup
class GetLanguageInfoListTests(SimpleTestCase):
libraries = {
'custom': 'template_tests.templatetags.custom',
'i18n': 'django.templatetags.i18n',
}
@setup({'i18n30': '{% load i18n %}'
... | bsd-3-clause |
Asilva4700/Aljos | Aljos/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py | 1534 | 3426 | # 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 os
import gyp
import gyp.common
import gyp.msvs_emulation
import json
import sys
generator_supports_multiple_toolsets = True
generator_... | gpl-3.0 |
twilio/twilio-python | tests/integration/messaging/v1/test_brand_registration.py | 1 | 5343 | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class BrandRegistrationTestCase... | mit |
PressLabs/cobalt | tests/unit/engine/conftest.py | 1 | 1900 | # Copyright 2016 Presslabs SRL
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | apache-2.0 |
prutseltje/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_group.py | 15 | 5852 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.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 |
mdhaman/superdesk-core | apps/io/feeding_services/reuters.py | 1 | 11746 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import datet... | agpl-3.0 |
izv/IzVerifier | IzVerifier/izspecs/containers/izclasses.py | 1 | 4268 | import re
from IzVerifier.izspecs.containers.izcontainer import IzContainer
from IzVerifier.izspecs.containers.constants import *
from os import walk
__author__ = 'fcanas'
class IzClasses(IzContainer):
"""
Container for parsing and storing custom classes used in izpack installers.
"""
properties = ... | mit |
NonnEmilia/OpenGenfri | pos/pos/settings.py | 2 | 3093 | """
Django settings for pos project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Ignore the following error when using ipython:
# /usr/local/lib/python2.7/sit... | mit |
htwenhe/DJOA | env/Lib/site-packages/django/utils/version.py | 344 | 2445 | from __future__ import unicode_literals
import datetime
import os
import subprocess
from django.utils.lru_cache import lru_cache
def get_version(version=None):
"Returns a PEP 386-compliant version number from VERSION."
version = get_complete_version(version)
# Now build the two parts of the version num... | mit |
zanbel/david | tests/test_vocabcompiler.py | 38 | 5213 | #!/usr/bin/env python2
# -*- coding: utf-8-*-
import unittest
import tempfile
import contextlib
import logging
import shutil
import mock
from client import vocabcompiler
class TestVocabCompiler(unittest.TestCase):
def testPhraseExtraction(self):
expected_phrases = ['MOCK']
mock_module = mock.Moc... | mit |
noisemaster/AdamTestBot | unidecode/x01e.py | 246 | 3853 | data = (
'A', # 0x00
'a', # 0x01
'B', # 0x02
'b', # 0x03
'B', # 0x04
'b', # 0x05
'B', # 0x06
'b', # 0x07
'C', # 0x08
'c', # 0x09
'D', # 0x0a
'd', # 0x0b
'D', # 0x0c
'd', # 0x0d
'D', # 0x0e
'd', # 0x0f
'D', # 0x10
'd', # 0x11
'D', # 0x12
'd', # 0x13
'E', # 0... | mit |
alexjc/pylearn2 | pylearn2/models/mlp.py | 5 | 166132 | """
Multilayer Perceptron
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2012-2013, Universite de Montreal"
__credits__ = ["Ian Goodfellow", "David Warde-Farley"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
import logging
import math
import operator
import sys
import warnings
import numpy ... | bsd-3-clause |
forging2012/taiga-back | taiga/mdrender/extensions/semi_sane_lists.py | 25 | 1281 | # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import markdown
class SemiSaneOListProcessor(markdown.blockprocessors.OListProcessor):
SIBLING_TAGS ... | agpl-3.0 |
hamzehd/edx-platform | cms/djangoapps/contentstore/management/commands/prompt.py | 204 | 1122 | import sys
def query_yes_no(question, default="yes"):
"""Ask a yes/no question via raw_input() and return their answer.
"question" is a string that is presented to the user.
"default" is the presumed answer if the user just hits <Enter>.
It must be "yes" (the default), "no" or None (meaning
... | agpl-3.0 |
staranjeet/fjord | fjord/suggest/tests/test_dummy.py | 1 | 2216 | import datetime
from fjord.base.tests import TestCase
from fjord.feedback.tests import ResponseFactory
from fjord.suggest import get_suggesters
from fjord.suggest.utils import get_suggestions
from fjord.suggest.providers.dummy import DummySuggester
from fjord.suggest.tests import SuggesterTestMixin
class DummySugges... | bsd-3-clause |
sorenh/cc | vendor/boto/boto/pyami/installers/ubuntu/mysql.py | 50 | 4876 | # Copyright (c) 2006-2009 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... | apache-2.0 |
mogoweb/chromium-crosswalk | chrome/test/functional/test_clean_exit.py | 69 | 1495 | #!/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 logging
import os
import signal
import subprocess
import tempfile
import unittest
import pyauto_functional
import pyauto
im... | bsd-3-clause |
Spondoolies-Tech/kernel | tools/perf/tests/attr.py | 105 | 9117 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-2.0 |
ahmadassaf/zulip | zerver/management/commands/rename_stream.py | 11 | 1417 | from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from argparse import ArgumentParser
from django.core.management.base import BaseCommand
from zerver.lib.actions import do_rename_stream
from zerver.lib.str_utils import force_text
from zerver.models import Realm, get_... | apache-2.0 |
kimiscircle/fdfs_client-py | setup.py | 2 | 1133 | #!/usr/bin/env python
import os
from fdfs_client import __version__
try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
f = open(os.path.join(os.path.dirname(__file__), 'README.md'))
long_description = f.read()
f.close()
sdict = {
'name': 'fdfs_cli... | gpl-3.0 |
atomicjets/twitter-for-bigquery | libs/config.py | 6 | 56933 | # Copyright 2004-2010 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 notice and this perm... | apache-2.0 |
dkodnik/arp | addons/sale_analytic_plans/__init__.py | 443 | 1208 | # -*- 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 |
brandond/ansible | lib/ansible/modules/network/aci/aci_tenant_span_src_group_to_dst_group.py | 19 | 7078 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
sdlBasic/sdlbrt | win32/mingw/opt/lib/python2.7/toaiff.py | 293 | 3142 | """Convert "arbitrary" sound files to AIFF (Apple and SGI's audio format).
Input may be compressed.
Uncompressed file type may be AIFF, WAV, VOC, 8SVX, NeXT/Sun, and others.
An exception is raised if the file is not of a recognized type.
Returned filename is either the input filename or a temporary filename;
in the la... | lgpl-2.1 |
jakebailey/PrairieLearn | tools/generate_text.py | 4 | 6445 | #!/usr/bin/env python
import os, fnmatch, sys, re, hashlib, subprocess, platform, glob
CONVERT_CMD = "convert"
if platform.system() == "Windows":
globspec = "C:\Program Files\ImageMagick*\convert.exe"
magicks = glob.glob(globspec)
if len(magicks) < 1:
print("ERROR: No files match %s" % globspec)
... | agpl-3.0 |
f3r/scikit-learn | examples/decomposition/plot_kernel_pca.py | 353 | 2011 | """
==========
Kernel PCA
==========
This example shows that Kernel PCA is able to find a projection of the data
that makes data linearly separable.
"""
print(__doc__)
# Authors: Mathieu Blondel
# Andreas Mueller
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomp... | bsd-3-clause |
vlinhd11/vlinhd11-android-scripting | python/src/Lib/io.py | 51 | 64383 | """
The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.
At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. Note, however, that there is no
seperation between reading and writing to streams; imp... | apache-2.0 |
hlieberman/debian-ansible | lib/ansible/module_utils/known_hosts.py | 8 | 5832 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
cliqz/socorro | alembic/versions/c1ac31c8fea_fix_bug_972612_is_gc_count_should_be_.py | 14 | 1359 | """fix bug 972612 - is_gc_count should be per-ADU
Revision ID: c1ac31c8fea
Revises: 1aa9adb91413
Create Date: 2014-02-13 15:14:23.916163
"""
# revision identifiers, used by Alembic.
revision = 'c1ac31c8fea'
down_revision = '491cdcf9f97c'
import datetime
from alembic import op
from socorro.lib import citexttype, js... | mpl-2.0 |
jfhumann/servo | tests/wpt/css-tests/tools/pywebsocket/src/example/origin_check_wsh.py | 516 | 1992 | # 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 |
clones/python-blinker | blinker/_utilities.py | 3 | 4253 | from weakref import ref
from blinker._saferef import BoundMethodWeakref
try:
callable
except NameError:
def callable(object):
return hasattr(object, '__call__')
try:
from collections import defaultdict
except:
class defaultdict(dict):
def __init__(self, default_factory=None, *a, **... | mit |
sos22/minios-hacks | tools/xm-test/tests/network/07_network_dom0_udp_pos.py | 42 | 1550 | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2006
# Author: <dykman@us.ibm.com>
# UDP tests to dom0.
# - determines dom0 network
# - creates a single guest domain
# - sets up a single NIC on same subnet as dom0
# - conducts hping2 udp tests to the dom0 IP address
# hping2 $dom0_IP -2... | gpl-2.0 |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/sklearn/datasets/samples_generator.py | 7 | 56557 | """
Generate samples of synthetic data sets.
"""
# Authors: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel, O. Grisel,
# G. Louppe, J. Nothman
# License: BSD 3 clause
import numbers
import array
import numpy as np
from scipy import linalg
import scipy.sparse as sp
from ..preprocessing import MultiLabelBin... | mit |
ChristosChristofidis/twitter_nlp | hbc/python/evalLLda.py | 10 | 5418 | #!/usr/bin/python
import sys
import re
from optparse import OptionParser
from LdaFeatures import LdaFeatures
parser = OptionParser()
parser.add_option("--gold", dest='gold', default='gold')
parser.add_option("--dictionaries", dest='dictionaries', default='dictionaries')
parser.add_option("--dictmap", dest='dictmap',... | gpl-3.0 |
ocelot-collab/ocelot | ocelot_gui/app/ui_forms/sim_twiss.py | 1 | 10760 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'app/ui_forms/sim_twiss.ui'
#
# Created by: PyQt5 UI code generator 5.10.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form_Twiss(object):
def setupUi(self, Form_Twiss):
... | gpl-3.0 |
davidhstocker/Graphyne | Config/Test/TestRepository/EventInitRemove.py | 1 | 1141 | '''
Created on Dec 13, 2016
@author: David Stocker
'''
import Graphyne.Scripting
import Graphyne.Graph
class OnInitialize(Graphyne.Scripting.StateEventScript):
"""
This class tests the initialize event. As this event has no return mechanism, we'll test it
by adding a property. The EventInitRemo... | apache-2.0 |
ProfessionalIT/professionalit-webiste | sdk/google_appengine/lib/django-1.5/django/contrib/auth/management/__init__.py | 70 | 6746 | """
Creates permissions for all installed apps that need permissions.
"""
from __future__ import unicode_literals
import getpass
import locale
import unicodedata
from django.contrib.auth import models as auth_app, get_user_model
from django.core import exceptions
from django.core.management.base import CommandError
f... | lgpl-3.0 |
LambdaCast/LambdaCast | portal/migrations/0018_auto__add_field_video_audioThumbURL.py | 1 | 11900 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Video.audioThumbURL'
db.add_column('portal_video', 'audioThumbURL',
se... | bsd-2-clause |
krujos/strava-private-to-public | private-to-public.py | 1 | 3601 | """
Really could have implemented this all in javascript on the client side...
"""
from __future__ import print_function
import requests
from flask import Flask, redirect, url_for, request, session, abort, jsonify
import os
import sys
import logging
import json
STRAVA_CLIENT_ID = 1367
Flask.get = lambda self, path: s... | apache-2.0 |
boxu0001/practice | py3/S1604_time.py | 1 | 2759 | '''
1604. Alert Using Same Key-Card Three or More Times in a One Hour Period
Medium
LeetCode company workers use key-cards to unlock office doors. Each time a worker uses their key-card, the security system saves the worker's name and the time when it was used. The system emits an alert if any worker uses the key-card... | gpl-3.0 |
craighiller/serendipity | venv/lib/python2.7/site-packages/setuptools/command/build_ext.py | 286 | 11854 | from distutils.command.build_ext import build_ext as _du_build_ext
try:
# Attempt to use Pyrex for building extensions, if available
from Pyrex.Distutils.build_ext import build_ext as _build_ext
except ImportError:
_build_ext = _du_build_ext
import os, sys
from distutils.file_util import copy_file
from set... | mit |
modulexcite/catapult | third_party/html5lib-python/utils/spider.py | 436 | 4157 | #!/usr/bin/env python
"""Spider to try and find bugs in the parser. Requires httplib2 and elementtree
usage:
import spider
s = spider.Spider()
s.spider("http://www.google.com", maxURLs=100)
"""
import urllib.request, urllib.error, urllib.parse
import urllib.robotparser
import md5
import httplib2
import html5lib
fro... | bsd-3-clause |
r0balo/pelisalacarta | python/main-classic/channels/peliculasnu.py | 1 | 10999 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para peliculas.nu
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urllib
from core import config
from core import ht... | gpl-3.0 |
Samsung/meminsight | lifetime-analysis/delta-staleness.py | 1 | 2439 | #
# Copyright (c) 2014 Samsung Electronics Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | apache-2.0 |
andymckay/addons-server | src/olympia/files/helpers.py | 2 | 15973 | import codecs
import mimetypes
import os
import stat
from django.conf import settings
from django.core.files.storage import default_storage as storage
from django.utils.datastructures import SortedDict
from django.utils.encoding import smart_unicode
from django.utils.translation import get_language, ugettext as _
from... | bsd-3-clause |
alanjw/GreenOpenERP-Win-X86 | python/Lib/site-packages/unidecode/x067.py | 252 | 4635 | data = (
'Zui ', # 0x00
'Can ', # 0x01
'Xu ', # 0x02
'Hui ', # 0x03
'Yin ', # 0x04
'Qie ', # 0x05
'Fen ', # 0x06
'Pi ', # 0x07
'Yue ', # 0x08
'You ', # 0x09
'Ruan ', # 0x0a
'Peng ', # 0x0b
'Ban ', # 0x0c
'Fu ', # 0x0d
'Ling ', # 0x0e
'Fei ', # 0x0f
'Qu ', # 0x10
'[?] '... | agpl-3.0 |
sodafree/backend | build/ipython/build/lib.linux-i686-2.7/IPython/core/magics/execution.py | 3 | 40995 | """Implementation of execution-related magic functions.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 The IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with ... | bsd-3-clause |
tumbl3w33d/ansible | lib/ansible/modules/cloud/amazon/s3_website.py | 13 | 11787 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
dalejung/trtools | trtools/core/topper.py | 1 | 4199 | import bottleneck as nb
import pandas as pd
import numpy as np
from trtools.monkey import patch
def bn_topn(arr, N, ascending=None):
"""
Return the top N results. Negative N will give N lowest results
Paramters
---------
arr : Series
one dimension array
N : int
number of eleme... | mit |
qubesuser/qubes-core-admin | qubes/app.py | 1 | 42427 | #
# The Qubes OS Project, https://www.qubes-os.org/
#
# Copyright (C) 2010-2015 Joanna Rutkowska <joanna@invisiblethingslab.com>
# Copyright (C) 2011-2015 Marek Marczykowski-Górecki
# <marmarek@invisiblethingslab.com>
# Copyright (C) 2014-2015 Wojtek Porczyk <woju@invisiblethingslab.com>... | gpl-2.0 |
uberlaggydarwin/bugfree-wookie | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
InspectorB/3Dami-python | src/raw/load.py | 1 | 5632 | from os.path import abspath, exists, isdir, isfile, walk, join, basename, expanduser, getsize
import io
from utils.pubsub import PubSub
import struct
from wire.ttypes import TBinaryProtocol
from wire.ttypes import Message
from thrift.transport import TTransport
class DataLocation:
"""A DataLocation represents whe... | gpl-3.0 |
llvm/llvm-zorg | zorg/buildbot/commands/NinjaCommand.py | 1 | 3878 | # TODO: Use Interpolate instead of WithProperties.
import re
from buildbot.process.properties import WithProperties
from buildbot.steps.shell import WarningCountingShellCommand
class NinjaCommand(WarningCountingShellCommand):
DEFAULT_NINJA = 'ninja'
@staticmethod
def sanitize_kwargs(kwargs):
# kw... | apache-2.0 |
markstoehr/structured_gaussian_mixtures | structured_gaussian_mixtures/online_GMM_no_mean.py | 1 | 3515 | from __future__ import division, print_function
from bm_tools import OnlineLogsumexp, sigmoid, log1pexp, logsumexp
import numpy
TRAIN = "/home/mark/Projects/succotash/succotash/datasets/train_examples.npy"
TEST = "/home/mark/Projects/succotash/succotash/datasets/test_examples.npy"
X = numpy.load(TRAIN)
n_components ... | apache-2.0 |
zzeleznick/zDjango | venv/lib/python2.7/site-packages/psycopg2/tests/test_extras_dictcursor.py | 62 | 17404 | #!/usr/bin/env python
#
# extras_dictcursor - test if DictCursor extension class works
#
# Copyright (C) 2004-2010 Federico Di Gregorio <fog@debian.org>
#
# psycopg2 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... | mit |
npinto/bangmetric | bangmetric/_sklearn_ridge.py | 1 | 28105 | """
Ridge regression
"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com>
# License: Simplified BSD
from abc import ABCMeta, abstractmethod
import warnings
import numpy as np
from sklearn.linear_model.base import LinearModel
from sklearn.base im... | bsd-3-clause |
moijes12/oh-mainline | vendor/packages/kombu/kombu/pidbox.py | 23 | 12704 | """
kombu.pidbox
===============
Generic process mailbox.
"""
from __future__ import absolute_import
import socket
import warnings
from collections import defaultdict, deque
from copy import copy
from itertools import count
from threading import local
from time import time
from . import Exchange, Queue, Consumer, ... | agpl-3.0 |
cervinko/calibre-web | vendor/jinja2/__init__.py | 14 | 2268 | # -*- coding: utf-8 -*-
"""
jinja2
~~~~~~
Jinja2 is a template engine written in pure Python. It provides a
Django inspired non-XML syntax but supports inline expressions and
an optional sandboxed environment.
Nutshell
--------
Here a small example of a Jinja2 template::
{% ... | gpl-3.0 |
nrhine1/scikit-learn | examples/applications/wikipedia_principal_eigenvector.py | 233 | 7819 | """
===============================
Wikipedia principal eigenvector
===============================
A classical way to assert the relative importance of vertices in a
graph is to compute the principal eigenvector of the adjacency matrix
so as to assign to each vertex the values of the components of the first
eigenvect... | bsd-3-clause |
v0i0/lammps | python/examples/simple.py | 9 | 2271 | #!/usr/bin/env python -i
# preceding line should have path for Python on your machine
# simple.py
# Purpose: mimic operation of examples/COUPLE/simple/simple.cpp via Python
# Serial syntax: simple.py in.lammps
# in.lammps = LAMMPS input script
# Parallel syntax: mpirun -np 4 simple.py in.lammps
# ... | gpl-2.0 |
songfj/calibre | src/calibre/ebooks/rtf2xml/border_parse.py | 22 | 8124 | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | gpl-3.0 |
n1bor/bitcoin | test/functional/feature_config_args.py | 6 | 13099 | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test various command line arguments and configuration file parameters."""
import os
import time
from ... | mit |
BonexGu/Blik2D-SDK | Blik2D/addon/opencv-3.1.0_for_blik/samples/python/lk_track.py | 5 | 3155 | #!/usr/bin/env python
'''
Lucas-Kanade tracker
====================
Lucas-Kanade sparse optical flow demo. Uses goodFeaturesToTrack
for track initialization and back-tracking for match verification
between frames.
Usage
-----
lk_track.py [<video_source>]
Keys
----
ESC - exit
'''
# Python 2/3 compatibility
from __... | mit |
ContinuumIO/odo | odo/backends/tests/test_text.py | 9 | 1610 | from __future__ import absolute_import, division, print_function
from odo.backends.text import (TextFile, resource, convert, discover, append,
drop, chunks, Temp)
from odo.utils import tmpfile, filetexts, filetext
from datashape import dshape
import gzip
import os
def test_resource():
assert isinstance(r... | bsd-3-clause |
Raghavan-Lab/LabUtilities | split_fasta.py | 1 | 2647 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Splits a multi-sequence fasta file into multiple files containing n number of reads.
Examples:
Split a very large fasta file into smaller files containing 10,000 reads
python split_fasta.py -f large_amino_acid_file.faa -n 10000
NOTE: This script places the ... | gpl-2.0 |
drpngx/tensorflow | tensorflow/python/kernel_tests/conv2d_transpose_test.py | 15 | 12105 | # 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 |
AospPlus/android_kernel_htc_enrc2b-old | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
edxnercel/edx-platform | lms/djangoapps/courseware/tests/test_footer.py | 63 | 2297 | """
Tests related to the basic footer-switching based off SITE_NAME to ensure
edx.org uses an edx footer but other instances use an Open edX footer.
"""
from mock import patch
from nose.plugins.attrib import attr
from django.conf import settings
from django.test import TestCase
from django.test.utils import override_... | agpl-3.0 |
johan--/Quiz-Program | vendor/bundle/ruby/2.2.0/gems/libv8-3.16.14.7/vendor/gyp/test/builddir/gyptest-default.py | 74 | 2670 | #!/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.
"""
Verify the settings that cause a set of programs to be created in
a specific build directory, and that no intermediate built files
get c... | cc0-1.0 |
hsduk/lets-encrypt-preview | acme/acme/jose/jwk_test.py | 32 | 7207 | """Tests for acme.jose.jwk."""
import binascii
import unittest
from acme import test_util
from acme.jose import errors
from acme.jose import json_util
from acme.jose import util
DSA_PEM = test_util.load_vector('dsa512_key.pem')
RSA256_KEY = test_util.load_rsa_private_key('rsa256_key.pem')
RSA512_KEY = test_util.loa... | apache-2.0 |
cloud9UG/odoo | addons/account/test/test_parent_structure.py | 432 | 2108 | # -*- 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 |
osmc/osmc | package/mediacenter-addon-osmc/src/script.module.osmcsetting.services/resources/lib/osmcservices/osmc/osmc_setting.py | 2 | 1337 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2014-2020 OSMC (KodeKarnage)
This file is part of script.module.osmcsetting.services
SPDX-License-Identifier: GPL-2.0-or-later
See LICENSES/GPL-2.0-or-later for more information.
"""
import os
import xbmcgui
from osmccommon import osmc_setting
from osmccommo... | gpl-2.0 |
hchen1202/django-react | virtualenv/lib/python3.6/site-packages/django/core/checks/security/sessions.py | 57 | 2781 | from django.conf import settings
from .. import Tags, Warning, register
from ..utils import patch_middleware_message
def add_session_cookie_message(message):
return message + (
" Using a secure-only session cookie makes it more difficult for "
"network traffic sniffers to hijack user sessions."
... | mit |
da4089/wireshark | doc/extcap_example.py | 5 | 10476 | #!/usr/bin/env python
# Copyright 2014 Roland Knall <rknall [AT] gmail.com>
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <gerald@wireshark.org>
# Copyright 1998 Gerald Combs
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# a... | gpl-2.0 |
Skype4Py/Skype4Py | Skype4Py/lang/ru.py | 23 | 19299 | apiAttachAvailable = u'\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u0418\u041f\u041f'
apiAttachNotAvailable = u'\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d'
apiAttachPendingAuthorization = u'\u041e\u0436\u... | bsd-3-clause |
amwelch/a10sdk-python | a10sdk/core/cgnv6/cgnv6_stateful_firewall_tcp_syn_timeout.py | 2 | 1325 | from a10sdk.common.A10BaseClass import A10BaseClass
class SynTimeout(A10BaseClass):
""" :param syn_timeout_val: {"description": "Set Seconds session can remain in half-open state before being deleted (default: 4 seconds)", "format": "number", "default": 4, "optional": true, "maximum": 30, "minimum": 2, "t... | apache-2.0 |
mikeywaites/flask-arrested | tests/test_endpoint.py | 1 | 10244 | import json
from mock import patch, MagicMock
from flask import Response
from werkzeug.exceptions import HTTPException
from arrested import (
ArrestedAPI, Resource,
Endpoint, ResponseHandler, GetListMixin,
CreateMixin, PutObjectMixin, PatchObjectMixin
)
from tests.utils import assertResponse
def test_g... | mit |
linux-on-ibm-z/kubernetes | translations/extract.py | 137 | 3951 | #!/usr/bin/env python
# Copyright 2017 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 |
Bulochkin/tensorflow_pack | tensorflow/contrib/compiler/jit.py | 129 | 4433 | # 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 |
jiangzhixiao/odoo | addons/account/report/account_financial_report.py | 380 | 6365 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
lezzago/LambdaMart | lambdamart.py | 1 | 10588 | import numpy as np
import math
import random
import copy
from sklearn.tree import DecisionTreeRegressor
from multiprocessing import Pool
from RegressionTree import RegressionTree
import pandas as pd
import pickle
def dcg(scores):
"""
Returns the DCG value of the list of scores.
Parameters
----------
scores : ... | mit |
Lkhagvadelger/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py | 119 | 71750 | # Copyright (C) 2009 Google Inc. All rights reserved.
# Copyright (C) 2009 Apple Inc. All rights reserved.
# Copyright (C) 2011 Daniel Bates (dbates@intudata.com). All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condit... | bsd-3-clause |
tntnatbry/tensorflow | tensorflow/python/layers/base.py | 8 | 12144 | # 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 |
keyurpatel076/MissionPlannerGit | packages/IronPython.StdLib.2.7.5-beta1/content/Lib/sre_constants.py | 349 | 7137 | #
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support modul... | gpl-3.0 |
geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/third_party/webrtc/tools/compare_videos.py | 13 | 5925 | #!/usr/bin/env python
# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... | gpl-3.0 |
StefanRijnhart/OpenUpgrade | addons/edi/models/__init__.py | 442 | 1116 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
ChromiumWebApps/chromium | chrome/test/mini_installer/registry_verifier.py | 44 | 4287 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import _winreg
import verifier
class RegistryVerifier(verifier.Verifier):
"""Verifies that the current registry matches the specified criteria."""
de... | bsd-3-clause |
crosswalk-project/chromium-crosswalk-efl | third_party/cython/src/Cython/Compiler/Parsing.py | 87 | 107990 | # cython: auto_cpdef=True, infer_types=True, language_level=3, py2_import=True
#
# Parser
#
# This should be done automatically
import cython
cython.declare(Nodes=object, ExprNodes=object, EncodedString=object,
BytesLiteral=object, StringEncoding=object,
FileSourceDescriptor=object, loo... | bsd-3-clause |
sigmavirus24/pip | pip/vcs/git.py | 3 | 11208 | from __future__ import absolute_import
import logging
import tempfile
import os.path
from pip.compat import samefile
from pip.exceptions import BadCommand
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves.urllib import request as urllib_request
from pip._vendor.packaging.versio... | mit |
shakamunyi/tensorflow | tensorflow/python/kernel_tests/sparse_slice_op_test.py | 47 | 13161 | # 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 |
B-UMMI/INNUca | src/SPAdes-3.13.0-Linux/share/spades/pyyaml2/tokens.py | 985 | 2573 |
class Token(object):
def __init__(self, start_mark, end_mark):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in self.__dict__
if not key.endswith('_mark')]
attributes.sort()
arguments = ', '.join(['%s=... | gpl-3.0 |
swatilodha/coala | tests/parsing/StringProcessing/UnescapedSearchForTest.py | 17 | 6174 |
from coalib.parsing.StringProcessing import unescaped_search_for
from tests.parsing.StringProcessing.StringProcessingTestBase import (
StringProcessingTestBase)
class UnescapedSearchForTest(StringProcessingTestBase):
# Match either "out1" or "out2".
test_basic_pattern = "out1|out2"
# These are the ex... | agpl-3.0 |
drexly/openhgsenti | lib/django/contrib/gis/db/backends/base/models.py | 434 | 7111 | import re
from django.contrib.gis import gdal
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class SpatialRefSysMixin(object):
"""
The SpatialRefSysMixin is a class used by the database-dependent
SpatialRefSys objects to reduce redu... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.