repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
xutian/avocado-vt | virttest/bootstrap.py | 5 | 40674 | from distutils import dir_util # virtualenv problem pylint: disable=E0611
import logging
import os
import glob
import shutil
import sys
import re
from avocado.utils import distro
from avocado.utils import genio
from avocado.utils import linux_modules
from avocado.utils import path as utils_path
from avocado.utils imp... | gpl-2.0 |
shownomercy/django | django/contrib/sites/migrations/0001_initial.py | 276 | 1096 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.sites.models
from django.contrib.sites.models import _simple_domain_name_validator
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.Create... | bsd-3-clause |
sserrot/champion_relationships | venv/Lib/site-packages/adodbapi/test/test_adodbapi_dbapi20.py | 1 | 5822 | print("This module depends on the dbapi20 compliance tests created by Stuart Bishop")
print("(see db-sig mailing list history for info)")
import platform
import unittest
import sys
import dbapi20
import setuptestframework
testfolder = setuptestframework.maketemp()
if '--package' in sys.argv:
pth = setuptestframew... | mit |
grovesdixon/metaTranscriptomes | scripts/parse_codeml_likelihoods.py | 1 | 1593 | #!/usr/bin/env python
##parse_codeml_likelihoods.py
##written 12/18/14 by Groves Dixon
ProgramName = 'parse_codeml_likelihoods.py'
LastUpdated = '12/18/14'
By = 'Groves Dixon'
VersionNumber = '1.0'
print "\nRunning Program {}...".format(ProgramName)
VersionString = '{} version {} Last Updated {} by {}'.format(ProgramN... | mit |
jigarkb/CTCI | CTCI/chapter_2/2.3.py | 2 | 1156 | # Delete Middle Node: Implement an algorithm to delete a node in the middle of
# singly linked list, given only access to that node
from LinkedList import Node, LinkedList
def delete_middle_node(node_to_delete):
if node_to_delete.next is None:
raise Exception("Invalid node to delete")
node_to_delete.d... | mit |
zorroz/microblog | flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py | 3127 | 1902 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | bsd-3-clause |
daivietpda/M7WLJ-5.0.2 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
timebackzhou/ogc_server | bayesian/test/test_factor_graph_verify.py | 2 | 3768 | import pytest
from bayesian.factor_graph import *
def pytest_funcarg__x1(request):
x1 = VariableNode('x1')
return x1
def pytest_funcarg__x2(request):
x2 = VariableNode('x2')
return x2
def pytest_funcarg__fA_node(request):
def fA(x1):
return 0.5
fA_node = FactorNode('fA', fA)
... | mit |
brakhane/python-mode | pymode/rope.py | 6 | 25526 | """ Rope support in pymode. """
from __future__ import absolute_import, print_function
import multiprocessing
import os.path
import re
import site
import sys
from rope.base import project, libutils, exceptions, change, worder # noqa
from rope.base.fscommands import FileSystemCommands # noqa
from rope.base.taskhandle ... | lgpl-3.0 |
rkashapov/buildbot | www/waterfall_view/setup.py | 10 | 1565 | #!/usr/bin/env python
#
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# A... | gpl-2.0 |
jsamoocha/pysweat | tests/test_transform_activities_moving_averages.py | 1 | 5107 | import unittest
import numpy as np
import pandas as pd
from pysweat.transformation.activities import weighted_average, compute_moving_averages
from pysweat.transformation.general import get_observations_without_feature
from pysweat.transformation.windows import select_activity_window
test_activities = pd.DataFrame()... | apache-2.0 |
sfroment/collectd-elasticsearch | tools/generate_defaults.py | 3 | 3690 | #! /usr/bin/env python
import json
def load_file(file):
""" Converts an array of file paths into an array of json defined objects
:param file: An array of filepath strings
:return: An array of loaded json objects
"""
CONFIGS = []
with open(file, 'r') as f:
j = json.load(f)
f.close(... | apache-2.0 |
bgroff/kala-app | django_kala/api/basecamp_classic/people/renderers.py | 1 | 12868 | from io import StringIO
from django.db.models import QuerySet
from django.utils.xmlutils import SimplerXMLGenerator
from django.utils.encoding import smart_text
from rest_framework.renderers import BaseRenderer
class XMLPeopleRenderer(BaseRenderer):
"""
Renderer which serializes to XML.
"""
media_typ... | mit |
persandstrom/home-assistant | tests/components/test_spaceapi.py | 4 | 3476 | """The tests for the Home Assistant SpaceAPI component."""
# pylint: disable=protected-access
from unittest.mock import patch
import pytest
from tests.common import mock_coro
from homeassistant.components.spaceapi import (
DOMAIN, SPACEAPI_VERSION, URL_API_SPACEAPI)
from homeassistant.setup import async_setup_com... | apache-2.0 |
kubevirt/client-python | kubevirt/models/v1_access_credential.py | 1 | 4455 | # coding: utf-8
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class V1Access... | apache-2.0 |
SeanTater/tscan | tscan/test_cli.py | 1 | 1962 | from unittest import TestCase
from mock import Mock, call
from cli import Plugin, Argument
from argparse import Namespace
class TestArgument(TestCase):
def test_create(self):
arg = Argument('--abcd', '--efgh', foo='bar')
assert arg.flags == ('--abcd', '--efgh')
assert arg.names == ['abcd', ... | gpl-3.0 |
nhenezi/kuma | kuma/wiki/migrations/0019_disallow_add_attachment.py | 5 | 17057 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
permissions = (
("disallow_add_attachment", "Cannot upload attachment"),
)
def forwards(self, orm):
db.send_pending_create_signals()
... | mpl-2.0 |
verycumbersome/the-blue-alliance | controllers/account_controller.py | 4 | 24016 | import os
import logging
import datetime
import random
import string
from collections import defaultdict
from google.appengine.ext import ndb
from base_controller import LoggedInHandler
from consts.account_permissions import AccountPermissions
from consts.auth_type import AuthType
from consts.client_type import Cli... | mit |
joegomes/deepchem | examples/sampl/sampl_datasets.py | 2 | 1395 | """
SAMPL dataset loader.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import numpy as np
import shutil
import deepchem as dc
def load_sampl(featurizer='ECFP', split='index'):
"""Load SAMPL datasets."""
# Featurize SAMPL dataset
prin... | mit |
djordon/queueing-tool | queueing_tool/queues/agents.py | 1 | 6408 | from numpy import infty
from numpy.random import uniform
from queueing_tool.queues.choice import _choice, _argmin
class Agent(object):
"""The base class for an agent.
``Agents`` are the objects that move throughout the network.
``Agents`` are instantiated by a queue, and once serviced the
``Agent`` ... | mit |
maohongyuan/kbengine | kbe/src/lib/python/Tools/scripts/highlight.py | 36 | 9117 | #!/usr/bin/env python3
'''Add syntax highlighting to Python source code'''
__author__ = 'Raymond Hettinger'
import keyword, tokenize, cgi, re, functools
try:
import builtins
except ImportError:
import __builtin__ as builtins
#### Analyze Python Source #################################
def is_builtin(s):
... | lgpl-3.0 |
Jionglun/w17test_2 | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/__init__.py | 603 | 6082 | ## pygame - Python Game Library
## Copyright (C) 2000-2001 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... | gpl-3.0 |
datastreaming/mflow_nodes | mflow_nodes/processors/base.py | 1 | 1732 | from logging import getLogger
class BaseProcessor(object):
"""
Just a stub, for actual stream processors to extend.
"""
_logger = getLogger(__name__)
def start(self):
"""
Start the stream mflow_processor.
:return: None.
"""
self._logger.debug("Starting mflo... | gpl-3.0 |
cryptobanana/ansible | lib/ansible/modules/cloud/ovirt/ovirt_vmpools.py | 75 | 7594 | #!/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 |
gunnarku/mysql-8.0 | storage/ndb/mcc/ndb_setup.py | 39 | 1802 | #! /usr/bin/env python
"""Launch script for the configurator backend. Parses command line options and starts the web server."""
import sys
import platform
import os.path
import mcc_config
def num_pyver(vn):
if isinstance(vn, str):
return int(''.join(filter(str.isdigit, vn)))
return vn
def num_py_maj... | gpl-2.0 |
nickzuber/ClusterRunner | app/util/autoversioning.py | 1 | 6946 | import os
import subprocess
from app.util import fs
_MAJOR_MINOR_VERSION = '0.5'
_calculated_version = None # We will cache the calculated version so that it can't change during execution.
_VERSION_FILE_PATH = os.path.join(os.path.dirname(__file__), 'package_version.py')
_VERSION_FILE_BACKUP_PATH = os.path.join(os... | apache-2.0 |
gsi-upm/soba | soba/space/continuousElements.py | 2 | 4137 | """
In the file continuousItems.py four classes are defined to implement the elements of
the physical space in a continuous model:
-GeneralItem: Class that implements generic elements positioned on the map with the effect of being impenetrable.
-Door: Class that implements bulding plane doors.
-Wall: Class th... | mit |
jimi-c/ansible | lib/ansible/modules/network/illumos/ipadm_addrprop.py | 61 | 7148 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Adam Števko <adam.stevko@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
blois/AndroidSDKCloneMin | ndk/prebuilt/linux-x86_64/lib/python2.7/ihooks.py | 259 | 18986 | """Import hook support.
Consistent use of this module will make it possible to change the
different mechanisms involved in loading modules independently.
While the built-in module imp exports interfaces to the built-in
module searching and loading algorithm, and it is possible to replace
the built-in function __impor... | apache-2.0 |
bobthekingofegypt/servo | tests/wpt/web-platform-tests/tools/html5lib/utils/spider.py | 436 | 4157 | #!/usr/bin/env python
"""Spider to try and find bugs in the parser. Requires httplib2 and elementtree
usage:
import spider
s = spider.Spider()
s.spider("http://www.google.com", maxURLs=100)
"""
import urllib.request, urllib.error, urllib.parse
import urllib.robotparser
import md5
import httplib2
import html5lib
fro... | mpl-2.0 |
francoisluus/tensorboard-supervise | tensorboard/plugin_util.py | 3 | 2526 | # 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 |
Aaron1992/tornado | tornado/test/httpclient_test.py | 8 | 23119 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
import base64
import binascii
from contextlib import closing
import functools
import sys
import threading
import datetime
from io import BytesIO
from tornado.escape import utf8
from tornado.httpclient import HTTPRe... | apache-2.0 |
pixelrebel/st2 | st2api/st2api/controllers/v1/aliasexecution.py | 5 | 7343 | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | apache-2.0 |
hentaiPanda/Levenshtein | levenshtein.py | 2 | 4422 | #!/usr/bin/env python
# coding: utf-8
'''
Created: 2014-9-17
Author: niR@github (https://github.com/hentaiPanda)
Version: 0.0.1
License: MIT
This is a straightforward implementation of Levenshitein
Distance and Damerau-Levenshtein Distance.
The code is based on the examples on the Wikipedia
You can ge... | mit |
redhat-cip/horizon | openstack_dashboard/dashboards/project/network_topology/tests.py | 2 | 9198 | # Copyright 2012 NEC Corporation
#
# 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 ag... | apache-2.0 |
PythonScientists/Shape | env/lib/python3.5/site-packages/pycparser/c_lexer.py | 21 | 14463 | #------------------------------------------------------------------------------
# pycparser: c_lexer.py
#
# CLexer class: lexer for the C language
#
# Eli Bendersky [http://eli.thegreenplace.net]
# License: BSD
#------------------------------------------------------------------------------
import re
import sys
from .p... | apache-2.0 |
atosatto/ansible | lib/ansible/modules/files/acl.py | 44 | 11662 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 |
bruecksen/isimip | config/settings/production.py | 1 | 2683 | # -*- coding: utf-8 -*-
'''
Production Configurations
- Use sentry for error logging
'''
import logging
from .common import * # noqa
SECRET_KEY = env("DJANGO_SECRET_KEY")
# CACHING
# ------------------------------------------------------------------------------
CACHES = {
'default': {
'BACKEND': 'dja... | mit |
Anonymouslemming/ansible | lib/ansible/modules/cloud/cloudstack/cs_account.py | 18 | 10806 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 |
ahuarte47/QGIS | tests/src/python/test_qgslayoutmap.py | 14 | 15917 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutItemMap.
.. note:: 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 2 of the License, or
(at your option) any later version.
"""
... | gpl-2.0 |
alexbhanneman/CS430-Project | src/js/three.js-master/utils/exporters/blender/addons/io_three/exporter/__init__.py | 119 | 2708 | import os
import sys
import traceback
from .. import constants, logger, exceptions, dialogs
from . import scene, geometry, api, base_classes
def _error_handler(func):
def inner(filepath, options, *args, **kwargs):
level = options.get(constants.LOGGING, constants.DISABLED)
version = options.ge... | mit |
miguelgrinberg/python-engineio | src/engineio/asyncio_server.py | 1 | 22271 | import asyncio
import urllib
from . import exceptions
from . import packet
from . import server
from . import asyncio_socket
class AsyncServer(server.Server):
"""An Engine.IO server for asyncio.
This class implements a fully compliant Engine.IO web server with support
for websocket and long-polling tran... | mit |
gilisagreen/Project4 | lib/itsdangerous.py | 296 | 30509 | # -*- coding: utf-8 -*-
"""
itsdangerous
~~~~~~~~~~~~
A module that implements various functions to deal with untrusted
sources. Mainly useful for web applications.
:copyright: (c) 2011 by Armin Ronacher and the Django Software Foundation.
:license: BSD, see LICENSE for more details.
"""
imp... | apache-2.0 |
amanuel/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/ifort.py | 61 | 3350 | """SCons.Tool.ifort
Tool-specific initialization for newer versions of the Intel Fortran Compiler
for Linux/Windows (and possibly Mac OS X).
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) ... | apache-2.0 |
piniGitHUB/volatility | volatility/plugins/addrspaces/crash.py | 44 | 3315 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (C) 2005,2006,2007 4tphi Research
#
# Authors:
# {npetroni,awalters}@4tphi.net (Nick Petroni and AAron Walters)
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the... | gpl-2.0 |
maurizi/nyc-trees | src/nyc_trees/apps/survey/views.py | 1 | 24867 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import os
import json
import shortuuid
from pytz import timezone
from celery import chain
from django.conf import settings
from django.contrib.gis.geos import Point
from django.core.e... | agpl-3.0 |
dnstap/knot | tests-extra/tools/dnstest/response.py | 1 | 9292 | #!/usr/bin/env python3
import binascii
import dns.name
from dnstest.utils import *
class Response(object):
'''Dig output context.'''
def __init__(self, server, response, args):
self.resp = response
self.args = args
self.srv = server
self.rname = dns.name.from_text(self.args[... | gpl-3.0 |
40223123/finaltest2 | static/Brython3.1.1-20150328-091302/Lib/abc.py | 765 | 8057 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) according to PEP 3119."""
from _weakrefset import WeakSet
def abstractmethod(funcobj):
"""A decorator indicating abstract methods.
Requires that the metaclass is ABCMeta or der... | gpl-3.0 |
rochacbruno/dynaconf | dynaconf/vendor_src/click/parser.py | 1 | 15782 | """
This module started out as largely a copy paste from the stdlib's
optparse module with the features removed that we do not need from
optparse because we implement them in Click on a higher level (for
instance type handling, help formatting and a lot more).
The plan is to remove more and more from here over time.
... | mit |
sileht/deb-openstack-nova | nova/virt/vmwareapi/vmops.py | 4 | 37865 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack 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
#
# htt... | apache-2.0 |
benschmaus/catapult | third_party/google-endpoints/apitools/base/protorpclite/util.py | 17 | 9243 | #!/usr/bin/env python
#
# Copyright 2010 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 o... | bsd-3-clause |
jjmleiro/hue | desktop/core/ext-py/boto-2.38.0/boto/rds/parametergroup.py | 170 | 7037 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | apache-2.0 |
Bysmyyr/chromium-crosswalk | build/android/gyp/write_build_config.py | 1 | 18096 | #!/usr/bin/env python
#
# 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.
"""Writes a build_config file.
The build_config file for a target is a json file containing information about
how to build that targ... | bsd-3-clause |
AudioGod/DTS-Eagle-Integration_CAF-Android-kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# 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.
from collections import defaultdict
def aut... | gpl-2.0 |
vrv/tensorflow | tensorflow/contrib/slim/python/slim/learning_test.py | 28 | 37001 | # 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 |
scyclops/Readable-Feeds | web/db.py | 16 | 36406 | """
Database API
(part of web.py)
"""
__all__ = [
"UnknownParamstyle", "UnknownDB", "TransactionError",
"sqllist", "sqlors", "reparam", "sqlquote",
"SQLQuery", "SQLParam", "sqlparam",
"SQLLiteral", "sqlliteral",
"database", 'DB',
]
import time
try:
import datetime
except ImportError:
datetime = Non... | gpl-3.0 |
rmst/chi | chi/rl/dqn_m.py | 1 | 11810 | #issue in tensortools
from time import sleep, time
import chi
import tensortools as tt
import chi.rl.wrappers
import gym
import numpy as np
import tensorflow as tf
from tensortools import Function
from chi.rl.memory import ReplayMemory
from chi.rl.core import Agent
from chi.rl.memory import ShardedMemory
from chi.rl.w... | mit |
nschloe/seacas | cmake/tribits/python_utils/GenerateDocUtilsOutput.py | 2 | 4168 | import sys
import os
import stat
import subprocess
#
# A) Set up basic paths and import modules
#
from GeneralScriptSupport import *
#
# B) Define some helper functions
#
def openWriteFilePermissions(filePath):
if os.path.exists(filePath):
os.chmod(filePath, stat.S_IREAD | stat.S_IWRITE \
| stat.S_IRG... | bsd-3-clause |
mujiansu/arangodb | 3rdParty/V8-4.3.61/build/gyp/test/library/gyptest-shared.py | 430 | 2230 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies simple build of a "Hello, world!" program with shared libraries,
including verifying that libraries are rebuilt correctly when ... | apache-2.0 |
andyaguiar/aiohttp | tests/test_web_response.py | 1 | 23820 | import asyncio
import datetime
import unittest
from unittest import mock
from aiohttp import hdrs
from aiohttp.multidict import CIMultiDict
from aiohttp.web import ContentCoding, Request, StreamResponse, Response
from aiohttp.protocol import HttpVersion, HttpVersion11, HttpVersion10
from aiohttp.protocol import RawRequ... | apache-2.0 |
mega-force/osmc | package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x0c2.py | 253 | 4710 | data = (
'syon', # 0x00
'syonj', # 0x01
'syonh', # 0x02
'syod', # 0x03
'syol', # 0x04
'syolg', # 0x05
'syolm', # 0x06
'syolb', # 0x07
'syols', # 0x08
'syolt', # 0x09
'syolp', # 0x0a
'syolh', # 0x0b
'syom', # 0x0c
'syob', # 0x0d
'syobs', # 0x0e
'syos', # 0x0f
'syoss', #... | gpl-2.0 |
hirofumi0810/tensorflow_end2end_speech_recognition | models/encoders/core/vgg_blstm.py | 1 | 9163 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""VGG + bidirectional LSTM encoder."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from models.encoders.core.cnn_util import conv_layer, max_pool, batch_normali... | mit |
hbrunn/OpenUpgrade | addons/stock_account/wizard/stock_invoice_onshipping.py | 33 | 4939 | # -*- 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 |
indevgr/django | tests/aggregation/models.py | 282 | 1444 | # -*- coding: utf-8 -*-
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
age = models.IntegerField()
friends = models.ManyToManyField('self', blank=True)
def __st... | bsd-3-clause |
maresja1/qemu-helenos | scripts/tracetool/backend/ftrace.py | 102 | 1351 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Ftrace built-in backend.
"""
__author__ = "Eiichi Tsukata <eiichi.tsukata.xh@hitachi.com>"
__copyright__ = "Copyright (C) 2013 Hitachi, Ltd."
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
__email__ ... | gpl-2.0 |
CalebSLane/openelisglobal-core | liquibase/HaitiLNSPMassive/scripts/sampleTypePanel.py | 6 | 1060 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
type = []
panel = []
done_combos = []
type_file = open('sampleType.txt','r')
panel_file = open('panels.txt','r')
type_panel_results = open("typePanelResults.txt", 'w')
for line in type_file:
type.append(line.strip())
type_file.close()
for line in pane... | mpl-2.0 |
HoracioAlvarado/fwd | venv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py | 499 | 5766 | """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a ... | mit |
kbase/data_api | bin/stress_service.py | 2 | 3471 | #!/usr/bin/env python
import argparse
import os
import multiprocessing
from six import print_
import sys
import time
import doekbase.data_api
#from doekbase.data_api.taxonomy.taxon.api import TaxonClientAPI
from doekbase.data_api.annotation.genome_annotation.api import GenomeAnnotationClientAPI
from doekbase.data_api... | mit |
eamuntz/Django-Tut | env/lib/python2.7/site-packages/django/db/models/fields/files.py | 105 | 15978 | import datetime
import os
from django import forms
from django.db.models.fields import Field
from django.core.files.base import File
from django.core.files.storage import default_storage
from django.core.files.images import ImageFile
from django.db.models import signals
from django.utils.encoding import force_str, for... | mit |
zhjunlang/kbengine | assets/scripts/base/Account.py | 27 | 1034 | # -*- coding: utf-8 -*-
import KBEngine
from KBEDebug import *
class Account(KBEngine.Proxy):
def __init__(self):
KBEngine.Proxy.__init__(self)
def onTimer(self, id, userArg):
"""
KBEngine method.
使用addTimer后, 当时间到达则该接口被调用
@param id : addTimer 的返回值ID
@param userArg : addTimer 最后一个参数所给入的数据
"""
DEB... | lgpl-3.0 |
emanueldima/b2share | b2share/modules/communities/errors.py | 1 | 1826 | # -*- coding: utf-8 -*-
#
# This file is part of EUDAT B2Share.
# Copyright (C) 2016 CERN.
#
# B2Share 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 |
drpngx/tensorflow | tensorflow/python/ops/collective_ops_test.py | 8 | 3394 | # 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 |
ar7z1/ansible | lib/ansible/modules/cloud/memset/memset_zone_domain.py | 35 | 9082 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Simon Weald <ansible@simonweald.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata... | gpl-3.0 |
swiftix/swift | utils/swift_build_support/tests/test_migration.py | 39 | 2818 | # test_migration.py - Tests for swift_build_support.migration -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt ... | apache-2.0 |
turbokongen/home-assistant | homeassistant/components/alarmdecoder/__init__.py | 9 | 5742 | """Support for AlarmDecoder devices."""
import asyncio
from datetime import timedelta
import logging
from adext import AdExt
from alarmdecoder.devices import SerialDevice, SocketDevice
from alarmdecoder.util import NoDeviceError
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
... | apache-2.0 |
akalipetis/tornado | tornado/test/gen_test.py | 60 | 43781 | from __future__ import absolute_import, division, print_function, with_statement
import contextlib
import datetime
import functools
import sys
import textwrap
import time
import weakref
from tornado.concurrent import return_future, Future
from tornado.escape import url_escape
from tornado.httpclient import AsyncHTTPC... | apache-2.0 |
shivam1111/odoo | openerp-wsgi.py | 363 | 1811 | # WSGI Handler sample configuration file.
#
# Change the appropriate settings below, in order to provide the parameters
# that would normally be passed in the command-line.
# (at least conf['addons_path'])
#
# For generic wsgi handlers a global application is defined.
# For uwsgi this should work:
# $ uwsgi_python --... | agpl-3.0 |
mikemow/youtube-dl | youtube_dl/extractor/camdemy.py | 124 | 5425 | # coding: utf-8
from __future__ import unicode_literals
import datetime
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urlparse,
)
from ..utils import (
parse_iso8601,
str_to_int,
)
class CamdemyIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?ca... | unlicense |
zturchan/CMPUT410-Lab6 | v1/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/util.py | 51 | 16632 | import sys
import shutil
import os
import stat
import re
import posixpath
import pkg_resources
import zipfile
import tarfile
from pip.exceptions import InstallationError, BadCommand
from pip.backwardcompat import WindowsError, string_types, raw_input
from pip.locations import site_packages, running_under_virtualenv
fro... | apache-2.0 |
inercia/candelabra | candelabra/topology/box.py | 1 | 7659 | #
# Candelabra
#
# Copyright Alvaro Saurin 2013 - All right Reserved
#
import os
from logging import getLogger
import tempfile
import tarfile
import json
from candelabra.tasks import TaskGenerator
from candelabra.errors import UnsupportedBoxException, ImportException
from candelabra.plugins import PLUGINS_REGISTRIES
... | bsd-2-clause |
kkintaro/termite-data-server | web2py/applications-original/admin/controllers/debug.py | 12 | 7978 | import os
import sys
import cStringIO
import gluon.contrib.shell
import gluon.dal
import gluon.html
import gluon.validators
import code
import thread
from gluon.debug import communicate, web_debugger, qdb_debugger
import pydoc
if DEMO_MODE or MULTI_USER_MODE:
session.flash = T('disabled in demo mode')
redirec... | bsd-3-clause |
openstack-hyper-v-python/numpy | numpy/distutils/fcompiler/lahey.py | 229 | 1438 | from __future__ import division, absolute_import, print_function
import os
from numpy.distutils.fcompiler import FCompiler
compilers = ['LaheyFCompiler']
class LaheyFCompiler(FCompiler):
compiler_type = 'lahey'
description = 'Lahey/Fujitsu Fortran 95 Compiler'
version_pattern = r'Lahey/Fujitsu Fortran... | bsd-3-clause |
db0/Doomtown-Reloaded-OCTGN | o8g/Scripts/customscripts.py | 1 | 127061 | # Python Scripts for the Star Wards LCG definition for OCTGN
# Copyright (C) 2013 Konstantine Thoukydides
# This python script 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 ... | agpl-3.0 |
NikNitro/Python-iBeacon-Scan | sympy/core/tests/test_count_ops.py | 36 | 4575 | from sympy import symbols, sin, exp, cos, Derivative, Integral, Basic, \
count_ops, S, And, I, pi, Eq, Or, Not, Xor, Nand, Nor, Implies, \
Equivalent, MatrixSymbol, Symbol, ITE
from sympy.core.containers import Tuple
x, y, z = symbols('x,y,z')
a, b, c = symbols('a,b,c')
def test_count_ops_non_visual():
de... | gpl-3.0 |
qbuat/hhntup | pbs.py | 4 | 4980 | #!/usr/bin/env python
import subprocess
from subprocess import call
import getpass
import time
import datetime
import os
import errno
def mkdir_p(path):
"""
mkdir -p functionality
http://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python
"""
try:
os.makedirs(path)
excep... | gpl-3.0 |
dgarnier/pyms | Peak/List/Utils.py | 7 | 3335 | """
Utilities for manipulation of peak lists
"""
#############################################################################
# #
# PyMS software for processing of metabolomic mass-spectrometry data #
# Copyright (C) 2005-2012 Vla... | gpl-2.0 |
Richard2ndQuadrant/ansible | lib/ansible/plugins/callback/timer.py | 168 | 1125 | # Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from datetime import datetime
from ansible.plugins.callback import CallbackBase
class CallbackModule(CallbackBase):
"""
This callback module tells you how long your plays ran for.
"""
... | gpl-3.0 |
ovnicraft/edx-platform | common/test/acceptance/pages/lms/discussion.py | 16 | 25860 | from contextlib import contextmanager
from bok_choy.javascript import wait_for_js
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise, Promise
from .course_page import CoursePage
class DiscussionPageMixin(object):
def is_ajax_finished(self):
return self.browser.execute... | agpl-3.0 |
google/iree | build_tools/bazel_to_cmake/bazel_to_cmake_converter.py | 1 | 28002 | # Lint as: python3
# Copyright 2020 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Converter class for converting Bazel BUILD files to CMakeLists.txt files.
See ba... | apache-2.0 |
Immortalin/python-for-android | python-modules/twisted/twisted/test/test_process.py | 49 | 78614 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test running processes.
"""
import gzip
import os
import sys
import signal
import StringIO
import errno
import gc
import stat
try:
import fcntl
except ImportError:
fcntl = process = None
else:
from twisted.internet impor... | apache-2.0 |
staslev/incubator-beam | sdks/python/apache_beam/utils/processes.py | 18 | 1744 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
poojavade/Genomics_Docker | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/scipy/io/wavfile.py | 13 | 9734 | """
Module to read / write wav files using numpy arrays
Functions
---------
`read`: Return the sample rate (in samples/sec) and data from a WAV file.
`write`: Write a numpy array as a WAV file.
"""
from __future__ import division, print_function, absolute_import
import sys
import numpy
import struct
import warnings... | apache-2.0 |
dmick/teuthology | teuthology/repo_utils.py | 1 | 14228 | import logging
import os
import re
import shutil
import subprocess
import time
from teuthology import misc
from teuthology.util.flock import FileLock
from teuthology.config import config
from teuthology.contextutil import MaxWhileTries, safe_while
from teuthology.exceptions import BootstrapError, BranchNotFoundError, ... | mit |
arquetype/thus | src/canonical/i18n.py | 3 | 4162 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
#
# Copyright (C) 2012 Canonical Ltd.
#
# 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 2 of the License, or
# (at your option) any later... | gpl-3.0 |
google/objectfilter | objectfilter/lexer.py | 1 | 14047 | #!/bin/env python
# Copyright 2013 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 a... | apache-2.0 |
ioana-delaney/spark | examples/src/main/python/avro_inputformat.py | 51 | 3170 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
atombrella/django-rest-framework | tests/test_relations_pk.py | 3 | 19626 | from __future__ import unicode_literals
from django.test import TestCase
from django.utils import six
from rest_framework import serializers
from tests.models import (
ForeignKeySource, ForeignKeyTarget, ManyToManySource, ManyToManyTarget,
NullableForeignKeySource, NullableOneToOneSource,
NullableUUIDFore... | bsd-2-clause |
rickerc/glance_audit | glance/api/cached_images.py | 5 | 3619 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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 |
walty8/trac | trac/ticket/tests/admin.py | 1 | 12046 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists o... | bsd-3-clause |
jsternberg/ansible-modules-core | network/basics/get_url.py | 6 | 16581 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Jan-Piet Mens <jpmens () 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 L... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.