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 |
|---|---|---|---|---|---|
sidnarayanan/BAdNet | train/pf/adv/models/train_panda_0.py | 1 | 9018 | #!/usr/local/bin/python2.7
from sys import exit, stdout, argv
from os import environ, system
environ['KERAS_BACKEND'] = 'tensorflow'
import numpy as np
import utils
import signal
from keras.layers import Input, Dense, Dropout, concatenate, LSTM, BatchNormalization, Conv1D, concatenate
from keras.models import Model ... | mit |
mattkretz/root | interpreter/llvm/src/tools/clang/bindings/python/tests/cindex/util.py | 88 | 2293 | # This file provides common utility functions for the test suite.
from clang.cindex import Cursor
from clang.cindex import TranslationUnit
def get_tu(source, lang='c', all_warnings=False, flags=[]):
"""Obtain a translation unit from source and language.
By default, the translation unit is created from source... | lgpl-2.1 |
kordless/wisdom | lib/pyotp/otp.py | 11 | 1820 | import base64
import hashlib
import hmac
class OTP(object):
def __init__(self, s, digits=6, digest=hashlib.sha1):
"""
@param [String] secret in the form of base32
@option options digits [Integer] (6)
Number of integers in the OTP
Google Authenticate only ... | mit |
aguestuser/social-network-analysis-sandbox | lib/python3.5/site-packages/pkg_resources/_vendor/packaging/markers.py | 228 | 8248 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import operator
import os
import platform
import sys
from pkg_resources.e... | gpl-3.0 |
vitor-alves/pixel-canvas-bot | packages/idna/intranges.py | 293 | 1749 | """
Given a list of integers, made up of (hopefully) a small number of long runs
of consecutive integers, compute a representation of the form
((start1, end1), (start2, end2) ...). Then answer the question "was x present
in the original list?" in time O(log(# runs)).
"""
import bisect
def intranges_from_list(list_):
... | gpl-3.0 |
sdvillal/manysources | chemdeco/integration/smartsviewer_utils.py | 1 | 5954 | # coding=utf-8
"""Thin python wrapper over SmartsViewer."""
import os.path as op
import subprocess
from joblib import Parallel, delayed, cpu_count
# for joblib pickling...
def _depict(svr, smarts, dest_file):
return svr.depict(smarts, dest_file)
def as_pil(paths):
from PIL import Image
return map(Image.... | bsd-3-clause |
kartikdhar/djangotest | virt1/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/euckrprober.py | 2931 | 1675 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
jamesleesaunders/python-xbee | xbee/tests/test_base.py | 1 | 5818 | #! /usr/bin/python
"""
test_base.py
By Paul Malmsten, 2010
pmalmsten@gmail.com
Tests the XBeeBase superclass module for XBee API conformance.
"""
import unittest
from xbee.base import XBeeBase
from xbee.tests.Fake import Serial
class TestWriteToDevice(unittest.TestCase):
"""
XBeeBase class should properly._w... | mit |
ishay2b/tensorflow | tensorflow/contrib/linalg/python/kernel_tests/linear_operator_test.py | 41 | 7997 | # 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 |
pando85/gourmet | gourmet/timer.py | 6 | 7647 | import gtk, gobject, time, gglobals, os
import xml.sax.saxutils
from sound import Player
from gtk_extras import cb_extras as cb
from gettext import gettext as _
class TimeSpinnerUI:
def __init__ (self, hoursSpin, minutesSpin, secondsSpin):
self.timer_hooks = []
self.running = False
self.ho... | gpl-2.0 |
karelin/polymode | Polymode/TriDiagonalSolver.py | 4 | 17195 | # _*_ coding=utf-8 _*_
#
#---------------------------------------------------------------------------------
#Copyright © 2009 Andrew Docherty
#
#This program is part of Polymode.
#Polymode is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the ... | gpl-3.0 |
boada/planckClusters | MOSAICpipe/bpz-1.99.3/bpz.py | 1 | 52171 | """
bpz: Bayesian Photo-Z estimation
Reference: Benitez 2000, ApJ, 536, p.571
Usage:
python bpz.py catalog.cat
Needs a catalog.columns file which describes the contents of catalog.cat
"""
from __future__ import print_function
from __future__ import division
from builtins import str
from builtins import ... | mit |
xupingmao/xnote | handlers/search/note.py | 1 | 1364 | # -*- coding:utf-8 -*-
# Created by xupingmao on 2017/06/11
# @modified 2020/02/18 00:20:12
"""搜索知识库文件"""
import re
import sys
import six
import xutils
import xauth
import xmanager
import xconfig
import xtables
from xutils import textutil
from xutils import SearchResult, text_contains
NOTE_DAO = xutils.DAO("note")
... | gpl-3.0 |
jimbydamonk/ansible-modules-core | cloud/google/gce_pd.py | 130 | 9532 | #!/usr/bin/python
# Copyright 2013 Google 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 vers... | gpl-3.0 |
kslundberg/pants | src/python/pants/reporting/reporting_utils.py | 10 | 1233 | # 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)
def items_to_report... | apache-2.0 |
nitzmahone/ansible-modules-core | network/dellos10/dellos10_facts.py | 11 | 13932 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell 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 versi... | gpl-3.0 |
yokose-ks/edx-platform | common/djangoapps/track/tracker.py | 239 | 2374 | """
Module that tracks analytics events by sending them to different
configurable backends.
The backends can be configured using Django settings as the example
below::
TRACKING_BACKENDS = {
'tracker_name': {
'ENGINE': 'class.name.for.backend',
'OPTIONS': {
'host': ... ,
... | agpl-3.0 |
michaelBenin/sqlalchemy | lib/sqlalchemy/testing/plugin/noseplugin.py | 1 | 2735 | # plugin/noseplugin.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Enhance nose with extra options and behaviors for running SQLAlchemy tests.
M... | mit |
jazzmes/ryu | ryu/app/rest_quantum.py | 22 | 4625 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012 Isaku Yamahata <yamahata at private email ne jp>
#
# 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
#
# h... | apache-2.0 |
pasqualguerrero/django | django/middleware/http.py | 247 | 2129 | from django.utils.http import http_date, parse_http_date_safe
class ConditionalGetMiddleware(object):
"""
Handles conditional GET operations. If the response has an ETag or
Last-Modified header, and the request has If-None-Match or
If-Modified-Since, the response is replaced by an HttpNotModified.
... | bsd-3-clause |
dkubiak789/OpenUpgrade | addons/sales_team/__openerp__.py | 52 | 1792 | # -*- 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 |
grengojbo/satchmo | satchmo/apps/satchmo_utils/urlhelper.py | 7 | 2626 | def delete_named_urlpattern(urlpatterns, name):
"""Delete the named urlpattern.
"""
found = False
ix = 0
while not found and ix < len(urlpatterns):
pattern = urlpatterns[ix]
if hasattr(pattern, 'url_patterns'):
found = delete_named_urlpattern(pattern.url_patterns, name)... | bsd-3-clause |
TraderZed/greygardens | node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py | 2710 | 5094 | # 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.
"""Visual Studio user preferences file writer."""
import os
import re
import socket # for gethostname
import gyp.common
import gyp.easy_xml as easy_xml
#------... | mit |
alikins/ansible | lib/ansible/modules/inventory/add_host.py | 66 | 2701 | # -*- mode: python -*-
#
# Copyright: Ansible Team
# 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': ['stablein... | gpl-3.0 |
rkJun/libhangul | doc/gen_hangulkeyboards.py | 4 | 14748 | #!/usr/bin/env python
# coding=utf-8
import sys
table = {}
current_name = ''
current_table = []
src = open('../hangul/hangulkeyboard.h', 'r')
for i in src.readlines():
pos = i.find('hangul_keyboard_table_')
if pos >= 0:
end = i.find('[')
current_name = i[pos + 22:end];
continue
pos = i.find('}')
if pos... | lgpl-2.1 |
gammu/wammu | Wammu/Logger.py | 1 | 5021 | # -*- coding: UTF-8 -*-
#
# Copyright © 2003 - 2018 Michal Čihař <michal@cihar.com>
#
# This file is part of Wammu <https://wammu.eu/>
#
# 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 ve... | gpl-3.0 |
giuliov/ansible | lib/ansible/inventory/group.py | 122 | 4627 | # (c) 2012-2014, 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) an... | gpl-3.0 |
inveniosoftware/invenio-migrator | tests/legacy/test_access_dump.py | 1 | 2580 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016, 2017 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... | gpl-2.0 |
skudriashev/incubator-airflow | airflow/migrations/versions/bbc73705a13e_add_notification_sent_column_to_sla_miss.py | 62 | 1063 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
MediaSapiens/wavesf | django/db/models/deletion.py | 12 | 10108 | from operator import attrgetter
from django.db import connections, transaction, IntegrityError
from django.db.models import signals, sql
from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE
from django.utils.datastructures import SortedDict
from django.utils.functional import wraps
def CASCADE(collecto... | bsd-3-clause |
CiscoSystems/vespa | neutron/tests/unit/_test_extension_portbindings.py | 5 | 11690 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 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.org... | apache-2.0 |
dhalleine/tensorflow | tensorflow/python/training/adam_test.py | 8 | 8216 | # 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 |
sebMathieu/dsima | simulator/src/agent/example.py | 1 | 2631 | ##@package Example
# Example of agent-based system based on a supply and a demand curve
#@author Sebastien MATHIEU
from .agent import Agent
from .abstractSystem import AbstractSystem
from .layer import Layer
from .data import Data
import math
## Supply with the target supply function \f$\pi = 0.1 q^2 +2\f... | bsd-3-clause |
arsenetar/dupeguru | hscommon/tests/table_test.py | 2 | 9762 | # Created By: Virgil Dupras
# Created On: 2008-08-12
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-... | gpl-3.0 |
OpenSourceActivismTech/call-power | alembic/versions/38f01b0893b8_add_call_in_campaign_id_to_.py | 3 | 1414 | """Add call_in_campaign_id to TwilioPhoneNumber
Revision ID: 38f01b0893b8
Revises: 3c34cfd19bf8
Create Date: 2016-10-21 18:59:13.190060
"""
# revision identifiers, used by Alembic.
revision = '38f01b0893b8'
down_revision = '3c34cfd19bf8'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchem... | agpl-3.0 |
DARKPOP/external_chromium_org | tools/deep_memory_profiler/lib/symbol.py | 99 | 7171 | # 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 logging
import os
import sys
_BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
_FIND_RUNTIME_SYMBOLS_PATH = os.path.join(_BASE... | bsd-3-clause |
hryamzik/ansible | lib/ansible/modules/cloud/ovirt/ovirt_external_provider.py | 12 | 14901 | #!/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 |
Athrun29/horizon | openstack_dashboard/test/integration_tests/pages/project/compute/imagespage.py | 3 | 4987 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
rschnapka/odoo | addons/l10n_fr/report/__init__.py | 424 | 1475 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... | agpl-3.0 |
tangledupinblue/pi-node-terminal | cardReader/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py | 1788 | 1435 | #!/usr/bin/env python
import re
import json
# https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
# http://stackoverflow.com/a/13436167/96656
def unisymbol(codePoint):
if codePoint >= 0x0000 and codePoint <= 0xFFFF:
return unichr(codePoint)
elif codePoint >= 0x010000 and codePoint <= 0x10FFFF:
... | mit |
foss-transportationmodeling/rettina-server | .env/lib/python2.7/site-packages/sqlalchemy/orm/deprecated_interfaces.py | 21 | 21941 | # orm/deprecated_interfaces.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from .. import event, util
from .interfaces import EXT_CONTINUE
@util... | apache-2.0 |
odoo-arg/odoo_l10n_ar | l10n_ar_invoice_presentation/models/presentation_header.py | 1 | 2454 | # - coding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# ... | agpl-3.0 |
gdit-cnd/RAPID | core/tasks.py | 2 | 1287 | import os
import gzip
import urllib.request
from celery import shared_task
from django.core.mail import EmailMessage
from celery.task import periodic_task
from celery.schedules import crontab
@shared_task(name='deliver_email')
def deliver_email(subject=None, body=None, recipients=None):
if recipients:
f... | mit |
pylbert/upm | examples/python/ehr.py | 6 | 2666 | #!/usr/bin/env python
# Author: Zion Orent <zorent@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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 ... | mit |
tdtrask/ansible | lib/ansible/parsing/yaml/constructor.py | 96 | 6286 | # (c) 2012-2014, 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) an... | gpl-3.0 |
ninadpdr/python-saml | setup.py | 1 | 1286 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014, OneLogin, Inc.
# All rights reserved.
from setuptools import setup
setup(
name='python-saml',
version='2.1.5',
description='Onelogin Python Toolkit. Add SAML support to your Python software using this library',
classifiers=[
... | bsd-3-clause |
roadmapper/ansible | test/units/modules/network/fortios/test_fortios_webfilter_override.py | 20 | 10787 | # Copyright 2019 Fortinet, Inc.
#
# 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.
#
# This program is distributed in the... | gpl-3.0 |
alphafoobar/intellij-community | python/helpers/pydev/pydev_runfiles.py | 52 | 30194 | from __future__ import nested_scopes
import fnmatch
import os.path
from pydev_runfiles_coverage import StartCoverageSupport
from pydevd_constants import * #@UnusedWildImport
import re
import time
#=======================================================================================================================
... | apache-2.0 |
itsjeyd/edx-platform | common/test/acceptance/fixtures/__init__.py | 15 | 1026 | import os
# Get the URL of the Studio instance under test
STUDIO_BASE_URL = os.environ.get('studio_url', 'http://localhost:8031')
# Get the URL of the LMS instance under test
LMS_BASE_URL = os.environ.get('lms_url', 'http://localhost:8003')
# Get the URL of the XQueue stub used in the test
XQUEUE_STUB_URL = os.envi... | agpl-3.0 |
peter-jang/ansible-modules-core | cloud/rackspace/rax.py | 30 | 32929 | #!/usr/bin/python
# 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... | gpl-3.0 |
marcore/edx-platform | lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py | 8 | 16630 | """
Unit tests for instructor_dashboard.py.
"""
import ddt
import datetime
from mock import patch
from nose.plugins.attrib import attr
from pytz import UTC
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.client import RequestFactory
from django.test.utils import override_... | agpl-3.0 |
GbalsaC/bitnamiP | lms/djangoapps/django_comment_client/migrations/0001_initial.py | 188 | 8982 | # -*- 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 model 'Role'
db.create_table('django_comment_client_role', (
('id', self.gf('django.db.... | agpl-3.0 |
noxora/flask-base | flask/lib/python3.4/site-packages/sqlalchemy/testing/suite/test_results.py | 35 | 11736 | from .. import fixtures, config
from ..config import requirements
from .. import exclusions
from ..assertions import eq_
from .. import engines
from ... import testing
from sqlalchemy import Integer, String, select, util, sql, DateTime, text, func
import datetime
from ..schema import Table, Column
class RowFetchTest... | mit |
mifl/android_kernel_pantech_presto | 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 |
kushalbhola/MyStuff | Practice/PythonApplication/env/Lib/site-packages/numpy/core/_methods.py | 5 | 8399 | """
Array methods which are called by both the C-code for the method
and the Python code for the NumPy-namespace function
"""
from __future__ import division, absolute_import, print_function
import warnings
from numpy.core import multiarray as mu
from numpy.core import umath as um
from numpy.core._asarray import asa... | apache-2.0 |
google/assetMG | app/backend/helpers.py | 1 | 1488 | # Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
aaltinisik/OCBAltinkaya | addons/email_template/email_template.py | 1 | 31022 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it ... | agpl-3.0 |
kenorb/BitTorrent | twisted/conch/scripts/cftp.py | 4 | 27273 | # -*- test-case-name: twisted.conch.test.test_cftp -*-
#
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
# $Id: cftp.py,v 1.65 2004/03/11 00:29:14 z3p Exp $
#""" Implementation module for the `cftp` command.
#"""
from twisted.conch.client import agent, connect, default, options
fro... | gpl-3.0 |
NSLS-II/filestore | filestore/test/test_write.py | 4 | 5524 | # ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... | bsd-3-clause |
pboechat/OperatorGraph | auto_tuner/Configuration.py | 1 | 9246 | import xml.sax
import ParseUtils
from Enums import *
####################################################################################################
class BaseConfiguration(xml.sax.ContentHandler):
def loadFromDisk(self, filename):
xml.sax.parse(filename, self)
######################################... | mit |
jcoady9/python-for-android | python3-alpha/extra_modules/gdata/tlslite/utils/OpenSSL_TripleDES.py | 48 | 1668 | """OpenSSL/M2Crypto 3DES implementation."""
from .cryptomath import *
from .TripleDES import *
if m2cryptoLoaded:
def new(key, mode, IV):
return OpenSSL_TripleDES(key, mode, IV)
class OpenSSL_TripleDES(TripleDES):
def __init__(self, key, mode, IV):
TripleDES.__init__(self, key, ... | apache-2.0 |
daisymax/nvda | source/core.py | 2 | 13078 | #core.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2006-2008 NVDA Contributors <http://www.nvda-project.org/>
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
"""NVDA core"""
# Do this first to initialise comtypes.client.gen_dir and the comtypes.... | gpl-2.0 |
sharifulgeo/networkx | networkx/algorithms/tests/test_cluster.py | 89 | 7321 | #!/usr/bin/env python
from nose.tools import *
import networkx as nx
class TestTriangles:
def test_empty(self):
G = nx.Graph()
assert_equal(list(nx.triangles(G).values()),[])
def test_path(self):
G = nx.path_graph(10)
assert_equal(list(nx.triangles(G).values()),
... | bsd-3-clause |
nysan/yocto-autobuilder | lib/python2.6/site-packages/Twisted-11.0.0-py2.6-linux-x86_64.egg/twisted/trial/test/packages.py | 25 | 3955 | import sys, os
from twisted.trial import unittest
testModule = """
from twisted.trial import unittest
class FooTest(unittest.TestCase):
def testFoo(self):
pass
"""
dosModule = testModule.replace('\n', '\r\n')
testSample = """
'''This module is used by test_loader to test the Trial test loading
function... | gpl-2.0 |
mindw/numpy | numpy/distutils/line_endings.py | 256 | 2053 | """ Functions for converting from DOS to UNIX line endings
"""
from __future__ import division, absolute_import, print_function
import sys, re, os
def dos2unix(file):
"Replace CRLF with LF in argument files. Print names of changed files."
if os.path.isdir(file):
print(file, "Directory!")
ret... | bsd-3-clause |
cgarrard/osgeopy-code | Chapter4/listing4_2.py | 1 | 1083 | import os
from osgeo import ogr
def layers_to_feature_dataset(ds_name, gdb_fn, dataset_name):
"""Copy layers to a feature dataset in a file geodatabase."""
# Open the input datasource.
in_ds = ogr.Open(ds_name)
if in_ds is None:
raise RuntimeError('Could not open datasource')
# Open the g... | mit |
ltilve/ChromiumGStreamerBackend | chrome/common/extensions/docs/server2/environment.py | 36 | 1521 | # 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 re
import os
import sys
from app_yaml_helper import AppYamlHelper
from third_party.json_schema_compiler.memoize import memoize
@memoize
def GetAppV... | bsd-3-clause |
spbguru/repo1 | tests/unit/py2/nupic/algorithms/anomaly_test.py | 2 | 4583 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditio... | gpl-3.0 |
pylada/pylada-light | src/pylada/config/vasp.py | 1 | 1440 | ###############################
# This file is part of PyLaDa.
#
# Copyright (C) 2013 National Renewable Energy Lab
#
# PyLaDa is a high throughput computational platform for Physics. It aims to make it easier to submit
# large numbers of jobs on supercomputers. It provides a python interface to physical input, suc... | gpl-3.0 |
kurtdawg24/robotframework | src/robot/model/message.py | 16 | 2493 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | apache-2.0 |
jennywoites/MUSSA | MUSSA_Flask/app/API_Rest/Services/DocenteServices/DocenteService.py | 1 | 5919 | from app.API_Rest.codes import *
from app.models.docentes_models import Docente
from app import db
from flask_user import roles_accepted
from app.API_Rest.Services.BaseService import BaseService
from app.models.generadorJSON.docentes_generadorJSON import generarJSON_docente
from app.models.docentes_models import Cursos... | gpl-3.0 |
allenlavoie/tensorflow | tensorflow/python/training/learning_rate_decay_test.py | 6 | 18959 | # 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 |
takeflight/django | tests/forms_tests/tests/test_extra.py | 16 | 35987 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import warnings
from django.forms import (
CharField, DateField, EmailField, FileField, Form, GenericIPAddressField,
HiddenInput, ImageField, IPAddressField, MultipleChoiceField,
MultiValueField, MultiWidget, PasswordInput, Se... | bsd-3-clause |
darmaa/odoo | addons/account_followup/__openerp__.py | 64 | 2998 | # -*- 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 |
kennedyshead/home-assistant | homeassistant/helpers/event.py | 2 | 48126 | """Helpers for listening to events."""
from __future__ import annotations
import asyncio
from collections.abc import Awaitable, Iterable
import copy
from dataclasses import dataclass
from datetime import datetime, timedelta
import functools as ft
import logging
import time
from typing import Any, Callable, List, cast
... | apache-2.0 |
lovelysystems/pyjamas | library/pyjamas/ui/HorizontalPanel.py | 1 | 2463 | # Copyright 2006 James Tauber and contributors
#
# 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 agre... | apache-2.0 |
homme/ansible-modules-core | system/group.py | 81 | 13394 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Stephen Fromm <sfromm@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 Lice... | gpl-3.0 |
fbradyirl/home-assistant | tests/components/persistent_notification/test_init.py | 4 | 7233 | """The tests for the persistent notification component."""
from homeassistant.components.websocket_api.const import TYPE_RESULT
from homeassistant.setup import setup_component, async_setup_component
import homeassistant.components.persistent_notification as pn
from tests.common import get_test_home_assistant
class T... | apache-2.0 |
jackrzhang/zulip | zerver/migrations/0130_text_choice_in_emojiset.py | 13 | 1745 | from django.db import migrations, models
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
# change emojiset to text if emoji_alt_code is true.
def change_emojiset(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
UserProfil... | apache-2.0 |
benpatterson/edx-platform | common/djangoapps/django_locale/tests.py | 81 | 6516 | # pylint: disable=invalid-name, line-too-long, super-method-not-called
"""
Tests taken from Django upstream:
https://github.com/django/django/blob/e6b34193c5c7d117ededdab04bb16caf8864f07c/tests/regressiontests/i18n/tests.py
"""
from django.conf import settings
from django.test import TestCase, RequestFactory
from djang... | agpl-3.0 |
Eforcers/inbox-cleaner | src/lib/gae_mini_profiler/instrumented_profiler.py | 13 | 2781 | """CPU profiler that works by instrumenting all function calls (uses cProfile).
This profiler provides detailed function timings for all function calls
during a request.
This is just a simple wrapper for cProfile with result formatting. See
http://docs.python.org/2/library/profile.html for more.
PRO: since every fun... | mit |
gechong/XlsxWriter | xlsxwriter/test/comparison/test_escapes01.py | 8 | 2872 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
seocam/mirror-test | colab/search/forms.py | 1 | 7726 | # -*- coding: utf-8 -*-
import unicodedata
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from haystack.forms import SearchForm
from haystack.inputs import AltParser
from haystack.inputs import AutoQuery
from colab.super_archives.models import Mailin... | gpl-2.0 |
mitsuhiko/sqlalchemy | lib/sqlalchemy/dialects/mysql/oursql.py | 5 | 8694 | # mysql/oursql.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mysql+oursql
:name: OurSQL
:dbapi: oursql
:connectstring... | mit |
aidan-/ansible-modules-extras | source_control/gitlab_user.py | 22 | 12534 | #!/usr/bin/python
# (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl)
#
# 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... | gpl-3.0 |
fluxw42/youtube-dl | youtube_dl/extractor/abcotvs.py | 15 | 3903 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_iso8601,
)
class ABCOTVSIE(InfoExtractor):
IE_NAME = 'abcotvs'
IE_DESC = 'ABC Owned Television Stations'
_VALID_URL = r'https?://(?:abc(?:7(?:news|ny|chica... | unlicense |
MartinHjelmare/home-assistant | homeassistant/components/lifx/__init__.py | 5 | 1836 | """Support for LIFX."""
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant import config_entries
from homeassistant.const import CONF_PORT
from homeassistant.helpers import config_entry_flow
from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN
DOMAIN = 'lifx'... | apache-2.0 |
cherusk/ansible | lib/ansible/modules/network/ios/ios_config.py | 19 | 13988 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
ekasitk/sahara | sahara/service/edp/oozie/workflow_creator/shell_workflow.py | 9 | 1685 | # Copyright (c) 2015 Red Hat 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 |
BartVB/ansible-modules-core | cloud/amazon/ec2_metric_alarm.py | 43 | 10680 | #!/usr/bin/python
# 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... | gpl-3.0 |
jeasoft/odoo | marcos_addons/marcos_ncf/__openerp__.py | 2 | 2410 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013-2015 Marcos Organizador de Negocios SRL http://marcos.do
# Write by Eneldo Serrata (eneldo@marcos.do)
#
# This program is free software: you can redistribute it and/or modify
# it un... | agpl-3.0 |
turtleloveshoes/kitsune | kitsune/forums/tests/test_feeds.py | 17 | 1665 | from datetime import datetime, timedelta
from nose.tools import eq_
from pyquery import PyQuery as pq
from kitsune.forums.feeds import ThreadsFeed, PostsFeed
from kitsune.forums.tests import ForumTestCase, forum, thread, post
from kitsune.sumo.tests import get
YESTERDAY = datetime.now() - timedelta(days=1)
class F... | bsd-3-clause |
ewiseblatt/spinnaker | dev/buildtool/hal_support.py | 2 | 5890 | #!/usr/bin/python
#
# 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... | apache-2.0 |
hjanime/VisTrails | vistrails/gui/variable_dropbox.py | 1 | 22113 | ###############################################################################
##
## Copyright (C) 2014-2015, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | bsd-3-clause |
fishjord/gsutil | gslib/tests/test_signurl.py | 2 | 15810 | # -*- coding: utf-8 -*-
# Copyright 2014 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 require... | apache-2.0 |
Stane1983/u-boot | tools/buildman/cmdline.py | 6 | 7614 | # SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2014 Google, Inc
#
from optparse import OptionParser
def ParseArgs():
"""Parse command line arguments from sys.argv[]
Returns:
tuple containing:
options: command line options
args: command lin arguments
"""
parser = O... | gpl-2.0 |
selboo/flask | scripts/flaskext_compat.py | 6 | 5023 | # -*- coding: utf-8 -*-
"""
flaskext_compat
~~~~~~~~~~~~~~~
Implements the ``flask.ext`` virtual package for versions of Flask
older than 0.7. This module is a noop if Flask 0.8 was detected.
Usage::
import flaskext_compat
flaskext_compat.activate()
from flask.ext import ... | bsd-3-clause |
CMRemix/trltetmo-dok2 | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
mitya57/django | tests/generic_views/test_detail.py | 31 | 8975 | import datetime
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.test import TestCase, override_settings
from django.test.client import RequestFactory
from django.views.generic.base import View
from django.views.generic.detail import SingleObjectTemplateResponseMixin
from django.... | bsd-3-clause |
Petraea/jsonbot | jsb/lib/less.py | 1 | 1782 | # jsb/less.py
#
#
""" maintain bot output cache. """
# jsb imports
from jsb.utils.exception import handle_exception
from jsb.utils.limlist import Limlist
from jsb.lib.cache import get, set, delete
## basic imports
import logging
## Less class
class Less(object):
""" output cache .. caches upto <nr> item of ... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.