repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
thomhastings/linux-3.17.1-parrot | refs/heads/master | arch/ia64/scripts/unwcheck.py | 13143 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... |
espenfjo/android_kernel_samsung_n8000 | refs/heads/jellybean | arch/ia64/scripts/unwcheck.py | 13143 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... |
chandolia/python-social-auth | refs/heads/master | social/backends/rdio.py | 79 | """
Rdio OAuth1 and OAuth2 backends, docs at:
http://psa.matiasaguirre.net/docs/backends/rdio.html
"""
from social.backends.oauth import BaseOAuth1, BaseOAuth2, OAuthAuth
RDIO_API = 'https://www.rdio.com/api/1/'
class BaseRdio(OAuthAuth):
ID_KEY = 'key'
def get_user_details(self, response):
ful... |
themurph/openshift-tools | refs/heads/prod | docker/oso-zabbix-server/src/smtp_ses.py | 33 | #!/usr/bin/env python
'''
Email script for zabbix notifications
'''
import smtplib
import sys
import yaml
def get_config():
'''Fetch the zabbix config credentials
'''
return yaml.load(open('/etc/openshift_tools/zabbix_actions.yml'))
def email():
'''send email for zabbix
'''
config = get_conf... |
stimpsonsg/moose | refs/heads/devel | python/mooseutils/message.py | 4 | import os
import traceback
from mooseutils import colorText
try:
from PyQt5 import QtWidgets, QtCore
MOOSE_USE_QT5 = True
except:
MOOSE_USE_QT5 = False
"""
Global for enabling/disabling debug mode.
"""
MOOSE_DEBUG_MODE = os.environ.get("MOOSE_PYTHON_DEBUG_MODE") == "1"
"""
Global for enabling/disabling t... |
ramielrowe/magnum | refs/heads/master | magnum/common/pythonk8sclient/client/models/V1beta3_PodStatus.py | 15 | #!/usr/bin/env python
"""
Copyright 2015 Reverb Technologies, 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 require... |
hdinsight/hue | refs/heads/master | desktop/core/ext-py/South-1.0.2/south/migration/__init__.py | 96 | """
Main migration logic.
"""
from __future__ import print_function
import sys
from django.core.exceptions import ImproperlyConfigured
import south.db
from south import exceptions
from south.models import MigrationHistory
from south.db import db, DEFAULT_DB_ALIAS
from south.migration.migrators import (Backwards, Fo... |
vladmm/intellij-community | refs/heads/master | python/testData/completion/reexportModules/a.after.py | 166 | import b
b.da<caret> |
cuauv/software | refs/heads/master | system_check/syscheck.py | 1 | #!/usr/bin/env python3
import gevent, termcolor, time, argparse, sys, os, signal
import test
from tests import *
from conf.vehicle import VEHICLE_TYPE
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--verbose', help='Display verbose output (default: false)', action='store_true')
parser.add_argument('-c... |
sudoguy/instabot | refs/heads/master | examples/infinity_feedliker.py | 3 | """
instabot example
Workflow:
Like rescent medias from your timeline feed.
"""
import sys
import os
import time
import argparse
sys.path.append(os.path.join(sys.path[0], '../'))
from instabot import Bot
parser = argparse.ArgumentParser(add_help=True)
parser.add_argument('-u', type=str, help="userna... |
o5k/openerp-oemedical-v0.1 | refs/heads/master | openerp/addons/hr_timesheet/report/users_timesheet.py | 36 | # -*- 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... |
VanirAOSP/kernel_htc_msm8974 | refs/heads/L5 | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
NL66278/OCB | refs/heads/8.0 | openerp/addons/base/tests/test_uninstall.py | 175 | # -*- coding: utf-8 -*-
# This assumes an existing but uninitialized database.
import unittest2
import openerp
from openerp import SUPERUSER_ID
import common
DB = common.DB
ADMIN_USER_ID = common.ADMIN_USER_ID
def registry(model):
return openerp.modules.registry.RegistryManager.get(DB)[model]
def cursor():
... |
damiencalloway/djtut | refs/heads/master | mysite/env/lib/python2.7/site-packages/django/db/models/sql/compiler.py | 52 | from django.utils.six.moves import zip
from django.core.exceptions import FieldError
from django.db import transaction
from django.db.backends.util import truncate_name
from django.db.models.constants import LOOKUP_SEP
from django.db.models.query_utils import select_related_descend
from django.db.models.sql.constants ... |
Jwpe/coveralls-python | refs/heads/master | tests/test_cli.py | 4 | # coding: utf-8
import os
import sys
from mock import patch, call
import pytest
import coveralls
from coveralls.api import CoverallsException
import coveralls.cli
@patch.dict(os.environ, {'TRAVIS': 'True'}, clear=True)
@patch.object(coveralls.cli.log, 'info')
@patch.object(coveralls.Coveralls, 'wear')
def test_debu... |
symoro/symoro | refs/heads/master | pysymoro/tests/test_screw6.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Unit test module for Screw6 class."""
import unittest
from sympy import Matrix
from sympy import ShapeError
from sympy import zeros
from pysymoro.screw6 import Screw6
class TestScrew6(unittest.TestCase):
"""Unit test for Screw6 class."""
def setUp(self):
... |
vbannai/neutron | refs/heads/master | neutron/openstack/common/middleware/debug.py | 26 | # Copyright 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 req... |
leopardhs/ns3_sdn | refs/heads/master | src/csma/bindings/modulegen_customizations.py | 376 |
def post_register_types(root_module):
root_module.add_include('"ns3/queue.h"')
root_module.add_include('"ns3/error-model.h"')
|
M3nin0/supreme-broccoli | refs/heads/master | Web/Flask/site_/lib/python3.5/site-packages/werkzeug/wrappers.py | 234 | # -*- coding: utf-8 -*-
"""
werkzeug.wrappers
~~~~~~~~~~~~~~~~~
The wrappers are simple request and response objects which you can
subclass to do whatever you want them to do. The request object contains
the information transmitted by the client (webbrowser) and the response
object contains al... |
cogeorg/BlackRhino | refs/heads/master | examples/firesales_simple/networkx/algorithms/shortest_paths/tests/test_unweighted.py | 40 | #!/usr/bin/env python
from nose.tools import *
import networkx as nx
class TestUnweightedPath:
def setUp(self):
from networkx import convert_node_labels_to_integers as cnlti
self.grid=cnlti(nx.grid_2d_graph(4,4),first_label=1,ordering="sorted")
self.cycle=nx.cycle_graph(7)
self.dir... |
snnn/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/as_string_op_test.py | 10 | # 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... |
ArcherSys/ArcherSys | refs/heads/master | Lib/site-packages/django/conf/locale/en_AU/formats.py | 117 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j M Y' # '25 Oc... |
wakatime/komodo-wakatime | refs/heads/master | components/wakatime/packages/pygments/lexers/ezhil.py | 31 | # -*- coding: utf-8 -*-
"""
pygments.lexers.ezhil
~~~~~~~~~~~~~~~~~~~~~
Pygments lexers for Ezhil language.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, words
from pygments.... |
biodrone/plex-desk | refs/heads/master | desk/flask/lib/python3.4/site-packages/sqlalchemy/dialects/postgresql/psycopg2cffi.py | 54 | # testing/engines.py
# Copyright (C) 2005-2015 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
"""
.. dialect:: postgresql+psycopg2cffi
:name: psycopg2cffi
:dbapi: psyco... |
tuffery/Frog2 | refs/heads/master | AMMOS/AMMOS_mac_linux_chimera_Dec2008_onVLS3D/AMMOS_ProtLig/AMMOS_ProtLig/bin/MinProteinLigands_sp5.py | 2 | #! /usr/bin/env python
########################################################
### ###
### Minimization of Protein-ligand Interactions ###
### written by D.Lagorce,M.Miteva ###
### http://www.vls3d.com ###
### ... |
sudheesh001/pontoon | refs/heads/master | pontoon/base/migrations/0022_remove_locale_nplurals.py | 4 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('base', '0021_auto_20150904_1007'),
]
operations = [
migrations.RemoveField(
model_name='locale',
name='nplur... |
akiss77/servo | refs/heads/master | tests/wpt/css-tests/tools/html5lib/html5lib/treewalkers/__init__.py | 1229 | """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a ... |
googleapis/python-kms | refs/heads/master | samples/snippets/iam_remove_member.py | 1 | # 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 agreed to in writing, s... |
mayankcu/Django-social | refs/heads/master | venv/Lib/site-packages/django/contrib/localflavor/de/de_states.py | 544 | # -*- coding: utf-8 -*
from django.utils.translation import ugettext_lazy as _
STATE_CHOICES = (
('BW', _('Baden-Wuerttemberg')),
('BY', _('Bavaria')),
('BE', _('Berlin')),
('BB', _('Brandenburg')),
('HB', _('Bremen')),
('HH', _('Hamburg')),
('HE', _('Hessen')),
('MV', _('Mecklenburg-We... |
IKholopov/HackUPC2017 | refs/heads/master | hackupc/static/js/bootstrap/Respond-master/test/unit/index.html.py | 1 | XXXXXXXXX XXXXX
XXXXXX
XXXXXX
XXXXX XXXXXXXXXXXXXXX XX
XXXXXXXXXXXXXXXXX XXXX XXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX
XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XX
XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXX XXX XXXXXXXXXXX XXXXXXX XXXXXXXXXXXXXXXX X... |
groschovskiy/lerigos_music | refs/heads/master | Server/API/lib/OpenSSL/__init__.py | 31 | # Copyright (C) AB Strakt
# See LICENSE for details.
"""
pyOpenSSL - A simple wrapper around the OpenSSL library
"""
from OpenSSL import rand, crypto, SSL
from OpenSSL.version import __version__
__all__ = [
'rand', 'crypto', 'SSL', 'tsafe', '__version__']
|
xen0l/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_snmp_contact.py | 43 | #!/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 distribut... |
HaebinShin/tensorflow | refs/heads/master | tensorflow/python/summary/event_file_inspector_test.py | 8 | # 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... |
bcrochet/python-ironicclient | refs/heads/master | ironicclient/v1/port_shell.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright 2013 Red Hat, 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... |
apanju/odoo | refs/heads/8.0 | addons/report/tests/__init__.py | 456 | import test_reports
|
tyg03485/tyg03485.github.io | refs/heads/master | _vendor/bundle/ruby/2.0.0/gems/nokogiri-1.6.8.1/ext/nokogiri/tmp/x86_64-apple-darwin16/ports/libxml2/2.9.4/libxml2-2.9.4/python/tests/schema.py | 35 | #!/usr/bin/python -u
import libxml2
import sys
# Memory debug specific
libxml2.debugMemory(1)
schema="""<?xml version="1.0" encoding="iso-8859-1"?>
<schema xmlns = "http://www.w3.org/2001/XMLSchema">
<element name = "Customer">
<complexType>
<sequence>
<element name = "FirstName" type = "string" />
<ele... |
hdknr/paloma | refs/heads/master | src/paloma/migrations/0004_auto_20150408_1958.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('paloma', '0003_auto_20150309_1912'),
]
operations = [
migrations.AlterField(
model_name='publish',
n... |
motuii/getbb | refs/heads/master | html_parser.py | 1 | #coding:utf-8
from bs4 import BeautifulSoup
import urllib
import chardet
import re
class HtmlParser(object):
"""docstring for HtmlParser"""
def _get_new_urls(self,page_url,soup):
new_urls = set()
#/^http:\/\/www\.\w.+\.\w+(\.\w+)?$/
links = soup.find_all(href=re.compile(r"^[a-zA-z]+://([a-zA-Z])+.[0... |
lemonad/molnetbot | refs/heads/master | molnetbot/xep0012.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
The MIT license
Copyright (c) 2010 Jonas Nockert
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... |
cogeorg/black_rhino | refs/heads/master | examples/firesales_SA/networkx/algorithms/dag.py | 20 | # -*- coding: utf-8 -*-
from fractions import gcd
import networkx as nx
"""Algorithms for directed acyclic graphs (DAGs)."""
# Copyright (C) 2006-2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
__author... |
chalmers-revere/opendlv.core | refs/heads/master | thirdparty/cxxtest/python/python3/cxxtest/cxxtestgen.py | 48 | #-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v3
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms of ... |
pduchesne/ckanext-geoview | refs/heads/master | ckanext/geoview/controllers/service_proxy.py | 1 | from logging import getLogger
from ckan import plugins as p
import urlparse
import requests
import ckan.logic as logic
import ckan.lib.base as base
from urllib import urlencode
log = getLogger(__name__)
MAX_FILE_SIZE = 4 * 1024 * 1024 # 1MB
CHUNK_SIZE = 512
# HTTP request parameters that may conflict with OGC ser... |
smkr/pyclipse | refs/heads/master | plugins/org.python.pydev.jython/Lib/sre.py | 8 | #
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license. For any other use, please contact Secret Labs
# AB (info@py... |
toontownfunserver/Panda3D-1.9.0 | refs/heads/master | python/Lib/lib2to3/fixes/fix_getcwdu.py | 327 | """
Fixer that changes os.getcwdu() to os.getcwd().
"""
# Author: Victor Stinner
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixGetcwdu(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
power< 'os' trailer< dot='.' name='getcwdu' > any* >
""... |
Ziqi-Li/bknqgis | refs/heads/master | pandas/doc/sphinxext/numpydoc/docscrape.py | 9 | """Extract reference documentation from the NumPy source tree.
"""
from __future__ import division, absolute_import, print_function
import inspect
import textwrap
import re
import pydoc
from warnings import warn
import collections
class Reader(object):
"""A line-based string reader.
"""
def __init__(se... |
code-google-com/oyprojectmanager | refs/heads/master | tests/mixins/test_iomixin.py | 3 | # -*- coding: utf-8 -*-
# Copyright (c) 2009-2012, Erkan Ozgur Yilmaz
#
# This module is part of oyProjectManager and is released under the BSD 2
# License: http://www.opensource.org/licenses/BSD-2-Clause
import os
import shutil
import tempfile
import unittest
from sqlalchemy import Column, Integer
from oyProjectMana... |
HubbleStack/Hubble | refs/heads/develop | tests/unittests/test_stat_nova.py | 2 | import sys
import os
myPath = os.path.abspath(os.getcwd())
sys.path.insert(0, myPath)
import hubblestack.files.hubblestack_nova.stat_nova
class TestStatNova():
def test_virtual(self):
expected_val = True
val = hubblestack.files.hubblestack_nova.stat_nova.__virtual__()
assert expected_val ... |
TeslaProject/external_chromium_org | refs/heads/lp5.1 | chrome/test/chromeos/autotest/files/client/deps/chrome_test/common.py | 187 | # Copyright (c) 2010 The Chromium OS 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, sys
dirname = os.path.dirname(sys.modules[__name__].__file__)
client_dir = os.path.abspath(os.path.join(dirname, "../../"))
sys.path.insert... |
MarkNenadov/TextFinch | refs/heads/master | regex.py | 1 | import re
romanNumeralRegex = re.compile( "(?:.*\s+\(?)(([(?=[mclxvi])m*(c[md]|d?c*)(x[cl]|l?x*)(i[xv]|v?i*))(?:\.\s.*)", re.IGNORECASE )
romanNumeralChapterVerseRegex = re.compile( "(?:.*\s+\(?)(([(?=[mdclxvi])m*(c[md]|d?c*)(x[cl]|l?x*)(i[xv]|v?i*)(\.\s[0123456789]?[0123456789]))(?:.*)", re.IGNORECASE )
def regexMat... |
TheWardoctor/Wardoctors-repo | refs/heads/master | script.module.tknorris.shared/lib/cache.py | 2 | """
tknorris shared module
Copyright (C) 2016 tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... |
Antiun/yelizariev-website | refs/heads/8.0 | web_login_background/controllers.py | 4 | # -*- coding: utf-8 -*-
from openerp import http
from random import choice
from openerp.addons.web.controllers.main import Home
from openerp.http import request
class Background(Home):
@http.route('/web/login', type='http', auth="none")
def web_login(self, redirect=None, **kw):
pictures = request.env... |
FarGroup/FarManager | refs/heads/master | enc/tools/tool.make_chm.py | 1 | #!/usr/bin/env python3
"""
Make projects files for building Far Manager Encyclopedia in .CHM format
"""
# pythonized by techtonik // gmail.com
# modifications by Far Group
# keywords for HHK are generated from "<a name=>" and "<h1>"
# contents tree for HHC is generated from /html/index.html following links one lev... |
ashutrix03/inteygrate_flaskapp-master | refs/heads/master | yowsup/layers/auth/keystream.py | 67 | import hashlib, hmac, sys
from struct import pack
from operator import xor
from itertools import starmap
class RC4:
def __init__(self, key, drop):
self.s = []
self.i = 0;
self.j = 0;
self.s = [0] * 256
for i in range(0, len(self.s)):
self.s[i] = i
for ... |
TathagataChakraborti/resource-conflicts | refs/heads/master | PLANROB-2015/seq-sat-lama/Python-2.5.2/Tools/bgen/bgen/bgen.py | 53 | "Export everything in the various bgen submodules."
from bgenType import *
from bgenVariable import *
from bgenBuffer import *
from bgenStackBuffer import *
from bgenHeapBuffer import *
from bgenStringBuffer import *
from bgenOutput import *
from bgenGenerator import *
from bgenModule import *
from bgenObjectDefinitio... |
ff94315/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/host/lib/python2.7/test/test_augassign.py | 134 | # Augmented assignment test.
from test.test_support import run_unittest, check_py3k_warnings
import unittest
class AugAssignTest(unittest.TestCase):
def testBasic(self):
x = 2
x += 1
x *= 2
x **= 2
x -= 8
x //= 5
x %= 3
x &= 2
x |= 5
... |
javnik36/pybikes | refs/heads/master | pybikes/movete.py | 2 | # -*- coding: utf-8 -*-
import re
from .base import BikeShareSystem, BikeShareStation
from . import utils
class Movete(BikeShareSystem):
meta = {
'system': 'Movete',
'company': ['Sistema de Transporte Metropolitano',
'Intendencia de Montevideo']
}
url = 'http://movet... |
ladybug-analysis-tools/ladybug-core | refs/heads/master | ladybug/sql.py | 1 | # coding=utf-8
"""Module for parsing EnergyPlus SQLite result files into Ladybug DataCollections"""
from __future__ import division
import os
import sqlite3
from collections import OrderedDict
import ladybug.datatype
from .dt import DateTime, datetime
from .location import Location
from .analysisperiod import Analysi... |
craigcook/masterfirefoxos | refs/heads/master | scripts/create_db_locales.py | 5 | from django.conf import settings
from masterfirefoxos.base.models import Locale
def run(*args):
for code in settings.LANGUAGE_NAMES.keys():
Locale.objects.get_or_create(code=code)
|
elijah513/pyspider | refs/heads/master | pyspider/database/local/projectdb.py | 63 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<roy@binux.me>
# http://binux.me
# Created on 2015-01-17 12:32:17
import os
import re
import six
import logging
from pyspider.database.base.projectdb import ProjectDB as BaseProjectDB
class Projec... |
ThomasMiconi/htmresearch | refs/heads/master | projects/sequence_prediction/continuous_sequence/run_tm_model_compare_sdr_cla_classifier.py | 3 | ## ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This ... |
alshedivat/tensorflow | refs/heads/master | tensorflow/python/keras/wrappers/__init__.py | 76 | # 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... |
aeklant/scipy | refs/heads/master | scipy/ndimage/filters.py | 1 | # Copyright (C) 2003-2005 Peter J. Verveer
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following d... |
jimmy54/zulip | refs/heads/master | manage.py | 109 | #!/usr/bin/env python
import os
import sys
import logging
import subprocess
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "zproject.settings")
from django.conf import settings
logger = logging.getLogger("zulip.management")
subprocess.check_call([os.path.join(os.path.dirna... |
mszewczy/odoo | refs/heads/8.0 | openerp/addons/base/res/res_users.py | 70 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... |
williamleif/histwords | refs/heads/master | sgns/hyperwords/hyperwords/representations/matrix_serializer.py | 3 | import numpy as np
from scipy.sparse import csr_matrix
def save_matrix(f, m):
np.savez_compressed(f, data=m.data, indices=m.indices, indptr=m.indptr, shape=m.shape)
def load_matrix(f):
if not f.endswith('.npz'):
f += '.npz'
loader = np.load(f)
return csr_matrix((loader['data'], l... |
EvanK/ansible | refs/heads/devel | test/units/modules/network/onyx/test_onyx_ptp_interface.py | 63 | #
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat.mock import patch
from ansible.modules.network.onyx impor... |
farin/python-fakturoid | refs/heads/master | fakturoid/paging.py | 1 | from itertools import islice
from fakturoid import six
class PagedResource(object):
"""List adapter for paged resources. Returns sliceable lazy loaded object."""
def __init__(self, page_size=20):
self.pages = {}
self.page_size = page_size or 20
self.page_count = None
def load_pa... |
suto/infernal-twin | refs/heads/master | build/pip/build/lib.linux-i686-2.7/pip/_vendor/cachecontrol/heuristics.py | 374 | import calendar
import time
from email.utils import formatdate, parsedate, parsedate_tz
from datetime import datetime, timedelta
TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT"
def expire_after(delta, date=None):
date = date or datetime.now()
return date + delta
def datetime_to_header(dt):
return formatdate(c... |
heke123/chromium-crosswalk | refs/heads/master | tools/android/loading/request_dependencies_lens_unittest.py | 10 | # Copyright 2016 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 unittest
import devtools_monitor
from loading_trace import LoadingTrace
from request_dependencies_lens import RequestDependencyLens
from request_trac... |
saxonhouse/lobbyist | refs/heads/master | main/admin.py | 1 | from django.contrib import admin
from .models import Event, Consultation
# Register your models here.
admin.site.register(Event)
admin.site.register(Consultation)
|
cmelange/ansible | refs/heads/devel | lib/ansible/modules/network/bigswitch/bigmon_policy.py | 19 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Ansible module to manage Big Monitoring Fabric service chains
# (c) 2016, Ted Elhourani <ted@bigswitch.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 publishe... |
GeoscienceAustralia/gdf | refs/heads/master | gdf/__main__.py | 1 | #!/usr/bin/env python
#===============================================================================
# Copyright (c) 2014 Geoscience Australia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
... |
MiyamotoAkira/kivy | refs/heads/master | examples/guide/firstwidget/2_print_touch.py | 61 | from kivy.app import App
from kivy.uix.widget import Widget
class MyPaintWidget(Widget):
def on_touch_down(self, touch):
print(touch)
class MyPaintApp(App):
def build(self):
return MyPaintWidget()
if __name__ == '__main__':
MyPaintApp().run()
|
amith01994/intellij-community | refs/heads/master | python/testData/inspections/ReplacePrint_after.py | 80 | from __future__ import print_function
print("foo") |
dmitry-r/incubator-airflow | refs/heads/master | airflow/operators/dummy_operator.py | 62 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... |
mglukhikh/intellij-community | refs/heads/master | python/testData/refactoring/unwrap/ifUnwrapEmpty_before.py | 83 | if True:
<caret>pass |
amondot/QGIS | refs/heads/master | python/plugins/processing/algs/lidar/fusion/CanopyMaxima.py | 9 | # -*- coding: utf-8 -*-
"""
***************************************************************************
CanopyMaxima.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
**************************... |
AsimmHirani/ISpyPi | refs/heads/master | tensorflow/contrib/tensorflow-master/tensorflow/contrib/distributions/python/kernel_tests/laplace_test.py | 35 | # 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... |
gpoulin/luigi | refs/heads/master | test/s3_test.py | 9 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Mortar Data
#
# 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... |
supermikol/coursera | refs/heads/master | Data Structures/Week 3/phone_book/phone_book.py | 1 | # python3
class Query:
def __init__(self, query):
self.type = query[0]
self.number = int(query[1])
if self.type == 'add':
self.name = query[2]
def read_queries():
n = int(input())
return [Query(input().split()) for i in range(n)]
def write_responses(result... |
jia200x/RIOT | refs/heads/master | tests/thread_msg_seq/tests/01-run.py | 12 | #!/usr/bin/env python3
import sys
from testrunner import run
THREAD_NAMES = ("nr1", "nr2", "nr3")
def testfunc(child):
child.expect_exact("START")
# Collect pids
thread_pids = []
for name in THREAD_NAMES:
child.expect(r"THREAD {} \(pid:(\d+)\) start".format(name))
thread_pids.append(... |
cwelton/incubator-hawq | refs/heads/master | tools/bin/gppylib/testold/programs/test_clsRecoverSegment.py | 12 | #!/usr/bin/env 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.0 (the
# "Li... |
josemfc/directorio-iep | refs/heads/master | directorio/admin.py | 1 | from django.contrib import admin
from django.contrib.auth.models import Permission
from .models import Profesor, Asignatura, Video, Convocatoria, PAC, Programa, Valoracion, Organizacion, Pertenece
admin.site.register(Permission)
admin.site.register(Profesor)
admin.site.register(Asignatura)
admin.site.register(Video)
... |
marc-sensenich/ansible | refs/heads/devel | lib/ansible/modules/network/fortios/fortios_firewall_multicast_address6.py | 2 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... |
jrrembert/django | refs/heads/master | tests/template_tests/filter_tests/test_time.py | 326 | from datetime import time
from django.template.defaultfilters import time as time_filter
from django.test import SimpleTestCase
from django.utils import timezone
from ..utils import setup
from .timezone_utils import TimezoneTestCase
class TimeTests(TimezoneTestCase):
"""
#20693: Timezone support for the tim... |
t3dev/odoo | refs/heads/master | addons/auth_oauth/models/res_config_settings.py | 22 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from odoo import api, fields, models
_logger = logging.getLogger(__name__)
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
@api.model
def get_uri(self):
... |
Studnicky/pokeapi | refs/heads/master | pokemon/south_migrations/0013_auto__add_typechart__del_field_type_no_effect__del_field_type_ineffect.py | 12 | # -*- 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 model 'TypeChart'
db.create_table(u'pokemon_typechart', (
(u'id', self.gf('django.db.mo... |
nguyentu1602/statsmodels | refs/heads/master | statsmodels/tsa/tests/results/arima211nc_results.py | 36 | import numpy as np
llf = np.array([-241.25977940638])
nobs = np.array([ 202])
k = np.array([ 4])
k_exog = np.array([ 1])
sigma = np.array([ .79533686587485])
chi2 = np.array([ 48655.961417345])
df_model = np.array([ 3])
k_ar = np.array([ 2])
k... |
fbraem/mqweb | refs/heads/develop | test/qmstatus.py | 1 | import unittest
from testbase import MQWebTest
'''
Test QueueManagerStatusController
'''
class TestQManagerStatusActions(MQWebTest):
'''
Test Inquire HTTP GET
'''
def testInquire(self):
json = self.getJSON('/api/qmstatus/inquire/' + self.qmgr)
'''
Test Inquire with HTTP POST
'''
def testInquireJSON(self)... |
chase-qi/workload-automation | refs/heads/master | wlauto/utils/power.py | 1 | # Copyright 2015 ARM Limited
#
# 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 writin... |
johnson1228/pymatgen | refs/heads/master | pymatgen/io/lobster.py | 4 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License
from __future__ import division, unicode_literals
import re
import numpy as np
from monty.io import zopen
from pymatgen.electronic_structure.core import Spin, Orbital
"""
Module for reading Lobster output fil... |
dulems/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/templatetags/future.py | 130 | from django.template import Library
from django.template import defaulttags
register = Library()
@register.tag
def ssi(parser, token):
# Used for deprecation path during 1.3/1.4, will be removed in 2.0
return defaulttags.ssi(parser, token)
@register.tag
def url(parser, token):
# Used for deprecation pa... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/soundobject/soundobject_cantina_medium.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/creature/npc/droid/crafted/jedi_training_droid.py | 85615 | import sys
def setup(core, object):
return |
kontais/EFI-MIPS | refs/heads/master | ToolKit/cmds/python/Lib/encodings/koi8_r.py | 15 | """ Python Character Mapping Codec generated from 'KOI8-R.TXT' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,erro... |
heemanshu/swift_liberty | refs/heads/master | test/unit/common/middleware/test_acl.py | 12 | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... |
pferreir/indico | refs/heads/master | indico/vendor/django_mail/backends/console.py | 4 | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
# The code in here is taken almost verbatim from `django.core.mail.backends.console`,
# which is licensed ... |
hwkns/django-waffle | refs/heads/master | waffle/south_migrations/0004_auto__add_field_flag_testing.py | 22 | # encoding: 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 'Flag.testing'
db.add_column('waffle_flag', 'testing', self.gf('django.db.models.fields.Boo... |
watchdogpolska/feder | refs/heads/master | feder/cases/tests.py | 1 | from django.urls import reverse
from django.test import RequestFactory, TestCase
from django.utils.http import urlencode
from feder.cases.models import Case
from feder.institutions.factories import InstitutionFactory
from feder.letters.factories import IncomingLetterFactory
from feder.letters.models import Letter
from... |
ifduyue/sentry | refs/heads/master | tests/sentry/utils/auth/__init__.py | 2878 | from __future__ import absolute_import
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.