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 |
|---|---|---|---|---|---|
fakhir-hanif/sentiment_gender | gender_dict.py | 1 | 2359 | gender = {
'fakhir': 'male', 'Amina': 'female', 'telenor': 'undefined', 'shahid': 'male', 'talkshalk': 'undefined', 'ikram': 'male',
'pakistan': 'undefined', 'pakistani': 'undefined', 'raja': 'male', 'pome': 'male', 'zikriya': 'male', 'djuice': 'undefined',
'easypesa': 'undefined', 'qaswar': 'male', 'shahjehan': ... | bsd-2-clause |
arenadata/ambari | ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/mahout.py | 1 | 2241 | """
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 use this ... | apache-2.0 |
yoer/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/messages/storage/cookie.py | 168 | 6425 | import json
from django.conf import settings
from django.contrib.messages.storage.base import BaseStorage, Message
from django.http import SimpleCookie
from django.utils.crypto import salted_hmac, constant_time_compare
from django.utils.safestring import SafeData, mark_safe
from django.utils import six
class Message... | apache-2.0 |
wangyum/mxnet | python/mxnet/gluon/contrib/rnn/__init__.py | 43 | 1029 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
jneves/python-social-auth | social/apps/cherrypy_app/utils.py | 77 | 1721 | import warnings
from functools import wraps
import cherrypy
from social.utils import setting_name, module_member
from social.strategies.utils import get_strategy
from social.backends.utils import get_backend, user_backends_data
DEFAULTS = {
'STRATEGY': 'social.strategies.cherrypy_strategy.CherryPyStrategy',
... | bsd-3-clause |
avsm/xen-unstable | tools/python/xen/web/SrvBase.py | 44 | 3290 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
ojengwa/grr | gui/api_call_renderers_test.py | 2 | 6040 | #!/usr/bin/env python
"""Tests for API call renderers."""
# pylint: disable=unused-import,g-bad-import-order
from grr.lib import server_plugins
# pylint: enable=unused-import,g-bad-import-order
import json
from grr.gui import api_aff4_object_renderers
from grr.gui import api_call_renderers
from grr.lib import fla... | apache-2.0 |
vmindru/ansible | lib/ansible/modules/packaging/os/zypper_repository.py | 81 | 13626 | #!/usr/bin/python
# encoding: utf-8
# (c) 2013, Matthias Vogelgesang <matthias.vogelgesang@gmail.com>
# (c) 2014, Justin Lecher <jlec@gentoo.org>
#
# 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_... | gpl-3.0 |
grayark/osquery | tools/tests/test_osqueryi.py | 36 | 5050 | #!/usr/bin/env python
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
fro... | bsd-3-clause |
Asteroid-Project/android_external_skia | platform_tools/android/gyp_gen/tool_makefile_writer.py | 4 | 3571 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Code for generating Android.mk for a tool."""
import android_framework_gyp
import gypd_parser
import makefile_writer
import os
import vars_dict_lib
def write_to... | bsd-3-clause |
cauchyturing/kaggle_diabetic_RAM | convert.py | 6 | 4457 | """Resize and crop images to square, save as tiff."""
from __future__ import division, print_function
import os
from multiprocessing.pool import Pool
import click
import numpy as np
from PIL import Image, ImageFilter
import data
N_PROC = 2
def convert(fname, crop_size):
img = Image.open(fname)
blurred = im... | mit |
AuyaJackie/odoo | addons/sale_margin/__init__.py | 441 | 1042 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
ryfeus/lambda-packs | Tensorflow/source/numpy/core/memmap.py | 26 | 11432 | from __future__ import division, absolute_import, print_function
import numpy as np
from .numeric import uint8, ndarray, dtype
from numpy.compat import long, basestring, is_pathlib_path
__all__ = ['memmap']
dtypedescr = dtype
valid_filemodes = ["r", "c", "r+", "w+"]
writeable_filemodes = ["r+", "w+"]
mode_equivalen... | mit |
googleapis/googleapis-gen | google/ads/googleads/v6/googleads-py/tests/unit/gapic/googleads.v6/services/test_mobile_app_category_constant_service.py | 1 | 31876 | # -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
40223139/2015cdaa5-12 | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/pkgdata.py | 603 | 2146 | """pkgdata is a simple, extensible way for a package to acquire data file
resources.
The getResource function is equivalent to the standard idioms, such as
the following minimal implementation::
import sys, os
def getResource(identifier, pkgname=__name__):
pkgpath = os.path.dirname(sys.modules[p... | gpl-3.0 |
obspy/TauPy | taupy/tests/test_TauP_Time.py | 1 | 5761 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This file tests the TauP_Time utility against the original TauPy using
both the high-level tau interface of TauPy and the java-like old script-based
interface.
"""
from __future__ import (absolute_import, division, print_function,
unicode_liter... | gpl-3.0 |
sebastian-code/portal | forum/migrations/0004_auto_20160402_1221.py | 2 | 1639 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('forum', '0003_auto_20160317_2138'),
]... | bsd-3-clause |
juanyaw/PTVS | Python/Tests/TestData/VirtualEnv/env/Lib/encodings/iso2022_jp_2004.py | 61 | 1112 | #
# iso2022_jp_2004.py: Python Unicode Codec for ISO2022_JP_2004
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_2004')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.de... | apache-2.0 |
prasidh09/cse506 | 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 |
josiah-wolf-oberholtzer/supriya | supriya/ugens/dynamics.py | 1 | 3847 | import collections
from supriya import CalculationRate
from supriya.synthdefs import PseudoUGen, UGen
from .delay import DelayN
class Amplitude(UGen):
"""
An amplitude follower.
::
>>> source = supriya.ugens.In.ar(0)
>>> amplitude = supriya.ugens.Amplitude.kr(
... attack_ti... | mit |
rubikloud/gpdb | gpAux/extensions/gtest/test/gtest_help_test.py | 2968 | 5856 | #!/usr/bin/env python
#
# Copyright 2009, 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... | apache-2.0 |
otmaneJai/Zipline | zipline/sources/data_frame_source.py | 26 | 5253 | #
# Copyright 2015 Quantopian, 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 wr... | apache-2.0 |
petebachant/pyqtgraph | examples/ImageView.py | 20 | 1812 | # -*- coding: utf-8 -*-
"""
This example demonstrates the use of ImageView, which is a high-level widget for
displaying and analyzing 2D and 3D data. ImageView provides:
1. A zoomable region (ViewBox) for displaying the image
2. A combination histogram and gradient editor (HistogramLUTItem) for
controlling t... | mit |
balloob/home-assistant | homeassistant/components/zha/core/channels/security.py | 3 | 6589 | """
Security channels module for Zigbee Home Automation.
For more details about this component, please refer to the documentation at
https://home-assistant.io/integrations/zha/
"""
import asyncio
from zigpy.exceptions import ZigbeeException
import zigpy.zcl.clusters.security as security
from homeassistant.core impor... | apache-2.0 |
theblacklion/diamond-framework | tilematrix.py | 2 | 25717 | # TODO
#
# @author Oktay Acikalin <oktay.acikalin@gmail.com>
# @copyright Oktay Acikalin
# @license MIT (LICENSE.txt)
import os
import sys
import ConfigParser
from collections import OrderedDict
from math import ceil, floor
import csv
from types import GeneratorType
from diamond import pyglet
from diamond.rect i... | mit |
40223234/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/signal.py | 743 | 1646 | """This module provides mechanisms to use signal handlers in Python.
Functions:
alarm() -- cause SIGALRM after a specified time [Unix only]
setitimer() -- cause a signal (described below) after a specified
float time and the timer may restart then [Unix only]
getitimer() -- get current value of timer [... | gpl-3.0 |
CDE-UNIBE/qcat | apps/search/search.py | 1 | 8779 | from functools import lru_cache
from django.conf import settings
from elasticsearch import TransportError
from questionnaire.models import Questionnaire
from .index import get_elasticsearch
from .utils import get_alias, ElasticsearchAlias
es = get_elasticsearch()
def get_es_query(
filter_params: list=None,... | apache-2.0 |
Lindy21/CSE498-LRS | oauth_provider/views.py | 1 | 8387 | from oauth.oauth import OAuthError
from django.conf import settings
from django.http import (
HttpResponse, HttpResponseBadRequest, HttpResponseRedirect, HttpResponseForbidden)
from django.utils.translation import ugettext as _
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers... | apache-2.0 |
joshuaunderwood7/HaskeLinGeom | pysrc/LG/Board.py | 1 | 2993 | def indexToLocation(x):
return ( (8-(x%8)) , (int(x/8)+1) )
class Location:
def __init__(self, x=1, y=1, z=1):
self.x = x
self.y = y
self.z = z
def parseStr(self, inStr):
inStr = inStr[1:-1]
inStr = inStr.split(',')
self.x = int(inStr[0])
self.y = in... | gpl-3.0 |
zombiecoincrypto/zombiecoin | share/qt/make_spinner.py | 4415 | 1035 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... | mit |
sauloal/pycluster | pypy-1.9_64/lib-python/2.7/encodings/iso8859_8.py | 593 | 11292 | """ Python Character Mapping Codec iso8859_8 generated from 'MAPPINGS/ISO8859/8859-8.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | mit |
rbarlow/pulp_puppet | pulp_puppet_common/pulp_puppet/common/sync_progress.py | 4 | 7722 | """
Contains classes and functions related to tracking the progress of the puppet
importer.
"""
from pulp_puppet.common import reporting
from pulp_puppet.common.constants import STATE_NOT_STARTED, STATE_SUCCESS, STATE_CANCELED
class SyncProgressReport(object):
"""
Stores the state of the sync run as it proce... | gpl-2.0 |
carlohamalainen/nipype | examples/rsfmri_fsl_compcorr.py | 5 | 3541 | #!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
==============================
rsfMRI: FSL, Nipype, tCompCorr
==============================
Performs preprocessing for resting state data based on the tCompCorr method
described ... | bsd-3-clause |
sole/high-fidelity | test/marionette/test_app.py | 1 | 2990 | from unittest import skip
from gaiatest import GaiaTestCase
class TestApp(GaiaTestCase):
"""Test standard app functionality like menu bar and tab-switching."""
popular_tab = ('css selector', '#popular-tab-container')
popular_tab_link = ('css selector', '#popular-tab a')
search_input = ('id', 'podcas... | mit |
waltervh/BornAgain | Wrap/swig/doxy2swig.py | 2 | 12248 | #!/usr/bin/env python
"""Doxygen XML to SWIG docstring converter.
Converts Doxygen generated XML files into a file containing docstrings
that can be used by SWIG-1.3.x. Note that you need to get SWIG
version > 1.3.23 or use Robin Dunn's docstring patch to be able to use
the resulting output.
Usage:
doxy2swig.py i... | gpl-3.0 |
chevanlol360/Kernel_LGE_Fx1 | 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 |
mancoast/CPythonPyc_test | cpython/223_test_poll.py | 10 | 4347 | # Test case for the os.poll() function
import sys, os, select, random
from test_support import verify, verbose, TestSkipped, TESTFN
try:
select.poll
except AttributeError:
raise TestSkipped, "select.poll not defined -- skipping test_poll"
def find_ready_matching(ready, flag):
match = []
for fd, mode... | gpl-3.0 |
DONIKAN/django | django/utils/numberformat.py | 431 | 1944 | from __future__ import unicode_literals
from decimal import Decimal
from django.conf import settings
from django.utils import six
from django.utils.safestring import mark_safe
def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='',
force_grouping=False):
"""
Gets a number (... | bsd-3-clause |
kalahbrown/HueBigSQL | desktop/core/ext-py/tablib-0.10.0/tablib/packages/openpyxl/writer/dump_worksheet.py | 61 | 8158 | # file openpyxl/writer/straight_worksheet.py
# Copyright (c) 2010 openpyxl
#
# 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... | apache-2.0 |
nitin-cherian/LifeLongLearning | Python/Experiments/JINJA/RealPython/jinja_env/lib/python3.5/site-packages/flask/json.py | 121 | 9183 | # -*- coding: utf-8 -*-
"""
flask.jsonimpl
~~~~~~~~~~~~~~
Implementation helpers for the JSON support in Flask.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import io
import uuid
from datetime import date
from .globals import current_app, request
from ._... | mit |
urosgruber/dd-agent | tests/checks/integration/test_go_expvar.py | 46 | 3078 | # stdlib
from collections import defaultdict
import time
# 3p
from nose.plugins.attrib import attr
# project
from tests.checks.common import AgentCheckTest
@attr(requires='go_expvar')
class TestGoExpVar(AgentCheckTest):
CHECK_NAME = 'go_expvar'
CHECK_GAUGES = [
'go_expvar.memstats.alloc',
... | bsd-3-clause |
i19870503/i19870503 | Python/eggnog2go_anno.py | 1 | 2591 | import os
import re
import pandas as pd
import string
import itertools
import numpy as np
import sys
import argparse
from collections import OrderedDict
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Create GO annotation and enrichment file')
parser.add_argument('-i',type=str,dest='i... | gpl-2.0 |
noslenfa/tdjangorest | uw/lib/python2.7/site-packages/IPython/parallel/apps/ipcontrollerapp.py | 2 | 20434 | #!/usr/bin/env python
# encoding: utf-8
"""
The IPython controller application.
Authors:
* Brian Granger
* MinRK
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full ... | apache-2.0 |
jhuapl-marti/marti | env-crits/lib/python2.7/site-packages/setuptools/command/bdist_egg.py | 155 | 17606 | """setuptools.command.bdist_egg
Build .egg distributions"""
# This module should be kept compatible with Python 2.3
from distutils.errors import DistutilsSetupError
from distutils.dir_util import remove_tree, mkpath
from distutils import log
from types import CodeType
import sys
import os
import marshal
import textwr... | mit |
listamilton/supermilton.repository | script.module.youtube.dl/lib/youtube_dl/extractor/musicplayon.py | 16 | 2312 | # encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
int_or_none,
js_to_json,
mimetype2ext,
)
class MusicPlayOnIE(InfoExtractor):
_VALID_URL = r'https?://(?:.+?\.)?musicplayon\.com/play(?:-touch)?\?(?:v|... | gpl-2.0 |
myerssr/volatility | volatility/plugins/overlays/windows/ssdt_vtypes.py | 44 | 6998 | # Volatility
# Copyright (c) 2008-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundation. You may not use, modify or
# distribu... | gpl-2.0 |
hastalafiesta/android_kernel_lge_g3 | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
seaotterman/tensorflow | tensorflow/python/kernel_tests/matrix_inverse_op_test.py | 10 | 3692 | # 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 |
OCA/program | program_multi_menu_budget/program_result_region.py | 1 | 1213 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Savoir-faire Linux (<www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the t... | agpl-3.0 |
TheTimmy/spack | var/spack/repos/builtin/packages/libxprintutil/package.py | 3 | 1793 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
loveyoupeng/rt | modules/web/src/main/native/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py | 379 | 79448 | """Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup parses a (possibly invalid) XML or HTML document into a
tree representation. It provides methods and Pythonic idioms that make
it easy to navigate, search, and modify the tree.
A well-formed X... | gpl-2.0 |
scalingdata/Impala | bin/start-impala-cluster.py | 6 | 13136 | #!/usr/bin/env python
# Copyright 2012 Cloudera 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 ag... | apache-2.0 |
ribag/ganeti-experiments | test/py/ganeti.serializer_unittest.py | 2 | 7648 | #!/usr/bin/python
#
# Copyright (C) 2006, 2007, 2008 Google 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 2 of the License, or
# (at your option) any later version.
#
# ... | gpl-2.0 |
avanzosc/avanzosc6.1 | avanzosc_tree_grid_ext/__openerp__.py | 1 | 1850 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2008-2013 AvanzOSC S.L. All Rights Reserved
# Date: 01/07/2013
#
# This program is free software: you can redistribute it and/or modif... | agpl-3.0 |
chun337163833/firesim | bin/lime.py | 2 | 14585 | #!/usr/bin/env python
"""Utilities for common tasks needed to use lime framework.
"""
import optparse
import subprocess
import logging
import sys
import os.path
import zipfile
import re
import shutil
import fileinput
import mimetypes
from os.path import join, splitext, split, exists
from shutil import copyfile
from d... | gpl-3.0 |
bigfatpaulyj/py-airfoil | scons-local-2.2.0/SCons/compat/_scons_collections.py | 14 | 1905 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
#
# 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
... | gpl-3.0 |
lordtangent/arsenalsuite | python/scripts/missing_timesheet_handler.py | 10 | 3347 | #!/usr/bin/python
from PyQt4.QtCore import *
from blur.Stone import *
from blur.Classes import *
import sys, re, blur.email, blur.jabber
app = None
dryRun = False
def init():
global app
global dryRun
# First Create a Qt Application
app = QCoreApplication(sys.argv)
# Load database config
if sys.platform=='win... | gpl-2.0 |
lukasgartmair/3Depict_Isosurfaces | docs/manual-latex/python-example.py | 2 | 1189 | #!/usr/bin/python
import sys
import os
#Append the contents of one file to another
def appendFile(sourceFile,targetFile):
try :
fileSrc = open(sourceFile,"rb")
fileTarget = open(targetFile,"ab")
#Extremely inefficient!!
byte = fileSrc.read(1)
while byte != "" :
fileTarget.write(byte)
byte=fileSr... | gpl-3.0 |
ufal/lindat-kontext | lib/plugins/default_token_connect/backends/__init__.py | 2 | 5098 | # Copyright (c) 2017 Charles University, Faculty of Arts,
# Institute of the Czech National Corpus
# Copyright (c) 2017 Tomas Machalek <tomas.machalek@gmail.com>
# Copyright (c) 2017 Petr Duda <petrduda@seznam.cz>
#
# This program is free software; you can redistribute it and/or
# modify it under the... | gpl-2.0 |
tchellomello/home-assistant | tests/components/homekit_controller/test_switch.py | 21 | 4751 | """Basic checks for HomeKitSwitch."""
from aiohomekit.model.characteristics import (
CharacteristicsTypes,
InUseValues,
IsConfiguredValues,
)
from aiohomekit.model.services import ServicesTypes
from tests.components.homekit_controller.common import setup_test_component
def create_switch_service(accessor... | apache-2.0 |
CodingCat/mxnet | python/mxnet/gluon/model_zoo/vision/resnet.py | 3 | 19913 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
sjsucohort6/openstack | python/venv/lib/python2.7/site-packages/keystoneauth1/loading/session.py | 3 | 10154 | # 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
# distributed under t... | mit |
ibank/node-gyp | gyp/pylib/gyp/msvs_emulation.py | 73 | 31885 | # 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.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
im... | mit |
xjsender/haoide | requests/cookies.py | 177 | 17387 | # -*- coding: utf-8 -*-
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import copy
import time
import calendar
import collections
from .compat import cookielib, urlparse, urlunparse, Morsel
try:
import threading
... | mit |
rcwoolley/device-cloud-python | device_cloud/osal.py | 1 | 3073 | '''
Copyright (c) 2016-2017 Wind River Systems, 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 a... | apache-2.0 |
agry/NGECore2 | scripts/mobiles/tatooine/shinn_guard.py | 2 | 1336 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobi... | lgpl-3.0 |
hztony/robotframework-selenium2library | test/unit/locators/test_elementfinder.py | 28 | 15184 | import unittest
import os
from Selenium2Library.locators import ElementFinder
from mockito import *
class ElementFinderTests(unittest.TestCase):
def test_find_with_invalid_prefix(self):
finder = ElementFinder()
browser = mock()
try:
self.assertRaises(ValueError, finder.find, br... | apache-2.0 |
dnarvaez/virtualenv-bootstrap | bootstrap.py | 1 | 4429 | #!/usr/bin/env python3
# Copyright 2013 Daniel Narvaez
#
# 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 la... | apache-2.0 |
shawnsi/ansible-modules-core | cloud/digital_ocean/digital_ocean.py | 23 | 14677 | #!/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 |
karwa/swift | utils/gyb_syntax_support/ExprNodes.py | 5 | 19975 | from Child import Child
from Node import Node # noqa: I201
EXPR_NODES = [
# An inout expression.
# &x
Node('InOutExpr', kind='Expr',
children=[
Child('Ampersand', kind='PrefixAmpersandToken'),
Child('Expression', kind='Expr'),
]),
# A #column expression.
... | apache-2.0 |
creimers/django-shop | shop/tests/api.py | 16 | 2260 | from shop.models.ordermodel import OrderExtraInfo, Order
from django.test.testcases import TestCase
from django.contrib.auth.models import User
from shop.tests.util import Mock
from shop.shop_api import ShopAPI
from decimal import Decimal
class ShopApiTestCase(TestCase):
def setUp(self):
self.user = User.... | bsd-3-clause |
omapzoom/platform-external-chromium | net/tools/testserver/asn1der.py | 67 | 1324 | #!/usr/bin/python2.5
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Helper module for ASN.1/DER encoding."""
import binascii
import struct
# Tags as defined by ASN.1.
INTEGER = 2
BIT_STRING = 3
N... | bsd-3-clause |
petecummings/django | tests/check_framework/test_templates.py | 288 | 1403 | from copy import deepcopy
from django.core.checks.templates import E001
from django.test import SimpleTestCase
from django.test.utils import override_settings
class CheckTemplateSettingsAppDirsTest(SimpleTestCase):
TEMPLATES_APP_DIRS_AND_LOADERS = [
{
'BACKEND': 'django.template.backends.djan... | bsd-3-clause |
tutumcloud/azure-sdk-for-python | tests/test_managementcertificatemanagementservice.py | 5 | 6981 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apa... | apache-2.0 |
edcast-inc/edx-platform-edcast | common/lib/xmodule/xmodule/tests/test_lti20_unit.py | 174 | 17021 | # -*- coding: utf-8 -*-
"""Tests for LTI Xmodule LTIv2.0 functional logic."""
import datetime
import textwrap
from django.utils.timezone import UTC
from mock import Mock
from xmodule.lti_module import LTIDescriptor
from xmodule.lti_2_util import LTIError
from . import LogicTest
class LTI20RESTResultServiceTest(Logi... | agpl-3.0 |
CCI-Tools/cate-core | cate/ops/index.py | 1 | 8641 |
# The MIT License (MIT)
# Copyright (c) 2016, 2017 by the ESA CCI Toolbox development team and contributors
#
# 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 w... | mit |
gaqzi/gocd-cli | tests/test_command.py | 2 | 1952 | import pytest
from gocd_cli.command import BaseCommand
from gocd_cli.exceptions import MissingDocumentationError
class FakeCommand(BaseCommand):
usage_summary = "I'm merely an example of things to come"
usage = """
Args:
something: something else
some-more: the other thing
"""
de... | mit |
PGHS-CP1A-2015/python_koans_kjhansen | python2/libs/colorama/ansitowin32.py | 37 | 6006 |
import re
import sys
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style
from .winterm import WinTerm, WinColor, WinStyle
from .win32 import windll
if windll is not None:
winterm = WinTerm()
def is_a_tty(stream):
return hasattr(stream, 'isatty') and stream.isatty()
class StreamWrapper(object):
''... | mit |
fedora-conary/conary | conary_test/repositorytest/filecontainertest.py | 2 | 5805 | #
# Copyright (c) SAS Institute 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 w... | apache-2.0 |
Tim1928/DBK-3.0_4.1 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
Konubinix/qutebrowser | tests/unit/config/test_style.py | 9 | 3507 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# This file is part of qutebrowser.
#
# qutebrowser 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 Sof... | gpl-3.0 |
bop/hybrid | lib/python2.6/site-packages/pip/vcs/git.py | 473 | 7898 | import tempfile
import re
import os.path
from pip.util import call_subprocess
from pip.util import display_path, rmtree
from pip.vcs import vcs, VersionControl
from pip.log import logger
from pip.backwardcompat import url2pathname, urlparse
urlsplit = urlparse.urlsplit
urlunsplit = urlparse.urlunsplit
class Git(Versi... | gpl-2.0 |
frishberg/django | django/db/backends/utils.py | 66 | 6725 | from __future__ import unicode_literals
import datetime
import decimal
import hashlib
import logging
from time import time
from django.conf import settings
from django.utils.encoding import force_bytes
from django.utils.timezone import utc
logger = logging.getLogger('django.db.backends')
class CursorWrapper(object... | bsd-3-clause |
goulu/networkx | networkx/algorithms/flow/tests/test_maxflow.py | 5 | 18883 | # -*- coding: utf-8 -*-
"""Maximum flow algorithms test suite.
"""
from nose.tools import *
import networkx as nx
from networkx.algorithms.flow import build_flow_dict, build_residual_network
from networkx.algorithms.flow import boykov_kolmogorov
from networkx.algorithms.flow import edmonds_karp
from networkx.algorithm... | bsd-3-clause |
Fireblend/chromium-crosswalk | tools/telemetry/telemetry/core/platform/tracing_options.py | 12 | 1519 | # 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.
RECORD_AS_MUCH_AS_POSSIBLE = 'record-as-much-as-possible'
RECORD_UNTIL_FULL = 'record-until-full'
RECORD_MODES = (RECORD_AS_MUCH_AS_POSSIBLE, RECORD_UNTIL_FU... | bsd-3-clause |
Passtechsoft/TPEAlpGen | blender/release/scripts/freestyle/styles/sequentialsplit_sketchy.py | 6 | 1933 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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.
#
# This program is distrib... | gpl-3.0 |
los-cocos/etc_code | cocos#248--RectMapCollider, player sometimes stuck/start.py | 1 | 6979 | """
A script to demo a defect in RectMapCollider, initial report by Netanel at
https://groups.google.com/forum/#!topic/cocos-discuss/a494vcH-u3I
The defect is that the player gets stuck at some positions, and it was confirmed
for cocos master Aug 1, 2015 (292ae676) and cocos-0.6.3-release, see cocos #248
The package ... | mit |
dfalt974/SickRage | lib/sqlalchemy/event/attr.py | 77 | 12639 | # event/attr.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
"""Attribute implementation for _Dispatch classes.
The various listener targets for a p... | gpl-3.0 |
jprine/pelican-plugins | category_meta/category_meta.py | 3 | 4347 | '''Copyright 2014 Zack Weinberg
Category Metadata
-----------------
A plugin to read metadata for each category from an index file in that
category's directory.
For this plugin to work properly, your articles should not have a
Category: tag in their metadata; instead, they should be stored in
(subdirectories of) per... | agpl-3.0 |
TimBuckley/effective_django | django/views/generic/edit.py | 15 | 8635 | import warnings
from django.forms import models as model_forms
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponseRedirect
from django.utils.encoding import force_text
from django.views.generic.base import TemplateResponseMixin, ContextMixin, View
from django.views.generic.deta... | bsd-3-clause |
scs/uclinux | user/python/python-2.4.4/Mac/Modules/cm/cmscan.py | 5 | 3001 | # Scan an Apple header file, generating a Python file of generator calls.
import sys
import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner
LONG = "Components"
SHORT = "cm"
def main():
input = "Components.h"
output = SHORT + "gen.py"
defsoutput = TO... | gpl-2.0 |
MackZxh/OCA-Choice | hr/hr_experience_analytic/__openerp__.py | 19 | 1956 | ###############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU A... | lgpl-3.0 |
marratj/ansible | lib/ansible/modules/monitoring/zabbix_screen.py | 24 | 17036 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013-2014, Epic Games, 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 |
mozman/ezdxf | tests/test_01_dxf_entities/test_131_field_list.py | 1 | 2369 | # Copyright (c) 2019 Manfred Moitzi
# License: MIT License
from typing import cast
import pytest
import ezdxf
from ezdxf.entities.idbuffer import FieldList
from ezdxf.lldxf.tagwriter import TagCollector, basic_tags_from_text
FIELDLIST = """0
FIELDLIST
5
0
102
{ACAD_REACTORS
330
0
102
}
330
0
100
AcDbIdSet
90
12
100
Ac... | mit |
michaelkirk/QGIS | tests/src/python/test_qgsrectangle.py | 11 | 7274 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsComposition.
.. 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 |
usc-isi/nova | nova/policy.py | 7 | 3601 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 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... | apache-2.0 |
krautradio/PyRfK | lib/rfk/database/base.py | 1 | 14479 | import time
import hashlib
from datetime import timedelta
from passlib.hash import bcrypt
from sqlalchemy import *
from sqlalchemy.orm import relationship, backref, exc
from sqlalchemy.dialects.mysql import INTEGER as Integer
from sqlalchemy.ext.hybrid import hybrid_property, hybrid_method
from sqlalchemy.sql.express... | bsd-3-clause |
mancoast/CPythonPyc_test | cpython/260_test_descr.py | 2 | 145704 | import types
import unittest
import warnings
from copy import deepcopy
from test import test_support
class OperatorsTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)
self.binops = {
'add': '+',
'sub': '-',
... | gpl-3.0 |
skg-net/ansible | lib/ansible/modules/storage/netapp/na_ontap_lun_map.py | 4 | 8502 | #!/usr/bin/python
""" this is lun mapping module
(c) 2018, NetApp, 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 |
chuan9/chromium-crosswalk | tools/win/split_link/install_split_link.py | 146 | 3104 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import _winreg
import os
import shutil
import subprocess
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
def IsExe(fpath):
return ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.