repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ofekd/servo | refs/heads/master | tests/wpt/web-platform-tests/service-workers/service-worker/resources/navigation-redirect-scope2.py | 330 | def main(request, response):
if "url" in request.GET:
headers = [("Location", request.GET["url"])]
return 302, headers, ''
return [], '''
<!DOCTYPE html>
<script>
window.parent.postMessage(
{
id: 'last_url',
result: location.href
}, '*');
</script>
'''
|
henaras/horizon | refs/heads/master | horizon/templatetags/shellfilter.py | 61 | # 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
# distributed under the Li... |
gavioto/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/pylib/gyp/__init__.py | 574 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import gyp.input
import optparse
import os.path
import re
import shlex
import sys
import traceback
from gyp.common import GypErr... |
edlectrico/weblogs_generator_threat | refs/heads/master | ip_locator.py | 1 | import pandas as pd
from geoip import geolite2
import sys
df = pd.DataFrame.from_csv('weblogs.csv')
geo_df = pd.DataFrame(columns = ['IP', 'Country', 'Continent', 'Timezone'])
ips = df['IP'].get_values()
for ip in ips:
try:
match = geolite2.lookup(ip)
if (match is not None):
geo_df = geo_df.append({'... |
fnouama/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/mercurial/treediscovery.py | 93 | # discovery.py - protocol changeset discovery functions
#
# Copyright 2010 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from node import nullid, short
from i18n import _
import util, error
def fi... |
etashjian/ECE757-final | refs/heads/master | src/mem/slicc/ast/DeclListAST.py | 65 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... |
mozilla/zamboni | refs/heads/master | mkt/files/tasks.py | 4 | import logging
from django.conf import settings
from django.utils.translation import ugettext as _
from cache_nuggets.lib import Message
from post_request_task.task import task
from mkt.files.helpers import FileViewer
from mkt.files.models import File
task_log = logging.getLogger('z.task')
@task
def extract_file... |
marc-sensenich/ansible | refs/heads/devel | lib/ansible/modules/network/aci/aci_domain_to_encap_pool.py | 12 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Dag Wieers <dag@wieers.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
ANSIBLE_METADATA = {'metadata_version': '1.1'... |
GenericStudent/home-assistant | refs/heads/dev | tests/components/auth/test_init_link_user.py | 21 | """Tests for the link user flow."""
from . import async_setup_auth
from tests.common import CLIENT_ID, CLIENT_REDIRECT_URI
async def async_get_code(hass, aiohttp_client):
"""Return authorization code for link user tests."""
config = [
{
"name": "Example",
"type": "insecure_exa... |
Yenthe666/Odoo_Samples | refs/heads/master | logging_demo/models.py | 4 | # -*- coding: utf-8 -*-
from openerp import models, fields, api
#Import logger
import logging
#Get the logger
_logger = logging.getLogger(__name__)
class logging_demo(models.Model):
_name = 'logging.demo'
name = fields.Char()
#This function will go off when the user clicks on the button named print_log_da... |
StackStorm/st2 | refs/heads/master | st2auth/st2auth/app.py | 3 | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... |
watonyweng/nova | refs/heads/master | nova/tests/unit/test_availability_zones.py | 36 | # Copyright 2013 Netease Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
rabipanda/tensorflow | refs/heads/master | tensorflow/python/data/kernel_tests/zip_dataset_op_test.py | 43 | # 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... |
rsignell-usgs/notebook | refs/heads/master | HOPS/hops_velocity.py | 1 |
# coding: utf-8
# ## Plot velocity from non-CF HOPS dataset
# In[5]:
get_ipython().magic(u'matplotlib inline')
import netCDF4
import matplotlib.pyplot as plt
# In[6]:
url='http://geoport.whoi.edu/thredds/dodsC/usgs/data2/rsignell/gdrive/nsf-alpha/Data/MIT_MSEAS/MSEAS_Tides_20160317/mseas_tides_2015071612_2015081... |
mendax-grip/cfdemUtilities | refs/heads/master | mixing/foamTreatment/createProbePoints.py | 1 | #------------------------------------------------------------------------------------------------------------
#
# This program creates a probe dictionnary for openfoam to sample in r theta z with homogenous distribution
#
# Output format : probesDict format of openFOAM
#
# Usage : python createProbesPoints ./probesDi... |
nichit93/Implementation-of-TRED-in-ns-3 | refs/heads/master | src/uan/bindings/modulegen__gcc_ILP32.py | 38 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
xenu256/QProb | refs/heads/master | aggregator/feeds.py | 1 | from datetime import time, datetime, timedelta
from mimetypes import MimeTypes
from os import stat
from django.contrib.syndication.views import Feed
from django.urls import reverse
from django.utils.html import strip_tags
from django.conf import settings
from .models import Post
class LatestArticlesFeed(Feed):
... |
skosukhin/spack | refs/heads/esiwace | lib/spack/external/yaml/lib3/yaml/composer.py | 273 |
__all__ = ['Composer', 'ComposerError']
from .error import MarkedYAMLError
from .events import *
from .nodes import *
class ComposerError(MarkedYAMLError):
pass
class Composer:
def __init__(self):
self.anchors = {}
def check_node(self):
# Drop the STREAM-START event.
if self.ch... |
ynonp/python-examples-verint-2016-07 | refs/heads/master | 30_gui_widgets/03_listbox.py | 4 | import Tkinter as tk
root = tk.Tk()
top = tk.Frame()
lyrics = {
"Lucifer Sam" : """
Lucifer Sam, siam cat.
Always sitting by your side
Always by your side.""",
"Astronomy Domine" :
"""Lime and limpid green, a second scene
A fight between the blue you once knew.
Floating down, the sound resounds
Around the icy water... |
Nick-OpusVL/odoo | refs/heads/8.0 | addons/board/board.py | 175 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... |
safwanrahman/mozillians | refs/heads/master | vendor-local/lib/python/kombu/transport/django/migrations/0001_initial.py | 13 | # 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 model 'Queue'
db.create_table('djkombu_queue', (
('id', self.gf('django.db.models.fie... |
Demicro/SM-J510FN_KERNEL | refs/heads/master | Documentation/networking/cxacru-cf.py | 14668 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... |
sonofeft/ODSCharts | refs/heads/master | odscharts/spreadsheet.py | 1 | # Support Python 2 and 3
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import print_function
#!/usr/bin/env python
# -*- coding: ascii -*-
r"""
ODSCharts creates ods spreadsheet files readable by either Microsoft Excel,
LibreOffice or OpenOffice.
The format is a very ... |
philippjfr/bokeh | refs/heads/master | examples/plotting/file/geojson_points.py | 13 | from bokeh.io import output_file, show
from bokeh.models import GeoJSONDataSource, HoverTool
from bokeh.plotting import figure
from bokeh.sampledata.sample_geojson import geojson
p = figure()
p.circle(x='x', y='y', line_color=None, fill_alpha=0.8, size=20,
source=GeoJSONDataSource(geojson=geojson))
p.add_to... |
Weicong-Lin/pymo-global | refs/heads/master | android/pgs4a-0.9.6/python-install/lib/python2.7/lib2to3/fixes/fix_raise.py | 327 | """Fixer for 'raise E, V, T'
raise -> raise
raise E -> raise E
raise E, V -> raise E(V)
raise E, V, T -> raise E(V).with_traceback(T)
raise E, None, T -> raise E.with_traceback(T)
raise (((E, E'), E''), E'''), V -> raise E(V)
raise "foo", V, T -> warns about string exceptions
CAVEATS:... |
kapari/django-oscar | refs/heads/master | src/oscar/management/commands/oscar_import_catalogue.py | 51 | import logging
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from oscar.core.loading import get_class
CatalogueImporter = get_class('partner.importers', 'CatalogueImporter')
CatalogueImportError = get_class('partner.exceptions', 'CatalogueImportError')
logger = l... |
mcxiaoke/python-labs | refs/heads/master | instagram/__init__.py | 12 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: mcxiaoke
# @Date: 2016-01-07 17:26:54
|
thresholdsoftware/asylum-v2.0 | refs/heads/master | openerp/addons/point_of_sale/__openerp__.py | 52 | # -*- 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... |
praekelt/jmbo-neo | refs/heads/develop | neo/migrations/0003_auto__add_field_neoprofile_login_alias.py | 1 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'NeoProfile.login_alias'
db.add_column('neo_neoprofile', 'login_alias',
... |
kret0s/gnuhealth-live | refs/heads/master | tryton/server/trytond-3.8.3/trytond/pyson.py | 1 | # This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
try:
import simplejson as json
except ImportError:
import json
import datetime
from dateutil.relativedelta import relativedelta
from functools import reduce, wraps
de... |
krishn9502/Angular-Express-Ecommerce | refs/heads/master | node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py | 1835 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""These functions are executed via gyp-flock-tool when using the Makefile
generator. Used on systems that don't have a built-in flock."""
... |
symbolicdata/code | refs/heads/master | src/sdeval/classes/templates/comp/GB_Fp_dp/Maple/template_sol.py | 1 | """
This is the template for extracting the solution for the computation
problem of computing a Groebner basis of an ideal in a commutative
polynomial ring over a finite field from the output of the computer
algebra system Maple.
.. moduleauthor:: Albert Heinle <albert.heinle@uwaterloo.ca>
"""
import xml.dom.minidom ... |
rutvik95/android_kernel_frostbite | refs/heads/kitkat | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... |
mattstibbs/blockbuster-server | refs/heads/develop | blockbuster/__init__.py | 1 | __author__ = 'Matt Stibbs'
__version__ = '1.27.00'
target_schema_version = '1.25.00'
from flask import Flask
import logging
from os.path import dirname
import sys
sys.path.append(dirname(__file__))
import bb_auditlogger as audit
logger = logging.getLogger(__name__)
app = Flask(__name__)
def startup():
import... |
hubenjm/Project-Euler | refs/heads/master | problem7.py | 1 | import numpy as np
import math
def isprime(n):
if n == 1 or n%2 == 0 or n%3 == 0: return False
elif n < 9: return True
m = int(math.sqrt(n)) + 1
i = 5
while i <= m:
if n%i == 0 or n%(i+2) == 0:
return False
i = i + 6
return True
def nthprime(N):
if N == 1: return 2
p = 3
i = 2
while i < N:
p += ... |
CUCWD/edx-platform | refs/heads/master | cms/wsgi.py | 17 | """
WSGI config for CMS.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments.
It exposes a module-level variable named ``application``. Django's
``runserver`` and ``runfcgi`` commands discover this application via the
``WSGI_APPLICATION`` setting.
"""
from ... |
alexchao56/sklearn-theano | refs/heads/master | sklearn_theano/externals/google/protobuf/internal/message_factory_python_test.py | 74 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
... |
hartym/rdc.etl | refs/heads/dev | rdc/etl/transform/map/xml.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2014 Romain Dorgueil
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
AdiPat/android_kernel_htc_pico | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... |
jepler/linuxcnc-mirror | refs/heads/master | src/hal/user_comps/mitsub_vfd.py | 2 | #!/usr/bin/env python
# This is a component of linuxcnc
# mitsub_vfd Copyright 2017 Chris Morley
#
#
# 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 Licens... |
suyashphadtare/vestasi-erp-1 | refs/heads/develop | erpnext/erpnext/setup/doctype/sales_person/__init__.py | 37694 | from __future__ import unicode_literals
|
GoogleCloudPlatform/training-data-analyst | refs/heads/master | courses/developingapps/v1.2/python/kubernetesengine/end/frontend/quiz/gcp/datastore.py | 22 | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
srene/ns-3-mptcp | refs/heads/master | examples/naming/examples-to-run.py | 199 | #! /usr/bin/env python
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
# buildable and runnable over time. Each tuple in the list contains
#
# (example_name, do_run, do_valgrind_run).
#
# See test.py for more i... |
closeio/flask-admin | refs/heads/master | flask_admin/contrib/peewee/view.py | 5 | import logging
from flask import flash
from flask_admin._compat import string_types, iteritems
from flask_admin.babel import gettext, ngettext, lazy_gettext
from flask_admin.model import BaseModelView
from flask_admin.model.form import create_editable_list_form
from peewee import PrimaryKeyField, ForeignKeyField, Fi... |
elogind/elogind | refs/heads/v246-stable | tools/xml_helper.py | 27 | #!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1+
from lxml import etree as tree
class CustomResolver(tree.Resolver):
def resolve(self, url, id, context):
if 'custom-entities.ent' in url:
return self.resolve_filename('man/custom-entities.ent', context)
_parser = tree.XMLParser()
_pa... |
Ziqi-Li/bknqgis | refs/heads/master | bokeh/bokeh/settings.py | 2 | ''' Control global configuration options with environment variables.
'''
from __future__ import absolute_import
import codecs
import logging
import os
from os.path import join, abspath, isdir
from .util.paths import ROOT_DIR, bokehjsdir
class Settings(object):
''' A class to collect global, overridable Bokeh c... |
beck/django | refs/heads/master | tests/template_tests/syntax_tests/test_lorem.py | 443 | from django.test import SimpleTestCase
from ..utils import setup
class LoremTagTests(SimpleTestCase):
@setup({'lorem1': '{% lorem 3 w %}'})
def test_lorem1(self):
output = self.engine.render_to_string('lorem1')
self.assertEqual(output, 'lorem ipsum dolor')
|
jatinmistry13/pattern | refs/heads/master | examples/05-vector/05-nb.py | 21 | import os, sys; sys.path.insert(0, os.path.join("..", ".."))
from pattern.vector import Document, Model, NB
from pattern.db import Datasheet
# Naive Bayes is one of the oldest classifiers,
# but is is still popular because it is fast for models
# that have many documents and many features.
# It is outperformed by KNN... |
torufuru/OFPatchPanel | refs/heads/hackathon | ryu/lib/packet/sctp.py | 7 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
arrabito/DIRAC | refs/heads/integration | Core/Utilities/ProcessPool.py | 1 | #################################################################
# $HeadURL$
#################################################################
"""
.. module:: Pfn
:synopsis: ProcessPool and related classes
ProcessPool
ProcessPool creates a pool of worker subprocesses to handle a queue of tasks
much like the produce... |
erjohnso/libcloud | refs/heads/trunk | docs/examples/dns/luadns/instantiate_driver.py | 29 | from libcloud.dns.types import Provider
from libcloud.dns.providers import get_driver
cls = get_driver(Provider.LUADNS)
driver = cls(user='user', key='api_key')
|
andreparames/odoo | refs/heads/8.0 | openerp/report/render/rml2pdf/customfonts.py | 261 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 P. Christeas, Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2013 OpenERP SA. (http://www.openerp.com)
#
# This program is free so... |
vadimtk/chrome4sdp | refs/heads/master | third_party/WebKit/PRESUBMIT.py | 1 | # Copyright (c) 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.
"""Top-level presubmit script for Blink.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmi... |
qrkourier/ansible | refs/heads/devel | lib/ansible/modules/clustering/consul_kv.py | 26 | #!/usr/bin/python
#
# (c) 2015, Steve Gargan <steve.gargan@gmail.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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'... |
dufferzafar/critiquebrainz | refs/heads/master | critiquebrainz/frontend/oauth/views.py | 1 | from flask import Blueprint, render_template, redirect, request
from flask_login import login_required, current_user
from critiquebrainz.utils import build_url
from critiquebrainz.ws.oauth import oauth
from critiquebrainz.data.model.oauth_client import OAuthClient
oauth_bp = Blueprint('oauth', __name__)
@oauth_bp.r... |
shoopio/shoop | refs/heads/master | shuup_tests/utils/forms.py | 2 | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from itertools import chain
from django.core.exceptions import Va... |
dgouldin/myspaceid-python-sdk | refs/heads/master | src/openid/extensions/sreg.py | 1 | """Simple registration request and response parsing and object representation
This module contains objects representing simple registration requests
and responses that can be used with both OpenID relying parties and
OpenID providers.
1. The relying party creates a request object and adds it to the
C{L{AuthReq... |
javier-ruiz-b/docker-rasppi-images | refs/heads/master | raspberry-google-home/env/lib/python3.7/site-packages/pyasn1_modules/rfc8418.py | 14 | # This file is being contributed to pyasn1-modules software.
#
# Created by Russ Housley.
#
# Copyright (c) 2019, Vigil Security, LLC
# License: http://snmplabs.com/pyasn1/license.html
#
# Elliptic Curve Diffie-Hellman (ECDH) Key Agreement Algorithm
# with X25519 and X448
#
# ASN.1 source from:
# https://www.rfc-edit... |
yse/behavior-studio | refs/heads/master | source/treeview/colors.py | 2 | # coding=utf-8
# -----------------
# file : colors.py
# date : 2014/09/20
# author : Victor Zarubkin
# contact : victor.zarubkin@gmail.com
# copyright : Copyright (C) 2014 Victor Zarubkin
# license : This file is part of BehaviorStudio.
# :
# : BehaviorStudio is free softw... |
RafaelOrtiz/EbookReader | refs/heads/master | ebook.py | 1 | #!/usr/bin/env python
#-*- coding: utf-8-*-
import logging
import os
import time
import pygtk
pygtk.require('2.0')
import gtk, sys
import epubadapter
import evinceadapter
from gtk import ToolButton
logging.basicConfig(level=logging.DEBUG)
_logger = logging.getLogger('read-activity')
def _get_screen_dpi():
x... |
yonglehou/robotframework | refs/heads/master | atest/testdata/test_libraries/as_listener/multiple_listenerlibrary.py | 19 | from listenerlibrary import listenerlibrary
class multiple_listenerlibrary(object):
def __init__(self):
self.instances = [
listenerlibrary(),
listenerlibrary(),
]
self.ROBOT_LIBRARY_LISTENER = self.instances
def events_should_be(self, *expected):
for i... |
ltowarek/budget-supervisor | refs/heads/dependabot/pip/django-3.1.10 | third_party/saltedge/test/test_full_report.py | 1 | # coding: utf-8
"""
Salt Edge Account Information API
API Reference for services # noqa: E501
OpenAPI spec version: 5.0.0
Contact: support@saltedge.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import swagger_cl... |
stefanfoulis/django-class-based-auth-views | refs/heads/develop | setup.py | 1 | from setuptools import setup, find_packages
version = __import__('class_based_auth_views').__version__
setup(
name="django-class-based-auth-views",
version=version,
url='http://github.com/stefanfoulis/django-class-based-auth-views',
license='BSD',
platforms=['OS Independent'],
description="A r... |
bowlofstew/luigi | refs/heads/master | luigi/parameter.py | 10 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
Soya93/Extract-Refactoring | refs/heads/master | python/testData/inspections/unusedImport/__init__.py | 473 | __author__ = 'user'
|
iterion/kubernetes | refs/heads/master | hack/verify-flags-underscore.py | 74 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
atsolakid/edx-platform | refs/heads/master | common/test/acceptance/tests/test_annotatable.py | 54 | # -*- coding: utf-8 -*-
"""
E2E tests for the LMS.
"""
from unittest import skip
from .helpers import UniqueCourseTest
from ..pages.studio.auto_auth import AutoAuthPage
from ..pages.lms.courseware import CoursewarePage
from ..pages.lms.annotation_component import AnnotationComponentPage
from ..fixtures.course import C... |
google-research/google-research | refs/heads/master | policy_eval/dual_dice.py | 1 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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 applicab... |
unb-libraries/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/pylib/gyp/generator/gypd.py | 151 | #!/usr/bin/python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""gypd output module
This module produces gyp input as its output. Output files are given the
.gypd extension to avoid overwriting the .gyp f... |
blablacio/uwsgi | refs/heads/master | tests/mako_ugreen.py | 21 | import uwsgi
from mako.template import Template
import time
def application(env, start_response):
start_response('200 OK', [('Content-Type', 'text/html')])
mytemplate = Template("<h1>I am Mako at ${thetime}</h1>")
uwsgi.green_schedule()
yield mytemplate.render(thetime=time.time())
for i in ran... |
h3biomed/ansible | refs/heads/h3 | test/units/modules/network/iosxr/test_iosxr_config.py | 59 | #
# (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... |
nvoron23/avos | refs/heads/master | openstack_dashboard/api/neutron.py | 2 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Cisco Systems, Inc.
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use... |
bobthekingofegypt/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/html5lib/html5lib/trie/datrie.py | 785 | from __future__ import absolute_import, division, unicode_literals
from datrie import Trie as DATrie
from six import text_type
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
chars = set()
for key in data.keys():
if not isinstance(key, text_type):
... |
allotria/intellij-community | refs/heads/master | python/testData/stubs/TypingNamedTupleFieldsChain.py | 27 | from typing import NamedTuple
fields0 = [("x", str), ("y", int)]
fields = fields0
nt = NamedTuple("name", fields) |
simon-pepin/scikit-learn | refs/heads/master | benchmarks/bench_plot_nmf.py | 206 | """
Benchmarks of Non-Negative Matrix Factorization
"""
from __future__ import print_function
from collections import defaultdict
import gc
from time import time
import numpy as np
from scipy.linalg import norm
from sklearn.decomposition.nmf import NMF, _initialize_nmf
from sklearn.datasets.samples_generator import... |
AICP/external_chromium_org | refs/heads/lp5.0 | tools/telemetry/telemetry/core/local_server_unittest.py | 13 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import BaseHTTPServer
import SimpleHTTPServer
from telemetry.core import local_server
from telemetry.unittest import tab_test_case
class SimpleLocalServerBa... |
fiore24/python_training | refs/heads/master | fixture/user.py | 1 | from model.user import User
import re
class UserHelper:
def __init__(self, app):
self.app = app
def return_to_user_page(self):
wd = self.app.wd
wd.find_element_by_link_text("home page").click()
def create(self, user):
wd = self.app.wd
self.open_user_page() #keep f... |
NEUNN/dockersource | refs/heads/master | mysql-service-broker/vendor/github.com/ugorji/go/codec/test.py | 107 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... |
Flexget/Flexget | refs/heads/develop | flexget/tests/test_radarr_list.py | 1 | import pytest
from flexget.components.managed_lists.lists.radarr_list import RadarrAPIService
RADARR_API_KEY = '65e246ce581a426781e1a8645f0a1f2c'
RADARR_BASE_URL = 'http://127.0.0.1'
RADARR_PORT = 7878
# Load up a radarr container and put VCR in record mode to record.
# NOTE: You'll need to reset radarr during runs o... |
egenerat/gae-django | refs/heads/master | lib/requests/packages/chardet/sjisprober.py | 1182 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
hantek/pylearn2 | refs/heads/master | pylearn2/sandbox/cuda_convnet/response_norm.py | 45 | """
A theano / pylearn2 wrapper for cuda-convnet's response normalization
functions.
"""
__authors__ = "David Warde-Farley"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["David Warde-Farley", "Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "David Warde-Farley"
__email__ = ... |
atreyv/sympy | refs/heads/master | sympy/physics/quantum/qexpr.py | 75 | from __future__ import print_function, division
from sympy import Expr, sympify, Symbol, Matrix
from sympy.printing.pretty.stringpict import prettyForm
from sympy.core.containers import Tuple
from sympy.core.compatibility import is_sequence, string_types, u
from sympy.physics.quantum.dagger import Dagger
from sympy.p... |
zerkrx/zerkbox | refs/heads/develop | lib/youtube_dl/extractor/teletask.py | 215 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import unified_strdate
class TeleTaskIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tele-task\.de/archive/video/html5/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://www.tele-task.de/archive/video/html5/2... |
Eigenlabs/EigenD | refs/heads/1.4 | plg_loop/clicker_plg.py | 1 |
#
# Copyright 2009 Eigenlabs Ltd. http://www.eigenlabs.com
#
# This file is part of EigenD.
#
# EigenD 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) a... |
garrettcap/Bulletproof-Backup | refs/heads/master | wx/tools/Editra/src/eclib/colorsetter.py | 3 | ###############################################################################
# Name: colorsetter.py #
# Purpose: Color Picker/Setter Control #
# Author: Cody Precord <cprecord@editra.org> #
... |
xiaohan2012/twitter-sent-dnn | refs/heads/master | plot_util.py | 4 | import numpy as np
import matplotlib
matplotlib.use("Agg") # to enable plot on non X11 env
from matplotlib import pyplot as plt
def plot_track(means, stds, title):
"""
Track means and stds as described in http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf
"""
fig = plt.figure()
ax = fig.... |
aparo/django-nonrel | refs/heads/master | django/core/management/__init__.py | 12 | import os
import sys
from optparse import OptionParser, NO_DEFAULT
import imp
import django
from django.core.management.base import BaseCommand, CommandError, handle_default_options
from django.utils.importlib import import_module
# For backwards compatibility: get_version() used to be in this module.
get_version = d... |
xflash96/gitolite-sshkey-form | refs/heads/master | gitolite_sshkey_form/gitolite.py | 2 | #!/usr/bin/env python
# encoding: utf-8
from os.path import basename, join as pjoin
from util import nextinseq, splitkey, joinkey
class Gitolite(object):
keydir = 'keydir'
commit_msg_add = 'Added public key: user "%s", fn "%s"'
commit_msg_del = 'Removed public key: user "%s", fn "%s"'
def __init__(... |
TeachAtTUM/edx-platform | refs/heads/master | common/djangoapps/third_party_auth/apps.py | 19 |
from django.apps import AppConfig
from django.conf import settings
class ThirdPartyAuthConfig(AppConfig):
name = 'third_party_auth'
verbose_name = "Third-party authentication"
def ready(self):
# To override the settings before loading social_django.
if settings.FEATURES.get('ENABLE_THIRD... |
kyleknap/boto | refs/heads/develop | boto/glacier/__init__.py | 145 | # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011 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 ... |
godfreyy/werkzeug | refs/heads/master | examples/coolmagic/views/__init__.py | 52 | # -*- coding: utf-8 -*-
"""
coolmagic.views
~~~~~~~~~~~~~~~
This module collects and assambles the urls.
:copyright: (c) 2009 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
|
sailwang94/android_kernel_samsung_ks01lte | refs/heads/cm-13.0 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... |
andyraib/data-storage | refs/heads/master | python_scripts/env/lib/python3.6/site-packages/matplotlib/backend_managers.py | 10 | """
`ToolManager`
Class that makes the bridge between user interaction (key press,
toolbar clicks, ..) and the actions in response to the user inputs.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import warnings
import matplotlib.c... |
rgeleta/odoo | refs/heads/8.0 | openerp/addons/test_converter/models.py | 367 | # -*- coding: utf-8 -*-
from openerp.osv import orm, fields
class test_model(orm.Model):
_name = 'test_converter.test_model'
_columns = {
'char': fields.char(),
'integer': fields.integer(),
'float': fields.float(),
'numeric': fields.float(digits=(16, 2)),
'many2one': fi... |
zasdfgbnm/tensorflow | refs/heads/master | tensorflow/python/ops/summary_op_util.py | 40 | # 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... |
nieyb/yuanhe | refs/heads/master | deb_tmp/wifi-pumpkin_20171031_all/usr/share/WiFi-Pumpkin/plugins/external/Responder/poisoners/NBTNS.py | 5 | #!/usr/bin/env python
# This file is part of Responder
# Original work by Laurent Gaffie - Trustwave Holdings
#
# 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, o... |
MattDevo/edk2 | refs/heads/master | AppPkg/Applications/Python/Python-2.7.2/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 --... |
uberamd/NGECore2 | refs/heads/master | scripts/object/draft_schematic/furniture/furniture_collection_fish_tank.py | 85615 | import sys
def setup(core, object):
return |
uberamd/NGECore2 | refs/heads/master | scripts/object/mobile/bib_fortuna.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/ship/crafted/armor/base_armor_subcomponent_mk2.py | 85615 | import sys
def setup(core, object):
return |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.