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 |
|---|---|---|---|---|---|
blazek/QGIS | tests/src/python/test_authmanager_proxy.py | 15 | 3241 | # -*- coding: utf-8 -*-
"""
Tests for auth manager Basic configuration update proxy
From build dir, run from test directory:
LC_ALL=en_US.UTF-8 ctest -R PyQgsAuthManagerProxy -V
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as publi... | gpl-2.0 |
smasala/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py | 119 | 7386 | # 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 |
blockstack/virtualchain | virtualchain/lib/blockchain/address.py | 1 | 1220 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Virtualchain
~~~~~
copyright: (c) 2014 by Halfmoon Labs, Inc.
copyright: (c) 2015-2018 by Blockstack.org
This file is part of Virtualchain
Virtualchain is free software: you can redistribute it and/or modify
it under the terms of th... | gpl-3.0 |
darongliu/Lstm_Turing_LM | lstm-neural-turing-machines-lm/exp1/v1-first-half/theano_toolkit/hinton.py | 33 | 1055 | # coding=utf-8
import numpy as np
chars = [" ", "▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"]
class BarHack(str):
def __str__(self):
return self.internal
def __len__(self):
return 1
#bh = BarHack()
def plot(arr, max_arr=None):
if max_arr == None:
max_arr = arr
max_val = max(abs(... | mit |
geekboxzone/lollipop_external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/thirdparty/coverage/codeunit.py | 66 | 3705 | """Code unit (module) handling for Coverage."""
import glob, os
from coverage.backward import open_source, string_class, StringIO
from coverage.misc import CoverageException
def code_unit_factory(morfs, file_locator):
"""Construct a list of CodeUnits from polymorphic inputs.
`morfs` is a module or a filena... | bsd-3-clause |
nwjs/chromium.src | third_party/blink/web_tests/external/wpt/webdriver/tests/get_title/user_prompts.py | 26 | 4499 | # META: timeout=long
import pytest
from tests.support.asserts import assert_dialog_handled, assert_error, assert_success
from tests.support.inline import inline
def get_title(session):
return session.transport.send(
"GET", "session/{session_id}/title".format(**vars(session)))
@pytest.fixture
def check... | bsd-3-clause |
JoeyCodinja/INFO3180PROJECT3 | lib/werkzeug/testsuite/formparser.py | 97 | 18740 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.formparser
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the form parsing facilities.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import unittest
from os.path import join, dirn... | apache-2.0 |
MAPC/warren-st-development-database | development/migrations/0003_auto__add_field_projecttype_order.py | 2 | 11969 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'ProjectType.order'
db.add_column('development_projecttype', 'order',
s... | bsd-3-clause |
Zanzibar82/streamondemand.test | servers/rapidvideo.py | 1 | 2493 | # -*- coding: iso-8859-1 -*-
# ------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para rapidvideo
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
# ------------------------------------------------------------
import re
from core import scrapertools
from core... | gpl-3.0 |
collinstocks/eventlet | eventlet/websocket.py | 2 | 25012 | import base64
import codecs
import collections
import errno
from random import Random
from socket import error as SocketError
import string
import struct
import sys
import time
try:
from hashlib import md5, sha1
except ImportError: # pragma NO COVER
from md5 import md5
from sha import sha as sha1
from ev... | mit |
pdeesawat/PSIT58_test_01 | Test_Python_code/last/Thailand/total_affect_Thailand.py | 1 | 1119 | import plotly.plotly as py
import plotly.graph_objs as go
data = open('Real_Final_database_02.csv')
alldata = data.readlines()
listdata = []
for i in alldata:
listdata.append(i.strip().split(','))
type_z = ['Flood', 'Epidemic', 'Drought', 'Earthquake', 'Storm']
fill_colors = ['#00d0f5', '#ff4a2e', 'a36800', '#ad99... | apache-2.0 |
Haikson/virtenviro | virtenviro/content/management/commands/import_content.py | 1 | 5045 | # ~*~ coding: utf-8 ~*~
__author__ = 'Kamo Petrosyan'
from django.core.management.base import BaseCommand, CommandError
from lxml import etree
from virtenviro.content.models import Page, AdditionalField, FieldValue, Template
def create_page(title, slug, content, template, is_home=False, intro='',
par... | apache-2.0 |
pektin/jam | compiler/jam/parser.py | 2 | 26048 | import logging
from io import IOBase
from copy import copy
from .. errors import *
from .. import lekvar
from .lexer import Lexer, Tokens
from . import pragma
#
# Tools
#
def parseFile(source:IOBase, logger=logging.getLogger()):
with lekvar.State.ioSource(source):
try:
module = Parser(Lexer(... | mit |
Kitware/girder | girder/cli/shell.py | 2 | 1642 | # -*- coding: utf-8 -*-
import click
import girder
import sys
from girder.utility.server import configureServer
def _launchShell(context):
"""
Launches a Python shell with the given context.
:param context: A dictionary containing key value pairs
of variable name -> value to be set in the newly
... | apache-2.0 |
peiyuwang/pants | contrib/scrooge/tests/python/pants_test/contrib/scrooge/tasks/test_scrooge_gen.py | 3 | 5182 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from textw... | apache-2.0 |
spring-week-topos/cinder-week | cinder/volume/drivers/lvm.py | 1 | 25664 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
progrium/hookah | hookah/storage.py | 1 | 1296 | import base64
import cPickle
from collections import deque
class LocalStorage(object):
MAX_ITEMS = 20
def __init__(self):
self._recent = deque()
def recent(self, n=10):
return list(self._recent)[0:n]
def recordLocal(self, ob):
if len(self._recent) >= self.MAX_ITEMS:
... | mit |
jonroberts/nasaMining | bak/nasa_ngrams_np.py | 1 | 2918 | from __future__ import unicode_literals
import json
from gensim.models.phrases import Phrases
from textblob import TextBlob
# from gensim: threshold represents a threshold for forming the phrases (higher means fewer phrases).
# A phrase of words a and b is accepted if (cnt(a, b) - min_count) * N / (cnt(a) * cnt(b)) >... | mit |
jblackburne/scikit-learn | examples/covariance/plot_outlier_detection.py | 24 | 4318 | """
==========================================
Outlier detection with several methods.
==========================================
When the amount of contamination is known, this example illustrates three
different ways of performing :ref:`outlier_detection`:
- based on a robust estimator of covariance, which is assum... | bsd-3-clause |
joone/chromium-crosswalk | third_party/WebKit/Source/build/scripts/name_utilities.py | 9 | 2766 | # 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 |
choderalab/openpathsampling | openpathsampling/tests/test_bias_function.py | 3 | 15374 | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from builtins import range
from builtins import object
from past.utils import old_div
from nose.tools import (assert_equal, assert_not_equal, assert_almost_equal,
raises, assert_in)
from... | lgpl-2.1 |
aweisberg/cassandra-dtest | cqlsh_tests/cqlsh_tests.py | 1 | 104867 | import binascii
import csv
import datetime
import os
import re
import subprocess
import sys
import logging
import pytest
from decimal import Decimal
from distutils.version import LooseVersion
from tempfile import NamedTemporaryFile
from uuid import UUID, uuid4
from cassandra import InvalidRequest
from cassandra.concu... | apache-2.0 |
Kazade/NeHe-Website | google_appengine/lib/django-1.3/tests/regressiontests/db_typecasts/tests.py | 89 | 2547 | # Unit tests for typecast functions in django.db.backends.util
from django.db.backends import util as typecasts
import datetime, unittest
TEST_CASES = {
'typecast_date': (
('', None),
(None, None),
('2005-08-11', datetime.date(2005, 8, 11)),
('1990-01-01', datetime.date(1990, 1, 1)... | bsd-3-clause |
silkyar/570_Big_Little | build/ARM/python/swig/event.py | 1 | 8040 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.40
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import d... | bsd-3-clause |
grzegorzmazur/yacas | docs/util/yacasdomain.py | 1 | 13898 | # -*- coding: utf-8 -*-
"""
The Yacas domain.
:copyright: Copyright 2014 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx import addnodes
from sphinx.roles import XRefRole
from sphinx... | lgpl-2.1 |
daevaorn/sentry | tests/sentry/api/endpoints/test_team_stats.py | 10 | 1170 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.app import tsdb
from sentry.testutils import APITestCase
class TeamStatsTest(APITestCase):
def test_simple(self):
self.login_as(user=self.user)
team = self.create_team(name='foo')
project_1 =... | bsd-3-clause |
gigglesninja/senior-design | MissionPlanner/Lib/site-packages/numpy/tests/test_ctypeslib.py | 53 | 4165 | import sys
import exceptions
import numpy as np
from numpy.ctypeslib import ndpointer, load_library
from numpy.testing import *
try:
cdll = load_library('multiarray', np.core.multiarray.__file__)
_HAS_CTYPE = True
except ImportError:
_HAS_CTYPE = False
except exceptions.OSError, e:
_HAS_CTYPE = False
... | gpl-2.0 |
dreamllq/node | deps/v8/tools/testrunner/server/presence_handler.py | 123 | 4443 | # Copyright 2012 the V8 project authors. 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 conditi... | apache-2.0 |
0111001101111010/open-health-inspection-api | venv/lib/python2.7/site-packages/_markerlib/markers.py | 1769 | 3979 | # -*- coding: utf-8 -*-
"""Interpret PEP 345 environment markers.
EXPR [in|==|!=|not in] EXPR [or|and] ...
where EXPR belongs to any of those:
python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
python_full_version = sys.version.split()[0]
os.name = os.name
sys.platform = sys.platfo... | gpl-2.0 |
andris210296/andris-projeto | backend/venv/lib/python2.7/site-packages/unidecode/x07b.py | 252 | 4669 | data = (
'Mang ', # 0x00
'Zhu ', # 0x01
'Utsubo ', # 0x02
'Du ', # 0x03
'Ji ', # 0x04
'Xiao ', # 0x05
'Ba ', # 0x06
'Suan ', # 0x07
'Ji ', # 0x08
'Zhen ', # 0x09
'Zhao ', # 0x0a
'Sun ', # 0x0b
'Ya ', # 0x0c
'Zhui ', # 0x0d
'Yuan ', # 0x0e
'Hu ', # 0x0f
'Gang ', # 0x10
... | mit |
codexgigassys/codex-backend | src/Api/task.py | 1 | 13136 | import pathmagic
import sys
from bottle import route
from bottle import request
from bottle import response
from Utils.Functions import jsonize
from bson.json_util import dumps
from Utils.Functions import clean_hash
from Utils.Functions import check_hashes
from Utils.Functions import change_date_to_str
from Utils.Funct... | mit |
backmari/moose | python/chigger/tests/field_data/field_data.py | 6 | 1050 | #!/usr/bin/env python
#pylint: disable=missing-docstring
#################################################################
# DO NOT MODIFY THIS HEADER #
# MOOSE - Multiphysics Object Oriented Simulation Environment #
# #... | lgpl-2.1 |
googleads/google-ads-python | google/ads/googleads/v8/services/services/ad_group_label_service/transports/grpc.py | 1 | 12018 | # -*- 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 |
celiafish/VisTrails | contrib/edu_utah_sci_eranders_proteindatabank/PDB.py | 6 | 4040 | import core.modules
import core.modules.module_registry
from core.modules.vistrails_module import Module, ModuleError
class ProteinDataBank(Module):
pass
class Protein(ProteinDataBank):
def __init__(self):
ProteinDataBank.__init__(self)
self.atoms = {}
self.sequence = {}
self.... | bsd-3-clause |
dingocuster/scikit-learn | benchmarks/bench_plot_approximate_neighbors.py | 244 | 6011 | """
Benchmark for approximate nearest neighbor search using
locality sensitive hashing forest.
There are two types of benchmarks.
First, accuracy of LSHForest queries are measured for various
hyper-parameters and index sizes.
Second, speed up of LSHForest queries compared to brute force
method in exact nearest neigh... | bsd-3-clause |
mSenyor/sl4a | python-build/python-libs/gdata/samples/spreadsheets/spreadsheetExample.py | 89 | 6374 | #!/usr/bin/python
#
# Copyright (C) 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
fw1121/Pandoras-Toolbox-for-Bioinformatics | src/SPAdes/ext/src/python_libs/pyyaml2/scanner.py | 434 | 52630 |
# Scanner produces tokens of the following types:
# STREAM-START
# STREAM-END
# DIRECTIVE(name, value)
# DOCUMENT-START
# DOCUMENT-END
# BLOCK-SEQUENCE-START
# BLOCK-MAPPING-START
# BLOCK-END
# FLOW-SEQUENCE-START
# FLOW-MAPPING-START
# FLOW-SEQUENCE-END
# FLOW-MAPPING-END
# BLOCK-ENTRY
# FLOW-ENTRY
# KEY
# VALUE
# AL... | gpl-3.0 |
zaccoz/odoo | addons/survey/__init__.py | 385 | 1037 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
elggem/external-tools | AtomSpaceSubscriber/SampleClient/client.py | 9 | 1129 | # Sample Python client for AtomSpacePublisherModule
#
# Prerequisite:
# sudo pip install pyzmq
# python client.py
#
# For use with this module:
# https://github.com/opencog/opencog/tree/master/opencog/persist/zmq/events
__author__ = 'Cosmo Harrigan'
IP_ADDRESS = '127.0.0.1'
PORT = '5563'
import zmq
def ma... | agpl-3.0 |
wisdark/Empire | lib/modules/powershell/situational_awareness/network/powerview/get_site.py | 3 | 5800 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Get-DomainSite',
'Author': ['@harmj0y'],
'Description': ('Gets a list of all current sites in a domain. Part of PowerView.'),
'Background' : True... | bsd-3-clause |
opalytics/opalytics-ticdat | examples/expert_section/cplex/fantop.py | 1 | 10338 | #
# Author: Pete Cacioppi Opalytics.com https://lnkd.in/bUhfyNn
#
# Solves a fantasy football drafting problem. Tries to maximize the weighted
# expected points of a draft, while obeying min/max restrictions for different
# positions (to include a maximum-flex-players constraint).
#
# Pre-computes the expected draft po... | bsd-2-clause |
lz1988/flaskweb | Lib/encodings/cp1257.py | 593 | 13630 | """ Python Character Mapping Codec cp1257 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.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,in... | bsd-2-clause |
DHI-GRAS/processing_workflow | markdown/extensions/def_list.py | 4 | 3521 | """
Definition List Extension for Python-Markdown
=============================================
Adds parsing of Definition Lists to Python-Markdown.
See <https://Python-Markdown.github.io/extensions/definition_lists>
for documentation.
Original code Copyright 2008 [Waylan Limberg](http://achinghead.com)
All changes... | gpl-3.0 |
EconomicSL/housing-model | src/main/resources/calibration/code/IncomeDistByTenure.py | 2 | 5549 | # -*- coding: utf-8 -*-
"""
Code to read English Housing Survey data about income for different tenures and plot a histogram of it.
@author: daniel, Adrian Carro
"""
import Datasets as ds
import matplotlib.pyplot as plt
# Read data
rawData = ds.EHSinterview()
# Data filtering according to the following fields:
# - P... | mit |
wangjun/odoo | addons/purchase_requisition/__init__.py | 378 | 1072 | ##############################################################################
#
# 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 Publ... | agpl-3.0 |
orentadmor/caffe | python/caffe/classifier.py | 31 | 2973 | #!/usr/bin/env python
"""
Classifier is an image classifier specialization of Net.
"""
import numpy as np
import caffe
class Classifier(caffe.Net):
"""
Classifier extends Net for image class prediction
by scaling, center cropping, or oversampling.
"""
def __init__(self, model_file, pretrained_fi... | bsd-2-clause |
laszlokiraly/OffenesParlament | offenesparlament/offenesparlament/views/subscriptions.py | 2 | 8975 | # -*- coding: UTF-8 -*-
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
from django.contrib import messages
from django.http import HttpResponse
from django.views.decorators.cache import never_cache
from op_scraper.models import User
from op_scraper.models import SubscribedContent
fro... | bsd-2-clause |
rogerhil/cdpc | cdpc/app/utils/validators.py | 1 | 11470 | # -*- coding: utf-8; Mode: Python -*-
#
# Copyright (C) 2010 Lincoln de Sousa <lincoln@comum.org>
# Copyright (C) 2010 Ministério da Cultura <http://cultura.gov.br>
# Copyright (C) 2010 Marco Túlio Gontijo e Silva <marcot@marcot.eti.br>
# Copyright (C) 2010 Rogério Hilbert Lima <rogerhil@gmail.com>
#
# This program... | agpl-3.0 |
caderache2014/basic_scraper | test_scraper1.py | 1 | 1725 | import pytest
import scraper1 as s
import bs4
def test_extract_listings():
html, encoding = s.read_search_results('apartments2.html')
doc = s.parse_source(html, encoding)
listings = s.extract_listings(doc)
assert str(listings)[0] == '<'
def test_add_address():
html, encoding = s.read_search_resul... | mit |
lzpfmh/electron | script/lib/util.py | 149 | 5265 | #!/usr/bin/env python
import atexit
import contextlib
import errno
import platform
import re
import shutil
import ssl
import subprocess
import sys
import tarfile
import tempfile
import urllib2
import os
import zipfile
from config import is_verbose_mode
def get_host_arch():
"""Returns the host architecture with a ... | mit |
johndpope/tensorflow | tensorflow/python/kernel_tests/fifo_queue_test.py | 45 | 60541 | # 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 |
mycodeday/crm-platform | stock/procurement.py | 227 | 22183 | # -*- 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... | gpl-3.0 |
resmo/ansible | test/units/modules/network/f5/test_bigip_remote_role.py | 22 | 3086 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
skarbat/KanoUbuntu | build-image.py | 1 | 6126 | #!/usr/bin/env python
#
# build-image.py - Expand Ubuntu Mate for RaspberryPI 2 with KanoOS software
#
# The process uses xsysroot to create a new Ubuntu image with KanoOS software:
#
# 1. Takes the Ubuntu image and expands it to fit a 4GB SD card
# 2. Installs KanoOS software
# 3. Converts the final image read... | mit |
maestrano/odoo | addons/sale_journal/__openerp__.py | 52 | 2681 | # -*- 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 |
mad-lab/transit | src/pytransit/analysis/pathway_enrichment.py | 1 | 20617 | import sys
try:
import wx
WX_VERSION = int(wx.version()[0])
hasWx = True
except Exception as e:
hasWx = False
WX_VERSION = 0
if hasWx:
import wx.xrc
from wx.lib.buttons import GenBitmapTextButton
from pubsub import pub
import wx.adv
import os
import time
import math
import random... | gpl-3.0 |
cloudera/hue | desktop/core/ext-py/djangorestframework-3.9.4/rest_framework/compat.py | 2 | 9222 | """
The `compat` module provides support for backwards compatibility with older
versions of Django/Python, and compatibility wrappers around optional packages.
"""
from __future__ import unicode_literals
import sys
from django.conf import settings
from django.core import validators
from django.utils import six
from ... | apache-2.0 |
avadacatavra/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/manifestexpected.py | 22 | 7524 | import os
import urlparse
from wptmanifest.backends import static
from wptmanifest.backends.static import ManifestItem
import expected
"""Manifest structure used to store expected results of a test.
Each manifest file is represented by an ExpectedManifest that
has one or more TestNode children, one per test in the ... | mpl-2.0 |
georgetown-analytics/product-classifier | apparel/classify.py | 2 | 2806 | # apparel.classify
# Classifier package - utilize built model to perform classifications
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Thu Feb 05 21:43:21 2015 -0500
#
# Copyright (C) 2014 Bengfort.com
# For license information, see LICENSE.txt
#
# ID: classify.py [] benjamin@bengfort.com $
"""
C... | mit |
PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/white_list/check_op_sequence_instance_0_input_white_list.py | 2 | 1597 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve
#
# 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 appli... | apache-2.0 |
bonitadecker77/python-for-android | python3-alpha/python3-src/Lib/sunau.py | 55 | 16822 | """Stuff to parse Sun and NeXT audio files.
An audio file consists of a header followed by the data. The structure
of the header is as follows.
+---------------+
| magic word |
+---------------+
| header size |
+---------------+
| data size |
+--------... | apache-2.0 |
djangorussia/django-1.3-branch | django/utils/functional.py | 307 | 14218 | # License for code in this file that was taken from Python 2.5.
# PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
# --------------------------------------------
#
# 1. This LICENSE AGREEMENT is between the Python Software Foundation
# ("PSF"), and the Individual or Organization ("Licensee") accessing and
# otherwise usin... | bsd-3-clause |
le4ndro/homeinventory | config/settings/production.py | 1 | 1166 | """
Production settings for homeinventory project.
"""
from .base import env
from .base import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = False
ALLOWED_HOSTS = ['127.0.0.1', '.herokuapp.com']
# SECRET CONFIGURATION
# -----------------------------------... | mit |
dorey/pyxform | pyxform/instance.py | 1 | 3121 | from xform_instance_parser import parse_xform_instance
class SurveyInstance(object):
def __init__(self, survey_object, **kwargs):
self._survey = survey_object
self.kwargs = kwargs #not sure what might be passed to this
#does the survey object provide a way to get the key dicts?
s... | bsd-2-clause |
felixjimenez/django | tests/foreign_object/tests.py | 46 | 16968 | import datetime
from operator import attrgetter
from .models import (
Country, Person, Group, Membership, Friendship, Article,
ArticleTranslation, ArticleTag, ArticleIdea, NewsArticle)
from django.test import TestCase, skipUnlessDBFeature
from django.utils.translation import activate
from django.core.exception... | bsd-3-clause |
stillinbeta/python-oauth2 | setup.py | 295 | 1233 | #!/usr/bin/env python
from setuptools import setup, find_packages
import os, re
PKG='oauth2'
VERSIONFILE = os.path.join('oauth2', '_version.py')
verstr = "unknown"
try:
verstrline = open(VERSIONFILE, "rt").read()
except EnvironmentError:
pass # Okay, there is no version file.
else:
MVSRE = r"^manual_verstr... | mit |
claudep/translate | translate/tools/test_pypo2phppo.py | 26 | 1729 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pypo2phppo unit tests
# Author: Wil Clouser <wclouser@mozilla.com>
# Date: 2009-12-03
from translate.convert import test_convert
from translate.misc import wStringIO
from translate.tools import pypo2phppo
class TestPyPo2PhpPo:
def test_single_po(self):
in... | gpl-2.0 |
Iwan-Zotow/VV | H1Dn.py | 1 | 1925 | #!/usr/bin/env python3
"""
Nonuniform bin histogram class, bins making and bin index code
"""
from H1D import H1D
class H1Dn(H1D):
"""
Nonuniform step histogram
"""
def __init__(self, x):
self._x = sorted(x)
n = len(self._x) - 1 # one less bin for a give boundaries
lo = self... | mit |
silenceli/nova | nova/tests/unit/api/openstack/compute/test_versions.py | 4 | 13522 | # Copyright 2010-2011 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... | apache-2.0 |
jnishi/chainer | tests/chainer_tests/training_tests/extensions_tests/test_snapshot.py | 2 | 2350 | import os
import unittest
import mock
from chainer import testing
from chainer import training
from chainer.training import extensions
class TestSnapshotObject(unittest.TestCase):
def test_trigger(self):
target = mock.MagicMock()
snapshot_object = extensions.snapshot_object(target, 'myfile.dat'... | mit |
yatinkumbhare/openstack-nova | nova/tests/unit/objects/test_instance_pci_requests.py | 34 | 9635 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
jupitercl/django-dpa-chile | dpa_chile/management/commands/populate_dpa_chile.py | 1 | 4008 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import urllib3
import json
from bunch import bunchify
from django.core.management.base import BaseCommand, CommandError
from dpa_chile.models import Region, Provincia, Comuna
safe_ascci = {'\xc1': 'Á', '\xc9': 'É', '\xcd': 'Í', '\xd3': 'Ó', '\xda': 'Ú',
... | mit |
rocky/python-spark | example/python2/test/helper.py | 1 | 2047 | import sys, os, difflib
def helper_init(file, subdir):
# I hate how clumsy Python is here
dirname = os.path.join(".", os.path.dirname(file))
parent_dir = os.path.join("..", os.path.dirname(file))
sys.path.append(parent_dir)
return os.path.join(dirname, subdir)
def compare_one(func, python_file, ve... | mit |
alvin319/CarnotKE | jyhton/lib-python/2.7/test/test_dummy_threading.py | 194 | 1840 | from test import test_support
import unittest
import dummy_threading as _threading
import time
class DummyThreadingTestCase(unittest.TestCase):
class TestThread(_threading.Thread):
def run(self):
global running
global sema
global mutex
# Uncomment if testin... | apache-2.0 |
wholebiome/MetaPathways_Python_Koonkie.3.0 | libs/python_modules/annotate/sequence/fasta.py | 2 | 1586 | """This module defines classes for working with FASTA files."""
import textwrap
from __init__ import (SequenceRecordParser, SequenceRecordSerializer,
SequenceRecord, SequenceFactory, Feature)
import location
class FastaRecordParser(SequenceRecordParser):
"""Parses a FASTA record from a stri... | mit |
Korkki/django | django/contrib/contenttypes/fields.py | 73 | 24817 | from __future__ import unicode_literals
from collections import defaultdict
from django.contrib.contenttypes.models import ContentType
from django.core import checks
from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, connection, models, router, transaction... | bsd-3-clause |
pyparallel/numpy | numpy/lib/tests/test_arraysetops.py | 114 | 10084 | """Test functions for 1D array set operations.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import (
run_module_suite, TestCase, assert_array_equal, assert_equal
)
from numpy.lib.arraysetops import (
ediff1d, intersect1d, setxor1d, union1d, set... | bsd-3-clause |
dcroc16/skunk_works | google_appengine/lib/django-1.4/tests/modeltests/order_with_respect_to/tests.py | 150 | 2855 | from __future__ import absolute_import
from operator import attrgetter
from django.test import TestCase
from .models import Post, Question, Answer
class OrderWithRespectToTests(TestCase):
def test_basic(self):
q1 = Question.objects.create(text="Which Beatle starts with the letter 'R'?")
q2 = Qu... | mit |
JBonsink/GSOC-2013 | tools/ns-allinone-3.14.1/ns-3.14.1/.waf-1.6.11-30618c54883417962c38f5d395f83584/waflib/Tools/suncxx.py | 14 | 1475 | #! /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
from waflib import Utils
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
def find_sxx(conf):
v=conf.env
cc=None
if v['CXX']:cc=v['CXX']
elif... | gpl-3.0 |
javiplx/cobbler-devel | cobbler/modules/authz_allowall.py | 6 | 1400 | """
Authorization module that allows everything, which is the default
for new cobbler installs.
Copyright 2007-2008, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.com>
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 Softw... | gpl-2.0 |
40223149/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/_testcapi.py | 742 | 4231 |
CHAR_MAX = 127
CHAR_MIN = -128
DBL_MAX = 1.7976931348623157e+308
DBL_MIN = 2.2250738585072014e-308
FLT_MAX = 3.4028234663852886e+38
FLT_MIN = 1.1754943508222875e-38
INT_MAX = 2147483647
INT_MIN = -2147483648
LLONG_MAX = 9223372036854775807
LLONG_MIN = -9223372036854775808
LONG_MAX = 2147483647
LONG_MIN = -2... | gpl-3.0 |
FRC-Team-3140/north-american-happiness | lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py | 3 | 36689 | # util/langhelpers.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
"""Routines to help with the creation, loading and introspection of
modules, class... | mit |
gwpy/seismon | seismon/bits.py | 2 | 22194 | #!/usr/bin/python
import os, glob, optparse, shutil, warnings, pickle, math, copy, pickle, matplotlib
import matplotlib.pyplot as plt
import numpy as np
import scipy.signal, scipy.stats
import seismon.NLNM, seismon.html
import seismon.eqmon, seismon.utils
try:
import gwpy.time, gwpy.timeseries
import gwpy.fre... | gpl-3.0 |
usc-isi/extra-specs | nova/rpc/__init__.py | 2 | 8740 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... | apache-2.0 |
gooddata/openstack-nova | nova/tests/functional/regressions/test_bug_1541691.py | 11 | 2126 | # Copyright 2016 HPE, 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 writing, s... | apache-2.0 |
MagicSolutions/django-email-tracker | email_tracker/tests/test_admin.py | 2 | 1343 | from __future__ import absolute_import
from django.test import TestCase
from django.contrib.auth.models import User
from email_tracker.models import TrackedEmail, EmailCategory
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
class EmailTrackerAdminTestCas... | mit |
erdc/proteus | proteus/Domain.py | 1 | 55880 | """
A class hierarchy and tools for building domains of PDE's.
.. inheritance-diagram:: proteus.Domain
:parts: 1
"""
from __future__ import print_function
from __future__ import division
from builtins import zip
from builtins import str
from builtins import range
from past.utils import old_div
from builtins import... | mit |
kevdoran/nifi-minifi-cpp | thirdparty/rocksdb/buckifier/util.py | 19 | 3196 | """
This module keeps commonly used components.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import subprocess
import os
import time
class ColorString:
""" Generate colorful strings on terminal """
HEADE... | apache-2.0 |
willthames/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_organization.py | 36 | 4833 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
#
# This module 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 opti... | gpl-3.0 |
nbortolotti/tensorflow-code-experiences | experiences/bq_integration/bqtensor.py | 1 | 1787 | import tensorflow as tf
import pandas as pd
import ConfigParser
tf.enable_eager_execution() # eager
config = ConfigParser.ConfigParser()
config.read('config.env')
project_id = config.get('google','cloud_id') #is needed use a cloud project id
df_train = pd.io.gbq.read_gbq('''SELECT * FROM [socialagilelearning:iris.t... | apache-2.0 |
mossberg/pyipinfodb | pyipinfodb/pyipinfodb.py | 1 | 1984 | #!/usr/bin/env python
"""
Simple python wrapper around the IPInfoDB API.
"""
import json
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
try:
import urllib2
except ImportError:
import urllib.request as urllib2
import socket
class IPInfo() :
def __init_... | mit |
pinkavaj/gnuradio | gr-zeromq/python/zeromq/qa_zeromq_reqrep.py | 14 | 1792 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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... | gpl-3.0 |
shezadkhan137/required | setup.py | 1 | 2620 | import codecs
import os
import re
from setuptools import setup, find_packages
with open('README.md') as f:
long_description = f.read()
###################################################################
NAME = "required"
PACKAGES = find_packages(where="src")
META_PATH = os.path.join("src", "required", "__init__... | mit |
UShan89/reason | reason/formgen.py | 2 | 2880 |
### Form generation - Form Templates
from flask_wtf import Form
from wtforms.fields import StringField, PasswordField, BooleanField, SubmitField
from flask.ext.wtf.html5 import URLField, EmailField
from wtforms.validators import DataRequired
from werkzeug import secure_filename
from flask_wtf.file import FileField, F... | gpl-2.0 |
shoyer/numpy | doc/neps/conf.py | 10 | 6840 | # -*- coding: utf-8 -*-
#
# NumPy Enhancement Proposals documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 11 12:45:09 2017.
#
# 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
# autog... | bsd-3-clause |
beni55/sympy | sympy/vector/tests/test_field_functions.py | 66 | 8574 | from sympy.core.function import Derivative
from sympy.vector.vector import Vector
from sympy.vector.coordsysrect import CoordSysCartesian
from sympy.simplify import simplify
from sympy.core.symbol import symbols
from sympy.core import S
from sympy import sin, cos
from sympy.vector.functions import (curl, divergence, gr... | bsd-3-clause |
kevinlondon/sentry | src/sentry/migrations/0108_fix_user.py | 36 | 25491 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
u'auth.group': {
'Meta': {'obje... | bsd-3-clause |
nhomar/odoo | addons/sale_margin/__openerp__.py | 261 | 1592 | ##############################################################################
#
# 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 |
hrayatnia/SciPy | ipython gallery/CS1001.py-master/IPMatrix.py | 2 | 5542 | #############################################################################
######### class Matrix with display() function for image visualization
#############################################################################
class Matrix:
"""
Represents a rectangular matrix with n rows and m columns.
"""... | bsd-3-clause |
guschmue/tensorflow | tensorflow/python/saved_model/main_op_impl.py | 73 | 2215 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.