repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
syphar/django | refs/heads/master | django/contrib/postgres/fields/__init__.py | 192 | from .array import * # NOQA
from .citext import * # NOQA
from .hstore import * # NOQA
from .jsonb import * # NOQA
from .ranges import * # NOQA
|
zhangg/trove | refs/heads/master | trove/tests/unittests/cluster/test_mongodb_cluster.py | 1 | # Copyright 2015 Tesora Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
rew4332/tensorflow | refs/heads/rew4332-patch-1 | tensorflow/python/platform/flags_test.py | 5 | # 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... |
thelabnyc/django-oscar-wfrs | refs/heads/master | sandbox/order/migrations/0009_surcharge.py | 4 | # Generated by Django 2.2.6 on 2020-02-19 09:16
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('order', '0008_auto_20190301_1035'),
]
replaces = [
("order", "0008_surcharge"),
]
operations = [
... |
NMTHydro/Recharge | refs/heads/develop | runners/taw_mod_config_runner.py | 1 | # ===============================================================================
# Copyright 2016 gabe-parrish
#
# 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/licen... |
ubc/edx-platform | refs/heads/release | pavelib/paver_tests/test_jshint.py | 130 | """
Tests for paver quality tasks
"""
import unittest
from mock import patch
import pavelib.quality
from paver.easy import BuildFailure
class TestPaverJsHint(unittest.TestCase):
"""
For testing run_jshint
"""
def setUp(self):
super(TestPaverJsHint, self).setUp()
# Mock the paver @ne... |
sergiocazzolato/snapd | refs/heads/master | check-pr-title.py | 5 | #!/usr/bin/python3
import argparse
import re
import urllib.request
from html.parser import HTMLParser
class InvalidPRTitle(Exception):
def __init__(self, invalid_title):
self.invalid_title = invalid_title
class GithubTitleParser(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
... |
damien-dg/horizon | refs/heads/master | horizon/templatetags/parse_date.py | 75 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
uberamd/NGECore2 | refs/heads/master | scripts/object/static/flora/city_flower_03.py | 85615 | import sys
def setup(core, object):
return |
jeffmahoney/supybot | refs/heads/urlsnarfer | plugins/BadWords/config.py | 7 | ###
# Copyright (c) 2005, Jeremiah Fincher
# 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... |
bols-blue/ansible | refs/heads/devel | hacking/module_formatter.py | 103 | #!/usr/bin/env python
# (c) 2012, Jan-Piet Mens <jpmens () gmail.com>
# (c) 2012-2014, Michael DeHaan <michael@ansible.com> and others
#
# 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 So... |
LIS/lis-tempest | refs/heads/LIS | tempest/hacking/checks.py | 3 | # Copyright 2013 IBM Corp.
#
# 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 wri... |
naritta/numpy | refs/heads/master | numpy/distutils/command/build.py | 21 | from __future__ import division, absolute_import, print_function
import os
import sys
from distutils.command.build import build as old_build
from distutils.util import get_platform
from numpy.distutils.command.config_compiler import show_fortran_compilers
class build(old_build):
sub_commands = [('config_cc', ... |
Elettronik/SickRage | refs/heads/master | lib/sqlalchemy/log.py | 79 | # sqlalchemy/log.py
# Copyright (C) 2006-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
# Includes alterations by Vinay Sajip vinay_sajip@yahoo.co.uk
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Logging control and... |
annarev/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/proto/descriptor_source_test.py | 25 | # =============================================================================
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#... |
huzq/scikit-learn | refs/heads/master | examples/miscellaneous/plot_anomaly_comparison.py | 11 | """
============================================================================
Comparing anomaly detection algorithms for outlier detection on toy datasets
============================================================================
This example shows characteristics of different anomaly detection algorithms
on 2D d... |
jasonwee/videoOnCloud | refs/heads/master | lib/cassandra/apache-cassandra-3.7/pylib/cqlshlib/test/test_cql_parsing.py | 37 | # 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... |
40223205/w16b_test- | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/unittest/util.py | 794 | """Various utility functions."""
from collections import namedtuple, OrderedDict
__unittest = True
_MAX_LENGTH = 80
def safe_repr(obj, short=False):
try:
result = repr(obj)
except Exception:
result = object.__repr__(obj)
if not short or len(result) < _MAX_LENGTH:
return result
... |
vitan/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/swappable_models/tests.py | 51 | from __future__ import absolute_import, unicode_literals
from django.utils.six import StringIO
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.core import management
from django.db.models.loading import cache
from django.test import TestCase
fro... |
DasIch/django | refs/heads/master | tests/timezones/models.py | 415 | from django.db import models
class Event(models.Model):
dt = models.DateTimeField()
class MaybeEvent(models.Model):
dt = models.DateTimeField(blank=True, null=True)
class Session(models.Model):
name = models.CharField(max_length=20)
class SessionEvent(models.Model):
dt = models.DateTimeField()
... |
atlashealth/ansible | refs/heads/devel | test/units/plugins/cache/test_cache.py | 98 | # (c) 2012-2015, 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 the License, or
# (at your option) an... |
hogarthj/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/os_object.py | 20 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSI... |
milaw/docker-registry-driver-cassandra | refs/heads/master | tests/test_package.py | 1 | # -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
class TestQuery(object):
def test_package(self):
import cassandra
logger.debug("Got cassandra %s" % cassandra)
|
mafiya69/sympy | refs/heads/master | sympy/physics/wigner.py | 29 | r"""
Wigner, Clebsch-Gordan, Racah, and Gaunt coefficients
Collection of functions for calculating Wigner 3j, 6j, 9j,
Clebsch-Gordan, Racah as well as Gaunt coefficients exactly, all
evaluating to a rational number times the square root of a rational
number [Rasch03]_.
Please see the description of the individual fun... |
timpalpant/calibre | refs/heads/master | src/calibre/gui2/convert/txt_output.py | 24 | # -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
from calibre.gui2.convert.txt_output_ui import Ui_Form
from calibre.gui2.convert import Widget
class PluginWidget(Widget, Ui_Form):
TITLE = _('TXT Output')
HELP =... |
PawarPawan/h2o-v3 | refs/heads/master | py2/testdir_rapids/test_rapids_funs_1000_stmnt.py | 21 | import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o2 as h2o
import h2o_browse as h2b, h2o_exec as h2e, h2o_import as h2i
# '(def anon {x} ( (var %x "null" %FALSE "null");;(var %x "null" %FALSE "null") );;;)',
from h2o_xl import Def, Fcn, Assign, KeyIndexed
from copy import copy
prin... |
dreamsxin/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/html5lib/trie/_base.py | 1735 | from __future__ import absolute_import, division, unicode_literals
from collections import Mapping
class Trie(Mapping):
"""Abstract base class for tries"""
def keys(self, prefix=None):
keys = super().keys()
if prefix is None:
return set(keys)
# Python 2.6: no set compre... |
kdani3/searx | refs/heads/master | searx/tests/engines/test_deezer.py | 6 | from collections import defaultdict
import mock
from searx.engines import deezer
from searx.testing import SearxTestCase
class TestDeezerEngine(SearxTestCase):
def test_request(self):
query = 'test_query'
dicto = defaultdict(dict)
dicto['pageno'] = 0
params = deezer.request(query,... |
zafar-hussain/or-tools | refs/heads/master | data/strimko/strimko2_002.py | 74 | streams = [
[1,1,2,2,2,2,2],
[1,1,2,3,3,3,2],
[1,4,1,3,3,5,5],
[4,4,3,1,3,5,5],
[4,6,6,6,7,7,5],
[6,4,6,4,5,5,7],
[6,6,4,7,7,7,7]
]
placed = [
[2,1,1],
[2,3,7],
[2,5,6],
[2,7,4],
[3,2,7],
[3,6,1],
[4,1,4],
[4,7,5],
[5,2,... |
zasdfgbnm/tensorflow | refs/heads/master | tensorflow/python/data/ops/readers.py | 5 | # 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... |
heysion/clone-cliapp | refs/heads/master | cliapp/settings.py | 1 | # Copyright (C) 2009-2013 Lars Wirzenius
#
# 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 distribu... |
cheatman-xda/kyleopen-kernel | refs/heads/master | tools/perf/scripts/python/check-perf-trace.py | 11214 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... |
orekyuu/intellij-community | refs/heads/master | python/testData/inspections/PyTypeCheckerInspection/StructuralTypesForNestedCalls.py | 79 | def f(x):
return x.foo + g(x)
def g(x):
return x.bar
def test():
f(<warning descr="Type 'str' doesn't have expected attributes 'foo', 'bar'">'string'</warning>)
|
titanium-forks/dbankier.TintSwitch | refs/heads/master | hooks/install.py | 365 | #!/usr/bin/env python
#
# This is the module install hook that will be
# called when your module is first installed
#
import os, sys
def main(args,argc):
# TODO: write your install hook here (optional)
# exit
sys.exit(0)
if __name__ == '__main__':
main(sys.argv,len(sys.argv))
|
bnbowman/HlaTools | refs/heads/master | src/pbhla/io/FofnIO.py | 1 | #! /usr/bin/env python
__author__ = 'bbowman@pacificbiosciences.com'
from pbcore.io.base import ReaderBase, WriterBase
class FofnReader( ReaderBase ):
"""
A Class for reading file names from a FOFN
"""
def __iter__(self):
for line in self.file:
filename = line.strip()
... |
sabi0/intellij-community | refs/heads/master | python/testData/resolve/multiFile/transitiveImport/TransitiveImport.py | 83 | from channel import * # token must pass through
print(token)
# <ref> |
wlawski/libmots | refs/heads/master | tests/monkeyrunner-tests/t0011-debug-window-landscape.py | 1 | #
# The MIT License (MIT)
#
# Copyright (c) 2014 Wiktor Lawski <wiktor.lawski@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation th... |
frank10704/DF_GCS_W | refs/heads/master | MissionPlanner-master/Lib/mimetypes.py | 53 | """Guess the MIME type of a file.
This module defines two useful functions:
guess_type(url, strict=1) -- guess the MIME type and encoding of a URL.
guess_extension(type, strict=1) -- guess the extension for a given MIME type.
It also contains the following, for tuning the behavior:
Data:
knownfiles --... |
mhrivnak/pulp | refs/heads/master | client_admin/test/unit/test_orphan.py | 17 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or impli... |
dpendl00/headphones | refs/heads/master | headphones/music_encoder.py | 1 | # This file is part of Headphones.
#
# Headphones 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.
#
# Headphones is distributed i... |
cloudkick/cast | refs/heads/develop | lib/extern/closure-linter/closure_linter/__init__.py | 1305 | #!/usr/bin/env python
|
bbodin/turbine | refs/heads/master | Turbine/algorithms/solve_SC1.py | 1 | import logging
try:
from swiglpk import *
except ImportError:
from glpk import *
class SolverSC1:
def __init__(self, dataflow, verbose, lp_filename):
self.dataflow = dataflow
self.verbose = verbose
self.lp_filename = lp_filename
self.colV = {} # dict use for storing gamm... |
kennedyshead/home-assistant | refs/heads/dev | tests/components/modbus/test_switch.py | 2 | """The tests for the Modbus switch component."""
from datetime import timedelta
from unittest import mock
from pymodbus.exceptions import ModbusException
import pytest
from homeassistant.components.modbus.const import (
CALL_TYPE_COIL,
CALL_TYPE_DISCRETE,
CALL_TYPE_REGISTER_HOLDING,
CALL_TYPE_REGISTER... |
romannurik/muzei | refs/heads/main | web/lib/bs4/builder/_lxml.py | 446 | __all__ = [
'LXMLTreeBuilderForXML',
'LXMLTreeBuilder',
]
from io import BytesIO
from StringIO import StringIO
import collections
from lxml import etree
from bs4.element import Comment, Doctype, NamespacedAttribute
from bs4.builder import (
FAST,
HTML,
HTMLTreeBuilder,
PERMISSIVE,
Parse... |
thdtjsdn/geonode | refs/heads/master | geonode/services/tasks.py | 35 | from celery.schedules import crontab
from celery.task import periodic_task
from django.conf import settings
from geonode.services.models import WebServiceHarvestLayersJob, WebServiceRegistrationJob
from geonode.services.views import update_layers, register_service_by_type
from django.core.mail import send_mail
@perio... |
jeffery9/mixprint_addons | refs/heads/master | contacts/__openerp__.py | 119 | # -*- 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... |
airbnb/airflow | refs/heads/master | airflow/providers/http/operators/__init__.py | 5130 | #
# 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... |
vperron/sentry | refs/heads/master | src/sentry/api/endpoints/auth_index.py | 14 | from __future__ import absolute_import
from django.contrib.auth import login, logout
from rest_framework.response import Response
from sentry.api import client
from sentry.api.authentication import QuietBasicAuthentication
from sentry.api.base import DocSection, Endpoint
class AuthIndexEndpoint(Endpoint):
"""
... |
SpringboardEdu/drip-py | refs/heads/master | setup.py | 1 | import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='drip-py',
version='0... |
hogarthj/ansible | refs/heads/devel | lib/ansible/modules/files/tempfile.py | 66 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Krzysztof Magosa <krzysztof@magosa.pl>
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = t... |
tinkerinestudio/Tinkerine-Suite | refs/heads/master | TinkerineSuite/pypy/lib-python/2.7/numbers.py | 177 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for numbers, according to PEP 3141.
TODO: Fill out more detailed documentation on the operators."""
from __future__ import division
from abc import ABCMeta, abstractmethod, abstractprop... |
gfrd/egfrd | refs/heads/develop | test/Model_test.py | 6 | #!/usr/bin/env python
import _gfrd
import unittest
class ModelTestCase(unittest.TestCase):
def setUp(self):
self.m = _gfrd.Model()
def tearDown(self):
pass
def test_network_rules(self):
self.assertTrue(isinstance(self.m.network_rules, _gfrd.NetworkRules))
def test_add_species... |
kingartur88/TennisKata | refs/heads/master | python/tennis_unittest.py | 16 | # -*- coding: utf-8 -*-
import unittest
from tennis import TennisGame1, TennisGame2, TennisGame3
test_cases = [
(0, 0, "Love-All", 'player1', 'player2'),
(1, 1, "Fifteen-All", 'player1', 'player2'),
(2, 2, "Thirty-All", 'player1', 'player2'),
(3, 3, "Deuce", 'player1', 'player2'),
(4, 4, "Deuce",... |
hanselke/erpnext-1 | refs/heads/develop | erpnext/patches/v4_2/fix_account_master_type.py | 120 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for d in frappe.db.sql("""select name from `tabAccount`
where ifnull(master_type, '') not in ('Customer', 'Supplier', '... |
whutch/atria | refs/heads/master | cwmud/core/utils/decorators.py | 2 | # -*- coding: utf-8 -*-
"""Support decorators."""
# Part of Clockwork MUD Server (https://github.com/whutch/cwmud)
# :copyright: (c) 2008 - 2017 Will Hutcheson
# :license: MIT (https://github.com/whutch/cwmud/blob/master/LICENSE.txt)
def patch(cls, method_name=None):
def _inner(func):
nonlocal method_nam... |
Liyier/learning_log | refs/heads/master | env/Lib/site-packages/django/contrib/postgres/lookups.py | 106 | from django.db.models import Lookup, Transform
from django.utils.encoding import force_text
from .search import SearchVector, SearchVectorExact, SearchVectorField
class PostgresSimpleLookup(Lookup):
def as_sql(self, qn, connection):
lhs, lhs_params = self.process_lhs(qn, connection)
rhs, rhs_para... |
DanCardin/nosferatu | refs/heads/master | migrations/versions/32b5a65095e_.py | 1 | """empty message
Revision ID: 32b5a65095e
Revises: 3a81028fee
Create Date: 2015-08-28 17:37:33.670336
"""
# revision identifiers, used by Alembic.
revision = '32b5a65095e'
down_revision = '3a81028fee'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please... |
FrankBian/kuma | refs/heads/master | kuma/wiki/middleware.py | 4 | from django.shortcuts import render
from django.http import HttpResponseRedirect
from kuma.core.helpers import urlparams
from .exceptions import ReadOnlyException
from .jobs import DocumentZoneURLRemapsJob
class ReadOnlyMiddleware(object):
"""
Renders a 403.html page with a flag for a specific message.
... |
guoku/django-storages | refs/heads/master | examples/libcloud_project/settings.py | 28 | # Django settings for libcloud_project project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
... |
ubaldino/marte | refs/heads/master | cerebro/web/web/wsgiserver/ssl_pyopenssl.py | 177 | """A library for integrating pyOpenSSL with CherryPy.
The OpenSSL module must be importable for SSL functionality.
You can obtain it from http://pyopenssl.sourceforge.net/
To use this module, set CherryPyWSGIServer.ssl_adapter to an instance of
SSLAdapter. There are two ways to use SSL:
Method One
----------
* ``s... |
pathway27/servo | refs/heads/master | tests/wpt/harness/wptrunner/metadata.py | 78 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import shutil
import sys
import tempfile
import types
import uuid
from collections import defaultdict
from mo... |
dotKom/onlineweb4 | refs/heads/develop | apps/article/dashboard/views.py | 1 | # -*- encoding: utf-8 -*-
from collections import Counter
from logging import getLogger
from django.contrib import messages
from django.contrib.contenttypes.models import ContentType
from django.shortcuts import get_object_or_404, redirect, render
from guardian.decorators import permission_required
from taggit.models... |
boltzj/coding-challenge | refs/heads/master | question3/q3v1.py | 2 | #!/usr/bin/python
__author__ = 'boltz_j'
import os.path
import sys
import re
if len(sys.argv) < 2:
print('Usage: \'' + sys.argv[0], 'log_file\'')
sys.exit(1)
if not os.path.isfile(sys.argv[1]):
print(sys.argv[1], 'is not a valid file')
sys.exit(2)
# Dictionary to store aggregate data from the log f... |
Connexions/openstax-cms | refs/heads/master | salesforce/management/commands/update_partners.py | 1 | from django.core.management.base import BaseCommand
from salesforce.models import Partner
from salesforce.salesforce import Salesforce
class Command(BaseCommand):
help = "update partners from salesforce.com for use on the marketplace"
def str2bool(self, v):
if isinstance(v, bool):
... |
rmbq/android_kernel_lge_hammerhead | refs/heads/cm-13.0-caf-070316 | tools/perf/scripts/python/check-perf-trace.py | 11214 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... |
ai-se/surrogate | refs/heads/master | script.py | 1 | from __future__ import division
import pdb
def WHEREDataTransformation(filename):
from Utilities.where import where
# The Data has to be access using this attribute table._rows.cells
import pandas as pd
df = pd.read_csv(filename)
headers = [h for h in df.columns if '$<' not in h]
data = df[head... |
JioEducation/edx-platform | refs/heads/master | common/djangoapps/embargo/views.py | 148 | """Views served by the embargo app. """
from django.http import Http404
from django.views.generic.base import View
from django.conf import settings
from edxmako.shortcuts import render_to_response
from embargo import messages
class CourseAccessMessageView(View):
"""Show a message explaining that the user was b... |
jmausolf/White_House_Speech_Crawler_PKG | refs/heads/master | Shell_Command/__main_speech_urls_bearer.py | 1 | ##################################
### ###
### Joshua G. Mausolf ###
### Computation Institute ###
### University of Chicago ###
### ###
##################################
import sys, csv, time
sys.path.append('../Python_Scripts/')
from getpare... |
erh3cq/hyperspy | refs/heads/RELEASE_next_minor | hyperspy/tests/component/test_powerlaw.py | 3 | # -*- coding: utf-8 -*-
# Copyright 2007-2020 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... |
alokkshukla/alokkshukla.github.io | refs/heads/master | node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/friendly.py | 364 | # -*- coding: utf-8 -*-
"""
pygments.styles.friendly
~~~~~~~~~~~~~~~~~~~~~~~~
A modern style based on the VIM pyte theme.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyw... |
carthagecollege/django-djtools | refs/heads/master | djtools/decorators/auth.py | 1 | from django.http import HttpResponseRedirect
from django.urls import reverse_lazy
from django.contrib.auth.decorators import user_passes_test
def superuser_only(function):
"""
Limit view to superusers only.
Usage:
--------------------------------------------------------------------------
@superuse... |
jgao54/airflow | refs/heads/master | airflow/contrib/sensors/cassandra_table_sensor.py | 10 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
gitseagull/pox | refs/heads/master | pox/messenger/tcp_transport.py | 26 | # Copyright 2011,2012 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is d... |
paulrouget/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/pytest/doc/en/_themes/flask_theme_support.py | 46 | # flasky extensions. flasky pygments style based on tango style
from pygments.style import Style
from pygments.token import (
Keyword,
Name,
Comment,
String,
Error,
Number,
Operator,
Generic,
Whitespace,
Punctuation,
Other,
Literal,
)
class FlaskyStyle(Style):
back... |
googleapis/googleapis-gen | refs/heads/master | google/cloud/vision/v1p4beta1/vision-v1p4beta1-py/google/cloud/vision_v1p4beta1/services/__init__.py | 962 | # -*- 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... |
Levis0045/MetaLex | refs/heads/master | build/lib.linux-x86_64-2.7/metalex/plugins/ocropy/ocrolib/nutils.py | 2 | from ocrolib.native import *
lstm_utils = r"""
#include <math.h>
void sumouter(int r,int n,int m,double out[n][m],double u[r][n],double v[r][m]) {
for(int i=0;i<n;i++) {
for(int j=0;j<m;j++) {
double total = 0.0;
for(int k=0;k<r;k++) total += u[k][i]*v[k][j];
out[i][j] ... |
cs98jrb/Trinity | refs/heads/master | mysite/orders/urls.py | 1 | from django.conf.urls import patterns, url
from orders import views
urlpatterns = patterns('',
# ex: /events/
url(r'^$', views.index, name='orders'),
# ex: /events/5/
url(r'^(?P<order_id>\d+)/$', views.detail, name='detail'),
# ex: /polls/5/results/
url(r'^(?P<order_id>\d+)/cancel/$', views.ca... |
suhe/odoo | refs/heads/master | addons/web_analytics/__openerp__.py | 18 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Google Analytics',
'version': '1.0',
'category': 'Extra Tools',
'complexity': "easy",
'description': """
Google Analytics.
=================
Collects web application usage with Google Analy... |
350dotorg/Django | refs/heads/master | tests/regressiontests/views/tests/generic/date_based.py | 99 | # coding: utf-8
from django.test import TestCase
from datetime import datetime, date
from datetime import timedelta
from regressiontests.views.models import Article, Author, DateArticle
class ObjectDetailTest(TestCase):
fixtures = ['testdata.json']
def setUp(self):
# Correct the date for the current ar... |
catmaid/CATMAID | refs/heads/master | django/applications/catmaid/migrations/0094_add_imported_cable_length_stats_summary_column.py | 2 | from django.db import migrations, models
forward = """
ALTER TABLE catmaid_stats_summary
ADD COLUMN import_cable_length double precision DEFAULT 0 NOT NULL;
"""
backward = """
ALTER TABLE catmaid_stats_summary
DROP COLUMN import_cable_length;
"""
class Migration(migrations.Migration):
dependen... |
ingadhoc/odoo | refs/heads/8.0 | addons/product_extended/__openerp__.py | 295 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2011 OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute i... |
npapier/sbf | refs/heads/master | pak/mkdb/angle.py | 1 | #!/usr/bin/env python
# SConsBuildFramework - Copyright (C) 2012, 2014, Nicolas Papier, Alexandre Di Pino.
# Distributed under the terms of the GNU General Public License (GPL)
# as published by the Free Software Foundation.
# Author Nicolas Papier
# Author Alexandre Di Pino
# @remark This package is used by ... |
kuckaogh/csclpp | refs/heads/master | csclpp/src/csclpp/dts/antlr4/PredictionContext.py | 1 | #
# Copyright (c) 2012-2016 The ANTLR Project. All rights reserved.
# Use of this file is governed by the BSD 3-clause license that
# can be found in the LICENSE.txt file in the project root.
#/
from io import StringIO
from RuleContext import RuleContext
from atn.ATN import ATN
from atn.ATNState import ATNState
class... |
marco-mariotti/selenoprofiles | refs/heads/master | libraries/networkx/classes/graph.py | 1 | """
Base class for undirected graphs.
The Graph class allows any hashable object as a node
and can associate key/value attribute pairs with each undirected edge.
Self-loops are allowed but multiple edges are not (see MultiGraph).
For directed graphs see DiGraph and MultiDiGraph.
"""
__author__ = """\n""".join(['Ari... |
challsted/learnPythonTheHardWay | refs/heads/master | ex1.py | 2 | #!/usr/bin/python
print "Hello World!"
print "Hello Again"
print "I like typeing this."
print "This is fun."
print "Yay! Printing."
print "I'd much rather you 'not'."
print 'I "said" do not touch this.'
|
kenshay/ImageScripter | refs/heads/master | ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/third_party/web-page-replay/third_party/dns/rdtypes/ANY/CERT.py | 248 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/278_test_httplib.py | 9 | import httplib
import array
import httplib
import StringIO
import socket
import errno
import unittest
TestCase = unittest.TestCase
from test import test_support
HOST = test_support.HOST
class FakeSocket:
def __init__(self, text, fileclass=StringIO.StringIO, host=None, port=None):
self.text = text
... |
MiLk/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_config.py | 18 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... |
SurfasJones/djcmsrc3 | refs/heads/master | venv/lib/python2.7/site-packages/cms/publisher/__init__.py | 79 | # -*- coding: utf-8 -*-
from .manager import PublisherManager # nopyflakes
__all__ = ('PublisherManager', 'VERSION')
VERSION = (0, 4, 'sintab')
|
Stavitsky/nova | refs/heads/master | nova/compute/manager.py | 1 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... |
edigiacomo/splitmailbox | refs/heads/master | setup.py | 1 | from setuptools import setup
setup(
name='splitmailbox',
version='0.1',
description='Simple tool to split your mailbox',
license='GPLv2+',
author='Emanuele Di Giacomo',
author_email='emanuele@digiacomo.cc',
url='https://github.com/edigiacomo/splitmailbox',
packages=['splitmailbox'],
... |
faucamp/python-gsmmodem | refs/heads/master | setup.py | 8 | #!/usr/bin/env python
""" python-gsmmodem installation script """
import sys
from distutils.core import Command
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('requirements.txt') as f:
requires = f.readlines()
if sys.version_info[0] == 2 and s... |
vkscool/nupic | refs/heads/master | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_wx.py | 69 | from __future__ import division
"""
backend_wx.py
A wxPython backend for matplotlib, based (very heavily) on
backend_template.py and backend_gtk.py
Author: Jeremy O'Donoghue (jeremy@o-donoghue.com)
Derived from original copyright work by John Hunter
(jdhunter@ace.bsd.uchicago.edu)
Copyright (C) Jeremy O'Don... |
batxes/4c2vhic | refs/heads/master | SHH_INV_models/SHH_INV_models_final_output_0.2_-0.1_10000/mtx1_models/SHH_INV_models14269.py | 4 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... |
kpdyer/marionette-testsuite | refs/heads/master | marionette_testsuite/traffic_generator/httpclient.py | 2 | #!/usr/bin/env python
# coding: utf-8
import sys
import argparse
import pycurl
from StringIO import StringIO
import time
import itertools
import tempfile
import filecmp
import os
sys.path.append('.')
def getMsgYield(requested_length):
retval = ''
try:
power = int(requested_length)
if power >... |
ya7lelkom/googleads-python-lib | refs/heads/master | examples/dfp/v201502/custom_field_service/get_all_custom_fields.py | 3 | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
MichaelNedzelsky/intellij-community | refs/heads/master | python/testData/completion/dunderAllReferenceImport.py | 83 | from sys import hexversion
__all__ = ['hexve<caret>']
|
TeamTwisted/external_chromium_org | refs/heads/opti-5.1 | tools/perf/record_android_profile.py | 27 | #!/usr/bin/env python
# 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
import sys
import tempfile
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, 'telemetry'))
from telemetry.... |
drichmond/tinker | refs/heads/master | python/IP.py | 1 | # ----------------------------------------------------------------------
# Copyright (c) 2016, The Regents of the University of California All
# rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... |
kisel/trex-core | refs/heads/master | scripts/external_libs/pyzmq-14.5.0/python2/ucs4/64bit/zmq/auth/base.py | 20 | """Base implementation of 0MQ authentication."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import logging
import zmq
from zmq.utils import z85
from zmq.utils.strtypes import bytes, unicode, b, u
from zmq.error import _check_version
from .certs import load_certificat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.