repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
11craft/pelican | refs/heads/master | pelican/rstdirectives.py | 22 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
from docutils import nodes, utils
from docutils.parsers.rst import directives, roles, Directive
from pygments.formatters import HtmlFormatter
from pygments import highlight
from pygments.lexers import get_lexer_by_name, TextLexer
import re... |
powervm/pypowervm | refs/heads/master | pypowervm/utils/retry.py | 1 | # Copyright 2015, 2016 IBM Corp.
#
# 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 require... |
LyonsLab/coge | refs/heads/master | bin/last_wrapper/Bio/AlignIO/NexusIO.py | 4 | # Copyright 2008-2010 by Peter Cock. All rights reserved.
#
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""
Bio.AlignIO support for the "nexus" file format.
You are expected to use this module v... |
sumeet/expect | refs/heads/master | tests/core/stub_test.py | 1 | import unittest2
from exam.decorators import fixture
from mock import Mock
from expect.core.stub import Args
from expect.core.stub import Stub
from expect.core.stub import UnknownArgumentsError
class StubTestCase(unittest2.TestCase):
stub = fixture(Stub, name='StubName')
return_value = fixture(Mock, name='... |
Cnfc19932/scrapy | refs/heads/master | scrapy/utils/ossignal.py | 204 |
from __future__ import absolute_import
from twisted.internet import reactor
import signal
signal_names = {}
for signame in dir(signal):
if signame.startswith("SIG"):
signum = getattr(signal, signame)
if isinstance(signum, int):
signal_names[signum] = signame
def install_shutdown_han... |
Mic92/ansible | refs/heads/devel | lib/ansible/galaxy/login.py | 46 | #!/usr/bin/env python
########################################################################
#
# (C) 2015, Chris Houseknecht <chouse@ansible.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... |
nap/jaro-winkler-distance | refs/heads/master | pyjarowinkler/__init__.py | 1 | __author__ = 'Jean-Bernard Ratte - jean.bernard.ratte@unary.ca'
|
beagles/sosreport-neutron | refs/heads/neutron_break_out | sos/plugins/smartcard.py | 1 | ## Copyright (C) 2007 Sadique Puthen <sputhenp@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 Software Foundation; either version 2 of the License, or
## (at your option) any later version.
## Thi... |
bneg/Empire | refs/heads/master | lib/modules/python/collection/osx/native_screenshot_mss.py | 9 | import base64
import os
class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'NativeScreenshotMSS',
# list of one or mo... |
gonzoleeman/open-isns | refs/heads/master | tests/harness.py | 1 | """
harness stuff (support)
"""
import os
import shutil
import sys
import unittest
import re
import time
#
# globals
#
class Global:
_isns_test_base = '/tmp/isns-test'
_isns_test_dir = '/tmp/isns-test/test'
_isns_bin_dir = '..'
_isns_test_dump = None
_isns_test_data = None
_isns_seq = 0
_i... |
crcox/NEXT | refs/heads/master | next/apps/DuelingBanditsPureExploration/algs/BR_SuccElim/BR_SuccElim.py | 2 | """
BR_LilUCB app implements DuelingBanditsPureExplorationPrototype
author: Kevin Jamieson, kevin.g.jamieson@gmail.com
last updated: 1/11/2015
BR_LilUCB implements the lilUCB algorithm described in
Jamieson, Malloy, Nowak, Bubeck, "lil' UCB : An Optimal Exploration Algorithm for Multi-Armed Bandits," COLT 2014
using ... |
minesense/VisTrails | refs/heads/master | vistrails/tests/resources/looping_upgrades/pkg_a/init.py | 2 | from vistrails.core.modules.module_descriptor import ModuleDescriptor
from vistrails.core.modules.vistrails_module import Module
from vistrails.core.upgradeworkflow import UpgradeModuleRemap
class A(Module):
_output_ports = [('result', 'basic:String')]
def compute(self):
self.set_output('result', 'A'... |
AJudge-team/AJudge | refs/heads/master | provider/problem_provider.py | 1 | from dto import ProblemMetadata
from os import path
import os
import glob
import json
class ProblemProvider:
def __init__(self):
pass
def get_problem_metadata_by_id(self, problem_id: str) -> ProblemMetadata:
problem_metadata = ProblemMetadata()
problem_metadata.problem_id = problem_... |
dennisobrien/bokeh | refs/heads/master | bokeh/sampledata/tests/test_stocks.py | 3 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... |
mith1979/ansible_automation | refs/heads/master | applied_python/applied_python/lib/python2.7/site-packages/jnpr/junos/op/nd.py | 6 | """
Pythonifier for IPv6 Neighbor Discovery Table/View
"""
from jnpr.junos.factory import loadyaml
from os.path import splitext
_YAML_ = splitext(__file__)[0] + '.yml'
globals().update(loadyaml(_YAML_))
|
martonw/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/QueueStatusServer/filters/__init__.py | 6014 | # Required for Python to search this directory for module files
|
h2oai/sparkling-water | refs/heads/master | py/tests/unit/with_runtime_sparkling/test_auto_encoder.py | 1 | #
# 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 us... |
kevinmel2000/sl4a | refs/heads/master | python/src/Lib/encodings/cp437.py | 593 | """ Python Character Mapping Codec cp437 generated from 'VENDORS/MICSFT/PC/CP437.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_map)
def decode(self,input,errors='strict... |
pniedzielski/fb-hackathon-2013-11-21 | refs/heads/master | src/repl.it/jsrepl/extern/python/unclosured/lib/python2.7/sha.py | 260 | # $Id$
#
# Copyright (C) 2005 Gregory P. Smith (greg@krypto.org)
# Licensed to PSF under a Contributor Agreement.
import warnings
warnings.warn("the sha module is deprecated; use the hashlib module instead",
DeprecationWarning, 2)
from hashlib import sha1 as sha
new = sha
blocksize = 1 # l... |
skasamatsu/py_mc | refs/heads/master | examples/HAp-bulk/Elist_to_expect.py | 1 | import numpy as np
import random as rand
import sys, os
import copy
import pickle
if __name__ == "__main__":
energy_lst = pickle.load(open("energy_reps.pickle", "rb"))
reps = pickle.load(open("latgas_reps.pickle", "rb"))
energy_lst = energy_lst - np.sum(energy_lst)/len(energy_lst) #energy_lst[0]
kb = ... |
xinglin/qemu-2.0.2 | refs/heads/master | scripts/qmp/qmp.py | 96 | # QEMU Monitor Protocol Python class
#
# Copyright (C) 2009, 2010 Red Hat Inc.
#
# Authors:
# Luiz Capitulino <lcapitulino@redhat.com>
#
# This work is licensed under the terms of the GNU GPL, version 2. See
# the COPYING file in the top-level directory.
import json
import errno
import socket
class QMPError(Excepti... |
spektom/incubator-airflow | refs/heads/master | airflow/contrib/hooks/cloudant_hook.py | 5 | #
# 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... |
caseyrollins/osf.io | refs/heads/develop | osf/migrations/0138_merge_20181012_1944.py | 13 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-10-12 19:44
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0137_merge_20181011_1525'),
('osf', '0137_auto_20181012_1756'),
]
operation... |
twitchyliquid64/misc-scripts | refs/heads/master | s3tool/boto-develop/boto/machinelearning/layer1.py | 127 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... |
Panos512/inspire-next | refs/heads/master | inspirehep/modules/authors/config.py | 3 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014, 2015 CERN.
#
# INSPIRE 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... |
gorjuce/odoo | refs/heads/8.0 | addons/base_import_module/models/__init__.py | 411 | # -*- coding: utf-8 -*-
import ir_module
import base_import_module
|
undoware/neutron-drive | refs/heads/master | google_appengine/lib/webapp2/webapp2_extras/security.py | 64 | # -*- coding: utf-8 -*-
"""
webapp2_extras.security
=======================
Security related helpers such as secure password hashing tools and a
random token generator.
:copyright: (c) 2010 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
:co... |
Donkyhotay/MoonPy | refs/heads/master | client/holdbutton.py | 1 | """Copyright 2009:
Isaac Carroll, Kevin Clement, Jon Handy, David Carroll, Daniel Carroll
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 ... |
pidah/st2contrib | refs/heads/master | packs/mistral/actions/get_results/get_workflow_results.py | 12 | import requests
from st2actions.runners.pythonrunner import Action
class WorkflowResults(Action):
EXECUTIONS_BASE_URL = None
def run(self, execution_id):
resp = requests.get(self._get_executions_url(execution_id))
return resp.json()
def _get_executions_url(self, execution_id):
i... |
dgvncsz0f/tic-tac-toe | refs/heads/master | vendor/flask/testsuite/appctx.py | 558 | # -*- coding: utf-8 -*-
"""
flask.testsuite.appctx
~~~~~~~~~~~~~~~~~~~~~~
Tests the application context.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
from flask.testsuite import FlaskTestCase
class AppContextTestCase(Flask... |
emilio/servo | refs/heads/master | tests/wpt/web-platform-tests/2dcontext/tools/gentestutils.py | 7 | # Copyright (c) 2010 Philip Taylor
# Released under the BSD license and W3C Test Suite License: see LICENSE.txt
# Current code status:
#
# This was originally written for use at
# http://philip.html5.org/tests/canvas/suite/tests/
#
# It has been adapted for use with the Web Platform Test Suite suite at
# https://githu... |
draugiskisprendimai/odoo | refs/heads/8.0 | addons/report/models/abstract_report.py | 249 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
ShashaQin/erpnext | refs/heads/develop | erpnext/stock/doctype/delivery_note/__init__.py | 37694 | from __future__ import unicode_literals
|
almeidapaulopt/erpnext | refs/heads/develop | erpnext/buying/doctype/purchase_receipt_item_supplied/__init__.py | 37694 | from __future__ import unicode_literals
|
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/core/management/commands/testserver.py | 239 | from django.core.management import call_command
from django.core.management.base import BaseCommand
from django.db import connection
class Command(BaseCommand):
help = 'Runs a development server with data from the given fixture(s).'
requires_system_checks = False
def add_arguments(self, parser):
... |
joshmoore/openmicroscopy | refs/heads/omero43-ice34 | components/tools/OmeroFS/fsPyinotifyMonitor.py | 1 | """
OMERO.fs Monitor module for Linux.
Copyright 2009 University of Dundee. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import logging
import copy
import threading
import sys, traceback
import socket
import time
# Third party path package. It provides much of the
# f... |
pitrou/numba | refs/heads/master | numba/hsa/tests/hsapy/test_simple.py | 4 | from __future__ import print_function, absolute_import
import numpy as np
from numba import hsa
import numba.unittest_support as unittest
class TestSimple(unittest.TestCase):
def test_array_access(self):
magic_token = 123
@hsa.jit
def udt(output):
output[0] = magic_token
... |
prutseltje/ansible | refs/heads/devel | test/units/modules/network/onyx/test_onyx_l2_interface.py | 41 | #
# (c) 2016 Red Hat 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
# (at your option) any later version.
#
# Ansible is d... |
openconnectome/open-connectome | refs/heads/master | scripts/checktask.py | 2 | import sys, os
import argparse
sys.path += [os.path.abspath('../django')]
import OCP.settings
os.environ['DJANGO_SETTINGS_MODULE'] = 'OCP.settings'
from django.conf import settings
import django
django.setup()
from OCP import celery_app
def main():
parser = argparse.ArgumentParser(description="Get celery task sta... |
Karajlug/karajlug | refs/heads/master | page/templatetags/page_nav.py | 1 | # -----------------------------------------------------------------------------
# Karajlug.org
# Copyright (C) 2010 Karajlug community
#
# 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 Found... |
park-python/course | refs/heads/master | lectures/09_Web_Development/project/music/core/admin.py | 1 | from django.contrib import admin
from .models import Artist, Genre, Ruble
# Register your models here.
@admin.register(Artist)
class ArtistAdmin(admin.ModelAdmin):
pass
@admin.register(Genre)
class GenreAdmin(admin.ModelAdmin):
pass
@admin.register(Ruble)
class RubleAdmin(admin.ModelAdmin):
pass
|
kkuunnddaannkk/vispy | refs/heads/master | examples/basics/gloo/gpuimage.py | 18 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------------------... |
Larhard/avatar | refs/heads/master | concept.py | 1 | import threading
import matplotlib.figure
import time
import numpy as np
import pyaudio
from kivy.app import App
from kivy.config import Config
from kivy.clock import mainthread
from kivy.core.image import Image
from kivy.garden.matplotlib.backend_kivyagg import FigureCanvasKivyAgg
from kivy.graphics.context_instructi... |
fyfcauc/android_external_chromium-org | refs/heads/du44 | build/android/pylib/constants.py | 23 | # Copyright (c) 2012 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.
"""Defines a set of constants shared by test runners and other scripts."""
import collections
import os
import subprocess
import sys
DIR_SOURCE_ROOT =... |
caotianwei/django | refs/heads/master | django/utils/dates.py | 590 | "Commonly-used date structures"
from django.utils.translation import pgettext_lazy, ugettext_lazy as _
WEEKDAYS = {
0: _('Monday'), 1: _('Tuesday'), 2: _('Wednesday'), 3: _('Thursday'), 4: _('Friday'),
5: _('Saturday'), 6: _('Sunday')
}
WEEKDAYS_ABBR = {
0: _('Mon'), 1: _('Tue'), 2: _('Wed'), 3: _('Thu'),... |
HeraldStudio/webservice-py | refs/heads/master | mod/card/handler.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2014-10-26 12:46:36
# @Author : yml_bright@163.com
from .._config import cardCacheTime
from config import *
from tornado.httpclient import HTTPRequest, AsyncHTTPClient
from BeautifulSoup import BeautifulSoup
from ..models.card_cache import CardCache
from sqla... |
bushxnyc/sqrl | refs/heads/master | sqrl/client/parser.py | 2 | #!/usr/bin/env python
from urlparse import urlparse
from urlparse import parse_qs
class URLParser():
"""
URLParser
- Value object for initial SQRL URL
"""
def __init__(self, url):
self.orig_url = url
url_parsed = urlparse(url)
self._validate(url_parsed)
self._proc... |
brandonclosson/crmapp | refs/heads/master | crmapp/subscribers/admin.py | 3 | from django.contrib import admin
from .models import Subscriber
admin.site.register(Subscriber)
|
ttfseiko/openerp-trunk | refs/heads/master | openerp/addons/base_gengo/__init__.py | 57 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Openerp sa (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... |
TsinghuaX/edx-platform | refs/heads/master | lms/djangoapps/instructor_task/tests/test_base.py | 7 | """
Base test classes for LMS instructor-initiated background tasks
"""
import json
from uuid import uuid4
from mock import Mock
from celery.states import SUCCESS, FAILURE
from django.test.testcases import TestCase
from django.contrib.auth.models import User
from django.test.utils import override_settings
from capa... |
bealdav/OpenUpgrade | refs/heads/8.0 | addons/account_budget/report/__init__.py | 444 | # -*- 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... |
jinnykoo/wuyisj | refs/heads/master | src/oscar/templatetags/form_tags.py | 73 | from django import template
register = template.Library()
@register.tag
def annotate_form_field(parser, token):
"""
Set an attribute on a form field with the widget type
This means templates can use the widget type to render things differently
if they want to. Django doesn't make this available by ... |
mdanielwork/intellij-community | refs/heads/master | python/testData/quickFixes/PyAugmentAssignmentQuickFixTest/function.py | 83 | def retStr():
return ''
s1 = ''
<weak_warning descr="Assignment can be replaced with augmented assignment">s1 = s1 <caret>+ retStr()</weak_warning>
|
rameshbabu79/fabric | refs/heads/master | bddtests/msp/mspconfig_pb2_grpc.py | 83 | import grpc
from grpc.framework.common import cardinality
from grpc.framework.interfaces.face import utilities as face_utilities
|
cainmatt/django | refs/heads/master | django/dispatch/__init__.py | 758 | """Multi-consumer multi-producer dispatching mechanism
Originally based on pydispatch (BSD) http://pypi.python.org/pypi/PyDispatcher/2.0.1
See license.txt for original license.
Heavily modified for Django's purposes.
"""
from django.dispatch.dispatcher import Signal, receiver # NOQA
|
googleapis/googleapis-gen | refs/heads/master | google/ads/googleads/v5/googleads-py/google/ads/googleads/v5/services/services/campaign_bid_modifier_service/client.py | 1 | # -*- 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... |
ASlave2Audio/Restaurant-App | refs/heads/master | mingw/bin/lib/distutils/command/install_data.py | 251 | """distutils.command.install_data
Implements the Distutils 'install_data' command, for installing
platform-independent data files."""
# contributed by Bastian Kleineidam
__revision__ = "$Id$"
import os
from distutils.core import Command
from distutils.util import change_root, convert_path
class install_data(Comman... |
s20121035/rk3288_android5.1_repo | refs/heads/master | external/chromium_org/third_party/jinja2/environment.py | 614 | # -*- coding: utf-8 -*-
"""
jinja2.environment
~~~~~~~~~~~~~~~~~~
Provides a class that holds runtime and parsing time options.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from jinja2 import nodes
from jinja2.defaults import BLOCK_S... |
auferack08/edx-platform | refs/heads/master | common/test/acceptance/pages/lms/progress.py | 182 | """
Student progress page
"""
from .course_page import CoursePage
class ProgressPage(CoursePage):
"""
Student progress page.
"""
url_path = "progress"
def is_browser_on_page(self):
is_present = (
self.q(css='div.course-info').present and
self.q(css='div#grade-deta... |
chartbeat-labs/kafkameta | refs/heads/master | tests/test_connection.py | 1 | from datetime import datetime
from kafkameta.connection import KafkaConnection
from utils import KafkaTest
class KafkaConnectionTest(KafkaTest):
def test_connection_init_no_state(self):
self.assertTrue(self.conn.connected)
self.assertEquals(self.conn._last_state_update, None)
def test_conne... |
tinkerthaler/odoo | refs/heads/8.0 | addons/l10n_fr/wizard/fr_report_bilan.py | 374 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... |
gnuhub/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/middleware/common.py | 86 | import re
from django.conf import settings
from django import http
from django.core.mail import mail_managers
from django.utils.http import urlquote
from django.core import urlresolvers
from django.utils.hashcompat import md5_constructor
from django.utils.log import getLogger
logger = getLogger('django.request')
cl... |
mateon1/servo | refs/heads/master | tests/wpt/web-platform-tests/XMLHttpRequest/resources/redirect.py | 45 | import time
def main(request, response):
code = int(request.GET.first("code", 302))
location = request.GET.first("location", request.url_parts.path +"?followed")
if "delay" in request.GET:
delay = float(request.GET.first("delay"))
time.sleep(delay / 1E3);
if "followed" in request.GET:... |
vsoch/repofish | refs/heads/master | analysis/methods/run_parse_repos_sherlock.py | 1 | import pickle
import pandas
import os
# This doesn't matter, function will clone repos locally if doesn't work
access_token = "vanessavanessavanessa"
# Read in list of Github repos
base = "/scratch/PI/russpold/data/PUBMED"
repos_folder = "%s/repos" %(base)
output_folder = "%s/functions" %(repos_folder)
if not os.path... |
supriyantomaftuh/django | refs/heads/master | tests/force_insert_update/models.py | 581 | """
Tests for forcing insert and update queries (instead of Django's normal
automatic behavior).
"""
from django.db import models
class Counter(models.Model):
name = models.CharField(max_length=10)
value = models.IntegerField()
class InheritedCounter(Counter):
tag = models.CharField(max_length=10)
cla... |
tareqalayan/ansible | refs/heads/devel | lib/ansible/plugins/test/__init__.py | 673 | # Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
|
paddyvishnubhatt/daranalysis | refs/heads/master | lib/werkzeug/utils.py | 345 | # -*- coding: utf-8 -*-
"""
werkzeug.utils
~~~~~~~~~~~~~~
This module implements various utilities for WSGI applications. Most of
them are used by the request and response wrappers but especially for
middleware development it makes sense to use them without the wrappers.
:copyright: (c) 2014 ... |
MartinThoma/algorithms | refs/heads/master | ML/50-mlps/14-keras-cnn-last-dropout/evaluate_main.py | 5 | #!/usr/bin/env python
# internal modules
import hasy_tools
# 3rd party modules
import keras
import numpy as np
# Load the data
data = hasy_tools.load_data()
x_train = data["x_train"]
y_train = data["y_train"]
x_validate = data["x_train"]
y_validate = data["y_train"]
x_test = data["x_test"]
y_test = data["y_test"]
#... |
Pencroff/ai-hackathon-2017 | refs/heads/master | Backend/venv/lib/python3.6/site-packages/setuptools/command/easy_install.py | 44 | #!/usr/bin/env python
"""
Easy Install
------------
A tool for doing automatic download/extract/build of distutils-based Python
packages. For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.
__ https://setuptools.readthedocs.io/en/latest/easy_install.html
""... |
jWeb94/pyDevAndTensorFlowIntro | refs/heads/master | src/gettingStartedTutorial/customModelWithHighLevelTraining.py | 1 | '''
Created on 05.10.2017
@author: jens
'''
import numpy as np
import tensorflow as tf
# Declare list of features, we only have one real-valued feature
def model_fn(features, labels, mode):
#features (wird bis ans Ende mit tf.estimator.EstimatorSpec durchgeschleift!) ist notwendig, wegen high-level-API
... |
rovere/utilities | refs/heads/master | dumpEventContent.py | 1 | #!/usr/bin/env python
import FWCore.ParameterSet.Config as cms
import argparse
import re
import copy
import sys
process = cms.Process("Demo")
process.load("Configuration.EventContent.EventContent_cff")
process.load("Configuration.EventContent.AlCaRecoOutput_cff")
# Special ALCA Stuff
def processAlcaStuff():
res... |
dekadev/Deka-kernel-CM10.1-3.4 | refs/heads/master | tools/perf/scripts/python/net_dropmonitor.py | 1258 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... |
mudbungie/NetExplorer | refs/heads/master | env/lib/python3.4/site-packages/networkx/algorithms/approximation/tests/test_independent_set.py | 96 | from nose.tools import *
import networkx as nx
import networkx.algorithms.approximation as a
def test_independent_set():
# smoke test
G = nx.Graph()
assert_equal(len(a.maximum_independent_set(G)),0)
|
googleapis/python-spanner | refs/heads/master | google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc_asyncio.py | 1 | # -*- 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... |
jaidevd/scikit-learn | refs/heads/master | sklearn/utils/sparsetools/setup.py | 32 | import numpy
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('sparsetools', parent_package, top_path)
config.add_extension('_traversal',
sources=['_traversal.pyx'],
include_d... |
joshuajan/odoo | refs/heads/master | addons/mail/report/__init__.py | 438 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
algiopensource/l10n-spain | refs/heads/8.0 | l10n_es_vat_book/__init__.py | 5 | # -*- coding: utf-8 -*-
# See README.rst file on addon root folder for license details
from . import models
from . import report
|
saisaizhang/Food | refs/heads/master | flask/lib/python2.7/site-packages/werkzeug/wsgi.py | 146 | # -*- coding: utf-8 -*-
"""
werkzeug.wsgi
~~~~~~~~~~~~~
This module implements WSGI related helpers.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import os
import sys
import posixpath
import mimetypes
from itert... |
nhenezi/kuma | refs/heads/master | kuma/search/tests/__init__.py | 22 | from __future__ import absolute_import
import time
from django.conf import settings
from elasticsearch_dsl.connections import connections
from elasticsearch.exceptions import ConnectionError
from rest_framework.test import APIRequestFactory
from kuma.core.middleware import LocaleURLMiddleware
from kuma.core.tests i... |
SohKai/ChronoLogger | refs/heads/master | web/flask/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/_vendor/colorama/__init__.py | 450 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from .initialise import init, deinit, reinit
from .ansi import Fore, Back, Style
from .ansitowin32 import AnsiToWin32
VERSION = '0.2.7'
|
lthurlow/Network-Grapher | refs/heads/master | proj/external/matplotlib-1.2.1/examples/event_handling/keypress_demo.py | 3 | #!/usr/bin/env python
"""
Show how to connect to keypress events
"""
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
def press(event):
print('press', event.key)
if event.key=='x':
visible = xl.get_visible()
xl.set_visible(not visible)
fig.canva... |
epssy/hue | refs/heads/master | desktop/core/ext-py/requests-2.6.0/requests/auth.py | 197 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
from base64 import b64encode
from .compat import urlparse, str
from .cookies import extract_cookies_to_jar
from .utils import parse_dict_header, ... |
algui91/grado_informatica_MH_Practicas | refs/heads/master | src/qapproblem/Elitist_GG_pos.py | 1 | '''
Created on May 13, 2014
@author: Alejandro Alcalde (elbauldelprogramador.com)
Licensed under GPLv3
'''
import math
from timeit import Timer
from qapproblem.Genetic import GG_Base
class Elitist_GG_pos(GG_Base):
'''
Implementation of a Elitist Genetic Algorithm with
position based crossover operator... |
benoitsteiner/tensorflow-opencl | refs/heads/master | tensorflow/contrib/eager/python/datasets_test.py | 4 | # 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... |
skmezanul/Bookie | refs/heads/develop | bookie/models/queue.py | 9 | import logging
from datetime import datetime
from sqlalchemy import Column
from sqlalchemy import DateTime
from sqlalchemy import Integer
from sqlalchemy import or_
from sqlalchemy import Unicode
from bookie.models import Base
LOG = logging.getLogger(__name__)
NEW = 0
RUNNING = 1
COMPLETE = 2
ERROR = 3
class Impo... |
ammarkhann/FinalSeniorCode | refs/heads/master | lib/python2.7/site-packages/pip/_vendor/html5lib/__init__.py | 336 | """
HTML parsing library based on the WHATWG "HTML5"
specification. The parser is designed to be compatible with existing
HTML found in the wild and implements well-defined error recovery that
is largely compatible with modern desktop web browsers.
Example usage:
import html5lib
f = open("my_document.html")
tree = ht... |
ResearchSoftwareInstitute/MyHPOM | refs/heads/myhpom-develop | hs_core/tests/api/rest/test_folders.py | 1 | import json
from rest_framework import status
from hs_core.models import ResourceFile
from hs_core.models import get_path
from .base import HSRESTTestCase
class TestFolders(HSRESTTestCase):
def test_create_folder(self):
rtype = 'GenericResource'
title = 'My Test resource'
params = {'res... |
pronix/spark | refs/heads/master | python/pyspark/mllib/stat/test.py | 155 | #
# 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 us... |
beezee/GAE-Django-site | refs/heads/master | django/core/management/commands/sqlsequencereset.py | 312 | from optparse import make_option
from django.core.management.base import AppCommand
from django.db import connections, models, DEFAULT_DB_ALIAS
class Command(AppCommand):
help = 'Prints the SQL statements for resetting sequences for the given app name(s).'
option_list = AppCommand.option_list + (
mak... |
janslow/boto | refs/heads/develop | tests/integration/dynamodb/__init__.py | 270 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, m... |
Widdershin/CodeEval | refs/heads/master | challenges/007-lowercase.py | 1 | """
https://www.codeeval.com/browse/20/
Lowercase
Challenge Description:
Given a string write a program to convert it into lowercase.
Input Sample:
The first argument will be a text file containing sentences, one per line.
You can assume all characters are from the english language. E.g.
HELLO CO... |
gangliao/Paddle | refs/heads/master | python/paddle/v2/optimizer.py | 2 | import py_paddle.swig_paddle as swig_api
import paddle.trainer_config_helpers.config_parser_utils as config_parser_utils
import paddle.trainer_config_helpers.optimizers as v1_optimizers
"""
Optimizers(update equation) for SGD method.
TODO(yuyang18): Complete comments.
"""
__all__ = [
'Momentum', 'Adam', 'Adamax'... |
baharev/sdopt-tearing | refs/heads/master | fmux_creator.py | 1 | # Only called by flatten.py as a subprocess.
#
# Copyright (C) 2014, 2015 University of Vienna
# All rights reserved.
# BSD license.
# Author: Ali Baharev <ali.baharev@gmail.com>
from pymodelica import compile_fmux
import sys
opt_dict = { "automatic_tearing" : False,
"eliminate_alias_variables": False,
... |
encukou/freeipa | refs/heads/master | ipaclient/remote_plugins/2_114/session.py | 8 | #
# Copyright (C) 2016 FreeIPA Contributors see COPYING for license
#
# pylint: disable=unused-import
import six
from . import Command, Method, Object
from ipalib import api, parameters, output
from ipalib.parameters import DefaultFrom
from ipalib.plugable import Registry
from ipalib.text import _
from ipapython.dn ... |
solome/jyp | refs/heads/master | misc/virtenv/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py | 1730 | from __future__ import absolute_import, division, unicode_literals
from . import _base
class Filter(_base.Filter):
def __init__(self, source, encoding):
_base.Filter.__init__(self, source)
self.encoding = encoding
def __iter__(self):
state = "pre_head"
meta_found = (self.enco... |
edx-solutions/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/template_module.py | 4 | """
Template module
"""
from string import Template
from lxml import etree
from xmodule.raw_module import RawDescriptor
from xmodule.x_module import DEPRECATION_VSCOMPAT_EVENT, XModule
class CustomTagModule(XModule):
"""
This module supports tags of the form
<customtag option="val" option2="val2" impl="... |
retomerz/intellij-community | refs/heads/master | python/testData/docstrings/googleParametersSectionWithoutSummary.py | 45 | def f(x):
"""
Parameters:
x: foo
""" |
tejasapatil/spark | refs/heads/master | examples/src/main/python/sql/basic.py | 52 | #
# 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 us... |
zats/chisel | refs/heads/master | commands/FBDisplayCommands.py | 3 | #!/usr/bin/python
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import lldb
... |
freeipa/freeipa-pr-ci | refs/heads/master | github/tests/test_topology.py | 1 | import pytest
from github.internals.entities import Topology
class TestTopology(object):
@pytest.mark.parametrize("test_input,expected", [
({"memory": 1, "cpu": 1}, Topology(memory=1, cpu=1)),
(
{"name": "topo", "memory": 1, "cpu": 1},
Topology(name="topo", memory=1, cpu=1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.