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 |
|---|---|---|---|---|---|
kristofvanmoffaert/python-omniture | build/lib/tests/testElement.py | 3 | 1771 | #!/usr/bin/python
import unittest
import omniture
import os
creds = {}
creds['username'] = os.environ['OMNITURE_USERNAME']
creds['secret'] = os.environ['OMNITURE_SECRET']
class ElementTest(unittest.TestCase):
def setUp(self):
fake_list = [{"id":"123","title":"ABC"},{"id":"456","title":"DEF"}]
sel... | mit |
rohangoel96/IRCLogParser | IRCLogParser/lib/analysis/user.py | 1 | 18354 | import networkx as nx
import re
import sys
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction import text
from nltk.stem.wordnet import WordNetLemmatizer
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import KMeans, MiniBatch... | mit |
m2ci-msp/ematoblender | ematoblender/scripts/ema_io/ema_gameserver/ActionBuilder.py | 3 | 1073 | __author__ = "Alexander Hewer"
__email__ = "hewer@coli.uni-saarland.de"
class ActionBuilder:
def build_fit_action(self, coilPositions, timeStamp):
action = self.__base_action("FIT")
action["points"] = coilPositions
action["timeStamp"] = timeStamp
return action
def build_fix_s... | gpl-3.0 |
gingerswede/ITSecCardGame | src/View/Card.py | 1 | 2437 | '''
IDE: Eclipse (PyDev)
Python version: 2.7
Operating system: Windows 8.1
@author: Emil Carlsson
@copyright: 2015 Emil Carlsson
@license: This program is distributed under the terms of the GNU General Public License
'''
import Model
import Tkinter as tk
from Tkconstants import LEFT
from PIL import ImageTk
from tkFo... | gpl-3.0 |
taknevski/tensorflow-xsmm | tensorflow/contrib/learn/python/learn/estimators/test_data.py | 122 | 1988 | # 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 |
elkingtonmcb/h2o-2 | py/testdir_ec2/test_rf_airlines.py | 9 | 2702 | import unittest, time, sys
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_rf
# RF train parameters
paramsTrainRF = {
'ntree' : 50,
'depth' : 30,
'bin_limit' : 10000,
'ignore' : 'AirTime,ArrDelay,DepDelay,CarrierDelay,IsArrDelayed',
... | apache-2.0 |
emkailu/PAT3DEM | bin/p3movierun.py | 1 | 3600 | #!/usr/bin/env python
import os
import sys
import argparse
import time
def main():
progname = os.path.basename(sys.argv[0])
usage = progname + """ [options] <f.txt>
Run p3movie.py to process movies listed in f.txt, and the movies will be deleted to save space.
"""
args_def = {'apix':1.25, 'voltage':200, 'time'... | mit |
yceruto/django | django/db/migrations/autodetector.py | 1 | 21219 | import importlib
import os
import re
import sys
from django.db.migrations import operations
from django.db.migrations.migration import Migration
from django.db.models.loading import cache
from django.utils import datetime_safe
from django.utils.six.moves import input
class MigrationAutodetector(object):
"""
... | bsd-3-clause |
ehdr/luigi | luigi/contrib/scalding.py | 26 | 10702 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | apache-2.0 |
ClustyROM/Galaxy_Note | tools/perf/scripts/python/failed-syscalls-by-pid.py | 944 | 1869 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
pprett/statsmodels | statsmodels/stats/outliers_influence.py | 1 | 27029 | # -*- coding: utf-8 -*-
"""Influence and Outlier Measures
Created on Sun Jan 29 11:16:09 2012
Author: Josef Perktold
License: BSD-3
"""
from collections import defaultdict
import numpy as np
from statsmodels.regression.linear_model import OLS
from statsmodels.tools.decorators import cache_readonly
#influence meas... | bsd-3-clause |
caseyrollins/osf.io | osf/migrations/0095_reset_osf_abstractprovider_licenses_acceptable_id_seq.py | 16 | 1189 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-04-12 20:31
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0094_update_preprintprovider_group_auth'),
]
operations = [
migrations.RunSQ... | apache-2.0 |
lyft/incubator-airflow | airflow/operators/s3_to_redshift_operator.py | 4 | 1190 | #
# 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... | apache-2.0 |
billzorn/mtgencode | lib/cardlib.py | 1 | 41779 | # card representation
import re
import random
import utils
import transforms
from manalib import Manacost, Manatext
# Some text prettification stuff that people may not have installed
try:
from titlecase import titlecase
except ImportError:
def titlecase(s):
return s.title()
try:
import textwrap
... | mit |
ikcalB/linuxcnc-mirror | src/hal/user_comps/pyvcp.py | 32 | 3152 | #!/usr/bin/env python
# This is a component of emc
# Copyright 2007 Anders Wallin <anders.wallin@helsinki.fi>
#
#
# 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 versio... | lgpl-2.1 |
bq/web2board | res/common/Scons/sconsFiles/SCons/Tool/GettextCommon.py | 6 | 17292 | """SCons.Tool.GettextCommon module
Used by several tools of `gettext` toolset.
"""
# Copyright (c) 2001 - 2015 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 withou... | lgpl-3.0 |
wimnat/ansible-modules-extras | system/ohai.py | 77 | 1693 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... | gpl-3.0 |
jaruba/chromium.src | tools/perf/page_sets/mse_cases.py | 9 | 2010 | # 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.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class MseCasesPage(page_module.Page):
def __init__(... | bsd-3-clause |
egenerat/flight-manager | lib/requests/packages/chardet/langcyrillicmodel.py | 2762 | 17725 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | mit |
chiefy/kubernetes | examples/cluster-dns/images/backend/server.py | 468 | 1313 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
rcomer/iris | lib/iris/tests/test_quickplot.py | 3 | 8026 | # Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""
Tests the high-level plotting interface.
"""
# import iris tests first so that some things can be initialised before impo... | lgpl-3.0 |
khosrow/luma-devel | luma/base/gui/design/PluginListWidgetDesign.py | 3 | 1349 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/mnt/debris/devel/repo/git/luma-fixes/resources/forms/PluginListWidgetDesign.ui'
#
# Created: Wed May 25 21:41:09 2011
# by: PyQt4 UI code generator 4.8.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCor... | gpl-2.0 |
andiwundsam/_of_normalize | pox/forwarding/l3_learning.py | 36 | 12330 | # Copyright 2012-2013 James McCauley
#
# 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 |
MicroPyramid/docker-box | dockit/views.py | 1 | 22934 | from os import statvfs, uname
import time
from socket import socket
import psutil
import uuid
import json
import requests
import subprocess
from django.shortcuts import render, HttpResponse, get_object_or_404, redirect
from django.http import JsonResponse, HttpResponseRedirect, StreamingHttpResponse, Http404
from docki... | mit |
jbellis/cassandra | bin/cqlsh.py | 1 | 100692 | #!/bin/sh
# -*- mode: Python -*-
# 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.... | apache-2.0 |
epage/dialcentral-gtk | src/alarm_handler.py | 1 | 9207 | #!/usr/bin/env python
import os
import time
import datetime
import ConfigParser
import dbus
_FREMANTLE_ALARM = "Fremantle"
_DIABLO_ALARM = "Diablo"
_NO_ALARM = "None"
try:
import alarm
ALARM_TYPE = _FREMANTLE_ALARM
except (ImportError, OSError):
try:
import osso.alarmd as alarmd
ALARM_TYPE = _DIABLO_ALARM
... | lgpl-2.1 |
khertan/ownNotes | python/requests/packages/charade/escprober.py | 206 | 3273 | ######################## 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.
... | gpl-3.0 |
s20121035/rk3288_android5.1_repo | external/chromium_org/tools/site_compare/commands/scrape.py | 189 | 1832 | # 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.
"""Command for scraping images from a URL or list of URLs.
Prerequisites:
1. The command_line package from tools/site_compare
2. Either the IE BHO o... | gpl-3.0 |
bluemask2001/namebench | tools/alexa-subdomains.py | 175 | 2862 | #!/usr/bin/env python
# Copyright 2009 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... | apache-2.0 |
eckucukoglu/arm-linux-gnueabihf | arm-linux-gnueabihf/libc/usr/lib/python2.7/ctypes/test/test_array_in_pointer.py | 117 | 1729 | import unittest
from ctypes import *
from binascii import hexlify
import re
def dump(obj):
# helper function to dump memory contents in hex, with a hyphen
# between the bytes.
h = hexlify(memoryview(obj))
return re.sub(r"(..)", r"\1-", h)[:-1]
class Value(Structure):
_fields_ = [("val", c_byte)]
... | gpl-2.0 |
zhuyue1314/FuzzLabs | requests/file_JPEG_B.py | 7 | 120707 | # =============================================================================
# JPEG Image Descriptor - BIG
# This file is part of the FuzzLabs Fuzzing Framework
#
# Author: FuzzLabs
# Date: 21/07/2015
#
# Original file MD5 sum: 4dde17f30fee6e6120a58d890a4ec572
# Original file SHA1 sum: 1e1d1c90b4b0dd9ad5719be96... | gpl-2.0 |
xbmc/atv2 | xbmc/lib/libPython/Python/Lib/plat-irix6/ERRNO.py | 9 | 2657 | # Generated by h2py from /usr/include/errno.h
# Included from sys/errno.h
# Included from standards.h
__KBASE = 1000
__IRIXBASE = 1000
__FTNBASE = 4000
__FTNLAST = 5999
EPERM = 1
ENOENT = 2
ESRCH = 3
EINTR = 4
EIO = 5
ENXIO = 6
E2BIG = 7
ENOEXEC = 8
EBADF = 9
ECHILD = 10
EAGAIN = 11
ENOMEM = 12
EACCES = 13
EFAULT = 1... | gpl-2.0 |
iksaif/euscan | pym/euscan/ebuild.py | 1 | 3030 | import os
import sys
import imp
import portage
from portage.const import VDB_PATH
from portage import _encodings
from portage import _shell_quote
from portage import _unicode_decode
from portage import _unicode_encode
# Stolen from the ebuild command
def package_from_ebuild(ebuild):
pf = None
if ebuild.endsw... | gpl-2.0 |
Vishluck/sympy | sympy/calculus/tests/test_finite_diff.py | 53 | 7632 | from sympy.core.compatibility import range
from sympy import S, symbols, Function
from sympy.calculus.finite_diff import (
apply_finite_diff, finite_diff_weights, as_finite_diff
)
def test_apply_finite_diff():
x, h = symbols('x h')
f = Function('f')
assert (apply_finite_diff(1, [x-h, x+h], [f(x-h), f(... | bsd-3-clause |
wuliming/pcp | src/pcp/uptime/pcp-uptime.py | 1 | 4952 | #!/usr/bin/env pmpython
#
# Copyright (C) 2014-2015 Red Hat.
#
# 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... | lgpl-2.1 |
muffinresearch/addons-server | apps/reviews/tests/test_feeds.py | 15 | 1267 | # -*- coding: utf-8 -*-
import mock
from nose.tools import eq_
import amo.tests
from reviews import feeds
from translations.models import Translation
class FeedTest(amo.tests.TestCase):
# Rub some unicode all over the reviews feed.
def setUp(self):
super(FeedTest, self).setUp()
self.feed = f... | bsd-3-clause |
DaanHoogland/cloudstack | test/integration/component/test_storage_motion.py | 6 | 12352 | # 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 |
pasqualguerrero/django | tests/gis_tests/geoapp/tests.py | 189 | 41436 | from __future__ import unicode_literals
import re
import tempfile
from django.contrib.gis import gdal
from django.contrib.gis.db.models import Extent, MakeLine, Union
from django.contrib.gis.geos import (
GeometryCollection, GEOSGeometry, LinearRing, LineString, Point, Polygon,
fromstr,
)
from django.core.man... | bsd-3-clause |
eucalyptus/se34euca | se34euca/lib/EucaUITestLib_Base.py | 1 | 30882 | import unittest
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
class UICheckException(Exception):
def __init__(self, message):
raise Exception(message)
... | bsd-2-clause |
cmdunkers/DeeperMind | PythonEnv/lib/python2.7/site-packages/numpy/distutils/exec_command.py | 63 | 20462 | #!/usr/bin/env python
"""
exec_command
Implements exec_command function that is (almost) equivalent to
commands.getstatusoutput function but on NT, DOS systems the
returned status is actually correct (though, the returned status
values may be different by a factor). In addition, exec_command
takes keyword arguments fo... | bsd-3-clause |
gurbrinder/Arduino | arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/_collections.py | 309 | 2903 | # urllib3/_collections.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from collections import MutableMapping
from threading import Lock
try: # Python 2.7+
... | lgpl-2.1 |
c0defreak/python-for-android | python-build/python-libs/gdata/src/gdata/webmastertools/service.py | 136 | 22175 | #!/usr/bin/python
#
# Copyright (C) 2008 Yu-Jie Lin
#
# 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... | apache-2.0 |
yatinkumbhare/openstack-nova | nova/tests/unit/virt/xenapi/test_agent.py | 65 | 17659 | # Copyright 2013 OpenStack Foundation
# 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 |
lamarmeigs/django-clean-fields | tests/test_utils.py | 1 | 2929 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from unittest import TestCase
from django.db import models
from mock import patch
from clean_fields.utils import (
get_model_field_value, get_model_field_names, par... | mit |
iivic/BoiseStateX | common/lib/capa/capa/safe_exec/safe_exec.py | 179 | 4876 | """Capa's specialized use of codejail.safe_exec."""
from codejail.safe_exec import safe_exec as codejail_safe_exec
from codejail.safe_exec import not_safe_exec as codejail_not_safe_exec
from codejail.safe_exec import json_safe, SafeExecException
from . import lazymod
from dogapi import dog_stats_api
import hashlib
#... | agpl-3.0 |
virtool/virtool | virtool/app_routes.py | 2 | 2008 | import logging
import os
import sys
import virtool.account.api
import virtool.analyses.api
import virtool.caches.api
import virtool.downloads.api
import virtool.files.api
import virtool.genbank.api
import virtool.groups.api
import virtool.history.api
import virtool.hmm.api
import virtool.http.auth
import virtool.http.... | mit |
bright-sparks/chromium-spacewalk | tools/telemetry/telemetry/page/actions/tap.py | 45 | 2540 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
from telemetry.page.actions import page_action
class TapAction(page_action.PageAction):
def __init__(self, selector=None, text=None, element_f... | bsd-3-clause |
anushreejangid/csm-ut | tests/test_decorators.py | 4 | 2597 | # =============================================================================
#
# Copyright (c) 2016, Cisco Systems
# All rights reserved.
#
# # Author: Klaudiusz Staniek
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met... | bsd-2-clause |
gbalme/Anacoinda | contrib/pyminer/pyminer.py | 385 | 6434 | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | mit |
grap/OCB | openerp/report/render/makohtml2html/__init__.py | 76 | 1120 | # -*- coding: utf-8 -*-
##############################################################################
#
# 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... | agpl-3.0 |
smishenk/blink-crosswalk | Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py | 39 | 13796 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
VasLem/KinectPainting | OptGridSearchCV.py | 1 | 7990 | '''
An optimized method for GridSearchCV, which iteratively performs grid search
and reduces the span of the parameters after each iteration. Made to make the
life of an engineer less boring.
'''
import numpy as np
from sklearn.model_selection import GridSearchCV
from sklearn.svm import LinearSVC
def optGridSearchCV(... | bsd-3-clause |
openstack/neutron-lib | neutron_lib/api/definitions/address_scope.py | 1 | 3800 | # Copyright (c) 2015 Huawei Technologies Co.,LTD.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | apache-2.0 |
elemhsb/mallorca | sw/airborne/test/ahrs/ahrs_utils.py | 15 | 5172 | #! /usr/bin/env python
# $Id$
# Copyright (C) 2011 Antoine Drouin
#
# This file is part of Paparazzi.
#
# Paparazzi 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, or (at your option)
# an... | gpl-2.0 |
tefasmile/Mi_Blog | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/_sourcemodbuiltins.py | 95 | 21984 | # -*- coding: utf-8 -*-
"""
pygments.lexers._sourcemodbuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains the names of SourceMod functions.
It is able to re-generate itself.
Do not edit the FUNCTIONS list by hand.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
... | mit |
msingh172/youtube-dl | youtube_dl/extractor/udemy.py | 33 | 7277 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
)
class UdemyIE(InfoExtractor):
IE_NAME = 'udemy'
_VALID_URL = r'https?://www\.udemy\.com/(?:[^#]+#/lectu... | unlicense |
rvalyi/OpenUpgrade | addons/account_analytic_analysis/account_analytic_analysis.py | 6 | 46929 | # -*- 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 |
bdang2012/taiga-back | taiga/projects/attachments/admin.py | 21 | 1362 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... | agpl-3.0 |
Phil-LiDAR2-Geonode/pl2-geonode | geonode/contrib/geosites/tests.py | 22 | 9742 | import json
from tastypie.test import ResourceTestCase
from django.test.utils import override_settings
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from guardian.shortcuts import get_anonymous_user
from guardian.shortcuts import remove_perm
from geonode.base.populate_test... | gpl-3.0 |
StuartLittlefair/astropy | astropy/table/operations.py | 3 | 54015 | """
High-level table operations:
- join()
- setdiff()
- hstack()
- vstack()
- dstack()
"""
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from copy import deepcopy
import collections
import itertools
from collections import OrderedDict, Counter
from collections.abc import Mapping, Sequence
import nu... | bsd-3-clause |
AsherBond/MondocosmOS | opencollada/Externals/LibXML/genChRanges.py | 13 | 15491 | #!/usr/bin/python -u
#
# Portions of this script have been (shamelessly) stolen from the
# prior work of Daniel Veillard (genUnicode.py)
#
# I, however, take full credit for any bugs, errors or difficulties :-)
#
# William Brack
# October 2003
#
# 18 October 2003
# Modified to maintain binary compatibility with previou... | agpl-3.0 |
drix00/microanalysis_file_format | pySpectrumFileFormat/OxfordInstruments/INCA/test_ReadSpectrumFullResults.py | 1 | 3406 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. py:currentmodule:: pySpectrumFileFormat.OxfordInstruments.INCA.test_ReadSpectrumFullResults
:synopsis: Tests for the module :py:mod:`pySpectrumFileFormat.OxfordInstruments.INCA.ReadSpectrumFullResults`
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill... | apache-2.0 |
UdhayaBalaji/pdf-annotation | jni/freetype/src/tools/docmaker/utils.py | 515 | 3063 | # Utils (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org>
#
import string, sys, os, glob
# current output directory
#
output_dir = None
# This function is used to sort the index. It is a simple lexicographical
# sort, except that it places capital letters before lowercase ones.
#
def index_sort( s1, ... | gpl-3.0 |
ecederstrand/django | django/contrib/sessions/models.py | 347 | 1298 | from __future__ import unicode_literals
from django.contrib.sessions.base_session import (
AbstractBaseSession, BaseSessionManager,
)
class SessionManager(BaseSessionManager):
use_in_migrations = True
class Session(AbstractBaseSession):
"""
Django provides full support for anonymous sessions. The s... | bsd-3-clause |
besser82/shogun | examples/undocumented/python/tests_check_commwordkernel_memleak.py | 4 | 4446 | #!/usr/bin/env python
import shogun as sg
parameter_list=[[10,7,0,False]]
def tests_check_commwordkernel_memleak (num, order, gap, reverse):
import gc
from shogun import Alphabet,StringCharFeatures,StringWordFeatures,DNA
from shogun import MSG_DEBUG
from shogun import CommWordStringKernel, IdentityKernelNormalizer... | bsd-3-clause |
windedge/odoo | addons/crm_claim/report/__init__.py | 446 | 1080 | # -*- 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... | agpl-3.0 |
minhphung171093/GreenERP_V7 | openerp/addons/base_report_designer/__openerp__.py | 110 | 1796 | # -*- 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 |
fjorba/invenio | modules/weblinkback/lib/weblinkbackadminlib.py | 25 | 9958 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | gpl-2.0 |
daajoe/asp_horn_backdoors | reduct.py | 1 | 3403 | #!/usr/bin/env python
#
# Copyright 2015
# Johannes K. Fichte, Vienna University of Technology, Austria
#
# reduct.py 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 y... | gpl-2.0 |
furiousdave/django-avatar | avatar/tests.py | 54 | 5563 | import os.path
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.conf import settings
from django.contrib.auth.models import User
from avatar.settings import AVATAR_DEFAULT_URL, AVATAR_MAX_AVATARS_PER_USER
from avatar.util import get_primary_avatar
from avatar.models import Av... | bsd-3-clause |
MSOpenTech/edx-platform | openedx/core/lib/django_test_client_utils.py | 20 | 1555 | """
This file includes the monkey-patch for requests' PATCH method, as we are using
older version of django that does not contains the PATCH method in its test client.
"""
# pylint: disable=protected-access
from __future__ import unicode_literals
from urlparse import urlparse
from django.test.client import RequestF... | agpl-3.0 |
systemd/linux | 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 |
hfp/tensorflow-xsmm | tensorflow/python/data/experimental/benchmarks/optimize_benchmark.py | 2 | 6143 | # 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 |
ktriponis/ansible-modules-core | cloud/rackspace/rax_clb_nodes.py | 43 | 8603 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
MissCatLady/AlarmEZ | venv/lib/python2.7/site-packages/pip/vendor/html5lib/ihatexml.py | 1727 | 16581 | from __future__ import absolute_import, division, unicode_literals
import re
import warnings
from .constants import DataLossWarning
baseChar = """
[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] |
[#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] |
[#x014A-#x017E] | [#x0180-... | mit |
mdboom/pytest | testing/test_helpconfig.py | 188 | 2031 | from _pytest.main import EXIT_NOTESTSCOLLECTED
import pytest
def test_version(testdir, pytestconfig):
result = testdir.runpytest("--version")
assert result.ret == 0
#p = py.path.local(py.__file__).dirpath()
result.stderr.fnmatch_lines([
'*pytest*%s*imported from*' % (pytest.__version__, )
]... | mit |
shubhdev/edxOnBaadal | lms/djangoapps/courseware/features/conditional.py | 102 | 4723 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, steps
from nose.tools import assert_in, assert_true # pylint: disable=no-name-in-module
from common import i_am_registered_for_the_course, visit_scenario_item
from problems_setup import add_problem_to_course, answer... | agpl-3.0 |
xflows/clowdflows | streams/management/commands/run_streams.py | 2 | 1655 | from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
help = 'check for streams that need to be executed and execute them'
option_list = NoArgsCommand.option_list
def handle_noargs(self, **options):
import time
from streams.models import Stream
... | mit |
bobcolner/material-girl | tests/test_user_model.py | 118 | 6851 | import unittest
import time
from datetime import datetime
from app import create_app, db
from app.models import User, AnonymousUser, Role, Permission, Follow
class UserModelTestCase(unittest.TestCase):
def setUp(self):
self.app = create_app('testing')
self.app_context = self.app.app_context()
... | mit |
sunu/oh-missions-oppia-beta | extensions/rules/coord_two_dim_test.py | 5 | 1551 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
magus424/powerline | tests/test_provided_config_files.py | 1 | 6114 | # vim:fileencoding=utf-8:noet
'''Dynamic configuration files tests.'''
from __future__ import (unicode_literals, division, absolute_import, print_function)
import sys
import os
import json
import tests.vim as vim_module
from tests.lib import Args, urllib_read, replace_attr
from tests import TestCase
VBLOCK = chr... | mit |
jimsimon/sky_engine | sky/engine/bindings/scripts/blink_idl_parser.py | 14 | 19028 | # Copyright (C) 2013 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 |
Juniper/tempest | tempest/lib/services/volume/v2/volumes_client.py | 1 | 14434 | # Copyright 2012 OpenStack Foundation
# 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 |
camagenta/youtube-dl | test/test_utils.py | 34 | 31908 | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# Various small unit tests
import io
import json
import xml.etree.ElementTree
from youtube_dl.u... | unlicense |
CydarLtd/ansible | test/runner/injector/injector.py | 163 | 7660 | #!/usr/bin/env python
"""Interpreter and code coverage injector for use with ansible-test.
The injector serves two main purposes:
1) Control the python interpreter used to run test tools and ansible code.
2) Provide optional code coverage analysis of ansible code.
The injector is executed one of two ways:
1) On the... | gpl-3.0 |
DistortedSignal/markov-lib | markov_test.py | 1 | 4459 | # -*- coding: utf-8 -*-
import markov_tool as mt
ins = mt.InstanceList()
if ins._get_native_types() != (0, {}):
print "There was a problem instantiating the InstanceList."
print ins._get_native_types()
ins['a'] = 1
if ins['a'] != 1 or ins._get_native_types() != (1, {'a': 1}):
print "There was a problem s... | mit |
mancoast/CPythonPyc_test | fail/313_test_tokenize.py | 2 | 34326 | # -*- coding: utf-8 -*-
doctests = """
Tests for the tokenize module.
The tests can be really simple. Given a small fragment of source
code, print out a table with tokens. The ENDMARK is omitted for
brevity.
>>> dump_tokens("1 + 1")
ENCODING 'utf-8' (0, 0) (0, 0)
NUMBER '1' (1, 0) (... | gpl-3.0 |
junmin-kim/TizenRT | build/tools/esp32/esptool_py/partition_offset.py | 10 | 1806 | #!/usr/bin/python
# Copyright 2019 Samsung Electronics 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 ... | apache-2.0 |
lulandco/SickRage | lib/chardet/sjisprober.py | 53 | 3690 | ######################## 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-3.0 |
MPIB/Lagerregal | devicetypes/tests.py | 1 | 2366 | from django.test import TestCase
from django.test.client import Client
from django.urls import reverse
from model_mommy import mommy
from devicetypes.models import Type
from users.models import Lageruser
class TypeTests(TestCase):
def setUp(self):
self.client = Client()
Lageruser.objects.create... | bsd-3-clause |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/tests/postgres_tests/models.py | 26 | 1983 | from django.contrib.postgres.fields import (
ArrayField, BigIntegerRangeField, DateRangeField, DateTimeRangeField,
FloatRangeField, HStoreField, IntegerRangeField,
)
from django.db import connection, models
class IntegerArrayModel(models.Model):
field = ArrayField(models.IntegerField())
class NullableIn... | mit |
batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/stringprep.py | 205 | 12917 | # This file is generated by mkstringprep.py. DO NOT EDIT.
"""Library that exposes various tables found in the StringPrep RFC 3454.
There are two kinds of tables: sets, for which a member test is provided,
and mappings, for which a mapping function is provided.
"""
from unicodedata import ucd_3_2_0 as unicodedata
ass... | apache-2.0 |
simontakite/sysadmin | pythonscripts/pythonnetworkingcoookbook/chapter7/7_7_configure_Apache_for_hosting_website_remotely.py | 4 | 1458 | #!/usr/bin/env python
# Python Network Programming Cookbook -- Chapter - 7
# This program is optimized for Python 2.7.
# It may run on any other version with/without modifications.
from getpass import getpass
from fabric.api import env, put, sudo, prompt
from fabric.contrib.files import exists
WWW_DOC_ROOT = "/data/a... | gpl-2.0 |
alphafoobar/intellij-community | python/helpers/docutils/utils.py | 40 | 24558 | # $Id: utils.py 6394 2010-08-20 11:26:58Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Miscellaneous utilities for the documentation utilities.
"""
__docformat__ = 'reStructuredText'
import sys
import os
import os.path
import warnings
import ... | apache-2.0 |
AhmadHamzeei/Amir-Accounting | amir/factor.py | 1 | 1168 | class factor:
number = None # factor number
bill_id = None
trans_id = None
dirty = False
## type of factor can be sell, buy
facotr_type = "sell"
def __init__(self, number):
if(number):
#get bill_id and trans_id and type from database
## set current factor deatils
... | gpl-3.0 |
orlenko/bccf | src/mezzanine/blog/management/commands/import_tumblr.py | 3 | 5052 |
from datetime import datetime
from optparse import make_option
from time import sleep
from urllib import urlopen
from django.core.management.base import CommandError
from django.utils.html import strip_tags
try:
from json import loads
except ImportError: # Python < 2.6
from django.utils.simplejson import lo... | unlicense |
TheSimoms/Felleshoelet | spotifyconnector/venv/lib/python3.6/site-packages/pip/_vendor/packaging/utils.py | 62 | 1520 | # 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 re
from .version import InvalidVersion, Version
_canonicalize_re... | gpl-2.0 |
elijah513/ice | python/test/Ice/inheritance/Server.py | 3 | 1086 | #!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | gpl-2.0 |
balloob/python-wink | src/pywink/test/devices/sensor_test.py | 3 | 11909 | import json
import os
import unittest
from unittest.mock import MagicMock
from pywink.api import get_devices_from_response_dict
from pywink.devices import types as device_types
from pywink.devices.piggy_bank import WinkPorkfolioBalanceSensor
from pywink.devices.smoke_detector import WinkSmokeDetector, WinkCoDetector,... | mit |
peterm-itr/edx-platform | lms/djangoapps/courseware/tests/test_video_xml.py | 13 | 3186 | # -*- coding: utf-8 -*-
# pylint: disable=protected-access
"""Test for Video Xmodule functional logic.
These test data read from xml, not from mongo.
We have a ModuleStoreTestCase class defined in
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py.
You can search for usages of this in the cms and lms tests ... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.