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 |
|---|---|---|---|---|---|
petermalcolm/osf.io | website/addons/osfstorage/oldels.py | 20 | 6749 | # encoding: utf-8
import os
import bson
import logging
import pymongo
from modularodm import fields, Q
from modularodm import exceptions as modm_errors
from modularodm.storage.base import KeyExistsException
from framework.auth import Auth
from framework.mongo import StoredObject
from framework.analytics import get_... | apache-2.0 |
p0psicles/SickRage | lib/unidecode/x07f.py | 252 | 4664 | data = (
'Zhui ', # 0x00
'Zi ', # 0x01
'Ke ', # 0x02
'Xiang ', # 0x03
'Jian ', # 0x04
'Mian ', # 0x05
'Lan ', # 0x06
'Ti ', # 0x07
'Miao ', # 0x08
'Qi ', # 0x09
'Yun ', # 0x0a
'Hui ', # 0x0b
'Si ', # 0x0c
'Duo ', # 0x0d
'Duan ', # 0x0e
'Bian ', # 0x0f
'Xian ', # 0x10
'... | gpl-3.0 |
adityahase/frappe | frappe/contacts/doctype/contact/contact.py | 1 | 8077 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, has_gravatar, cint
from frappe import _
from frappe.model.document import Document
from frappe.core.doctype... | mit |
blacksburg98/dyplot | dyplot/hist.py | 1 | 2203 | from dyplot.c3 import C3 as Core
import numpy as np
class Hist(Core):
"""
Compute the histogram of a set of data.
"""
def __init__(self, a, bins=10, r=None, weights=None, density=None, xlabel = "", **kwargs):
"""
:param a: input data. The histogram is computed over the flat... | mit |
ucsd-ccbb/Oncolist | src/restLayer/models/SearchResult.py | 1 | 1295 | __author__ = 'aarongary'
class SearchResultModel():
def __init__(self):
self.clusterNodeName = ''
self.searchTab = ''
self.geneScoreRangeMax = 100
self.geneSuperList = []
self.items = []
self.geneScoreRangeStep = 0.1
self.geneScoreRangeMin = 5
self.se... | mit |
rven/odoo | addons/l10n_hn/__manifest__.py | 4 | 1240 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2009-2016 Salvatore Josué Trimarchi Pinto <trimarchi@bacgroup.net>
# This module provides a minimal Honduran chart of accounts that can be use
# to build upon a more complex one. It also includes a char... | agpl-3.0 |
Livit/Livit.Learn.EdX | common/test/acceptance/pages/lms/discovery.py | 126 | 1303 | """
Course discovery page.
"""
from . import BASE_URL
from bok_choy.page_object import PageObject
class CourseDiscoveryPage(PageObject):
"""
Find courses page (main page of the LMS).
"""
url = BASE_URL + "/courses"
form = "#discovery-form"
def is_browser_on_page(self):
"""
L... | agpl-3.0 |
alej0varas/django-o2o_tagging | o2o_tagging/models.py | 1 | 2048 | from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from model_utils.managers import PassThroughManager
from .managers import O2OTagQuerySet
class O2OTag(models.Model):
# The object that is tagging
tagger_content_type = mode... | gpl-3.0 |
anistark/mozillians | mozillians/phonebook/migrations/0001_initial.py | 9 | 1155 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Invite',
fields=[
... | bsd-3-clause |
zfrenchee/pandas | pandas/tests/indexes/datetimes/test_arithmetic.py | 1 | 21153 | # -*- coding: utf-8 -*-
import warnings
from datetime import datetime, timedelta
import pytest
import numpy as np
import pandas as pd
import pandas.util.testing as tm
from pandas.errors import PerformanceWarning
from pandas import (Timestamp, Timedelta, Series,
DatetimeIndex, TimedeltaIndex,
... | bsd-3-clause |
PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/test_decayed_adagrad_op.py | 7 | 2616 | # Copyright (c) 2018 PaddlePaddle 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 app... | apache-2.0 |
lookout/dd-agent | checks/datadog.py | 7 | 14895 | # stdlib
from datetime import datetime
import glob
from itertools import groupby
import os
import re
import sys
import time
import traceback
# project
from checks import LaconicFilter
import modules
from util import windows_friendly_colon_split
from utils.tailfile import TailFile
if hasattr('some string', 'partition'... | bsd-3-clause |
mpetyx/palmdrop | venv/lib/python2.7/site-packages/django/views/debug.py | 99 | 43130 | from __future__ import unicode_literals
import datetime
import os
import re
import sys
import types
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.http import (HttpResponse, HttpResponseServerError,
HttpResponseNotFound, HttpRequest, build_request_repr)
from d... | apache-2.0 |
xfournet/intellij-community | python/lib/Lib/site-packages/django/conf/locale/lv/formats.py | 316 | 1490 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'Y. \g\a\d\a j. F'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = r'Y. \g\a\d\a ... | apache-2.0 |
settingout/android_kernel_oneplus_msm8974 | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
mozilla/bedrock | bedrock/base/tests/test_middleware.py | 9 | 1763 | from urllib.parse import urlencode
from django.test import TestCase, RequestFactory
from django.test.utils import override_settings
from bedrock.base.middleware import LocaleURLMiddleware
@override_settings(DEV=True)
class TestLocaleURLMiddleware(TestCase):
def setUp(self):
self.rf = RequestFactory()
... | mpl-2.0 |
Block137/Dual2 | Tools/autotest/param_metadata/xmlemit.py | 28 | 2600 | #!/usr/bin/env python
from xml.sax.saxutils import escape, quoteattr
from emit import Emit
from param import known_param_fields
# Emit APM documentation in an machine readable XML format
class XmlEmit(Emit):
def __init__(self):
Emit.__init__(self)
wiki_fname = 'apm.pdef.xml'
self.f = ope... | gpl-3.0 |
StackPointCloud/ansible-modules-extras | notification/flowdock.py | 60 | 6041 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Matt Coddington <coddington@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... | gpl-3.0 |
cyberark-bizdev/ansible | lib/ansible/plugins/action/junos_config.py | 29 | 4342 | #
# (c) 2017, Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is... | gpl-3.0 |
manashmndl/dfvfs | tests/path/raw_path_spec.py | 1 | 1149 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the RAW storage media image path specification implementation."""
import unittest
from dfvfs.path import raw_path_spec
from tests.path import test_lib
class RawPathSpecTest(test_lib.PathSpecTestCase):
"""Tests for the RAW storage media image path specificati... | apache-2.0 |
t0mm0/youtube-dl | youtube_dl/extractor/ntvde.py | 120 | 2811 | # encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
js_to_json,
parse_duration,
)
class NTVDeIE(InfoExtractor):
IE_NAME = 'n-tv.de'
_VALID_URL = r'https?://(?:www\.)?n-tv\.de/mediathek/videos/[^/?#]+/[^/?#]+-article(?P<id>... | unlicense |
Titan-C/selfspy | selfspy/activity_store.py | 1 | 9740 | # Copyright 2012 David Fendrich
# Copyright 2017 Oscar Najera
# This file is part of Selfspy
# Selfspy 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) a... | gpl-3.0 |
pkuyym/Paddle | python/paddle/fluid/tests/book/notest_understand_sentiment.py | 1 | 13573 | # Copyright (c) 2018 PaddlePaddle 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 appli... | apache-2.0 |
marlontoe/android_kernel_sony_msm8974 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
sublime1809/django | django/db/backends/schema.py | 2 | 42073 | import hashlib
import operator
from django.db.backends.creation import BaseDatabaseCreation
from django.db.backends.utils import truncate_name
from django.db.models.fields.related import ManyToManyField
from django.db.transaction import atomic
from django.utils.encoding import force_bytes
from django.utils.log import ... | bsd-3-clause |
manipopopo/tensorflow | tensorflow/contrib/cmake/python_sanity_test.py | 46 | 3692 | # 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 |
carlcarl/PyGithub | github/tests/Issue50.py | 39 | 3844 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
lukeiwanski/tensorflow | tensorflow/python/ops/special_math_ops_test.py | 3 | 13982 | # 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 |
rajadhva/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/mux.py | 636 | 71218 | # Copyright 2012, 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 |
erjohnso/ansible | lib/ansible/module_utils/iosxr.py | 16 | 5570 | # 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 |
lovexiaov/python-in-practice | texteditor2/Display.py | 4 | 4435 | #!/usr/bin/env python3
# Copyright © 2012-13 Qtrac Ltd. All rights reserved.
# This program or 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 version 3 of the
# License, or (at your option) any ... | gpl-3.0 |
domob1812/huntercore | test/functional/rpc_named_arguments.py | 22 | 1211 | #!/usr/bin/env python3
# Copyright (c) 2016-2017 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 using named arguments for RPCs."""
from test_framework.test_framework import BitcoinTestFramework... | mit |
jcrugzz/lpvisualization | django/contrib/localflavor/sk/sk_districts.py | 543 | 2453 | """
Slovak districts according to http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska
"""
from django.utils.translation import ugettext_lazy as _
DISTRICT_CHOICES = (
('BB', _('Banska Bystrica')),
('BS', _('Banska Stiavnica')),
('BJ', _('Bardejov')),
('BN', _('Banovce nad Bebravo... | bsd-3-clause |
AndrewSmart/audacity | lib-src/lv2/lv2/plugins/eg02-midigate.lv2/waflib/Tools/msvc.py | 70 | 27831 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys,re,tempfile
from waflib import Utils,Task,Logs,Options,Errors
from waflib.Logs import debug,warn
from waflib.TaskGen import after_method,feature
from waflib.Conf... | gpl-2.0 |
chidea/GoPythonDLLWrapper | bin/lib/test/test_importlib/builtin/test_finder.py | 81 | 2798 | from .. import abc
from .. import util
from . import util as builtin_util
frozen_machinery, source_machinery = util.import_importlib('importlib.machinery')
import sys
import unittest
class FindSpecTests(abc.FinderTests):
"""Test find_spec() for built-in modules."""
def test_module(self):
# Common ... | mit |
vmendez/DIRAC | Core/Utilities/ThreadScheduler.py | 10 | 5835 | # $HeadURL$
__RCSID__ = "$Id$"
from DIRAC import S_ERROR, S_OK, gLogger
from DIRAC.Core.Utilities.ThreadSafe import Synchronizer
try:
import hashlib as md5
except ImportError:
import md5
import threading
import time
gSchedulerLock = Synchronizer()
class ThreadScheduler:
def __init__( self, enableReactorThread... | gpl-3.0 |
ForkedReposBak/mxnet | benchmark/opperf/utils/op_registry_utils.py | 2 | 24275 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
demonchild2112/travis-test | grr/server/grr_response_server/databases/mem_paths.py | 1 | 14025 | #!/usr/bin/env python
"""The in memory database methods for path handling."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from future.builtins import filter
from future.utils import iteritems
from future.utils import iterkeys
from typing import Dict
f... | apache-2.0 |
verdurin/bcbio-nextgen | bcbio/variation/mutect.py | 4 | 13034 | """Provide support for MuTect and other paired analysis tools."""
from distutils.version import LooseVersion
import os
import toolz as tz
from bcbio import bam, broad, utils
from bcbio.utils import file_exists, get_in, open_gzipsafe
from bcbio.distributed.transaction import file_transaction
from bcbio.variation.real... | mit |
quom/google-cloud-python | bigtable/google/cloud/bigtable/_generated/bigtable_pb2.py | 7 | 49239 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/bigtable/v2/bigtable.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import ... | apache-2.0 |
s40523220/2016fallcp_hw | pelicanconf.py | 1 | 2015 | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = 'KMOL'
SITENAME = '2016Fall 課程網誌 (虎尾科大MDE)'
# 不要用文章所在目錄作為類別
USE_FOLDER_AS_CATEGORY = False
#PATH = 'content'
#OUTPUT_PATH = 'output'
TIMEZONE = 'Asia/Taipei'
DEFAULT_LANG = 'en'
# Feed generation is u... | agpl-3.0 |
lowitty/server | libsLinux/twisted/test/test_process.py | 8 | 84274 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test running processes.
@var CONCURRENT_PROCESS_TEST_COUNT: The number of concurrent processes to use
to stress-test the spawnProcess API. This value is tuned to a number of
processes which has been determined to stay below various
... | mit |
lthurlow/Boolean-Constrained-Routing | networkx-1.8.1/build/lib/networkx/algorithms/shortest_paths/weighted.py | 19 | 23161 | # -*- coding: utf-8 -*-
"""
Shortest path algorithms for weighed graphs.
"""
__author__ = """\n""".join(['Aric Hagberg <hagberg@lanl.gov>',
'Loïc Séguin-C. <loicseguin@gmail.com>',
'Dan Schult <dschult@colgate.edu>'])
# Copyright (C) 2004-2011 by
# Aric Hagb... | mit |
dgarros/ansible | lib/ansible/modules/cloud/ovirt/ovirt_networks.py | 30 | 9556 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | gpl-3.0 |
bev-a-tron/pledgeservice | testlib/setuptools/__init__.py | 158 | 5195 | """Extensions to the 'distutils' for large or complex distributions"""
import os
import sys
import distutils.core
import distutils.filelist
from distutils.core import Command as _Command
from distutils.util import convert_path
from fnmatch import fnmatchcase
import setuptools.version
from setuptools.extension import ... | agpl-3.0 |
8ojangles/grunt-template-project | node_modules/node-gyp/gyp/tools/pretty_vcproj.py | 2637 | 9586 | #!/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.
"""Make the format of a vcproj really pretty.
This script normalize and sort an xml. It also fetches all the properties
inside linked... | mit |
Krossom/python-for-android | python-modules/twisted/twisted/web/test/test_xml.py | 53 | 43051 | # -*- test-case-name: twisted.web.test.test_xml -*-
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Some fairly inadequate testcases for Twisted XML support.
"""
from twisted.trial.unittest import TestCase
from twisted.web import sux
from twisted.web import microdom
from twisted.... | apache-2.0 |
ianyh/heroku-buildpack-python-opencv | vendor/.heroku/lib/python2.7/lib-tk/Tkconstants.py | 375 | 1493 | # Symbolic constants for Tk
# Booleans
NO=FALSE=OFF=0
YES=TRUE=ON=1
# -anchor and -sticky
N='n'
S='s'
W='w'
E='e'
NW='nw'
SW='sw'
NE='ne'
SE='se'
NS='ns'
EW='ew'
NSEW='nsew'
CENTER='center'
# -fill
NONE='none'
X='x'
Y='y'
BOTH='both'
# -side
LEFT='left'
TOP='top'
RIGHT='right'
BOTTOM='bottom'
# -relief
RAISED='rai... | mit |
joshuaduffy/selenium | py/test/selenium/webdriver/common/api_example_tests.py | 5 | 11790 | # 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 |
pabelanger/stackalytics | stackalytics/processor/rcs.py | 10 | 6445 | # Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | apache-2.0 |
CTSRD-CHERI/u-boot | test/py/u_boot_console_sandbox.py | 8 | 2859 | # SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2015 Stephen Warren
# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
# Logic to interact with the sandbox port of U-Boot, running as a sub-process.
import time
from u_boot_spawn import Spawn
from u_boot_console_base import ConsoleBase
class Consol... | gpl-2.0 |
jonparrott/gcloud-python | automl/google/cloud/automl_v1beta1/proto/annotation_payload_pb2.py | 3 | 6880 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/automl_v1beta1/proto/annotation_payload.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
fro... | apache-2.0 |
WiReD-/metagoofil | hachoir_parser/container/asn1.py | 86 | 10684 | """
Abstract Syntax Notation One (ASN.1) parser.
Technical informations:
* PER standard
http://www.tu.int/ITU-T/studygroups/com17/languages/X.691-0207.pdf
* Python library
http://pyasn1.sourceforge.net/
* Specification of Abstract Syntax Notation One (ASN.1)
ISO/IEC 8824:1990 Information Technology
* Specificati... | gpl-2.0 |
phihag/youtube-dl | youtube_dl/extractor/cbc.py | 10 | 15158 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
js_to_json,
smuggle_url,
try_get,
xpath_text,
xpath_element,
xpath_with_ns,
find_xpath_attr,
parse_iso8601,
parse_age_limit,
... | unlicense |
factorlibre/OCB | addons/account/wizard/account_journal_select.py | 385 | 2068 | # -*- 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 |
aspose-pdf/Aspose.Pdf-for-Java | Plugins/Aspose-Pdf-Java-for-Jython/asposepdf/WorkingWithDocumentObject/AddJavascript.py | 1 | 1156 | from asposepdf import Settings
from com.aspose.pdf import Document
from com.aspose.pdf import JavascriptAction
class AddJavascript:
def __init__(self):
dataDir = Settings.dataDir + 'WorkingWithDocumentObject/AddJavascript/'
# Open a pdf document.
doc = Document(dataDir +... | mit |
vishu-guntupalli/spring-batch-dashboard | spring_batch_dashboard/spring_batch_dashboard/settings.py | 1 | 3308 | """
Django settings for spring_batch_dashboard project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/... | mit |
UnrememberMe/pants | src/python/pants/base/validation.py | 16 | 2244 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from six import stri... | apache-2.0 |
shogun-toolbox/shogun | examples/undocumented/python/distribution_hmm.py | 2 | 1320 | #!/usr/bin/env python
import shogun as sg
from tools.load import LoadMatrix
lm=LoadMatrix()
data=lm.load_cubes('../data/fm_train_cube.dat')
parameter_list=[[data, 1, 64, 1e-5, 2, 0, False, 5], [data, 3, 6, 1e-1, 1, 0, False, 2]]
def distribution_hmm(fm_cube, N, M, pseudo, order, gap, reverse, num_examples):
charfea... | bsd-3-clause |
countrymarmot/mccdaq | setup.py | 1 | 2031 | #!/usr/bin/env python
"""Build script for mccdaq.
unzip mccdaq-x.x.zip
>>>> setup.py install
mccdaq-x.x.win32-py2.x.exe
>>>> setup.py bdist_wininst --bitmap mccdaq.bmp
"""
from distutils.core import setup, Extension
import os, re, sys, string
VERSION_MAJOR = 0
VERSION_MINOR = 2
mccdaq_version = str(VERSION_MAJOR) ... | bsd-3-clause |
linuxwhatelse/plugin.audio.linuxwhatelse.gmusic | addon/routes/actions.py | 1 | 21782 | import os
import json
import shutil
import urlparse
import re
import uuid
import codecs
import xbmc
import xbmcgui
import xbmcplugin
import mapper
import gmusicapi
from addon.gmusic_wrapper import GMusic
from addon import utils
from addon import listing
from addon import thumbs
from addon import ADDON
from addon im... | gpl-3.0 |
hacklabr/timtec | accounts/forms.py | 1 | 4697 | # -*- coding: utf-8 -*-
from __builtin__ import super
from django.contrib.auth import get_user_model
from django import forms
from localflavor.br.forms import BRCPFField
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from timtec.settings import ACCOUNT_REQUIRED_FIELDS as field... | agpl-3.0 |
eadgarchen/tensorflow | tensorflow/python/data/util/sparse_test.py | 32 | 12006 | # 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 |
40223151/2014c2g9 | exts/w2/static/Brython2.0.0-20140209-164925/Lib/decimal.py | 47 | 228497 | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz <aahz at pobox.com>
# and Tim Peters
# This module should be kept in sync with ... | gpl-2.0 |
rfk/git-remote-hg | git_remote_hg/test.py | 1 | 1101 | """
git_remote_hg.test: testcases for git_remote_hg
================================================
Actually there are no "tests" as such just yet. This is simply here out of
habit, since I use it to sync the main docstring with README.rst.
"""
import os
import unittest
import git_remote_hg
class TestDocstrin... | mit |
drjeep/django | django/utils/dateformat.py | 365 | 10712 | """
PHP date() style date formatting
See http://www.php.net/date for format strings
Usage:
>>> import datetime
>>> d = datetime.datetime.now()
>>> df = DateFormat(d)
>>> print(df.format('jS F Y H:i'))
7th October 2003 11:39
>>>
"""
from __future__ import unicode_literals
import calendar
import datetime
import re
impo... | bsd-3-clause |
rhyolight/nupic | tests/swarming/nupic/swarming/experiments/smart_speculation_temporal/permutations.py | 10 | 5491 | # ----------------------------------------------------------------------
# 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 |
christoph-buente/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/systemhost_mock.py | 129 | 2935 | # Copyright (c) 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, ... | bsd-3-clause |
GrAndSE/lighty-template | setup.py | 1 | 2990 | #!/usr/bin/env python
"""
Lighty-template
~~~~~~~~~~~~~~~
Lighty-template is very simple template engine for python (python.org).
Template syntax looks like django-template or jinja2 template. But template
engine code is easier and gives a way to write all needed tags without any
hacks.
Now it does not include all fe... | bsd-3-clause |
Allianzcortex/scrapy | tests/test_utils_url.py | 89 | 11178 | # -*- coding: utf-8 -*-
import unittest
import six
from scrapy.spiders import Spider
from scrapy.utils.url import (url_is_from_any_domain, url_is_from_spider,
canonicalize_url)
__doctests__ = ['scrapy.utils.url']
class UrlUtilsTest(unittest.TestCase):
def test_url_is_from_any_doma... | bsd-3-clause |
dl1ksv/python-for-android | src/buildlib/jinja2.egg/jinja2/filters.py | 17 | 29827 | # -*- coding: utf-8 -*-
"""
jinja2.filters
~~~~~~~~~~~~~~
Bundled jinja filters.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import math
from random import choice
from operator import itemgetter
from itertools import groupby
from jinja2.utils... | mit |
maxdeliso/elevatorSim | Lib/test/test_call.py | 182 | 3159 | import unittest
from test import support
# The test cases here cover several paths through the function calling
# code. They depend on the METH_XXX flag that is used to define a C
# function, which can't be verified from Python. If the METH_XXX decl
# for a C function changes, these tests may not cover the right pat... | bsd-2-clause |
tfroehlich82/EventGhost | plugins/Weather/pywapi.py | 4 | 12836 | #Copyright (c) 2009 Eugene Kaznacheev <qetzal@gmail.com>
#Permission is hereby granted, free of charge, to any person
#obtaining a copy of this software and associated documentation
#files (the "Software"), to deal in the Software without
#restriction, including without limitation the rights to use,
#copy, modify, mer... | gpl-2.0 |
waynecoulson/TV-Show-Downloader | sickbeard/__init__.py | 1 | 54063 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Lice... | gpl-3.0 |
LegNeato/buck | third-party/py/unittest2/unittest2/test/support.py | 122 | 5487 | import sys
import warnings
import unittest2
def resultFactory(*_):
return unittest2.TestResult()
class OldTestResult(object):
"""An object honouring TestResult before startTestRun/stopTestRun."""
def __init__(self, *_):
self.failures = []
self.errors = []
self.testsRun = 0
... | apache-2.0 |
siddharthsarda/django-registration | registration/backends/default/__init__.py | 71 | 5385 | from django.conf import settings
from django.contrib.sites.models import RequestSite
from django.contrib.sites.models import Site
from registration import signals
from registration.forms import RegistrationForm
from registration.models import RegistrationProfile
class DefaultBackend(object):
"""
A registrati... | bsd-3-clause |
ChenJunor/hue | desktop/core/ext-py/boto-2.38.0/boto/s3/website.py | 185 | 10607 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | apache-2.0 |
zachcp/bioconda-recipes | recipes/emboss/fix_acd_path.py | 38 | 4778 | #!/usr/bin/env python
import os
import shutil
import sys
"""
This script produces for every binary a new shell script similar to:
--------------------------------------------
#!/bin/bash
export EMBOSS_ACDROOT=../share/EMBOSS/acd/
export EMBOSS_DATA=../share/EMBOSS/data
export PLPLOT_LIB=../share/EMBOSS
_water "$@"... | mit |
dialounke/pylayers | pylayers/simul/tests/test_DLink_rmaw.py | 2 | 1426 | # -*- coding: latin1 -*-
from pylayers.simul.link import *
import pylayers.signal.waveform as wvf
import pdb
import warnings
fcGHz=5
WMHz = 3000
Nf = 400
fGHz = np.linspace(fcGHz-WMHz*0.5e-3,fcGHz+WMHz*0.5e-3,Nf)
L=Layout('defstr.lay',bgraphs=1)
L=Layout('espoo.lay',bgraphs=1)
print('DL has removed airwalls')
... | mit |
joseihf/coding-events | api/migrations/0004_auto__add_eventtheme__add_eventaudience.py | 3 | 9588 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'EventTheme'
db.create_table(u'api_eventtheme', (
... | mit |
chaosmaker/pyload | module/plugins/crypter/FilefactoryComFolder.py | 3 | 1757 | # -*- coding: utf-8 -*-
import re
from module.plugins.Crypter import Crypter
class FilefactoryComFolder(Crypter):
__name__ = "FilefactoryComFolder"
__type__ = "crypter"
__pattern__ = r"(http://(www\.)?filefactory\.com/f/\w+).*"
__version__ = "0.1"
__description__ = """Filefactory.com Folder Plugi... | gpl-3.0 |
plotly/plotly.py | packages/python/plotly/plotly/validators/layout/ternary/_caxis.py | 1 | 11077 | import _plotly_utils.basevalidators
class CaxisValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="caxis", parent_name="layout.ternary", **kwargs):
super(CaxisValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | mit |
DARKPOP/external_chromium_org | gpu/gles2_conform_support/generate_gles2_conform_tests.py | 139 | 1430 | #!/usr/bin/env python
# Copyright (c) 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.
"""code generator for OpenGL ES 2.0 conformance tests."""
import os
import re
import sys
def ReadFileAsLines(filename):
"""Read... | bsd-3-clause |
cpcloud/datashape | setup.py | 5 | 1129 | import os
from setuptools import setup
import versioneer
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
with open(os.p... | bsd-2-clause |
ajinabraham/Mobile-Security-Framework-MobSF | scripts/mass_static_analysis.py | 1 | 3070 | #!/usr/bin/env python
# Mass Static Analysis
import os
import urllib.request
import urllib.error
import urllib.parse
import argparse
import requests
import logging
logger = logging.getLogger(__name__)
def is_server_up(url):
try:
response = urllib.request.urlopen(url, timeout=5)
return True
exc... | gpl-3.0 |
luzi82/HiSocial | core/user/UserGroup.py | 1 | 2042 | from sqlalchemy import Column, String
from sqlalchemy.schema import ForeignKey
from user import User
import Group
from base.DatabaseBase import DBB
class UserGroup(DBB):
__tablename__ = "hs_user_usergroup"
user_id = Column(String(User.USER_ID_LENGTH),ForeignKey("hs_user_user.user_id"), primary_key=Tr... | gpl-3.0 |
foxcarlos/trelar | pruebaCliente.py | 1 | 4112 | from trello import TrelloClient
import json
# api_key='your-key' - 05571f7ecf0d9177c020b9ab3495aaac
# api_secret='your-secret' - 03a65f30fb4946c03cba7998327f7e10025493f7e036408d6efbcdbd63fc66f5
# token='your-oauth-token-key' - 1316a12594687b611d0c631896b9b421436bd955d0d376162521c5ed267155d8
# token_secret='your-oauth-... | mit |
jmighion/ansible | lib/ansible/plugins/action/wait_for_connection.py | 38 | 4364 | # (c) 2017, Dag Wieers <dag@wieers.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 later version.
#
... | gpl-3.0 |
akosyakov/intellij-community | python/helpers/pycharm/tcunittest.py | 5 | 8312 | import traceback, sys
from unittest import TestResult
import datetime
from tcmessages import TeamcityServiceMessages
PYTHON_VERSION_MAJOR = sys.version_info[0]
def strclass(cls):
if not cls.__name__:
return cls.__module__
return "%s.%s" % (cls.__module__, cls.__name__)
def smart_str(s):
encoding = 'utf-... | apache-2.0 |
ehashman/oh-mainline | vendor/packages/sphinx/sphinx/util/smartypants.py | 35 | 11142 | r"""
This is based on SmartyPants.py by `Chad Miller`_ <smartypantspy@chad.org>,
version 1.5_1.6.
Copyright and License
=====================
SmartyPants_ license::
Copyright (c) 2003 John Gruber
(http://daringfireball.net/)
All rights reserved.
Redistribution and use in source and binary forms, wit... | agpl-3.0 |
umkay/zulip | analytics/management/commands/clear_analytics_tables.py | 2 | 1104 | from __future__ import absolute_import
from __future__ import print_function
import sys
from argparse import ArgumentParser
from django.db import connection
from django.core.management.base import BaseCommand
from typing import Any
CLEAR_QUERY = """
DELETE FROM ONLY analytics_installationcount;
DELETE FROM ONLY ana... | apache-2.0 |
bxlab/HiFive_Paper | Scripts/HiCLib/numexpr-2.4.3/bench/vml_timing2.py | 3 | 1260 | # References:
#
# http://software.intel.com/en-us/intel-mkl
# https://github.com/pydata/numexpr/wiki/NumexprMKL
from __future__ import print_function
import datetime
import sys
import numpy as np
import numexpr as ne
from time import time
N = 1e7 # higher value can cause segfault (on x86)
x = np.linspace(0, 1, N)
y ... | bsd-3-clause |
sudheesh001/oh-mainline | vendor/packages/celery/celery/tests/test_task/test_context.py | 18 | 6041 | # -*- coding: utf-8 -*-"
from __future__ import absolute_import
import threading
from celery.task.base import Context
from celery.tests.utils import unittest
# Retreive the values of all context attributes as a
# dictionary in an implementation-agnostic manner.
def get_context_as_dict(ctx, getter=getattr):
defa... | agpl-3.0 |
okomestudio/moto | moto/events/models.py | 5 | 8035 | import os
import re
import json
from moto.core.exceptions import JsonRESTError
from moto.core import BaseBackend, BaseModel
class Rule(BaseModel):
def _generate_arn(self, name):
return 'arn:aws:events:us-west-2:111111111111:rule/' + name
def __init__(self, name, **kwargs):
self.name = name
... | apache-2.0 |
diofant/diofant | diofant/tests/logic/test_dimacs.py | 1 | 1069 | """Various tests on satisfiability using dimacs cnf file syntax
You can find lots of cnf files in
ftp://dimacs.rutgers.edu/pub/challenge/satisfiability/benchmarks/cnf/
"""
import os
from diofant.logic.algorithms.dpll import dpll_satisfiable
from diofant.logic.algorithms.dpll2 import \
dpll_satisfiable as dpll2_sa... | bsd-3-clause |
heladio/my-blog | pelica-env/lib/python2.7/site-packages/setuptools/tests/test_develop.py | 148 | 2816 | """develop tests
"""
import os
import shutil
import site
import sys
import tempfile
from setuptools.command.develop import develop
from setuptools.dist import Distribution
SETUP_PY = """\
from setuptools import setup
setup(name='foo',
packages=['foo'],
use_2to3=True,
)
"""
INIT_PY = """print "foo"
"""
clas... | mit |
cryptobanana/ansible | lib/ansible/template/safe_eval.py | 39 | 4919 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
mancoast/CPythonPyc_test | cpython/264_test_future_builtins.py | 58 | 1348 | import test.test_support, unittest
# we're testing the behavior of these future builtins:
from future_builtins import hex, oct, map, zip, filter
from test import test_support
class BuiltinTest(unittest.TestCase):
def test_hex(self):
self.assertEqual(hex(0), '0x0')
self.assertEqual(hex(16), '0x10')... | gpl-3.0 |
teonlamont/mne-python | mne/time_frequency/tests/test_tfr.py | 3 | 25782 | import numpy as np
import os.path as op
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_equal)
import pytest
import mne
from mne import Epochs, read_events, pick_types, create_info, EpochsArray
from mne.io import read_raw_fif
from mne.utils import _TempDir, ... | bsd-3-clause |
beezee/GAE-Django-site | django/db/models/options.py | 96 | 20299 | import re
from bisect import bisect
from django.conf import settings
from django.db.models.related import RelatedObject
from django.db.models.fields.related import ManyToManyRel
from django.db.models.fields import AutoField, FieldDoesNotExist
from django.db.models.fields.proxy import OrderWrt
from django.db.models.loa... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.