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 |
|---|---|---|---|---|---|
bowlofstew/Impala | testdata/bin/cache_tables.py | 15 | 2845 | #!/usr/bin/env impala-python
#
# This script will warm up the buffer cache with the tables required to run the input
# query. This only works on a mini-dfs cluster. This is remarkably difficult to do
# since hdfs which tries to hide the details of the block locations from users.
# The only way to do this is to
# ... | apache-2.0 |
nhoffman/opiates | opiate/utils.py | 1 | 2361 | from collections import Iterable
import os
from os import path
import shutil
import logging
from __init__ import __version__
log = logging.getLogger(__name__)
def flatten(seq):
"""
Poached from http://stackoverflow.com/questions/2158395/flatten-an-irregular-list-of-lists-in-python
Don't flatten strings ... | gpl-3.0 |
Seekatar/pcg | Games/FineControl.py | 1 | 2743 | import base
import datetime
import random
from FixedRandomGame import FixedRandomGame as __base
# use __base, otherwise when searching for games, FixedRandomGame shows up multiple times
class FineControl(__base):
"""
Touch four plates in patterns as fast as you can.
Level 1: tight, clockwise 5 times
... | mit |
avinassh/praw | praw/errors.py | 6 | 14613 | # This file is part of PRAW.
#
# PRAW 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.
#
# PRAW is distributed in the hope that it will ... | gpl-3.0 |
yati-sagade/incubator-airflow | tests/contrib/operators/test_file_to_wasb.py | 38 | 2728 | # -*- 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 |
AZtheAsian/zulip | zerver/views/pointer.py | 31 | 1319 | from __future__ import absolute_import
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from typing import Text
from zerver.decorator import to_non_negative_int
from zerver.lib.actions import do_update_pointer
from zerver.lib.request import has_request_variables, Js... | apache-2.0 |
achawkins/Forsteri | doc/conf.py | 1 | 9317 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Forsteri documentation build configuration file, created by
# sphinx-quickstart on Fri Apr 24 16:09:15 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# a... | mit |
DIRACGrid/COMDIRAC | Interfaces/scripts/dgetenv.py | 1 | 1529 | #! /usr/bin/env python
"""
print DCommands session environment variables
"""
import DIRAC
from COMDIRAC.Interfaces import critical
from COMDIRAC.Interfaces import DSession
if __name__ == "__main__":
from COMDIRAC.Interfaces import ConfigCache
from DIRAC.Core.Base import Script
Script.setUsageMessage( '\n'.j... | gpl-3.0 |
nistats/nistats | examples/03_second_level_models/plot_oasis.py | 1 | 6030 | """Voxel-Based Morphometry on Oasis dataset
========================================
This example uses Voxel-Based Morphometry (VBM) to study the relationship
between aging, sex and gray matter density.
The data come from the `OASIS <http://www.oasis-brains.org/>`_ project.
If you use it, you need to agree with the d... | bsd-3-clause |
saltstar/spark | examples/src/main/python/ml/standard_scaler_example.py | 128 | 1594 | #
# 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 |
spring-week-topos/horizon-week | openstack_dashboard/dashboards/project/images/urls.py | 5 | 1396 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 |
RPGOne/Skynet | pytorch-master/torch/nn/modules/upsampling.py | 1 | 3469 | from numbers import Integral
from .module import Module
from .. import functional as F
from .utils import _pair
class _UpsamplingBase(Module):
def __init__(self, size=None, scale_factor=None):
super(_UpsamplingBase, self).__init__()
if size is None and scale_factor is None:
raise Val... | bsd-3-clause |
python-ivi/python-ivi | ivi/agilent/agilentMSOX91304A.py | 2 | 1692 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2017 Alex Forencich
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... | mit |
sdague/home-assistant | tests/components/vacuum/test_device_action.py | 15 | 3063 | """The tests for Vacuum device actions."""
import pytest
import homeassistant.components.automation as automation
from homeassistant.components.vacuum import DOMAIN
from homeassistant.helpers import device_registry
from homeassistant.setup import async_setup_component
from tests.common import (
MockConfigEntry,
... | apache-2.0 |
mihaip/NewsBlur | vendor/feedvalidator/demo/src/tests/testXmlEncodingDecode.py | 16 | 5356 | #!/usr/bin/python
"""$Id: testXmlEncodingDecode.py 710 2006-10-13 00:57:33Z josephw $"""
__author__ = "Joseph Walton <http://www.kafsemo.org/>"
__version__ = "$Revision: 710 $"
__date__ = "$Date: 2006-10-13 00:57:33 +0000 (Fri, 13 Oct 2006) $"
__copyright__ = "Copyright (c) 2004 Joseph Walton"
import os, sys
curdir ... | mit |
iliavolyova/evo-clustering | src/stats.py | 1 | 5952 | from __future__ import division
import os
from functools import partial
import log as logger
import core
import gui_graphs
from PyQt4.QtGui import *
defaultParams = {
'Dataset' : 'Iris',
'Number of generations' : 100,
'Population size': 20,
'Max clusters' : 5,
... | mit |
paritosh-in/tizen-extensions-crosswalk | tools/gyp/pylib/gyp/generator/ninja.py | 13 | 74892 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import hashlib
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
import gyp.common
import gyp.msvs_... | bsd-3-clause |
astaninger/speakout | venv/lib/python3.6/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... | mit |
franciscod/python-telegram-bot | telegram/document.py | 2 | 2064 | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... | gpl-2.0 |
rosmo/ansible | lib/ansible/modules/network/eos/eos_interface.py | 23 | 15169 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible by Red Hat, inc
# 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 |
ool2016-seclab/quarantineSystem | api.py | 1 | 3438 | import json
import logging
import ryutest
from webob import Response
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.app.wsgi import ControllerBase, WSGIApplication, route
from ryu.lib import dpid as dpid_lib
simple_switc... | mit |
j00bar/ansible | contrib/inventory/brook.py | 140 | 9670 | #!/usr/bin/env python
# Copyright 2016 Doalitic.
#
# 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 ve... | gpl-3.0 |
anti-social/elasticmagic | tests_integ/conftest.py | 1 | 1312 | import uuid
import pytest
from elasticmagic import Document, Field
from elasticmagic.types import Text
def pytest_addoption(parser):
parser.addoption("--es-url", action="store", default="localhost:9200")
def pytest_generate_tests(metafunc):
# This is called for every test. Only get/set command line argume... | apache-2.0 |
rjschof/gem5 | src/arch/x86/isa/insts/x87/arithmetic/division.py | 41 | 2926 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
dookyoonhan/mean1 | node_modules/meanio/node_modules/npm/node_modules/node-gyp/gyp/PRESUBMIT.py | 496 | 3373 | # 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.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... | mit |
melvinw/pktgen | controller/job_pb2.py | 1 | 9157 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: job.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 reflection as _reflectio... | bsd-3-clause |
syphar/django | django/contrib/gis/db/backends/base/models.py | 67 | 4111 | from django.contrib.gis import gdal
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class SpatialRefSysMixin(object):
"""
The SpatialRefSysMixin is a class used by the database-dependent
SpatialRefSys objects to reduce redundant code.... | bsd-3-clause |
mlhenderson/data_api | lib/doekbase/data_api/tests/test_assembly_api.py | 4 | 12967 | """
Unit tests for assembly
"""
import logging
from unittest import skipUnless
from . import shared
from doekbase.data_api import exceptions
from doekbase.data_api.sequence.assembly.api import AssemblyAPI
from doekbase.data_api.sequence.assembly.api import AssemblyClientAPI
from doekbase.data_api.sequence.assembly.api... | mit |
likaiwalkman/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py | 116 | 10213 | # Copyright (c) 2010 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 ... | bsd-3-clause |
rembo10/headphones | lib/unidecode/x0a0.py | 253 | 4428 | data = (
'it', # 0x00
'ix', # 0x01
'i', # 0x02
'ip', # 0x03
'iet', # 0x04
'iex', # 0x05
'ie', # 0x06
'iep', # 0x07
'at', # 0x08
'ax', # 0x09
'a', # 0x0a
'ap', # 0x0b
'uox', # 0x0c
'uo', # 0x0d
'uop', # 0x0e
'ot', # 0x0f
'ox', # 0x10
'o', # 0x11
'op', # 0x12
'ex',... | gpl-3.0 |
lerker/cupydle | cupydle/dnn/viejo/Neurons.py | 1 | 3537 | import numpy as np
__author__ = "Nelson Ponzoni"
__copyright__ = "Copyright 2015-2016, Proyecto Final de Carrera"
__credits__ = ["Nelson Ponzoni"]
__license__ = "GPL"
__version__ = "20160101"
__maintainer__ = "Nelson Ponzoni"
__email__ = "npcuadra@gmail.com"
__status__ = "Production"
"""
Neurons class, this is abstra... | apache-2.0 |
pipsiscool/audacity | lib-src/lv2/lilv/waflib/Tools/compiler_c.py | 343 | 1759 | #! /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,imp,types
from waflib.Tools import ccroot
from waflib import Utils,Configure
from waflib.Logs import debug
c_compiler={'win32':['msvc','gcc'],'cygwin':['gcc'],'d... | mit |
3quarterstack/simple_blog | djangoappengine/mapreduce/input_readers.py | 28 | 2569 | from djangoappengine.db.utils import get_cursor, set_cursor, set_config
from google.appengine.api.datastore import Key
from mapreduce.datastore_range_iterators import AbstractKeyRangeIterator, _KEY_RANGE_ITERATORS
from mapreduce.input_readers import AbstractDatastoreInputReader, _get_params, BadReaderParamsError
from... | mit |
denilsonsa/django-guardian | guardian/testapp/tests/mixins_test.py | 42 | 5655 | from __future__ import unicode_literals
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import ImproperlyConfigured
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.test impor... | bsd-2-clause |
IllusionRom-deprecated/android_platform_external_chromium_org | chrome/tools/build/win/create_installer_archive.py | 23 | 25503 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Script to create Chrome Installer archive.
This script is used to create an archive of all the files required for a
Chrome ... | bsd-3-clause |
shepdelacreme/ansible | lib/ansible/modules/network/cli/cli_config.py | 24 | 12544 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Ansible by Red Hat, inc
# 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 |
guaix-ucm/numina | numina/util/tests/test_context.py | 3 | 1483 |
import os
from ..context import environ
def test_environ_context1():
"""Remove env var if it was not set"""
cache_dir = '/cache/dir'
with environ(OOO_CACHE_HOME=cache_dir):
assert os.environ['OOO_CACHE_HOME'] == cache_dir
is_in = 'OOO_CACHE_HOME' in os.environ
assert is_in == False
... | gpl-3.0 |
yonglehou/WinObjC | deps/scripts/libpng.py | 159 | 8895 |
# python 2.7.9
import subprocess, os.path, os, shutil
DEBUG = False
BUILD_CONFIGURATION = "RelWithDebInfo"
PATCH_FILE = os.path.realpath(os.path.join(".", "libpng.patch"))
BUILD_DIR = "temp_build"
PATH_FILE = "paths.txt"
OUTPUT_DIR = os.path.realpath(os.path.join("..", "prebuilt"))
HEADER_DIR = os.path.realpath(os.p... | mit |
jhseu/tensorflow | tensorflow/python/data/experimental/kernel_tests/serialization/dataset_constructor_serialization_test.py | 15 | 3785 | # 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 |
Imaginashion/cloud-vision | .fr-d0BNfn/django-jquery-file-upload/venv/lib/python3.5/site-packages/pip/compat/dictconfig.py | 921 | 23096 | # This is a copy of the Python logging.config.dictconfig module,
# reproduced with permission. It is provided here for backwards
# compatibility for Python versions prior to 2.7.
#
# Copyright 2009-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# docu... | mit |
byohay/Remarkable | remarkable/AboutRemarkableDialog.py | 1 | 1798 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (C) 2016 <Jamie McGowan> <jamiemcgowan.dev@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
# ... | mit |
guillaume-philippon/aquilon | lib/aquilon/worker/commands/show_desk_desk.py | 4 | 1248 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2013 Contributor
#
# 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 t... | apache-2.0 |
hogarthj/ansible | lib/ansible/modules/cloud/amazon/ec2_snapshot.py | 27 | 9687 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
rulz/django-allauth | allauth/socialaccount/providers/facebook/south_migrations/0003_tosocialaccount.py | 82 | 8978 | # encoding: utf-8
from south.v2 import DataMigration
class Migration(DataMigration):
depends_on = (('socialaccount', '0002_genericmodels'),)
def forwards(self, orm):
# Migrate FB apps
app_id_to_sapp = {}
for app in orm.FacebookApp.objects.all():
sapp = orm['socialaccount.S... | mit |
jacshfr/mozilla-bedrock | bedrock/events/tests/test_models.py | 6 | 1679 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os.path
from datetime import datetime
from django.test.utils import override_settings
from mock import patch
fr... | mpl-2.0 |
kenshay/ImageScript | Script_Runner/PYTHON/Lib/site-packages/asn1crypto/_ordereddict.py | 29 | 4533 | # Copyright (c) 2009 Raymond Hettinger
#
# 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, merge,
# publish,... | gpl-3.0 |
azumimuo/family-xbmc-addon | plugin.video.playlistLoader/resources/lib/chardet/utf8prober.py | 2919 | 2652 | ######################## 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... | gpl-2.0 |
idaholab/raven | scripts/conversionScripts/toDistributions_MVN_Node.py | 2 | 2699 | # Copyright 2017 Battelle Energy Alliance, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
mokieyue/mopidy | mopidy/httpclient.py | 4 | 1669 | from __future__ import unicode_literals
import platform
import mopidy
"Helpers for configuring HTTP clients used in Mopidy extensions."
def format_proxy(proxy_config, auth=True):
"""Convert a Mopidy proxy config to the commonly used proxy string format.
Outputs ``scheme://host:port``, ``scheme://user:pass... | apache-2.0 |
tboyce1/home-assistant | homeassistant/components/mqtt/server.py | 7 | 3068 | """
Support for a local MQTT broker.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/mqtt/#use-the-embedded-broker
"""
import asyncio
import logging
import tempfile
import voluptuous as vol
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
impor... | apache-2.0 |
ryuunosukeyoshi/PartnerPoi-Bot | lib/youtube_dl/extractor/camdemy.py | 64 | 5772 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlencode,
compat_urlparse,
)
from ..utils import (
clean_html,
parse_duration,
str_to_int,
unified_strdate,
)
class CamdemyIE(InfoExtractor):
_V... | gpl-3.0 |
zploskey/servo | tests/wpt/harness/wptrunner/vcs.py | 156 | 1368 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import subprocess
from functools import partial
from mozlog import get_default_logger
logger = None
def vcs(bin_name)... | mpl-2.0 |
hesseltuinhof/mxnet | python/mxnet/gluon/model_zoo/vision/__init__.py | 1 | 3746 | # coding: utf-8
# pylint: disable=wildcard-import, arguments-differ
r"""Module for pre-defined neural network models.
This module contains definitions for the following model architectures:
- `AlexNet`_
- `DenseNet`_
- `Inception V3`_
- `ResNet V1`_
- `ResNet V2`_
- `SqueezeNet`_
- `VGG`_
You can construct a mod... | apache-2.0 |
gmacchi93/serverInfoParaguay | apps/venv/lib/python2.7/site-packages/django/db/backends/oracle/compiler.py | 407 | 2180 | from django.db.models.sql import compiler
class SQLCompiler(compiler.SQLCompiler):
def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
"""
Creates the SQL for this query. Returns the SQL string and list
of parameters. This is overridden from the original Query clas... | apache-2.0 |
AtomLaw/clamwin-0.1 | py/throb/throbImages.py | 1 | 261647 | #----------------------------------------------------------------------
# This file was generated by L:\Projects\ClamWin\py\throb\ENCODE~1.PY
#
from wxPython.wx import wxImageFromStream, wxBitmapFromImage
import cStringIO
catalog = {}
index = []
class ImageClass: pass
def getscanprogress01Data():
return \
'\x89... | gpl-2.0 |
MPIBGC-TEE/CompartmentalSystems | notebooks/ELM_dask.py | 1 | 1730 | #from dask.distributed import Client
import xarray as xr
import numpy as np
import pandas as pd
import importlib
import ELMlib
importlib.reload(ELMlib)
#client = Client(n_workers=2, threads_per_worker=2, memory_limit='1GB')
#client
#ds = xr.open_dataset('../Data/14C_spinup_holger_fire.2x2_small.nc')
from netCDF4 imp... | mit |
gusgollings/scbdo | scbdo/tod.py | 1 | 16340 |
# SCBdo : DISC Track Racing Management Software
# Copyright (C) 2010 Nathan Fraser
#
# 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 ... | gpl-3.0 |
CraigHarris/gpdb | src/test/tinc/tincrepo/mpp/lib/mpp_tl.py | 9 | 1172 | """
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | apache-2.0 |
minhphung171093/GreenERP_V7 | openerp/addons/account_voucher/report/account_voucher_print.py | 61 | 3718 | # -*- 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 |
chouseknecht/ansible | lib/ansible/modules/cloud/amazon/ecs_service_info.py | 8 | 9276 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
SteveHNH/ansible | lib/ansible/modules/packaging/os/portinstall.py | 29 | 6800 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, berenddeboer
# Written by berenddeboer <berend@pobox.com>
# Based on pkgng module written by bleader <bleader at ratonland.org>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, d... | gpl-3.0 |
jgeskens/django | tests/generic_inline_admin/admin.py | 150 | 1100 | from __future__ import absolute_import
from django.contrib import admin
from django.contrib.contenttypes import generic
from .models import (Media, PhoneNumber, Episode, EpisodeExtra, Contact,
Category, EpisodePermanent, EpisodeMaxNum)
site = admin.AdminSite(name="admin")
class MediaInline(generic.GenericTabul... | bsd-3-clause |
piotroxp/scibibscan | scib/lib/python3.5/site-packages/astropy/coordinates/baseframe.py | 1 | 45786 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Framework and base classes for coordinate frames/"low-level" coordinate
classes.
"""
from __future__ import (absolute_import, unicode_literals, division,
print_function)
# Standard library
import inspec... | mit |
tiagochiavericosta/edx-platform | lms/djangoapps/courseware/tests/test_credit_requirements.py | 41 | 5422 | """
Tests for credit requirement display on the progress page.
"""
import datetime
from mock import patch
from pytz import UTC
from django.conf import settings
from django.core.urlresolvers import reverse
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories... | agpl-3.0 |
Nephos/gitinspector | setup.py | 50 | 1900 | # coding: utf-8
#
# Copyright © 2013 Ejwa Software. All rights reserved.
#
# This file is part of gitinspector.
#
# gitinspector 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,... | gpl-3.0 |
code-sauce/tensorflow | tensorflow/python/kernel_tests/conv_ops_3d_test.py | 20 | 15925 | # 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 |
bigendiansmalls/capstone | bindings/python/test_x86.py | 32 | 5316 | #!/usr/bin/env python
# Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com>
from __future__ import print_function
from capstone import *
from capstone.x86 import *
from xprint import to_hex, to_x, to_x_32
X86_CODE64 = b"\x55\x48\x8b\x05\xb8\x13\x00\x00"
X86_CODE16 = b"\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x... | bsd-3-clause |
sonofeft/ODSCharts | docs/fulltoc.py | 10 | 3362 | # -*- encoding: utf-8 -*-
#
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
#
# 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
#
# ... | gpl-3.0 |
atilag/qiskit-sdk-py | qiskit/_jobprocessor.py | 1 | 4559 | # -*- coding: utf-8 -*-
# Copyright 2017 IBM RESEARCH. 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 requ... | apache-2.0 |
sfrenza/test-for-bot | venv/Lib/site-packages/nltk/compat.py | 2 | 11863 | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Compatibility
#
# Copyright (C) 2001-2017 NLTK Project
#
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import absolute_import, print_function
import os
import sys
from functools import update_wrapper, wraps
import fractions
impo... | mit |
resmo/ansible | lib/ansible/modules/network/check_point/cp_mgmt_network.py | 20 | 7591 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage Check Point Firewall (c) 2019
#
# 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 o... | gpl-3.0 |
Darkmer/masterchief | CourseBuilderenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/langhebrewmodel.py | 2763 | 11318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... | mit |
tadebayo/myedge | myvenv/Lib/site-packages/django/contrib/gis/db/backends/oracle/adapter.py | 273 | 1866 | from cx_Oracle import CLOB
from django.contrib.gis.db.backends.base.adapter import WKTAdapter
from django.contrib.gis.geos import GeometryCollection, Polygon
from django.utils.six.moves import range
class OracleSpatialAdapter(WKTAdapter):
input_size = CLOB
def __init__(self, geom):
"""
Oracl... | mit |
tyagiarpit/servo | tests/wpt/harness/wptrunner/testloader.py | 97 | 22234 | import json
import os
import sys
import urlparse
from abc import ABCMeta, abstractmethod
from Queue import Empty
from collections import defaultdict, OrderedDict, deque
from multiprocessing import Queue
import manifestinclude
import manifestexpected
import wpttest
from mozlog import structured
manifest = None
manifes... | mpl-2.0 |
SimVascular/VTK | Filters/Core/Testing/Python/multipleComponentContour.py | 20 | 1879 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# get the interactor ui
## Graphics stuff
# Create the RenderWindow, Renderer and both Actors
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren =... | bsd-3-clause |
SeniorLimpio/ldroid_kernel | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
watspidererik/testenv | flask/lib/python2.7/site-packages/pip/_vendor/colorama/ansi.py | 527 | 1039 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
'''
This module generates ANSI character codes to printing colors to terminals.
See: http://en.wikipedia.org/wiki/ANSI_escape_code
'''
CSI = '\033['
def code_to_chars(code):
return CSI + str(code) + 'm'
class AnsiCodes(object):
def __... | mit |
jiangzhixiao/odoo | addons/account/wizard/account_period_close.py | 341 | 2646 | # -*- 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 |
fredrik-johansson/mpmath | mpmath/tests/test_ode.py | 15 | 1822 | #from mpmath.calculus import ODE_step_euler, ODE_step_rk4, odeint, arange
from mpmath import odefun, cos, sin, mpf, sinc, mp
'''
solvers = [ODE_step_euler, ODE_step_rk4]
def test_ode1():
"""
Let's solve:
x'' + w**2 * x = 0
i.e. x1 = x, x2 = x1':
x1' = x2
x2' = -x1
"""
def derivs((x... | bsd-3-clause |
theflofly/tensorflow | tensorflow/examples/speech_commands/train.py | 4 | 17458 | # 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 |
d40223223/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/VFS_import.py | 738 | 3059 | import os
from browser import doc
#_scripts=doc.createElement('script')
#_scripts.src="/src/py_VFS.js"
#_scripts.type="text/javascript"
#doc.get(tag='head')[0].appendChild(_scripts)
VFS=dict(JSObject(__BRYTHON__.py_VFS))
class VFSModuleFinder:
def __init__(self, path_entry):
print("in VFSModuleFinder")
... | gpl-3.0 |
vicky2135/lucious | oscar/lib/python2.7/site-packages/django/forms/utils.py | 241 | 6131 | from __future__ import unicode_literals
import json
import sys
from django.conf import settings
from django.core.exceptions import ValidationError # backwards compatibility
from django.utils import six, timezone
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.html import e... | bsd-3-clause |
meganlkm/faker | faker/providers/person/fi_FI/__init__.py | 19 | 14403 | # coding=utf-8
from __future__ import unicode_literals
from .. import Provider as PersonProvider
class Provider(PersonProvider):
formats = (
'{{first_name}} {{last_name}}',
'{{first_name}} {{last_name}}',
'{{last_name}}, {{first_name}}'
)
prefixes = (
'Herra', 'hra', 'Rouv... | mit |
teslaji/homebase | venv/HomeBase/lib/python3.5/site-packages/django/db/migrations/autodetector.py | 41 | 56981 | from __future__ import unicode_literals
import functools
import re
from itertools import chain
from django.conf import settings
from django.db import models
from django.db.migrations import operations
from django.db.migrations.migration import Migration
from django.db.migrations.operations.models import AlterModelOpt... | gpl-3.0 |
SkySkimmer/coq | doc/tools/coqrst/notations/TacticNotationsLexer.py | 6 | 3961 | # Generated from TacticNotations.g by ANTLR 4.7.2
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\f")
buf.write("f\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4... | lgpl-2.1 |
donspaulding/adspygoogle | examples/adspygoogle/dfp/v201206/get_all_roles.py | 2 | 1477 | #!/usr/bin/python
#
# Copyright 2012 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 b... | apache-2.0 |
rlr/fjord | fjord/base/browsers.py | 2 | 5980 | import re
from collections import namedtuple
# From http://msdn.microsoft.com/en-us/library/ms537503(v=vs.85).aspx
WINDOWS_VERSION = {
'Windows NT 10.0': ('Windows', '10'),
'Windows NT 6.4': ('Windows', '10'),
'Windows NT 6.3': ('Windows', '8.1'),
'Windows NT 6.2': ('Windows', '8'),
'Windows NT 6.... | bsd-3-clause |
ewbankkit/cloud-custodian | tools/c7n_gcp/tests/test_bigquery.py | 5 | 4353 | # Copyright 2018 Capital One Services, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
mcanthony/nupic | tests/integration/nupic/algorithms/knn_classifier_test/categories_test.py | 35 | 3887 | #!/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... | agpl-3.0 |
zkraime/osf.io | website/identifiers/metadata.py | 51 | 1953 | # -*- coding: utf-8 -*-
import lxml.etree
import lxml.builder
NAMESPACE = 'http://datacite.org/schema/kernel-3'
XSI = 'http://www.w3.org/2001/XMLSchema-instance'
SCHEMA_LOCATION = 'http://datacite.org/schema/kernel-3 http://schema.datacite.org/meta/kernel-3/metadata.xsd'
E = lxml.builder.ElementMaker(nsmap={
None:... | apache-2.0 |
reviewboard/reviewboard | reviewboard/reviews/views.py | 2 | 90019 | from __future__ import unicode_literals
import io
import json
import logging
import re
import struct
import dateutil.parser
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db.models import Q
from d... | mit |
morta-code/YAX | setup.py | 1 | 1245 | from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
... | gpl-3.0 |
lutianming/leetcode | reorder_list.py | 1 | 1288 | # Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
# @param head, a ListNode
# @return nothing
def reorderList(self, head):
if not head or not head.next:
return head
fast = head
s... | mit |
magyarm/periphondemand-code | src/bin/code/intercon.py | 1 | 5000 | #! /usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Name: Intercon.py
# Purpose:
# Author: Fabien Marteau <fabien.marteau@armadeus.com>
# Created: 13/05/2008
#-----------------------------------------------------------------------------
# C... | lgpl-2.1 |
aimas/TuniErp-8.0 | openerp/tools/cache.py | 226 | 6865 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
H1ghT0p/kitsune | kitsune/users/migrations/0008_auto_20150610_2214.py | 18 | 3304 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import kitsune.sumo.models
class Migration(migrations.Migration):
dependencies = [
('users', '0007_auto_add_screen_share_permission'),
]
operations = [
migrations.AddField(
... | bsd-3-clause |
calvingit21/h2o-2 | R/tests/run.py | 8 | 49355 | #!/usr/bin/python
import sys
import os
import shutil
import signal
import time
import random
import getpass
import re
import subprocess
import ConfigParser
class H2OUseCloudNode:
"""
A class representing one node in an H2O cloud which was specified by the user.
Don't try to build or tear down this kind o... | apache-2.0 |
cosmo-ethz/hope | hope/_library.py | 1 | 67054 | # Copyright (c) 2014 ETH Zurich, Institute of Astronomy, Lukas Gamper <lukas.gamper@usystems.ch>
from __future__ import print_function, division, absolute_import, unicode_literals
LIBRARY_HOPE_EXP = """
#ifndef M_LN2
#define M_LN2 0.693147180559945309417
#endif
static const double hope_exp_data[] = {1.04097186427... | gpl-3.0 |
zdrjson/DDKit | python/iMacFirstPythonPragrammer/FindSameNameImage.py | 1 | 1755 | import os, sys, re, shutil
if __name__ == '__main__':
used_map = {}
resPath = "./MagnetPF/Res/"
depDir = "Deprecated"
skipDir = ["message"]
for root, dirs, files in os.walk("./"):
for file in files:
if file.endswith(".m"):
filepath = os.path.join(root,... | mit |
owlabs/incubator-airflow | airflow/contrib/operators/snowflake_operator.py | 1 | 3034 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.