repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
priseborough/ardupilot | libraries/AP_HAL_ChibiOS/hwdef/scripts/dma_parse.py | 44 | 2704 | #!/usr/bin/env python
'''
extra DMA mapping tables from a stm32 datasheet
This assumes a csv file extracted from the datasheet using tablula:
https://github.com/tabulapdf/tabula
'''
import sys, csv, os
def parse_dma_table(fname, table):
dma_num = 1
csvt = csv.reader(open(fname,'rb'))
i = 0
last_cha... | gpl-3.0 |
keita1314/httpie | httpie/plugins/manager.py | 22 | 1991 | from itertools import groupby
from pkg_resources import iter_entry_points
from httpie.plugins import AuthPlugin, FormatterPlugin, ConverterPlugin
from httpie.plugins.base import TransportPlugin
ENTRY_POINT_NAMES = [
'httpie.plugins.auth.v1',
'httpie.plugins.formatter.v1',
'httpie.plugins.converter.v1',
... | bsd-3-clause |
michaelaye/scikit-image | skimage/morphology/binary.py | 34 | 4760 | """
Binary morphological operations
"""
import numpy as np
from scipy import ndimage as ndi
from .misc import default_selem
# The default_selem decorator provides a diamond structuring element as default
# with the same dimension as the input image and size 3 along each axis.
@default_selem
def binary_erosion(image, ... | bsd-3-clause |
suncycheng/intellij-community | python/helpers/py2only/docutils/parsers/rst/languages/he.py | 128 | 3640 | # Author: Meir Kriheli
# Id: $Id: he.py 7119 2011-09-02 13:00:23Z milde $
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated for each language: ... | apache-2.0 |
Zelgadis87/Sick-Beard | lib/hachoir_parser/file_system/fat.py | 90 | 16185 | from lib.hachoir_core.compatibility import sorted
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet, StaticFieldSet,
RawBytes, PaddingBytes, createPaddingField, Link, Fragment,
Bit, Bits, UInt8, UInt16, UInt32,
String, Bytes, NullBytes)
from lib.hachoir_core.field.integer im... | gpl-3.0 |
C00kiie/Youtube-Mp3-telegram-bot | youtube_dl/extractor/rockstargames.py | 64 | 2248 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_iso8601,
)
class RockstarGamesIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rockstargames\.com/videos(?:/video/|#?/?\?.*\bvideo=)(?P<id>\d+)'
_TESTS = [{
'... | mit |
sharhar/USB-Thing | UpdaterFiles/Lib/python-3.5.1.amd64/Lib/uu.py | 182 | 6755 | #! /usr/bin/env python3
# Copyright 1994 by Lance Ellinghouse
# Cathedral City, California Republic, United States of America.
# All Rights Reserved
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provid... | apache-2.0 |
nwjs/chromium.src | 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 |
Russell-IO/ansible | lib/ansible/module_utils/network/fortimanager/fortimanager.py | 64 | 3514 | # 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 |
nealbob/nealbob.github.io | _site/code/multicore_storage_sim.py | 2 | 2177 | import numpy as np
from matplotlib import pyplot as plt
import time
from multiprocessing import Process
from multiprocessing.queues import Queue
def retry_on_eintr(function, *args, **kw):
while True:
try:
return function(*args, **kw)
except IOError, e:
if e.errno... | mit |
kiran/bart-sign | venv/lib/python2.7/site-packages/setuptools/depends.py | 114 | 6418 | import sys
import imp
import marshal
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from distutils.version import StrictVersion
from setuptools.extern import six
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Require:
"""A prerequisite to building or... | mit |
davidovich/pip | pip/_vendor/_markerlib/markers.py | 1769 | 3979 | # -*- coding: utf-8 -*-
"""Interpret PEP 345 environment markers.
EXPR [in|==|!=|not in] EXPR [or|and] ...
where EXPR belongs to any of those:
python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
python_full_version = sys.version.split()[0]
os.name = os.name
sys.platform = sys.platfo... | mit |
xodus7/tensorflow | tensorflow/compiler/tests/gather_nd_op_test.py | 22 | 6019 | # 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 |
montekki/linux-2.6-acedia | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
echohenry2006/tvb-library | contrib/from_articles/region_deterministic_bnm_wc.py | 5 | 3642 | # -*- coding: utf-8 -*-
"""
What:
Reproduces Figures 23 and 24 of Sanz-Leon P., Knock, S. A., Spiegler, A. and Jirsa V.
Mathematical framework for large-scale brain network modelling in The Virtual Brain.
Neuroimage, 2014, (in review)
Needs:
A working installation of tvb
Run:
python region_de... | gpl-2.0 |
yamt/neutron | quantum/tests/unit/nec/stub_ofc_driver.py | 7 | 2078 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.or... | apache-2.0 |
pedrobaeza/odoo | addons/l10n_be_coda/wizard/__init__.py | 439 | 1098 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it u... | agpl-3.0 |
ds-hwang/chromium-crosswalk | chrome/tools/webforms_aggregator_unittests.py | 185 | 10307 | #!/usr/bin/env python
# Copyright (c) 2011 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 subprocess
import tempfile
import unittest
# Same name as the aggregator module name.
import webfo... | bsd-3-clause |
sylvan5/pygame | pyrpg/pyrpg24/pyrpg24.py | 1 | 36082 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pygame
from pygame.locals import *
import codecs
import os
import random
import struct
import sys
SCR_RECT = Rect(0, 0, 640, 480)
GS = 32
DOWN,LEFT,RIGHT,UP = 0,1,2,3
STOP, MOVE = 0, 1 # 移動タイプ
PROB_MOVE = 0.005 # 移動確率
TRANS_COLOR = (190,179,145) # マップチップの透明色
sou... | mit |
viz4biz/PyDataNYC2015 | enaml/vtk_canvas.py | 1 | 2430 | #------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... | apache-2.0 |
guorendong/iridium-browser-ubuntu | third_party/trace-viewer/trace_viewer/build/update_gyp_and_gn.py | 5 | 4726 | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import os
import re
from trace_viewer.build import check_common
from trace_viewer import trace_viewer_project
class _Token(object):
... | bsd-3-clause |
Gateworks/platform-external-chromium_org | native_client_sdk/src/tools/httpd.py | 61 | 10344 | #!/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 BaseHTTPServer
import imp
import logging
import multiprocessing
import optparse
import os
import SimpleHTTPServer # pylint:... | bsd-3-clause |
helenwarren/pied-wagtail | wagtail/wagtailsearch/views/queries.py | 6 | 1721 | from django.shortcuts import render
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.contrib.auth.decorators import permission_required
from wagtail.wagtailadmin.modal_workflow import render_modal_workflow
from wagtail.wagtailadmin.forms import SearchForm
from wagtail.wagtailsearch... | bsd-3-clause |
feureau/Small-Scripts | Blender/Blender config/2.91/scripts/addons/bricksculpt_v1-2-0/classes/bricksculpt_choose_paintbrush_material.py | 1 | 2230 | # Copyright (C) 2019 Christopher Gearhart
# chris@bblanimation.com
# http://bblanimation.com/
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opt... | gpl-3.0 |
titienmiami/mmc.repository | plugin.video.SportsDevil/lib/utils/beta/t0mm0/common/net.py | 3 | 10343 | '''
common XBMC Module
Copyright (C) 2011 t0mm0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Th... | gpl-2.0 |
FusionSP/android_external_chromium_org | net/tools/testserver/asn1.py | 180 | 3751 | # 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.
# This file implements very minimal ASN.1, DER serialization.
import types
def ToDER(obj):
'''ToDER converts the given object into DER encoding'''
... | bsd-3-clause |
Maplecroft/django-contrib-comments | tests/testapp/tests/__init__.py | 6 | 2795 | from __future__ import absolute_import
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.test import TestCase
from django.test.utils import override_settings
from django_comments.forms import CommentForm
from... | bsd-3-clause |
jpshort/odoo | comunity_modules/auditlog/migrations/8.0.1.0/pre-migration.py | 43 | 1185 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2015 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
dannyboi104/SickRage | lib/bs4/builder/_lxml.py | 446 | 8661 | __all__ = [
'LXMLTreeBuilderForXML',
'LXMLTreeBuilder',
]
from io import BytesIO
from StringIO import StringIO
import collections
from lxml import etree
from bs4.element import Comment, Doctype, NamespacedAttribute
from bs4.builder import (
FAST,
HTML,
HTMLTreeBuilder,
PERMISSIVE,
Parse... | gpl-3.0 |
NINAnor/QGIS | src/plugins/grass/scripts/qgis.v.upgrade.py | 15 | 2603 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
***************************************************************************
qgis.v.upgrade.py
---------------------
Date : October 2015
Copyright : (C) 2015 by Radim Blazek
Email : radim.blazek@gmail.com
***... | gpl-2.0 |
firebitsbr/infernal-twin | build/reportlab/src/reportlab/graphics/samples/scatter.py | 42 | 3574 | #Autogenerated by ReportLab guiedit do not edit
from reportlab.graphics.charts.legends import Legend
from reportlab.graphics.charts.lineplots import ScatterPlot
from reportlab.graphics.shapes import Drawing, _DrawingEditorMixin, String
from reportlab.graphics.charts.textlabels import Label
from reportlab.graphics.sampl... | gpl-3.0 |
SEL-Columbia/commcare-hq | custom/ilsgateway/tests/test_locations_sync.py | 1 | 1228 | import json
import os
from django.test import TestCase
from corehq.apps.commtrack.tests.util import bootstrap_domain as initial_bootstrap
from corehq.apps.locations.models import Location
from custom.ilsgateway.api import Location as Loc
from custom.ilsgateway.commtrack import sync_ilsgateway_location
TEST_DOMAIN = 'i... | bsd-3-clause |
magosil86/ruffus | ruffus/test/test_check_if_uptodate.py | 1 | 3289 | #!/usr/bin/env python
from __future__ import print_function
"""
Test check_if_uptodate
Bug: @parallel sets @check_if_uptodate to None.
Submitted by Jafar Taghiyar (jafar<dot>taghiyar<at>gmail.com)
https://github.com/bunbun/ruffus/issues/53
"""
import os
import os
tempdir = os.path.abspath(os.path.abspat... | mit |
mcr/ietfdb | django/utils/tzinfo.py | 313 | 2511 | "Implementation of tzinfo classes for use with datetime.datetime."
import time
from datetime import timedelta, tzinfo
from django.utils.encoding import smart_unicode, smart_str, DEFAULT_LOCALE_ENCODING
class FixedOffset(tzinfo):
"Fixed offset in minutes east from UTC."
def __init__(self, offset):
if i... | bsd-3-clause |
Unow/edx-platform | common/djangoapps/course_modes/migrations/0005_auto__add_field_coursemode_expiration_datetime.py | 59 | 1858 | # -*- 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 'CourseMode.expiration_datetime'
db.add_column('course_modes_coursemode', 'expiration_datetim... | agpl-3.0 |
ComputerArchitectureGroupPWr/Floorplan-Maker | src/FloorplanMakerUI_old.py | 1 | 15396 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'main_window.ui'
#
# Created: Tue Aug 5 12:46:39 2014
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from floorplanFrameBeh import FloorplanFrame
from heate... | mit |
Victorgichohi/ChromeWebLab | Sketchbots/sw/labqueue/support/modeling.py | 7 | 17657 | # Copyright 2013 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 ... | apache-2.0 |
HaebinShin/tensorflow | tensorflow/examples/skflow/hdf5_classification.py | 5 | 2006 | # 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 appl... | apache-2.0 |
Fiware/dataModels | tools/ldcontext_generator.py | 1 | 9962 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script provides two files:
- context.jsonld, that serves https://schema.lab.fiware.org/ld/fiware-data-models-context.jsonld
- mapping_list.yml, that serves https://uri.fiware.org/ns/data-models
context.jsonld is combined by extracting the properties, types and enu... | mit |
google/cauliflowervest | cauliflowervest/client/mac/main.py | 1 | 3039 | # 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 a... | apache-2.0 |
solvo/derb | report_builder/migrations/0001_initial.py | 1 | 11231 | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-12 19:47
from __future__ import unicode_literals
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = T... | gpl-3.0 |
ddico/odoo | addons/mrp/tests/test_cancel_mo.py | 5 | 5171 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import Form
from datetime import datetime, timedelta
from odoo.fields import Datetime as Dt
from odoo.exceptions import UserError
from odoo.addons.mrp.tests.common import TestMrpCommon
class TestMrpCan... | agpl-3.0 |
stansonhealth/ansible-modules-core | cloud/openstack/os_image.py | 68 | 6384 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either vers... | gpl-3.0 |
wevote/WebAppPublic | voter/models.py | 1 | 55344 | # voter/models.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.db import models
from django.contrib.auth.models import (BaseUserManager, AbstractBaseUser) # PermissionsMixin
from django.core.validators import RegexValidator
from exception.models import handle_exception, handle_record_foun... | bsd-3-clause |
lrq3000/pyFileFixity | pyFileFixity/lib/profilers/pprofile/pprofile.py | 2 | 29125 | #!/usr/bin/env python
from collections import defaultdict, deque
from functools import partial, wraps
from time import time
from warnings import warn
import argparse
import inspect
import linecache
import os
import sys
import threading
import thread
import zipfile
def _getFuncOrFile(func, module, line):
if func ==... | mit |
BenKeyFSI/poedit | deps/boost/tools/build/src/tools/midl.py | 15 | 5761 | # Copyright (c) 2005 Alexey Pakhunov.
# Copyright (c) 2011 Juraj Ivancic
#
# Use, modification and distribution is subject to the Boost Software
# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
# http://www.boost.org/LICENSE_1_0.txt)
# Microsoft Interface Definition Language (MIDL) related routines
fro... | mit |
philiptmark/angular-app | node_modules/protractor/node_modules/jasmine/node_modules/jasmine-core/setup.py | 191 | 1983 | from setuptools import setup, find_packages, os
import json
with open('package.json') as packageFile:
version = json.load(packageFile)['version']
setup(
name="jasmine-core",
version=version,
url="http://pivotal.github.io/jasmine/",
author="Pivotal Labs",
author_email="jasmine-js@googlegroups.com... | mit |
michaelkuty/feincms | feincms/extensions.py | 3 | 4555 | """
Base types for extensions refactor
"""
from __future__ import absolute_import, unicode_literals
from functools import wraps
import inspect
from django.contrib import admin
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from feincms.utils import get_object
class Extensions... | bsd-3-clause |
wdv4758h/ZipPy | lib-python/3/symbol.py | 9 | 2023 | #! /usr/bin/env python3
"""Non-terminal symbols of Python grammar (from "graminit.h")."""
# This file is automatically generated; please don't muck it up!
#
# To update the symbols in this file, 'cd' to the top directory of
# the python source tree after building the interpreter and run:
#
# ./python Lib/symbol... | bsd-3-clause |
siwater/Cloudworks | aws-cfn-bootstrap-1.3/cfnbootstrap/file_tool.py | 1 | 9622 | #==============================================================================
# Copyright 2011 Amazon.com, Inc. or its affiliates. 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 ... | mit |
matslindh/kimochi | alembic/versions/8f5b2066cbac_add_self_referential_image_reference.py | 1 | 2160 | """Add self-referential image reference
Revision ID: 8f5b2066cbac
Revises: 698cc06661d6
Create Date: 2016-03-20 19:35:31.321144
"""
# revision identifiers, used by Alembic.
revision = '8f5b2066cbac'
down_revision = '698cc06661d6'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
... | mit |
zeptonaut/catapult | third_party/webapp2/tests/extras_routes_test.py | 24 | 13785 | # -*- coding: utf-8 -*-
import webapp2
from webapp2_extras.routes import (DomainRoute, HandlerPrefixRoute,
RedirectRoute, NamePrefixRoute, PathPrefixRoute)
import test_base
class HomeHandler(webapp2.RequestHandler):
def get(self, **kwargs):
self.response.out.write('home sweet home')
app = webapp2.... | bsd-3-clause |
bzloink/psi4 | psi4/driver/qcdb/libmintsbasisset.py | 2 | 61690 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2017 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | lgpl-3.0 |
akalipetis/raven-python | raven/_compat.py | 1 | 5038 | """Utilities for writing code that runs on Python 2 and 3"""
# flake8: noqa
# Copyright (c) 2010-2013 Benjamin Peterson
#
# 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,... | bsd-3-clause |
ADemonisis/mitmproxy | libmproxy/console/contentview.py | 10 | 14694 | from __future__ import absolute_import
import cStringIO
import json
import logging
import lxml.html
import lxml.etree
from PIL import Image
from PIL.ExifTags import TAGS
import subprocess
import traceback
import urwid
import html2text
import netlib.utils
from netlib import odict
from . import common, signals
from .. ... | mit |
microscopium/microscopium | microscopium/screens/image_xpress.py | 2 | 2669 | """Feature computations and other functions for Image Xpress screens
"""
import os
import collections as coll
import re
from .. import features as feat
from .. import _util
def ix_semantic_filename(fn):
"""Split an ImageXpress filename into its annotated components.
Parameters
----------
fn : string
... | bsd-3-clause |
grantvk/aima-python | submissions/Sery/myNN.py | 13 | 3375 | from sklearn.neural_network import MLPClassifier
import traceback
from submissions.Sery import aids
class DataFrame:
data = []
feature_names = []
target = []
target_names = []
aidsECHP = DataFrame()
aidsECHP.data = []
target_data = []
list_of_report = aids.get_reports()
for record in list_of_report:
... | mit |
moto-timo/robotframework | utest/output/test_filelogger.py | 1 | 1867 | import unittest
import time
from robot.output.filelogger import FileLogger
from robot.utils import StringIO, robottime
from robot.utils.asserts import *
from robot.utils.robottime import TimestampCache
class _FakeTimeCache(TimestampCache):
def __init__(self):
self.fake = time.mktime((2006, 6, 13, 8, 37,... | apache-2.0 |
ralsina/urssus | urssus/ui/Ui_greaderimport.py | 4 | 3745 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'urssus/ui/greaderimport.ui'
#
# Created: Fri Feb 27 23:57:10 2009
# by: PyQt4 UI code generator 4.4.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Dialog(object):
def setupUi(se... | gpl-2.0 |
loleg/realms-wiki | realms/lib/util.py | 1 | 3701 | import click
import re
import os
import hashlib
import json
import string
import random
import sys
from jinja2 import Template
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self
def random_string(size=6, chars=string.as... | gpl-2.0 |
luckylavish/zamboni | mkt/submit/tests/test_models.py | 18 | 1039 | from nose.tools import eq_
from mkt.site.fixtures import fixture
from mkt.site.tests import TestCase
from mkt.submit.models import AppSubmissionChecklist
from mkt.webapps.models import Webapp
class TestAppSubmissionChecklist(TestCase):
fixtures = fixture('webapp_337141')
def setUp(self):
self.webapp... | bsd-3-clause |
schlueter/ansible | lib/ansible/utils/module_docs_fragments/junos.py | 22 | 3041 | #
# (c) 2015, Peter Sprygada <psprygada@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | gpl-3.0 |
sinkuri256/python-for-android | python-build/python-libs/gdata/src/atom/http_core.py | 133 | 17418 | #!/usr/bin/env python
#
# Copyright (C) 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... | apache-2.0 |
exelearning/iteexe | nevow/compy.py | 14 | 17827 | # Copyright (c) 2004 Divmod.
# See LICENSE for details.
"""COMponents for PYthon
Compy 386
Borrowed from Twisted and hacked mercilessly."""
# system imports
import types
import warnings
import weakref
from nevow.util import qual, namedAny, uniquify, allYourBase
def newImplements(*ifaces):
"""Declare that a ... | gpl-2.0 |
astynax/ranger | ranger/config/commands.py | 2 | 63344 | # -*- coding: utf-8 -*-
# This file is part of ranger, the console file manager.
# This configuration file is licensed under the same terms as ranger.
# ===================================================================
#
# NOTE: If you copied this file to /etc/ranger/commands_full.py or
# ~/.config/ranger/commands_fu... | gpl-3.0 |
gavin-feng/odoo | addons/pad_project/__init__.py | 441 | 1066 | # -*- 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 |
atul-bhouraskar/django | django/conf/locale/nb/formats.py | 504 | 1766 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATET... | bsd-3-clause |
azureplus/hue | desktop/core/ext-py/Django-1.6.10/django/conf/locale/cs/formats.py | 118 | 1702 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. E Y'
TIME_FORMAT = 'G:i:s'
DAT... | apache-2.0 |
peacekeeper/indy-sdk | wrappers/python/tests/demo/test_anoncreds.py | 2 | 10248 | from indy import anoncreds, wallet, blob_storage
import pytest
import json
# noinspection PyUnusedLocal
@pytest.mark.asyncio
async def test_anoncreds_demo_works(pool_name, path_home, wallet_config, credentials):
# 1. Create My Wallet and Get Wallet Handle
await wallet.create_wallet(wallet_config, credentials... | apache-2.0 |
darren-rogan/CouchPotatoServer | libs/daemon.py | 7 | 3640 | #!/usr/bin/env python
from signal import SIGTERM
import sys
import os
import time
import atexit
class Daemon():
"""
A generic daemon class.
Usage: subclass the Daemon class and override the run() method
"""
def __init__(self, pidfile, stdin = '/dev/null', stdout = '/dev/null', stderr = '/dev/null... | gpl-3.0 |
mrGeen/eden | static/scripts/tools/run_scheduler_tasks.py | 10 | 4998 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Call Web2py scheduler in app models context and run a specified task using
# its scheduled arguments. Two options for running this script:
#
# cd web2py
# python applications/<app>/static/scripts/tools/run_scheduler_tasks.py --app=<app> --task=<task>
# -- or --
# export... | mit |
fyffyt/scikit-learn | examples/ensemble/plot_adaboost_regression.py | 311 | 1529 | """
======================================
Decision Tree Regression with AdaBoost
======================================
A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D
sinusoidal dataset with a small amount of Gaussian noise.
299 boosts (300 decision trees) is compared with a single decision tr... | bsd-3-clause |
SCOAP3/invenio | invenio/modules/submit/models.py | 7 | 19240 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2011, 2012, 2015 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 optio... | gpl-2.0 |
zekroTJA/regiusBot | commands/cmd_mute.py | 1 | 2707 | import discord
from os import path, makedirs, remove
import STATICS
ROLE_NAME = "Supporter"
perm = 2
description = "Mute members on guild in chat"
def get_mutes(server):
if not path.isdir("SAVES/" + server.id):
makedirs("SAVES/" + server.id)
if path.isfile("SAVES/" + server.id + "/mutes"):
... | mit |
DieBauer/flink | flink-libraries/flink-python/src/main/python/org/apache/flink/python/api/flink/functions/ReduceFunction.py | 21 | 2634 | # ###############################################################################
# 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 thi... | apache-2.0 |
bertucho/moviestalk2 | venv/Lib/encodings/utf_16.py | 404 | 3984 | """ Python 'utf-16' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs, sys
### Codec APIs
encode = codecs.utf_16_encode
def decode(input, errors='strict'):
return codecs.utf_16_decode(input, errors, True)
class IncrementalEncoder(c... | mit |
Dinoshauer/linie | tests/test_handlers.py | 1 | 2635 | """Linie handlers test specs."""
import logging
from testfixtures import LogCapture
from unittest import TestCase
from linie import handlers, exceptions
from linie.handlers import DEFAULT_FORMAT, _check_keys, _check_values, _get_fmts
class TestStreamHandlerPrivates(TestCase):
"""Test private functions of the s... | mit |
BalazsHoranyi/movie_stream | movie_stream/users/views.py | 32 | 1377 | from django.core.urlresolvers import reverse
from django.views.generic import DetailView, ListView, RedirectView, UpdateView
from django.contrib.auth.mixins import LoginRequiredMixin
from .models import User
class UserDetailView(LoginRequiredMixin, DetailView):
model = User
# These next two lines tell the v... | mit |
hsaputra/tensorflow | tensorflow/python/keras/layers/__init__.py | 13 | 8718 | # 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 |
pombredanne/pangyp | gyp/pylib/gyp/generator/eclipse.py | 1825 | 17014 | # 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.
"""GYP backend that generates Eclipse CDT settings files.
This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML
files that can be importe... | mit |
ma314smith/home-assistant | tests/helpers/test_discovery.py | 7 | 7028 | """Test discovery helpers."""
from collections import OrderedDict
from unittest.mock import patch
from homeassistant import loader, bootstrap
from homeassistant.core import callback
from homeassistant.helpers import discovery
from homeassistant.util.async import run_coroutine_threadsafe
from tests.common import (
... | mit |
kevclarx/ansible | test/sanity/code-smell/ansible-var-precedence-check.py | 19 | 18542 | #!/usr/bin/env python
# A tool to check the order of precedence for ansible variables
# https://github.com/ansible/ansible/blob/devel/test/integration/test_var_precedence.yml
import json
import os
import sys
import shutil
import stat
import subprocess
import tempfile
import yaml
from pprint import pprint
from optpars... | gpl-3.0 |
aguspiza/agora-ciudadana | userena/tests/views.py | 6 | 14737 | from django.core.urlresolvers import reverse
from django.core import mail
from django.contrib.auth.models import User
from django.contrib.auth.forms import PasswordChangeForm
from django.conf import settings
from userena import forms
from userena import settings as userena_settings
from userena.tests.profiles.test imp... | agpl-3.0 |
mcdaniel67/sympy | bin/coverage_report.py | 51 | 3708 | #!/usr/bin/env python
"""
Script to generate test coverage reports.
Usage:
$ bin/coverage_report.py
This will create a directory covhtml with the coverage reports. To
restrict the analysis to a directory, you just need to pass its name as
argument. For example:
$ bin/coverage_report.py sympy/logic
runs only the t... | bsd-3-clause |
totalgood/nlpia | src/nlpia/scripts/lsa_tweets.py | 1 | 3415 | import os
import gc
import json
import numpy as np
import gzip
from gensim.models import TfidfModel, LsiModel
from gensim.corpora import Dictionary
from nlpia.data.loaders import BIGDATA_PATH, read_csv
KEEP_N = 300000 # max vocab size
NO_BELOW = 5 # min DF (count)
NO_ABOVE = .7 # max DF (fraction)
def l... | mit |
hmoco/osf.io | api/nodes/utils.py | 2 | 1937 | # -*- coding: utf-8 -*-
from modularodm import Q
from rest_framework.exceptions import PermissionDenied, NotFound
from rest_framework.status import is_server_error
import requests
from website.files.models import OsfStorageFile
from website.files.models import OsfStorageFolder
from website.util import waterbutler_api_... | apache-2.0 |
salguarnieri/intellij-community | python/helpers/py2only/docutils/utils/urischemes.py | 154 | 6275 | # $Id: urischemes.py 7464 2012-06-25 13:16:03Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
`schemes` is a dictionary with lowercase URI addressing schemes as
keys and descriptions as values. It was compiled from the index at
http://www.iana.or... | apache-2.0 |
gam-phon/taiga-back | taiga/base/apps.py | 3 | 1279 | # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or mo... | agpl-3.0 |
ceph/Diamond | src/collectors/mountstats/mountstats.py | 5 | 8054 | # coding=utf-8
"""
The function of MountStatsCollector is to parse the detailed per-mount NFS
performance statistics provided by `/proc/self/mountstats` (reads, writes,
remote procedure call count/latency, etc.) and provide counters to Diamond.
Filesystems may be included/excluded using a regular expression filter,
lik... | mit |
EDUlib/edx-platform | lms/djangoapps/ccx/migrations/0004_seed_forum_roles_in_ccx_courses.py | 4 | 3421 | import logging
import six
from ccx_keys.locator import CCXLocator
from django.db import migrations
from openedx.core.djangoapps.django_comment_common.models import (
FORUM_ROLE_ADMINISTRATOR,
FORUM_ROLE_COMMUNITY_TA,
FORUM_ROLE_MODERATOR,
FORUM_ROLE_STUDENT
)
from openedx.core.djangoapps.django_comment... | agpl-3.0 |
aishraj/pykons_solution | python3/koans/about_method_bindings.py | 3 | 2744 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
def function():
return "pineapple"
def function2():
return "tractor"
class Class:
def method(self):
return "parrot"
class AboutMethodBindings(Koan):
def test_methods_are_bound_to_an_object(self):
obj = Class()
... | mit |
codeforamerica/heroku-buildpack-pygeo | vendor/distribute-0.6.36/setuptools/command/develop.py | 477 | 6447 | from setuptools.command.easy_install import easy_install
from distutils.util import convert_path, subst_vars
from pkg_resources import Distribution, PathMetadata, normalize_path
from distutils import log
from distutils.errors import DistutilsError, DistutilsOptionError
import os, sys, setuptools, glob
class develop(ea... | mit |
stevehof/location-ninja | lib/flask_admin/tests/peeweemodel/test_basic.py | 5 | 7111 | from nose.tools import eq_, ok_
from nose.plugins.skip import SkipTest
# Skip test on PY3
from flask.ext.admin._compat import PY2, as_unicode
if not PY2:
raise SkipTest('Peewee is not Python 3 compatible')
import peewee
from wtforms import fields
from flask.ext.admin import form
from flask.ext.admin._compat imp... | gpl-3.0 |
sogelink/ansible | lib/ansible/module_utils/facts/other/facter.py | 232 | 2985 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
lightcn/odoo | addons/account_asset/account_asset.py | 183 | 28936 | # -*- encoding: 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 G... | agpl-3.0 |
hynnet/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/sqlite3/test/userfunctions.py | 15 | 13845 | #-*- coding: ISO-8859-1 -*-
# pysqlite2/test/userfunctions.py: tests for user-defined functions and
# aggregates.
#
# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warran... | gpl-2.0 |
kemalakyol48/python-for-android | python-modules/twisted/twisted/internet/test/test_fdset.py | 49 | 6441 | # Copyright (c) 2009-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for implementations of L{IReactorFDSet}.
"""
__metaclass__ = type
import socket
from twisted.internet.interfaces import IReactorFDSet
from twisted.internet.abstract import FileDescriptor
from twisted.internet.test.reactormix... | apache-2.0 |
lokik/sfepy | sfepy/terms/terms_membrane.py | 5 | 7314 | import numpy as nm
from sfepy.base.base import assert_
from sfepy.linalg import dot_sequences
from sfepy.mechanics.tensors import dim2sym, transform_data
import sfepy.mechanics.membranes as membranes
from sfepy.terms.terms import Term
def eval_membrane_mooney_rivlin(a1, a2, mtx_c, c33, mode):
"""
Evaluate str... | bsd-3-clause |
codasus/django-blogages | blogages/django/forms/extras/widgets.py | 156 | 5157 | """
Extra HTML Widget classes
"""
import time
import datetime
import re
from django.forms.widgets import Widget, Select
from django.utils import datetime_safe
from django.utils.dates import MONTHS
from django.utils.safestring import mark_safe
from django.utils.formats import get_format
from django.conf import setting... | mit |
facelessuser/Pywin32 | lib/x32/win32com/demos/outlookAddin.py | 5 | 4629 | # A demo plugin for Microsoft Outlook (NOT Outlook Express)
#
# This addin simply adds a new button to the main Outlook toolbar,
# and displays a message box when clicked. Thus, it demonstrates
# how to plug in to Outlook itself, and hook outlook events.
#
# Additionally, each time a new message arrives in the Inbox, ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.